data-structure-typed 2.5.0 → 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 +63 -26
- 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 +28244 -14795
- 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 +28239 -14790
- 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 +28242 -14796
- 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 +28237 -14791
- 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-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 +240 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +280 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +502 -2
- package/dist/types/data-structures/binary-tree/bst.d.ts +481 -1
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +380 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +120 -1
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +2764 -384
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +2753 -353
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +2241 -321
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +2554 -274
- package/dist/types/data-structures/graph/abstract-graph.d.ts +4 -4
- package/dist/types/data-structures/graph/directed-graph.d.ts +200 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +180 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +230 -10
- package/dist/types/data-structures/heap/heap.d.ts +280 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +343 -3
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +303 -3
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +362 -2
- package/dist/types/data-structures/matrix/matrix.d.ts +160 -0
- package/dist/types/data-structures/queue/deque.d.ts +304 -4
- package/dist/types/data-structures/queue/queue.d.ts +240 -0
- package/dist/types/data-structures/stack/stack.d.ts +200 -0
- package/dist/types/data-structures/trie/trie.d.ts +244 -4
- package/dist/types/interfaces/graph.d.ts +1 -1
- package/dist/types/types/common.d.ts +2 -2
- package/dist/types/types/data-structures/heap/heap.d.ts +1 -0
- 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 +28022 -14573
- package/dist/umd/data-structure-typed.min.js +9 -3
- 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 +106 -10
- package/src/data-structures/base/index.ts +1 -0
- 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 +240 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +281 -1
- package/src/data-structures/binary-tree/binary-tree.ts +502 -2
- package/src/data-structures/binary-tree/bst.ts +481 -1
- package/src/data-structures/binary-tree/red-black-tree.ts +380 -0
- package/src/data-structures/binary-tree/segment-tree.ts +121 -2
- package/src/data-structures/binary-tree/tree-map.ts +2862 -482
- package/src/data-structures/binary-tree/tree-multi-map.ts +2963 -563
- package/src/data-structures/binary-tree/tree-multi-set.ts +2399 -479
- package/src/data-structures/binary-tree/tree-set.ts +2685 -405
- package/src/data-structures/graph/abstract-graph.ts +4 -4
- package/src/data-structures/graph/directed-graph.ts +200 -0
- package/src/data-structures/graph/undirected-graph.ts +180 -0
- package/src/data-structures/hash/hash-map.ts +235 -15
- package/src/data-structures/heap/heap.ts +280 -0
- package/src/data-structures/linked-list/doubly-linked-list.ts +343 -3
- package/src/data-structures/linked-list/singly-linked-list.ts +303 -3
- package/src/data-structures/linked-list/skip-linked-list.ts +362 -2
- package/src/data-structures/matrix/matrix.ts +161 -1
- package/src/data-structures/queue/deque.ts +305 -5
- package/src/data-structures/queue/queue.ts +240 -0
- package/src/data-structures/stack/stack.ts +200 -0
- package/src/data-structures/trie/trie.ts +245 -5
- package/src/interfaces/graph.ts +1 -1
- package/src/types/common.ts +2 -2
- package/src/types/data-structures/heap/heap.ts +1 -0
- 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.5.
|
|
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
|
---
|
|
@@ -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)
|
|
@@ -299,7 +331,7 @@ queue.push(6); // Add to back: O(1)
|
|
|
299
331
|
| **BinaryIndexedTree** | Prefix sums, frequency counting | O(log n) | — |
|
|
300
332
|
| **Matrix** | 2D grid arithmetic | O(n²) add | — |
|
|
301
333
|
|
|
302
|
-
👉 [See all 20+ structures →](./docs/
|
|
334
|
+
👉 [See all 20+ structures →](./docs/OVERVIEW.md) | [Full API docs →](https://data-structure-typed-docs.vercel.app/)
|
|
303
335
|
|
|
304
336
|
---
|
|
305
337
|
|
|
@@ -310,8 +342,8 @@ queue.push(6); // Add to back: O(1)
|
|
|
310
342
|
| Your Goal | Start Here | Next Steps |
|
|
311
343
|
|---------------------------|-------------------------------------------|-----------------------------------------|
|
|
312
344
|
| **Learn concepts** | [CONCEPTS.md](./docs/CONCEPTS.md) | [GUIDES.md](./docs/GUIDES.md) |
|
|
313
|
-
| **Use in my project** | [GUIDES.md](./docs/GUIDES.md) | [
|
|
314
|
-
| **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) |
|
|
315
347
|
| **Performance questions** | [PERFORMANCE.md](./docs/PERFORMANCE.md) | [ARCHITECTURE.md](./docs/ARCHITECTURE.md) |
|
|
316
348
|
| **Framework integration** | [INTEGRATIONS.md](./docs/INTEGRATIONS.md) | [GUIDES.md](./docs/GUIDES.md) |
|
|
317
349
|
| **Understand design** | [ARCHITECTURE.md](./docs/ARCHITECTURE.md) | [CONCEPTS.md](./docs/CONCEPTS.md) |
|
|
@@ -325,14 +357,19 @@ queue.push(6); // Add to back: O(1)
|
|
|
325
357
|
- 5 Comparisons with Native JavaScript
|
|
326
358
|
- Complete Decision Guide
|
|
327
359
|
|
|
328
|
-
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
|
|
329
366
|
- Quick Reference Table
|
|
330
367
|
- All 20+ Structures with Examples
|
|
331
368
|
- CRUD Operations
|
|
332
369
|
- Common Methods
|
|
333
370
|
- TypeScript Support
|
|
334
371
|
|
|
335
|
-
|
|
372
|
+
4. **[ARCHITECTURE.md](./docs/ARCHITECTURE.md)** - Design & Implementation
|
|
336
373
|
- Design Philosophy & Principles
|
|
337
374
|
- 3 Pain Points Solved
|
|
338
375
|
- Why Deque is 484x Faster
|
|
@@ -340,20 +377,20 @@ queue.push(6); // Add to back: O(1)
|
|
|
340
377
|
- Self-Balancing Strategy
|
|
341
378
|
- V8 JIT Optimizations
|
|
342
379
|
|
|
343
|
-
|
|
380
|
+
5. **[PERFORMANCE.md](./docs/PERFORMANCE.md)** - Benchmarks & Comparisons
|
|
344
381
|
- Performance Summary
|
|
345
382
|
- 3 Real-World Scenarios
|
|
346
383
|
- Detailed Benchmarks
|
|
347
384
|
- When to Use What
|
|
348
385
|
- Optimization Tips
|
|
349
386
|
|
|
350
|
-
|
|
387
|
+
6. **[GUIDES.md](./docs/GUIDES.md)** - Real-World Examples
|
|
351
388
|
- 4 Design Patterns
|
|
352
389
|
- 5 Production Code Examples
|
|
353
390
|
- Common Mistakes
|
|
354
391
|
- Best Practices
|
|
355
392
|
|
|
356
|
-
|
|
393
|
+
7. **[INTEGRATIONS.md](./docs/INTEGRATIONS.md)** - Framework Integration
|
|
357
394
|
- React Integration (State Management, Leaderboard)
|
|
358
395
|
- Express Integration (LRU Cache, Rate Limiting)
|
|
359
396
|
- Nest.js Integration (Ranking Service, Task Queue)
|
|
@@ -583,7 +620,7 @@ MIT
|
|
|
583
620
|
README.md (this file)
|
|
584
621
|
docs/
|
|
585
622
|
├── CONCEPTS.md (theory & fundamentals)
|
|
586
|
-
├──
|
|
623
|
+
├── OVERVIEW.md (Data structures overview)
|
|
587
624
|
├── ARCHITECTURE.md (design principles)
|
|
588
625
|
├── PERFORMANCE.md (benchmarks)
|
|
589
626
|
├── GUIDES.md (real-world examples)
|
|
@@ -600,7 +637,7 @@ docs/
|
|
|
600
637
|
|
|
601
638
|
**Want to build?** → [GUIDES.md](./docs/GUIDES.md)
|
|
602
639
|
|
|
603
|
-
**Need API?** → [
|
|
640
|
+
**Need API?** → [API Docs](https://data-structure-typed-docs.vercel.app/) | [Overview](./docs/OVERVIEW.md)
|
|
604
641
|
|
|
605
642
|
**Curious about performance?** → [PERFORMANCE.md](./docs/PERFORMANCE.md)
|
|
606
643
|
|