data-structure-typed 2.4.5 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +12984 -0
- package/.vitepress/cache/deps_temp_51f5f1b0/package.json +3 -0
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +4505 -0
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +9731 -0
- package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +347 -0
- package/CHANGELOG.md +3 -1
- package/README.md +78 -31
- package/dist/cjs/binary-tree.cjs +23698 -0
- package/dist/cjs/graph.cjs +5236 -0
- package/dist/cjs/hash.cjs +1262 -0
- package/dist/cjs/heap.cjs +1540 -0
- package/dist/cjs/index.cjs +24509 -2899
- package/dist/cjs/linked-list.cjs +4370 -0
- package/dist/cjs/matrix.cjs +1042 -0
- package/dist/cjs/priority-queue.cjs +1314 -0
- package/dist/cjs/queue.cjs +4090 -0
- package/dist/cjs/stack.cjs +861 -0
- package/dist/cjs/trie.cjs +1173 -0
- package/dist/cjs-legacy/binary-tree.cjs +23730 -0
- package/dist/cjs-legacy/graph.cjs +5234 -0
- package/dist/cjs-legacy/hash.cjs +1262 -0
- package/dist/cjs-legacy/heap.cjs +1537 -0
- package/dist/cjs-legacy/index.cjs +32555 -10936
- package/dist/cjs-legacy/linked-list.cjs +4376 -0
- package/dist/cjs-legacy/matrix.cjs +1045 -0
- package/dist/cjs-legacy/priority-queue.cjs +1312 -0
- package/dist/cjs-legacy/queue.cjs +4088 -0
- package/dist/cjs-legacy/stack.cjs +861 -0
- package/dist/cjs-legacy/trie.cjs +1172 -0
- package/dist/esm/binary-tree.mjs +23683 -0
- package/dist/esm/graph.mjs +5223 -0
- package/dist/esm/hash.mjs +1259 -0
- package/dist/esm/heap.mjs +1534 -0
- package/dist/esm/index.mjs +24507 -2898
- package/dist/esm/linked-list.mjs +4363 -0
- package/dist/esm/matrix.mjs +1038 -0
- package/dist/esm/priority-queue.mjs +1310 -0
- package/dist/esm/queue.mjs +4086 -0
- package/dist/esm/stack.mjs +859 -0
- package/dist/esm/trie.mjs +1170 -0
- package/dist/esm-legacy/binary-tree.mjs +23715 -0
- package/dist/esm-legacy/graph.mjs +5221 -0
- package/dist/esm-legacy/hash.mjs +1259 -0
- package/dist/esm-legacy/heap.mjs +1531 -0
- package/dist/esm-legacy/index.mjs +32553 -10935
- package/dist/esm-legacy/linked-list.mjs +4369 -0
- package/dist/esm-legacy/matrix.mjs +1041 -0
- package/dist/esm-legacy/priority-queue.mjs +1308 -0
- package/dist/esm-legacy/queue.mjs +4084 -0
- package/dist/esm-legacy/stack.mjs +859 -0
- package/dist/esm-legacy/trie.mjs +1169 -0
- package/dist/types/data-structures/base/index.d.ts +1 -0
- package/dist/types/data-structures/base/iterable-element-base.d.ts +1 -1
- package/dist/types/data-structures/base/iterable-entry-base.d.ts +8 -8
- package/dist/types/data-structures/base/linear-base.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +368 -51
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +473 -147
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +931 -80
- package/dist/types/data-structures/binary-tree/bst.d.ts +792 -29
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +592 -32
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +320 -135
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +3662 -6
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +3487 -201
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +2778 -65
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +3414 -6
- package/dist/types/data-structures/graph/abstract-graph.d.ts +4 -4
- package/dist/types/data-structures/graph/directed-graph.d.ts +419 -47
- package/dist/types/data-structures/graph/map-graph.d.ts +59 -1
- package/dist/types/data-structures/graph/undirected-graph.d.ts +384 -59
- package/dist/types/data-structures/hash/hash-map.d.ts +462 -89
- package/dist/types/data-structures/heap/heap.d.ts +567 -99
- package/dist/types/data-structures/heap/max-heap.d.ts +46 -0
- package/dist/types/data-structures/heap/min-heap.d.ts +59 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +631 -49
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +581 -68
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +775 -12
- package/dist/types/data-structures/matrix/matrix.d.ts +491 -0
- package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +57 -0
- package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +60 -0
- package/dist/types/data-structures/priority-queue/priority-queue.d.ts +60 -0
- package/dist/types/data-structures/queue/deque.d.ts +578 -71
- package/dist/types/data-structures/queue/queue.d.ts +451 -42
- package/dist/types/data-structures/stack/stack.d.ts +374 -32
- package/dist/types/data-structures/trie/trie.d.ts +458 -48
- package/dist/types/interfaces/graph.d.ts +1 -1
- package/dist/types/types/common.d.ts +2 -2
- package/dist/types/types/data-structures/binary-tree/segment-tree.d.ts +1 -1
- package/dist/types/types/data-structures/heap/heap.d.ts +1 -0
- package/dist/types/types/data-structures/linked-list/skip-linked-list.d.ts +1 -4
- package/dist/types/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
- package/dist/types/types/utils/validate-type.d.ts +4 -4
- package/dist/umd/data-structure-typed.js +32432 -10808
- package/dist/umd/data-structure-typed.min.js +10 -4
- package/docs-site-docusaurus/README.md +41 -0
- package/docs-site-docusaurus/docs/api/README.md +52 -0
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +6130 -0
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +282 -0
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +2266 -0
- package/docs-site-docusaurus/docs/api/classes/BST.md +5831 -0
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +333 -0
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +455 -0
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +4647 -0
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +331 -0
- package/docs-site-docusaurus/docs/api/classes/Deque.md +2767 -0
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +2999 -0
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +2685 -0
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +221 -0
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +253 -0
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +21 -0
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +1333 -0
- package/docs-site-docusaurus/docs/api/classes/Heap.md +1881 -0
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +800 -0
- package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +644 -0
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +1632 -0
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +1853 -0
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +1108 -0
- package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +156 -0
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +2824 -0
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +2929 -0
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +1026 -0
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +1866 -0
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +1883 -0
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +1879 -0
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +1882 -0
- package/docs-site-docusaurus/docs/api/classes/Navigator.md +109 -0
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +1839 -0
- package/docs-site-docusaurus/docs/api/classes/Queue.md +2244 -0
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +6374 -0
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +372 -0
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +2897 -0
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +169 -0
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +1229 -0
- package/docs-site-docusaurus/docs/api/classes/Stack.md +1573 -0
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +1257 -0
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +1475 -0
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +1117 -0
- package/docs-site-docusaurus/docs/api/classes/Trie.md +1708 -0
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +199 -0
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +2979 -0
- package/docs-site-docusaurus/docs/guide/_category_.json +6 -0
- package/docs-site-docusaurus/docs/guide/architecture.md +613 -0
- package/docs-site-docusaurus/docs/guide/concepts.md +420 -0
- package/docs-site-docusaurus/docs/guide/guides.md +611 -0
- package/docs-site-docusaurus/docs/guide/installation.md +60 -0
- package/docs-site-docusaurus/docs/guide/integrations.md +823 -0
- package/docs-site-docusaurus/docs/guide/overview.md +638 -0
- package/docs-site-docusaurus/docs/guide/performance.md +833 -0
- package/docs-site-docusaurus/docs/guide/quick-start.md +73 -0
- package/docs-site-docusaurus/docusaurus.config.ts +159 -0
- package/docs-site-docusaurus/fix-mdx-generics.mjs +75 -0
- package/docs-site-docusaurus/package-lock.json +18667 -0
- package/docs-site-docusaurus/package.json +50 -0
- package/docs-site-docusaurus/prefix-class-to-methods.mjs +48 -0
- package/docs-site-docusaurus/sidebars.ts +23 -0
- package/docs-site-docusaurus/sort-protected.mjs +87 -0
- package/docs-site-docusaurus/src/css/custom.css +96 -0
- package/docs-site-docusaurus/src/pages/index.module.css +13 -0
- package/docs-site-docusaurus/src/pages/index.tsx +71 -0
- package/docs-site-docusaurus/src/pages/markdown-page.md +7 -0
- package/docs-site-docusaurus/src/theme/TOCItems/index.tsx +34 -0
- package/docs-site-docusaurus/static/.nojekyll +0 -0
- package/docs-site-docusaurus/static/img/docusaurus-social-card.jpg +0 -0
- package/docs-site-docusaurus/static/img/docusaurus.png +0 -0
- package/docs-site-docusaurus/static/img/favicon.ico +0 -0
- package/docs-site-docusaurus/static/img/favicon.png +0 -0
- package/docs-site-docusaurus/static/img/logo-180.png +0 -0
- package/docs-site-docusaurus/static/img/logo.jpg +0 -0
- package/docs-site-docusaurus/static/img/logo.png +0 -0
- package/docs-site-docusaurus/static/img/logo.svg +1 -0
- package/docs-site-docusaurus/static/img/og-image.png +0 -0
- package/docs-site-docusaurus/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/docs-site-docusaurus/static/img/undraw_docusaurus_react.svg +170 -0
- package/docs-site-docusaurus/static/img/undraw_docusaurus_tree.svg +40 -0
- package/docs-site-docusaurus/static/robots.txt +4 -0
- package/docs-site-docusaurus/typedoc.json +23 -0
- package/package.json +109 -12
- package/src/data-structures/base/index.ts +1 -0
- package/src/data-structures/base/iterable-element-base.ts +4 -5
- package/src/data-structures/base/iterable-entry-base.ts +8 -8
- package/src/data-structures/base/linear-base.ts +3 -3
- package/src/data-structures/binary-tree/avl-tree.ts +386 -51
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +596 -247
- package/src/data-structures/binary-tree/binary-tree.ts +956 -81
- package/src/data-structures/binary-tree/bst.ts +840 -35
- package/src/data-structures/binary-tree/red-black-tree.ts +689 -97
- package/src/data-structures/binary-tree/segment-tree.ts +498 -249
- package/src/data-structures/binary-tree/tree-map.ts +3784 -7
- package/src/data-structures/binary-tree/tree-multi-map.ts +3614 -211
- package/src/data-structures/binary-tree/tree-multi-set.ts +2874 -65
- package/src/data-structures/binary-tree/tree-set.ts +3531 -10
- package/src/data-structures/graph/abstract-graph.ts +4 -4
- package/src/data-structures/graph/directed-graph.ts +429 -47
- package/src/data-structures/graph/map-graph.ts +59 -1
- package/src/data-structures/graph/undirected-graph.ts +393 -59
- package/src/data-structures/hash/hash-map.ts +476 -92
- package/src/data-structures/heap/heap.ts +581 -99
- package/src/data-structures/heap/max-heap.ts +46 -0
- package/src/data-structures/heap/min-heap.ts +59 -0
- package/src/data-structures/linked-list/doubly-linked-list.ts +646 -47
- package/src/data-structures/linked-list/singly-linked-list.ts +596 -68
- package/src/data-structures/linked-list/skip-linked-list.ts +1067 -90
- package/src/data-structures/matrix/matrix.ts +584 -12
- package/src/data-structures/priority-queue/max-priority-queue.ts +57 -0
- package/src/data-structures/priority-queue/min-priority-queue.ts +60 -0
- package/src/data-structures/priority-queue/priority-queue.ts +60 -0
- package/src/data-structures/queue/deque.ts +592 -70
- package/src/data-structures/queue/queue.ts +463 -42
- package/src/data-structures/stack/stack.ts +384 -32
- package/src/data-structures/trie/trie.ts +470 -48
- package/src/interfaces/graph.ts +1 -1
- package/src/types/common.ts +2 -2
- package/src/types/data-structures/binary-tree/segment-tree.ts +1 -1
- package/src/types/data-structures/heap/heap.ts +1 -0
- package/src/types/data-structures/linked-list/skip-linked-list.ts +2 -1
- package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
- package/src/types/utils/validate-type.ts +4 -4
- package/vercel.json +6 -0
- package/dist/leetcode/avl-tree-counter.mjs +0 -2957
- package/dist/leetcode/avl-tree-multi-map.mjs +0 -2889
- package/dist/leetcode/avl-tree.mjs +0 -2720
- package/dist/leetcode/binary-tree.mjs +0 -1594
- package/dist/leetcode/bst.mjs +0 -2398
- package/dist/leetcode/deque.mjs +0 -683
- package/dist/leetcode/directed-graph.mjs +0 -1733
- package/dist/leetcode/doubly-linked-list.mjs +0 -709
- package/dist/leetcode/hash-map.mjs +0 -493
- package/dist/leetcode/heap.mjs +0 -542
- package/dist/leetcode/max-heap.mjs +0 -375
- package/dist/leetcode/max-priority-queue.mjs +0 -383
- package/dist/leetcode/min-heap.mjs +0 -363
- package/dist/leetcode/min-priority-queue.mjs +0 -371
- package/dist/leetcode/priority-queue.mjs +0 -363
- package/dist/leetcode/queue.mjs +0 -943
- package/dist/leetcode/red-black-tree.mjs +0 -2765
- package/dist/leetcode/singly-linked-list.mjs +0 -754
- package/dist/leetcode/stack.mjs +0 -217
- package/dist/leetcode/tree-counter.mjs +0 -3039
- package/dist/leetcode/tree-multi-map.mjs +0 -2913
- package/dist/leetcode/trie.mjs +0 -413
- package/dist/leetcode/undirected-graph.mjs +0 -1650
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseTransition,
|
|
3
|
+
BaseTransitionPropsValidators,
|
|
4
|
+
Comment,
|
|
5
|
+
DeprecationTypes,
|
|
6
|
+
EffectScope,
|
|
7
|
+
ErrorCodes,
|
|
8
|
+
ErrorTypeStrings,
|
|
9
|
+
Fragment,
|
|
10
|
+
KeepAlive,
|
|
11
|
+
ReactiveEffect,
|
|
12
|
+
Static,
|
|
13
|
+
Suspense,
|
|
14
|
+
Teleport,
|
|
15
|
+
Text,
|
|
16
|
+
TrackOpTypes,
|
|
17
|
+
Transition,
|
|
18
|
+
TransitionGroup,
|
|
19
|
+
TriggerOpTypes,
|
|
20
|
+
VueElement,
|
|
21
|
+
assertNumber,
|
|
22
|
+
callWithAsyncErrorHandling,
|
|
23
|
+
callWithErrorHandling,
|
|
24
|
+
camelize,
|
|
25
|
+
capitalize,
|
|
26
|
+
cloneVNode,
|
|
27
|
+
compatUtils,
|
|
28
|
+
compile,
|
|
29
|
+
computed,
|
|
30
|
+
createApp,
|
|
31
|
+
createBaseVNode,
|
|
32
|
+
createBlock,
|
|
33
|
+
createCommentVNode,
|
|
34
|
+
createElementBlock,
|
|
35
|
+
createHydrationRenderer,
|
|
36
|
+
createPropsRestProxy,
|
|
37
|
+
createRenderer,
|
|
38
|
+
createSSRApp,
|
|
39
|
+
createSlots,
|
|
40
|
+
createStaticVNode,
|
|
41
|
+
createTextVNode,
|
|
42
|
+
createVNode,
|
|
43
|
+
customRef,
|
|
44
|
+
defineAsyncComponent,
|
|
45
|
+
defineComponent,
|
|
46
|
+
defineCustomElement,
|
|
47
|
+
defineEmits,
|
|
48
|
+
defineExpose,
|
|
49
|
+
defineModel,
|
|
50
|
+
defineOptions,
|
|
51
|
+
defineProps,
|
|
52
|
+
defineSSRCustomElement,
|
|
53
|
+
defineSlots,
|
|
54
|
+
devtools,
|
|
55
|
+
effect,
|
|
56
|
+
effectScope,
|
|
57
|
+
getCurrentInstance,
|
|
58
|
+
getCurrentScope,
|
|
59
|
+
getCurrentWatcher,
|
|
60
|
+
getTransitionRawChildren,
|
|
61
|
+
guardReactiveProps,
|
|
62
|
+
h,
|
|
63
|
+
handleError,
|
|
64
|
+
hasInjectionContext,
|
|
65
|
+
hydrate,
|
|
66
|
+
hydrateOnIdle,
|
|
67
|
+
hydrateOnInteraction,
|
|
68
|
+
hydrateOnMediaQuery,
|
|
69
|
+
hydrateOnVisible,
|
|
70
|
+
initCustomFormatter,
|
|
71
|
+
initDirectivesForSSR,
|
|
72
|
+
inject,
|
|
73
|
+
isMemoSame,
|
|
74
|
+
isProxy,
|
|
75
|
+
isReactive,
|
|
76
|
+
isReadonly,
|
|
77
|
+
isRef,
|
|
78
|
+
isRuntimeOnly,
|
|
79
|
+
isShallow,
|
|
80
|
+
isVNode,
|
|
81
|
+
markRaw,
|
|
82
|
+
mergeDefaults,
|
|
83
|
+
mergeModels,
|
|
84
|
+
mergeProps,
|
|
85
|
+
nextTick,
|
|
86
|
+
nodeOps,
|
|
87
|
+
normalizeClass,
|
|
88
|
+
normalizeProps,
|
|
89
|
+
normalizeStyle,
|
|
90
|
+
onActivated,
|
|
91
|
+
onBeforeMount,
|
|
92
|
+
onBeforeUnmount,
|
|
93
|
+
onBeforeUpdate,
|
|
94
|
+
onDeactivated,
|
|
95
|
+
onErrorCaptured,
|
|
96
|
+
onMounted,
|
|
97
|
+
onRenderTracked,
|
|
98
|
+
onRenderTriggered,
|
|
99
|
+
onScopeDispose,
|
|
100
|
+
onServerPrefetch,
|
|
101
|
+
onUnmounted,
|
|
102
|
+
onUpdated,
|
|
103
|
+
onWatcherCleanup,
|
|
104
|
+
openBlock,
|
|
105
|
+
patchProp,
|
|
106
|
+
popScopeId,
|
|
107
|
+
provide,
|
|
108
|
+
proxyRefs,
|
|
109
|
+
pushScopeId,
|
|
110
|
+
queuePostFlushCb,
|
|
111
|
+
reactive,
|
|
112
|
+
readonly,
|
|
113
|
+
ref,
|
|
114
|
+
registerRuntimeCompiler,
|
|
115
|
+
render,
|
|
116
|
+
renderList,
|
|
117
|
+
renderSlot,
|
|
118
|
+
resolveComponent,
|
|
119
|
+
resolveDirective,
|
|
120
|
+
resolveDynamicComponent,
|
|
121
|
+
resolveFilter,
|
|
122
|
+
resolveTransitionHooks,
|
|
123
|
+
setBlockTracking,
|
|
124
|
+
setDevtoolsHook,
|
|
125
|
+
setTransitionHooks,
|
|
126
|
+
shallowReactive,
|
|
127
|
+
shallowReadonly,
|
|
128
|
+
shallowRef,
|
|
129
|
+
ssrContextKey,
|
|
130
|
+
ssrUtils,
|
|
131
|
+
stop,
|
|
132
|
+
toDisplayString,
|
|
133
|
+
toHandlerKey,
|
|
134
|
+
toHandlers,
|
|
135
|
+
toRaw,
|
|
136
|
+
toRef,
|
|
137
|
+
toRefs,
|
|
138
|
+
toValue,
|
|
139
|
+
transformVNodeArgs,
|
|
140
|
+
triggerRef,
|
|
141
|
+
unref,
|
|
142
|
+
useAttrs,
|
|
143
|
+
useCssModule,
|
|
144
|
+
useCssVars,
|
|
145
|
+
useHost,
|
|
146
|
+
useId,
|
|
147
|
+
useModel,
|
|
148
|
+
useSSRContext,
|
|
149
|
+
useShadowRoot,
|
|
150
|
+
useSlots,
|
|
151
|
+
useTemplateRef,
|
|
152
|
+
useTransitionState,
|
|
153
|
+
vModelCheckbox,
|
|
154
|
+
vModelDynamic,
|
|
155
|
+
vModelRadio,
|
|
156
|
+
vModelSelect,
|
|
157
|
+
vModelText,
|
|
158
|
+
vShow,
|
|
159
|
+
version,
|
|
160
|
+
warn,
|
|
161
|
+
watch,
|
|
162
|
+
watchEffect,
|
|
163
|
+
watchPostEffect,
|
|
164
|
+
watchSyncEffect,
|
|
165
|
+
withAsyncContext,
|
|
166
|
+
withCtx,
|
|
167
|
+
withDefaults,
|
|
168
|
+
withDirectives,
|
|
169
|
+
withKeys,
|
|
170
|
+
withMemo,
|
|
171
|
+
withModifiers,
|
|
172
|
+
withScopeId
|
|
173
|
+
} from "./chunk-7OIKW5WK.js";
|
|
174
|
+
export {
|
|
175
|
+
BaseTransition,
|
|
176
|
+
BaseTransitionPropsValidators,
|
|
177
|
+
Comment,
|
|
178
|
+
DeprecationTypes,
|
|
179
|
+
EffectScope,
|
|
180
|
+
ErrorCodes,
|
|
181
|
+
ErrorTypeStrings,
|
|
182
|
+
Fragment,
|
|
183
|
+
KeepAlive,
|
|
184
|
+
ReactiveEffect,
|
|
185
|
+
Static,
|
|
186
|
+
Suspense,
|
|
187
|
+
Teleport,
|
|
188
|
+
Text,
|
|
189
|
+
TrackOpTypes,
|
|
190
|
+
Transition,
|
|
191
|
+
TransitionGroup,
|
|
192
|
+
TriggerOpTypes,
|
|
193
|
+
VueElement,
|
|
194
|
+
assertNumber,
|
|
195
|
+
callWithAsyncErrorHandling,
|
|
196
|
+
callWithErrorHandling,
|
|
197
|
+
camelize,
|
|
198
|
+
capitalize,
|
|
199
|
+
cloneVNode,
|
|
200
|
+
compatUtils,
|
|
201
|
+
compile,
|
|
202
|
+
computed,
|
|
203
|
+
createApp,
|
|
204
|
+
createBlock,
|
|
205
|
+
createCommentVNode,
|
|
206
|
+
createElementBlock,
|
|
207
|
+
createBaseVNode as createElementVNode,
|
|
208
|
+
createHydrationRenderer,
|
|
209
|
+
createPropsRestProxy,
|
|
210
|
+
createRenderer,
|
|
211
|
+
createSSRApp,
|
|
212
|
+
createSlots,
|
|
213
|
+
createStaticVNode,
|
|
214
|
+
createTextVNode,
|
|
215
|
+
createVNode,
|
|
216
|
+
customRef,
|
|
217
|
+
defineAsyncComponent,
|
|
218
|
+
defineComponent,
|
|
219
|
+
defineCustomElement,
|
|
220
|
+
defineEmits,
|
|
221
|
+
defineExpose,
|
|
222
|
+
defineModel,
|
|
223
|
+
defineOptions,
|
|
224
|
+
defineProps,
|
|
225
|
+
defineSSRCustomElement,
|
|
226
|
+
defineSlots,
|
|
227
|
+
devtools,
|
|
228
|
+
effect,
|
|
229
|
+
effectScope,
|
|
230
|
+
getCurrentInstance,
|
|
231
|
+
getCurrentScope,
|
|
232
|
+
getCurrentWatcher,
|
|
233
|
+
getTransitionRawChildren,
|
|
234
|
+
guardReactiveProps,
|
|
235
|
+
h,
|
|
236
|
+
handleError,
|
|
237
|
+
hasInjectionContext,
|
|
238
|
+
hydrate,
|
|
239
|
+
hydrateOnIdle,
|
|
240
|
+
hydrateOnInteraction,
|
|
241
|
+
hydrateOnMediaQuery,
|
|
242
|
+
hydrateOnVisible,
|
|
243
|
+
initCustomFormatter,
|
|
244
|
+
initDirectivesForSSR,
|
|
245
|
+
inject,
|
|
246
|
+
isMemoSame,
|
|
247
|
+
isProxy,
|
|
248
|
+
isReactive,
|
|
249
|
+
isReadonly,
|
|
250
|
+
isRef,
|
|
251
|
+
isRuntimeOnly,
|
|
252
|
+
isShallow,
|
|
253
|
+
isVNode,
|
|
254
|
+
markRaw,
|
|
255
|
+
mergeDefaults,
|
|
256
|
+
mergeModels,
|
|
257
|
+
mergeProps,
|
|
258
|
+
nextTick,
|
|
259
|
+
nodeOps,
|
|
260
|
+
normalizeClass,
|
|
261
|
+
normalizeProps,
|
|
262
|
+
normalizeStyle,
|
|
263
|
+
onActivated,
|
|
264
|
+
onBeforeMount,
|
|
265
|
+
onBeforeUnmount,
|
|
266
|
+
onBeforeUpdate,
|
|
267
|
+
onDeactivated,
|
|
268
|
+
onErrorCaptured,
|
|
269
|
+
onMounted,
|
|
270
|
+
onRenderTracked,
|
|
271
|
+
onRenderTriggered,
|
|
272
|
+
onScopeDispose,
|
|
273
|
+
onServerPrefetch,
|
|
274
|
+
onUnmounted,
|
|
275
|
+
onUpdated,
|
|
276
|
+
onWatcherCleanup,
|
|
277
|
+
openBlock,
|
|
278
|
+
patchProp,
|
|
279
|
+
popScopeId,
|
|
280
|
+
provide,
|
|
281
|
+
proxyRefs,
|
|
282
|
+
pushScopeId,
|
|
283
|
+
queuePostFlushCb,
|
|
284
|
+
reactive,
|
|
285
|
+
readonly,
|
|
286
|
+
ref,
|
|
287
|
+
registerRuntimeCompiler,
|
|
288
|
+
render,
|
|
289
|
+
renderList,
|
|
290
|
+
renderSlot,
|
|
291
|
+
resolveComponent,
|
|
292
|
+
resolveDirective,
|
|
293
|
+
resolveDynamicComponent,
|
|
294
|
+
resolveFilter,
|
|
295
|
+
resolveTransitionHooks,
|
|
296
|
+
setBlockTracking,
|
|
297
|
+
setDevtoolsHook,
|
|
298
|
+
setTransitionHooks,
|
|
299
|
+
shallowReactive,
|
|
300
|
+
shallowReadonly,
|
|
301
|
+
shallowRef,
|
|
302
|
+
ssrContextKey,
|
|
303
|
+
ssrUtils,
|
|
304
|
+
stop,
|
|
305
|
+
toDisplayString,
|
|
306
|
+
toHandlerKey,
|
|
307
|
+
toHandlers,
|
|
308
|
+
toRaw,
|
|
309
|
+
toRef,
|
|
310
|
+
toRefs,
|
|
311
|
+
toValue,
|
|
312
|
+
transformVNodeArgs,
|
|
313
|
+
triggerRef,
|
|
314
|
+
unref,
|
|
315
|
+
useAttrs,
|
|
316
|
+
useCssModule,
|
|
317
|
+
useCssVars,
|
|
318
|
+
useHost,
|
|
319
|
+
useId,
|
|
320
|
+
useModel,
|
|
321
|
+
useSSRContext,
|
|
322
|
+
useShadowRoot,
|
|
323
|
+
useSlots,
|
|
324
|
+
useTemplateRef,
|
|
325
|
+
useTransitionState,
|
|
326
|
+
vModelCheckbox,
|
|
327
|
+
vModelDynamic,
|
|
328
|
+
vModelRadio,
|
|
329
|
+
vModelSelect,
|
|
330
|
+
vModelText,
|
|
331
|
+
vShow,
|
|
332
|
+
version,
|
|
333
|
+
warn,
|
|
334
|
+
watch,
|
|
335
|
+
watchEffect,
|
|
336
|
+
watchPostEffect,
|
|
337
|
+
watchSyncEffect,
|
|
338
|
+
withAsyncContext,
|
|
339
|
+
withCtx,
|
|
340
|
+
withDefaults,
|
|
341
|
+
withDirectives,
|
|
342
|
+
withKeys,
|
|
343
|
+
withMemo,
|
|
344
|
+
withModifiers,
|
|
345
|
+
withScopeId
|
|
346
|
+
};
|
|
347
|
+
//# sourceMappingURL=vue.js.map
|
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,9 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
9
9
|
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)
|
|
10
10
|
|
|
11
|
-
## [v2.
|
|
11
|
+
## [v2.5.1](https://github.com/zrwusa/data-structure-typed/compare/v2.5.0...main) (upcoming)
|
|
12
|
+
|
|
13
|
+
## [v2.5.0](https://github.com/zrwusa/data-structure-typed/compare/v2.4.3...v2.5.0) (27 March 2026)
|
|
12
14
|
|
|
13
15
|
### Changes
|
|
14
16
|
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ A comprehensive TypeScript data structures library with production-ready impleme
|
|
|
14
14
|

