/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { AttachState } from "@fluidframework/container-definitions";
import { generateHandleContextPath } from "@fluidframework/runtime-utils/internal";
export class ContainerFluidHandleContext {
    get IFluidHandleContext() {
        return this;
    }
    /**
     * Creates a new ContainerFluidHandleContext.
     * @param path - The path to this handle relative to the routeContext.
     * @param runtime - The IRuntime object this context represents.
     * @param routeContext - The parent IFluidHandleContext that has a route to this handle.
     */
    constructor(path, runtime, routeContext) {
        this.path = path;
        this.runtime = runtime;
        this.routeContext = routeContext;
        this.absolutePath = generateHandleContextPath(path, this.routeContext);
    }
    attachGraph() {
        throw new Error("can't attach container runtime form within container!");
    }
    get isAttached() {
        return this.runtime.attachState !== AttachState.Detached;
    }
    async resolveHandle(request) {
        return this.runtime.resolveHandle(request);
    }
}
//# sourceMappingURL=containerHandleContext.js.map