"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContainerFluidHandleContext = void 0;
const container_definitions_1 = require("@fluidframework/container-definitions");
const internal_1 = require("@fluidframework/runtime-utils/internal");
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 = (0, internal_1.generateHandleContextPath)(path, this.routeContext);
    }
    attachGraph() {
        throw new Error("can't attach container runtime form within container!");
    }
    get isAttached() {
        return this.runtime.attachState !== container_definitions_1.AttachState.Detached;
    }
    async resolveHandle(request) {
        return this.runtime.resolveHandle(request);
    }
}
exports.ContainerFluidHandleContext = ContainerFluidHandleContext;
//# sourceMappingURL=containerHandleContext.js.map