|
|
15
15
|

|
|
16
16
|
|
|
17
|
-
**📦 [Installation](#-installation) • 🎮 [Playground](#-playground) • ⚡ [Quick Start](#-quick-start-30-seconds) • 📖 [Docs](#-documentation) • 📋 [API](
|
|
17
|
+
**📦 [Installation](#-installation) • 🎮 [Playground](#-playground) • ⚡ [Quick Start](#-quick-start-30-seconds) • 📖 [Docs](#-documentation) • 📋 [API](https://data-structure-typed-docs.vercel.app/) • 💡 [Examples](./docs/GUIDES.md)**
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -45,12 +45,35 @@ yarn add data-structure-typed
|
|
|
45
45
|
pnpm add data-structure-typed
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
### Subpath Imports (Tree-Shaking Friendly)
|
|
49
|
+
|
|
50
|
+
Import only what you need — bundlers automatically tree-shake unused code:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
// Full bundle — everything available
|
|
54
|
+
import { RedBlackTree, Deque, HashMap } from 'data-structure-typed';
|
|
55
|
+
|
|
56
|
+
// Subpath — smaller bundle, only loads the category you need
|
|
57
|
+
import { RedBlackTree, TreeMap, AVLTree } from 'data-structure-typed/binary-tree';
|
|
58
|
+
import { Deque, Queue } from 'data-structure-typed/queue';
|
|
59
|
+
import { HashMap } from 'data-structure-typed/hash';
|
|
60
|
+
import { Heap, MinHeap } from 'data-structure-typed/heap';
|
|
61
|
+
import { Trie } from 'data-structure-typed/trie';
|
|
62
|
+
import { Stack } from 'data-structure-typed/stack';
|
|
63
|
+
import { DoublyLinkedList } from 'data-structure-typed/linked-list';
|
|
64
|
+
import { DirectedGraph } from 'data-structure-typed/graph';
|
|
65
|
+
import { Matrix } from 'data-structure-typed/matrix';
|
|
66
|
+
import { MinPriorityQueue } from 'data-structure-typed/priority-queue';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> **Note:** With `"sideEffects": false` and modern bundlers (Vite, Webpack 5, Rollup), even the full import `from 'data-structure-typed'` will tree-shake unused structures. Subpath imports give you explicit control and faster IDE autocomplete.
|
|
70
|
+
|
|
48
71
|
### Individual Packages
|
|
49
72
|
|
|
50
|
-
|
|
73
|
+
Standalone packages are also available:
|
|
51
74
|
|
|
52
75
|
```bash
|
|
53
|
-
npm i
|
|
76
|
+
npm i avl-tree-typed bst-typed heap-typed
|
|
54
77
|
```
|
|
55
78
|
|
|
56
79
|
---
|
|
@@ -139,11 +162,11 @@ for (let i = 0; i < 100000; i++) {
|
|
|
139
162
|
| DoublyLinkedList | 100k push | 5.70 | 2.40 | 5.70 | 1.90 |
|
|
140
163
|
| SinglyLinkedList | 100K unshift & shift | 3.77 | 1958.39 | 4.80 | - |
|
|
141
164
|
| PriorityQueue | 100K add | 4.00 | - | 1.05 | 4.96 |
|
|
142
|
-
| TreeSet | 1M add |
|
|
143
|
-
| TreeMap | 1M set |
|
|
144
|
-
| TreeMultiSet | 1M add (TreeMultiSet expanded iteration) |
|
|
145
|
-
| TreeMultiMap | 1M add (TreeMultiMap bucketed) |
|
|
146
|
-
| RedBlackTree | 1M get |
|
|
165
|
+
| TreeSet | 1M add | 995.72 | - | 462.00 | 677.58 |
|
|
166
|
+
| TreeMap | 1M set | 978.72 | - | 512.00 | 623.23 |
|
|
167
|
+
| TreeMultiSet | 1M add (TreeMultiSet expanded iteration) | 217.73 | - | 752.00 | - |
|
|
168
|
+
| TreeMultiMap | 1M add (TreeMultiMap bucketed) | 366.19 | - | 731.00 | - |
|
|
169
|
+
| RedBlackTree | 1M get | 99.24 | - | 52.97 | - |
|
|
147
170
|
| BST | 10K add randomly | 5.50 | - | - | - |
|
|
148
171
|
| BinaryTree | 1K add randomly | 9.77 | - | - | - |
|
|
149
172
|
| HashMap | 1M set | 146.17 | 144.83 | 76.26 | 94.16 |
|
|
@@ -232,27 +255,36 @@ const set = new Set(tree); // Set constructor
|
|
|
232
255
|
```typescript
|
|
233
256
|
import { RedBlackTree } from 'data-structure-typed';
|
|
234
257
|
|
|
235
|
-
|
|
258
|
+
// Descending comparator — highest scores first
|
|
259
|
+
const leaderboard = new RedBlackTree<number, string>([
|
|
236
260
|
[100, 'Alice'],
|
|
237
261
|
[85, 'Bob'],
|
|
238
262
|
[92, 'Charlie']
|
|
239
|
-
]);
|
|
263
|
+
], { comparator: (a, b) => b - a });
|
|
240
264
|
|
|
241
|
-
//
|
|
242
|
-
|
|
243
|
-
|
|
265
|
+
// Top-2 via lazy iterator — O(2 log n), no full traversal
|
|
266
|
+
const iter = leaderboard.entries();
|
|
267
|
+
for (let i = 0; i < 2; i++) {
|
|
268
|
+
const { value: [score, player] } = iter.next();
|
|
269
|
+
console.log(`${score}: ${player}`);
|
|
244
270
|
}
|
|
245
|
-
// Output:
|
|
246
|
-
// Alice: 100
|
|
247
|
-
// Charlie: 92
|
|
248
|
-
// Bob: 85
|
|
271
|
+
// Output: 100: Alice → 92: Charlie
|
|
249
272
|
|
|
250
|
-
// Update score
|
|
273
|
+
// Update score — O(log n)
|
|
251
274
|
leaderboard.delete(85);
|
|
252
|
-
leaderboard.set(95, 'Bob');
|
|
275
|
+
leaderboard.set(95, 'Bob');
|
|
276
|
+
|
|
277
|
+
// Top-k — O(k log n), no array copy needed
|
|
278
|
+
const top3: [number, string][] = [];
|
|
279
|
+
let score = leaderboard.getLeftMost(); // highest score
|
|
280
|
+
while (score !== undefined && top3.length < 3) {
|
|
281
|
+
top3.push([score, leaderboard.get(score)!]);
|
|
282
|
+
score = leaderboard.higher(score); // next in tree order
|
|
283
|
+
}
|
|
253
284
|
|
|
254
|
-
//
|
|
255
|
-
const
|
|
285
|
+
// Range query — players scoring 90~100, O(log n + k)
|
|
286
|
+
const scores90to100 = leaderboard.rangeSearch([90, 100]);
|
|
287
|
+
// [100, 95, 92] — automatically respects tree order
|
|
256
288
|
```
|
|
257
289
|
|
|
258
290
|
### Task Queue (Scheduling)
|
|
@@ -294,8 +326,12 @@ queue.push(6); // Add to back: O(1)
|
|
|
294
326
|
| **Stack** | Undo/redo, expression parsing | O(1) | [npm](https://www.npmjs.com/package/stack-typed) |
|
|
295
327
|
| **LinkedList** | Dynamic sizing, no index shift | O(1)* | [npm](https://www.npmjs.com/package/linked-list-typed) |
|
|
296
328
|
| **AVLTree** | Stricter balance than RB-Tree | O(log n) | [npm](https://www.npmjs.com/package/avl-tree-typed) |
|
|
329
|
+
| **SkipList** | Sorted KV, TreeMap alternative | O(log n) avg | — |
|
|
330
|
+
| **SegmentTree** | Range sum/min/max/custom queries | O(log n) | — |
|
|
331
|
+
| **BinaryIndexedTree** | Prefix sums, frequency counting | O(log n) | — |
|
|
332
|
+
| **Matrix** | 2D grid arithmetic | O(n²) add | — |
|
|
297
333
|
|
|
298
|
-
👉 [See all 20+ structures →](./docs/
|
|
334
|
+
👉 [See all 20+ structures →](./docs/OVERVIEW.md) | [Full API docs →](https://data-structure-typed-docs.vercel.app/)
|
|
299
335
|
|
|
300
336
|
---
|
|
301
337
|
|
|
@@ -306,8 +342,8 @@ queue.push(6); // Add to back: O(1)
|
|
|
306
342
|
| Your Goal | Start Here | Next Steps |
|
|
307
343
|
|---------------------------|-------------------------------------------|-----------------------------------------|
|
|
308
344
|
| **Learn concepts** | [CONCEPTS.md](./docs/CONCEPTS.md) | [GUIDES.md](./docs/GUIDES.md) |
|
|
309
|
-
| **Use in my project** | [GUIDES.md](./docs/GUIDES.md) | [
|
|
310
|
-
| **Look up API** | [
|
|
345
|
+
| **Use in my project** | [GUIDES.md](./docs/GUIDES.md) | [OVERVIEW.md](./docs/OVERVIEW.md) |
|
|
346
|
+
| **Look up API** | [API Docs](https://data-structure-typed-docs.vercel.app/) | [PERFORMANCE.md](./docs/PERFORMANCE.md) |
|
|
311
347
|
| **Performance questions** | [PERFORMANCE.md](./docs/PERFORMANCE.md) | [ARCHITECTURE.md](./docs/ARCHITECTURE.md) |
|
|
312
348
|
| **Framework integration** | [INTEGRATIONS.md](./docs/INTEGRATIONS.md) | [GUIDES.md](./docs/GUIDES.md) |
|
|
313
349
|
| **Understand design** | [ARCHITECTURE.md](./docs/ARCHITECTURE.md) | [CONCEPTS.md](./docs/CONCEPTS.md) |
|
|
@@ -321,14 +357,19 @@ queue.push(6); // Add to back: O(1)
|
|
|
321
357
|
- 5 Comparisons with Native JavaScript
|
|
322
358
|
- Complete Decision Guide
|
|
323
359
|
|
|
324
|
-
2. **[
|
|
360
|
+
2. **[API Docs](https://data-structure-typed-docs.vercel.app/)** - Full API Reference (TypeDoc)
|
|
361
|
+
- Complete method signatures, parameters, return types
|
|
362
|
+
- Real-world `@example` code for every method
|
|
363
|
+
- Inheritance hierarchy and type details
|
|
364
|
+
|
|
365
|
+
3. **[OVERVIEW.md](./docs/OVERVIEW.md)** - Data Structures Overview
|
|
325
366
|
- Quick Reference Table
|
|
326
367
|
- All 20+ Structures with Examples
|
|
327
368
|
- CRUD Operations
|
|
328
369
|
- Common Methods
|
|
329
370
|
- TypeScript Support
|
|
330
371
|
|
|
331
|
-
|
|
372
|
+
4. **[ARCHITECTURE.md](./docs/ARCHITECTURE.md)** - Design & Implementation
|
|
332
373
|
- Design Philosophy & Principles
|
|
333
374
|
- 3 Pain Points Solved
|
|
334
375
|
- Why Deque is 484x Faster
|
|
@@ -336,20 +377,20 @@ queue.push(6); // Add to back: O(1)
|
|
|
336
377
|
- Self-Balancing Strategy
|
|
337
378
|
- V8 JIT Optimizations
|
|
338
379
|
|
|
339
|
-
|
|
380
|
+
5. **[PERFORMANCE.md](./docs/PERFORMANCE.md)** - Benchmarks & Comparisons
|
|
340
381
|
- Performance Summary
|
|
341
382
|
- 3 Real-World Scenarios
|
|
342
383
|
- Detailed Benchmarks
|
|
343
384
|
- When to Use What
|
|
344
385
|
- Optimization Tips
|
|
345
386
|
|
|
346
|
-
|
|
387
|
+
6. **[GUIDES.md](./docs/GUIDES.md)** - Real-World Examples
|
|
347
388
|
- 4 Design Patterns
|
|
348
389
|
- 5 Production Code Examples
|
|
349
390
|
- Common Mistakes
|
|
350
391
|
- Best Practices
|
|
351
392
|
|
|
352
|
-
|
|
393
|
+
7. **[INTEGRATIONS.md](./docs/INTEGRATIONS.md)** - Framework Integration
|
|
353
394
|
- React Integration (State Management, Leaderboard)
|
|
354
395
|
- Express Integration (LRU Cache, Rate Limiting)
|
|
355
396
|
- Nest.js Integration (Ranking Service, Task Queue)
|
|
@@ -549,6 +590,12 @@ Need prefix/text matching?
|
|
|
549
590
|
Need graph operations?
|
|
550
591
|
→ DirectedGraph/UndirectedGraph
|
|
551
592
|
|
|
593
|
+
Need range queries on array (sum/min/max)?
|
|
594
|
+
→ SegmentTree (any merge op) or BinaryIndexedTree (prefix sums only)
|
|
595
|
+
|
|
596
|
+
Need sorted key-value with same API as TreeMap?
|
|
597
|
+
→ SkipList (O(log n) avg, probabilistic balancing)
|
|
598
|
+
|
|
552
599
|
Otherwise?
|
|
553
600
|
→ Use Array (simplest case)
|
|
554
601
|
```
|
|
@@ -573,7 +620,7 @@ MIT
|
|
|
573
620
|
README.md (this file)
|
|
574
621
|
docs/
|
|
575
622
|
├── CONCEPTS.md (theory & fundamentals)
|
|
576
|
-
├──
|
|
623
|
+
├── OVERVIEW.md (Data structures overview)
|
|
577
624
|
├── ARCHITECTURE.md (design principles)
|
|
578
625
|
├── PERFORMANCE.md (benchmarks)
|
|
579
626
|
├── GUIDES.md (real-world examples)
|
|
@@ -590,7 +637,7 @@ docs/
|
|
|
590
637
|
|
|
591
638
|
**Want to build?** → [GUIDES.md](./docs/GUIDES.md)
|
|
592
639
|
|
|
593
|
-
**Need API?** → [
|
|
640
|
+
**Need API?** → [API Docs](https://data-structure-typed-docs.vercel.app/) | [Overview](./docs/OVERVIEW.md)
|
|
594
641
|
|
|
595
642
|
**Curious about performance?** → [PERFORMANCE.md](./docs/PERFORMANCE.md)
|
|
596
643
|
|