import { Snapshot, SnapshotNode } from '../../compact'; import { Segment } from '../../paths'; import { NodeRegistry } from '../../registry'; import { NodeSchema } from '../../schema'; import { Op } from '../types'; /** `path` is `ops[i]…` for proposal fields and payload nodes, `#…` for nodes already on the page; `opIndex` is -1 for the whole proposal. */ export type Issue = { opIndex: number; path: string; message: string; }; export declare const has: (nodes: object, id: string) => boolean; export declare const typeOf: (node: SnapshotNode) => string; /** Schema of a node whose content a proposal may change: registered and writable, plus ROOT (it takes sections). */ export declare function contentSchema(type: string, id: string, registry: NodeRegistry): NodeSchema | undefined; /** Child → parent, read from the `nodes` lists like `planProposal` does. */ export declare function parentMap(snapshot: Snapshot): Map; /** Nearest first; stops on a cycle in malformed data. */ export declare function ancestorsOf(parentOf: ReadonlyMap, id: string): string[]; export type Ref = { id: string; path: string; role: 'target' | 'parent' | 'anchor'; }; /** The ids an op names, with the proposal path of each. */ export declare function refsOf(op: Op, i: number): Ref[]; /** * Paths of the leaves of `set`, as segment arrays (a key is never split on "." or "["); arrays and empty objects * are leaves, as `applySteps` replaces them whole. */ export declare function leafPaths(value: Record, prefix?: Segment[]): Segment[][]; /** The props paths an `update` op writes: `set` leaves, `unset` paths, and `children` for `text`. */ export declare function writtenPaths(op: Extract): Segment[][];