import * as Effect from 'effect/Effect'; import * as Option from 'effect/Option'; import * as GraphBuilder from './graph-builder'; /** * A single `(prefix, id?)` pair as parsed by `@dxos/app-toolkit`'s `UrlPath.parse`. Kept as a * plain structural type here (rather than importing `UrlPath.Pair`) because app-graph must not * depend on app-toolkit. */ export type UrlPair = { key: string; id?: string; workspace: string; }; /** * A resolved pair: the index it occupied in the parsed chain, and the qualified graph node id it * resolved to. `null` in the caller's result array means the pair didn't resolve (unknown key or * no matching node); how an unresolved pair is surfaced is the caller's concern. */ export type ResolvedPair = { pairIndex: number; nodeId: string; }; /** The graph-path representation of a node, the reverse of a `UrlPair` (`id` is absent for singleton keys). */ export type RepresentedNode = { key: string; id?: string; workspace: string; }; /** * A single registered URL prefix key, in the shape `UrlPath.parse` expects. Kept as a plain * structural type here (rather than importing `UrlPath.KeyTableEntry`) because app-graph must not * depend on app-toolkit. */ export type UrlKeyTableEntry = { key: string; hasId: boolean; anchor: boolean; }; /** * Build the `urlKey -> { key, hasId }` table consumed by `UrlPath.parse`, straight from the * builder's current `urlKey`/`urlKeyHasId` declarations — the "registration, not parser" property * the URL grammar requires. Callers (the layout url-handler) pass this to `UrlPath.parse` * to tokenize a pathname into a pair chain. */ export declare const buildUrlKeyTable: (builder: GraphBuilder.GraphBuilder) => Map; /** * Resolve a parsed URL's pair chain to graph node ids, walking left to right. Resolution is fully * explicit — each keyed extension declares either a static `urlPath` template (preferred) or a dynamic * `resolve` Effect (data-dependent shapes); there is no generic search. Reverse mapping still uses the * provenance the builder tracks (see `GraphBuilder.getNodeExtensionId`). * * An unknown key, or a key whose extension produces no matching node, yields `null` at that index; * how a `null` is surfaced is the caller's concern. A linked pair resolves against the *preceding * item's* node, not the raw preceding pair. */ export declare const resolveUrl: (builder: GraphBuilder.GraphBuilder, parsed: { workspace: string; pairs: ReadonlyArray; }) => Effect.Effect>; /** * Reverse-map a graph node id back to its `(key, id?, workspace)` representation, the inverse of * `resolveUrl`. A linked node (a `~` segment) maps to the declared `linked` key * with the variant as its id — independent of the producing extension, so every linked node is * addressable. Any other node maps via its producing extension's `urlKey` (`getNodeExtensionId`); * a node with no key-declaring producer returns `Option.none()` (unmapped — serialization skips it * with a dev-time warning one layer up, per the design's "unmapped nodes" rule). */ export declare const representNode: (builder: GraphBuilder.GraphBuilder, nodeId: string) => Option.Option; //# sourceMappingURL=path-resolution.d.ts.map