UNPKG

427 BTypeScriptView Raw
1export interface Path {
2 prev: Path | undefined;
3 key: string | number;
4 typename: string | undefined;
5}
6
7/**
8 * Given a Path and a key, return a new Path containing the new key.
9 */
10export function addPath(
11 prev: Path | undefined,
12 key: string | number,
13 typename: string | undefined,
14): Path;
15
16/**
17 * Given a Path, return an Array of the path keys.
18 */
19export function pathToArray(path: Path): Array<string | number>;