This commit is contained in:
Kismet Hasanaj
2026-05-02 20:07:02 +02:00
parent ce8672e283
commit 34dc9aec52
9428 changed files with 1733330 additions and 0 deletions
@@ -0,0 +1,29 @@
import type { SegmentNodeState } from '../userspace/app/segment-explorer-node';
/**
* Trie data structure for storing and searching paths
*
* This can be used to store app router paths and search for them efficiently.
* e.g.
*
* [trie root]
* ├── layout.js
* ├── page.js
* ├── blog
* ├── layout.js
* ├── page.js
* ├── [slug]
* ├── layout.js
* ├── page.js
**/
type TrieNode<Value = string> = {
value: Value | undefined;
children: {
[key: string]: TrieNode<Value> | undefined;
};
};
export type SegmentTrieNode = TrieNode<SegmentNodeState>;
export declare const insertSegmentNode: (value: SegmentNodeState) => void;
export declare const removeSegmentNode: (value: SegmentNodeState) => void;
export declare const getSegmentTrieRoot: () => TrieNode<SegmentNodeState>;
export declare function useSegmentTree(): SegmentTrieNode;
export {};