UNPKG

538 BTypeScriptView Raw
1import type { Maybe } from './Maybe';
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(
11 prev: Readonly<Path> | undefined,
12 key: string | number,
13 typename: string | undefined,
14): Path;
15/**
16 * Given a Path, return an Array of the path keys.
17 */
18export declare function pathToArray(
19 path: Maybe<Readonly<Path>>,
20): Array<string | number>;