/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal"; import { FluidObjectHandle } from "@fluidframework/datastore/internal"; import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal"; import type { ISharedObject } from "./types.js"; /** * Handle for a shared object. See also `SharedObjectHandle`. * Supports binding other handles to the underlying Shared Object (see {@link ISharedObjectHandle.bind}). * * @internal */ export interface ISharedObjectHandle extends IFluidHandleInternal { /** * Binds the given handle to this DDS or attach the given handle if this DDS is attached. * A bound handle will also be attached once this DDS is attached. * * @param handle - The target handle to bind to this DDS */ bind(handle: IFluidHandleInternal): void; } /** * Type guard for {@link ISharedObjectHandle}. * @internal */ export declare function isISharedObjectHandle(handle: unknown): handle is ISharedObjectHandle; /** * Handle for a shared object (DDS). * * @remarks * * This object is used for already loaded (in-memory) shared objects. * * It provides a "bind" function that is expected to be invoked on all handles stored in this DDS, * ensuring the target object becomes attached along with this DDS. */ export declare class SharedObjectHandle extends FluidObjectHandle implements ISharedObjectHandle { protected readonly value: ISharedObject; private readonly runtime; /** * Whether services have been attached for the associated shared object. */ get isAttached(): boolean; /** * Tells whether the object of this handle is visible in the container locally or globally. */ private get isVisible(); /** * Tracks whether this handle is locally visible in the container. */ private isLocallyVisible; private readonly pendingHandles; /** * Creates a new SharedObjectHandle. * @param value - The shared object this handle is for. * @param path - The id of the shared object. It is also the path to this object relative to the routeContext. * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route * to this handle. */ constructor(value: ISharedObject, path: string, runtime: IFluidDataStoreRuntime); /** * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle. * When attaching the handle, it registers the associated shared object. */ attachGraph(): void; bind(handle: IFluidHandleInternal): void; } //# sourceMappingURL=handle.d.ts.map