path-trie.d.ts 416 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Resolved value.
  3. */
  4. export type ResolvedValue<T = unknown> = {
  5. value: T;
  6. params: {[name: string]: unknown};
  7. }
  8. /**
  9. * Path trie.
  10. */
  11. export declare class PathTrie {
  12. /**
  13. * Add value.
  14. *
  15. * @param pathTemplate
  16. * @param value
  17. */
  18. add<T>(pathTemplate: string, value: T): this;
  19. /**
  20. * Match value.
  21. * @param path
  22. */
  23. match<T = unknown>(path: string): ResolvedValue<T> | undefined;
  24. }