@blackglory/structures 0.6.0 → 0.6.3
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/README.md +20 -5
- package/dist/es2015/index.min.mjs +2 -2
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +54 -1
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +54 -0
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +2 -2
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +2 -2
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +54 -1
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +54 -0
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +2 -2
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/hash-map.d.ts +2 -2
- package/lib/es2015/hash-map.js.map +1 -1
- package/lib/es2015/hash-set.d.ts +2 -2
- package/lib/es2015/hash-set.js.map +1 -1
- package/lib/es2015/index.d.ts +1 -0
- package/lib/es2015/index.js +1 -0
- package/lib/es2015/index.js.map +1 -1
- package/lib/es2015/sparse-set.d.ts +8 -0
- package/lib/es2015/sparse-set.js +37 -0
- package/lib/es2015/sparse-set.js.map +1 -0
- package/lib/es2015/trie-map.d.ts +4 -2
- package/lib/es2015/trie-map.js +19 -0
- package/lib/es2015/trie-map.js.map +1 -1
- package/lib/es2018/hash-map.d.ts +2 -2
- package/lib/es2018/hash-map.js.map +1 -1
- package/lib/es2018/hash-set.d.ts +2 -2
- package/lib/es2018/hash-set.js.map +1 -1
- package/lib/es2018/index.d.ts +1 -0
- package/lib/es2018/index.js +1 -0
- package/lib/es2018/index.js.map +1 -1
- package/lib/es2018/sparse-set.d.ts +8 -0
- package/lib/es2018/sparse-set.js +37 -0
- package/lib/es2018/sparse-set.js.map +1 -0
- package/lib/es2018/trie-map.d.ts +4 -2
- package/lib/es2018/trie-map.js +19 -0
- package/lib/es2018/trie-map.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,11 +52,11 @@ class Emitter<EventToArgs extends Record<string, unknown[]>> {
|
|
|
52
52
|
|
|
53
53
|
### HashMap
|
|
54
54
|
```ts
|
|
55
|
-
class HashMap<K, V,
|
|
55
|
+
class HashMap<K, V, Hash = unknown> {
|
|
56
56
|
get [Symbol.toStringTag](): string
|
|
57
57
|
get size(): number
|
|
58
58
|
|
|
59
|
-
constructor(hash: (key: K) =>
|
|
59
|
+
constructor(hash: (key: K) => Hash)
|
|
60
60
|
|
|
61
61
|
set(key: K, value: V): this
|
|
62
62
|
has(key: K): boolean
|
|
@@ -68,12 +68,12 @@ class HashMap<K, V, H = unknown> {
|
|
|
68
68
|
|
|
69
69
|
### HashSet
|
|
70
70
|
```ts
|
|
71
|
-
class HashSet<V,
|
|
71
|
+
class HashSet<V, Hash = unknown> implements Iterable<V> {
|
|
72
72
|
get [Symbol.toStringTag](): string
|
|
73
73
|
get size(): number
|
|
74
74
|
[Symbol.iterator](): IterableIterator<V>
|
|
75
75
|
|
|
76
|
-
constructor(hash: (value: V) =>
|
|
76
|
+
constructor(hash: (value: V) => Hash)
|
|
77
77
|
|
|
78
78
|
add(value: V): this
|
|
79
79
|
delete(value: V): boolean
|
|
@@ -146,9 +146,13 @@ class Queue<T> {
|
|
|
146
146
|
|
|
147
147
|
### TrieMap
|
|
148
148
|
```ts
|
|
149
|
-
class TrieMap<K extends Iterable<T>, V, T =
|
|
149
|
+
class TrieMap<K extends Iterable<T>, V, T = unknown> {
|
|
150
150
|
get [Symbol.toStringTag](): string
|
|
151
151
|
|
|
152
|
+
keys(): Iterable<T[]>
|
|
153
|
+
values(): Iterable<V>
|
|
154
|
+
entries(): Iterable<[key: T[], value: V]>
|
|
155
|
+
|
|
152
156
|
set(key: K, value: V): this
|
|
153
157
|
has(key: K): boolean
|
|
154
158
|
get(key: K): V | undefined
|
|
@@ -197,3 +201,14 @@ class ObservableFiniteStateMachine<
|
|
|
197
201
|
observeStateChanges(): Observable<IFiniteStateMachineStateChange<State, Event>>
|
|
198
202
|
}
|
|
199
203
|
```
|
|
204
|
+
|
|
205
|
+
### SparseSet
|
|
206
|
+
```ts
|
|
207
|
+
class SparseSet {
|
|
208
|
+
get [Symbol.iterator](): Iterable<number>
|
|
209
|
+
|
|
210
|
+
add(value: number): void
|
|
211
|
+
has(value: number): boolean
|
|
212
|
+
remove(value: number): void
|
|
213
|
+
}
|
|
214
|
+
```
|