Path.d.ts 427 B

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