/** * Lazy link-set handle factory (#553). * * `vault.links(name)` is a SYNC accessor, but every method on the handle * it returns is async — so the handle can defer loading the `LinkSet` * storage engine to the first actual link I/O. This keeps `link-set.ts` * out of the floor bundle for consumers that never use links, while the * handle object itself stays cached and referentially stable per name. * * Besides the public {@link LinkSetHandle} surface, the handle carries * the two cascade internals the ref/link enforcement facade consults * (`vault-facade.ts` casts the handle to `LinkSet` and duck-types them). */ import { type LinkRow, type LinkSpec, type LinkSetHandle } from './names.js'; import type { NoydbStore } from '../../kernel/types.js'; import type { NoydbEventEmitter } from '../../kernel/events.js'; import type { EnclaveKey } from '../../kernel/enclave/index.js'; /** @internal The lazy handle: public surface + facade cascade internals. */ export type LazyLinkSetHandle = LinkSetHandle & { readonly _collectionName: string; _rowsTouchingEndpoint(collection: string, id: string): Promise; }; /** @internal Constructor args for the deferred {@link LinkSet}. */ export interface LazyLinkSetDeps { readonly adapter: NoydbStore; readonly vault: string; readonly name: string; readonly spec: LinkSpec; readonly encrypted: boolean; readonly getDEK: (collectionName: string) => Promise; readonly actor: string; readonly emitter: NoydbEventEmitter; readonly endpointExists: (collection: string, id: string) => Promise; } /** @internal Build the handle; the LinkSet engine dynamic-imports on first use. */ export declare function makeLazyLinkSetHandle(d: LazyLinkSetDeps): LazyLinkSetHandle;