UNPKG

661 BTypeScriptView Raw
1import { Maybe } from './types.js';
2export interface Path {
3 readonly prev: Path | undefined;
4 readonly key: string | number;
5 readonly typename: string | undefined;
6}
7/**
8 * Given a Path and a key, return a new Path containing the new key.
9 */
10export declare function addPath(prev: Readonly<Path> | undefined, key: string | number, typename: string | undefined): Path;
11/**
12 * Given a Path, return an Array of the path keys.
13 */
14export declare function pathToArray(path: Maybe<Readonly<Path>>): Array<string | number>;
15/**
16 * Build a string describing the path.
17 */
18export declare function printPathArray(path: ReadonlyArray<string | number>): string;