import type { CanonicalPublicAttrs, HsonMeta, HsonNode, Primitive } from "../../core/types.js"; import type { DocumentLiveMapMode, LiveMapDocumentContent, LiveMapDocumentPath, LiveMapDocumentRequestTarget } from "../../types/livemap.types.js"; /** Internal-only logical document edge. This module is not a package entrypoint. */ export type InternalDocumentLogicalEdge = Readonly<{ kind: "content"; index: number; }> | Readonly<{ kind: "raw-content"; index: number; }> | Readonly<{ kind: "facet"; facet: InternalDocumentFacet; }>; export type InternalDocumentFacet = "tag" | "attrs" | "metadata" | "content"; export type InternalDocumentPhysicalAssociation = Readonly<{ kind: "direct"; path: LiveMapDocumentPath; }> | Readonly<{ kind: "carrier"; path: LiveMapDocumentPath; carrierPaths: readonly LiveMapDocumentPath[]; }> | Readonly<{ kind: "facet"; facet: Exclude; ownerPath: LiveMapDocumentPath; }> | Readonly<{ kind: "none"; reason: "empty-element-content"; ownerPath?: LiveMapDocumentPath; }>; export type InternalDocumentLogicalResolution = Readonly<{ kind: "node"; value: HsonNode; physical: InternalDocumentPhysicalAssociation; }> | Readonly<{ kind: "primitive"; value: Primitive; physical: InternalDocumentPhysicalAssociation; }> | Readonly<{ kind: "content"; scope: "document" | "element"; length: number; physical: InternalDocumentPhysicalAssociation; }> | Readonly<{ kind: "facet"; facet: "tag"; value: string; access: "readonly"; physical: InternalDocumentPhysicalAssociation; }> | Readonly<{ kind: "facet"; facet: "attrs"; value: CanonicalPublicAttrs; access: "operation-specific"; physical: InternalDocumentPhysicalAssociation; }> | Readonly<{ kind: "facet"; facet: "metadata"; value: Readonly; access: "protected"; physical: InternalDocumentPhysicalAssociation; }>; export type InternalDocumentContentMutationLowering = Readonly<{ kind: "content-insert"; target: LiveMapDocumentRequestTarget; index: number; content: LiveMapDocumentContent; }> | Readonly<{ kind: "content-remove"; target: LiveMapDocumentRequestTarget; index: number; }> | Readonly<{ kind: "replace-root"; root: HsonNode; }>; export type InternalDocumentTraversalFailureCode = "INVALID_DOCUMENT_ROOT" | "INVALID_EDGE_INDEX" | "CONTENT_INDEX_OUT_OF_RANGE" | "PRIMITIVE_DESCENT" | "FACET_UNAVAILABLE" | "FACET_DESCENT" | "PHYSICAL_TARGET_UNAVAILABLE"; /** Structured internal failure; deliberately absent from every public entrypoint. */ export declare class InternalDocumentTraversalError extends Error { readonly code: InternalDocumentTraversalFailureCode; readonly edgeIndex: number | undefined; constructor(code: InternalDocumentTraversalFailureCode, reason: string, edgeIndex?: number, options?: ErrorOptions); } /** * Resolve logical document edges against one current canonical root. * * Logical content edges hide the ordinary element's `_hson_elem` carrier. * Raw content edges remain available only for internal structural leaves such * as the payload of `_hson_str`. Returned node/facet values are detached reads; * the physical association remains the sole mutation/location authority. */ export declare function resolve_internal_document_location(root: HsonNode, mode: DocumentLiveMapMode, edges: readonly InternalDocumentLogicalEdge[]): InternalDocumentLogicalResolution; /** Internal one-shot canonical preorder search specialized to exact string IDs. */ export declare function find_internal_document_id_path(root: HsonNode, mode: DocumentLiveMapMode, scopeEdges: readonly InternalDocumentLogicalEdge[], scopePath: readonly number[], id: string): readonly number[] | undefined; /** Lower a resolved logical content container to the existing mutation target. */ export declare function lower_internal_document_content_target(resolution: InternalDocumentLogicalResolution): LiveMapDocumentRequestTarget; /** Lower one resolved child endpoint to its parent target and physical slot. */ export declare function lower_internal_document_content_slot(resolution: InternalDocumentLogicalResolution): Readonly<{ target: LiveMapDocumentRequestTarget; index: number; }>; /** Lower an ordinary element or one of its facets to the existing attrs target. */ export declare function lower_internal_document_element_target(resolution: InternalDocumentLogicalResolution): LiveMapDocumentRequestTarget; /** * Lower logical insertion without inventing a path for absent canonical state. * The returned instruction is transient and must be handed to an existing * content-insert or root-replacement planner. */ export declare function lower_internal_document_content_insert(resolution: InternalDocumentLogicalResolution, indexInput: number, content: LiveMapDocumentContent): InternalDocumentContentMutationLowering; /** Lower logical removal, collapsing the last materialized owner canonically. */ export declare function lower_internal_document_content_remove(resolution: InternalDocumentLogicalResolution, indexInput: number): InternalDocumentContentMutationLowering; //# sourceMappingURL=livemap.document.logical.d.ts.map