@thi.ng/api 8.3.2 → 8.3.5
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/CHANGELOG.md +1 -1
- package/README.md +2 -2
- package/deref.d.ts +1 -1
- package/deref.js +1 -1
- package/keyval.d.ts +10 -10
- package/package.json +57 -57
- package/typedarray.d.ts +4 -4
- package/typedarray.js +4 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ node --experimental-repl-await
|
|
|
60
60
|
> const api = await import("@thi.ng/api");
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
Package sizes (gzipped, pre-treeshake): ESM: 2.
|
|
63
|
+
Package sizes (gzipped, pre-treeshake): ESM: 2.25 KB
|
|
64
64
|
|
|
65
65
|
## Dependencies
|
|
66
66
|
|
|
@@ -93,4 +93,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
93
93
|
|
|
94
94
|
## License
|
|
95
95
|
|
|
96
|
-
© 2016 -
|
|
96
|
+
© 2016 - 2022 Karsten Schmidt // Apache Software License 2.0
|
package/deref.d.ts
CHANGED
package/deref.js
CHANGED
package/keyval.d.ts
CHANGED
|
@@ -49,9 +49,9 @@ export declare type Val8<T, A extends Keys<T>, B extends Keys1<T, A>, C extends
|
|
|
49
49
|
*
|
|
50
50
|
* @internal
|
|
51
51
|
*
|
|
52
|
-
* @param T
|
|
53
|
-
* @param C
|
|
54
|
-
* @param R
|
|
52
|
+
* @param T - he structure to get the values from.
|
|
53
|
+
* @param C - he current key.
|
|
54
|
+
* @param R - he remaining keys
|
|
55
55
|
*/
|
|
56
56
|
declare type ValNReducer<T, C, R extends unknown[]> = C extends keyof T ? {
|
|
57
57
|
0: T[C];
|
|
@@ -91,9 +91,9 @@ export declare type Without8<T, A extends Keys<T>, B extends Keys1<T, A>, C exte
|
|
|
91
91
|
*
|
|
92
92
|
* @internal
|
|
93
93
|
*
|
|
94
|
-
* @param T
|
|
95
|
-
* @param C
|
|
96
|
-
* @param R
|
|
94
|
+
* @param T - he structure to remove keys from.
|
|
95
|
+
* @param C - he current key.
|
|
96
|
+
* @param R - he remaining keys.
|
|
97
97
|
*/
|
|
98
98
|
declare type WithoutNReducer<T, C, R extends unknown[]> = C extends keyof T ? {
|
|
99
99
|
0: Without<T, C>;
|
|
@@ -135,10 +135,10 @@ export declare type Replace8<T, A extends Keys<T>, B extends Keys1<T, A>, C exte
|
|
|
135
135
|
*
|
|
136
136
|
* @internal
|
|
137
137
|
*
|
|
138
|
-
* @param T
|
|
139
|
-
* @param C
|
|
140
|
-
* @param R
|
|
141
|
-
* @param V
|
|
138
|
+
* @param T - he structure to remove keys from.
|
|
139
|
+
* @param C - he current key.
|
|
140
|
+
* @param R - he remaining keys.
|
|
141
|
+
* @param V - he type to use for the replacement.
|
|
142
142
|
*/
|
|
143
143
|
declare type ReplaceNReducer<T, C, R extends unknown[], V> = C extends keyof T ? {
|
|
144
144
|
0: Replace<T, C, V>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/api",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.5",
|
|
4
4
|
"description": "Common, generic types, interfaces & mixins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@microsoft/api-extractor": "^7.
|
|
38
|
-
"@thi.ng/testament": "^0.2.
|
|
37
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
38
|
+
"@thi.ng/testament": "^0.2.5",
|
|
39
39
|
"rimraf": "^3.0.2",
|
|
40
40
|
"tools": "^0.0.1",
|
|
41
|
-
"typedoc": "^0.22.
|
|
42
|
-
"typescript": "^4.
|
|
41
|
+
"typedoc": "^0.22.13",
|
|
42
|
+
"typescript": "^4.6.2"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"assert",
|
|
@@ -69,158 +69,158 @@
|
|
|
69
69
|
],
|
|
70
70
|
"exports": {
|
|
71
71
|
".": {
|
|
72
|
-
"
|
|
72
|
+
"default": "./index.js"
|
|
73
73
|
},
|
|
74
74
|
"./api": {
|
|
75
|
-
"
|
|
75
|
+
"default": "./api.js"
|
|
76
76
|
},
|
|
77
77
|
"./assoc": {
|
|
78
|
-
"
|
|
78
|
+
"default": "./assoc.js"
|
|
79
79
|
},
|
|
80
80
|
"./bind": {
|
|
81
|
-
"
|
|
81
|
+
"default": "./bind.js"
|
|
82
82
|
},
|
|
83
83
|
"./buffered": {
|
|
84
|
-
"
|
|
84
|
+
"default": "./buffered.js"
|
|
85
85
|
},
|
|
86
86
|
"./clear": {
|
|
87
|
-
"
|
|
87
|
+
"default": "./clear.js"
|
|
88
88
|
},
|
|
89
89
|
"./compare": {
|
|
90
|
-
"
|
|
90
|
+
"default": "./compare.js"
|
|
91
91
|
},
|
|
92
92
|
"./contains": {
|
|
93
|
-
"
|
|
93
|
+
"default": "./contains.js"
|
|
94
94
|
},
|
|
95
95
|
"./copy": {
|
|
96
|
-
"
|
|
96
|
+
"default": "./copy.js"
|
|
97
97
|
},
|
|
98
98
|
"./decorators/configurable": {
|
|
99
|
-
"
|
|
99
|
+
"default": "./decorators/configurable.js"
|
|
100
100
|
},
|
|
101
101
|
"./decorators/deprecated": {
|
|
102
|
-
"
|
|
102
|
+
"default": "./decorators/deprecated.js"
|
|
103
103
|
},
|
|
104
104
|
"./decorators/nomixin": {
|
|
105
|
-
"
|
|
105
|
+
"default": "./decorators/nomixin.js"
|
|
106
106
|
},
|
|
107
107
|
"./decorators/sealed": {
|
|
108
|
-
"
|
|
108
|
+
"default": "./decorators/sealed.js"
|
|
109
109
|
},
|
|
110
110
|
"./deref": {
|
|
111
|
-
"
|
|
111
|
+
"default": "./deref.js"
|
|
112
112
|
},
|
|
113
113
|
"./dissoc": {
|
|
114
|
-
"
|
|
114
|
+
"default": "./dissoc.js"
|
|
115
115
|
},
|
|
116
116
|
"./empty": {
|
|
117
|
-
"
|
|
117
|
+
"default": "./empty.js"
|
|
118
118
|
},
|
|
119
119
|
"./enable": {
|
|
120
|
-
"
|
|
120
|
+
"default": "./enable.js"
|
|
121
121
|
},
|
|
122
122
|
"./equiv": {
|
|
123
|
-
"
|
|
123
|
+
"default": "./equiv.js"
|
|
124
124
|
},
|
|
125
125
|
"./event": {
|
|
126
|
-
"
|
|
126
|
+
"default": "./event.js"
|
|
127
127
|
},
|
|
128
128
|
"./fn": {
|
|
129
|
-
"
|
|
129
|
+
"default": "./fn.js"
|
|
130
130
|
},
|
|
131
131
|
"./get": {
|
|
132
|
-
"
|
|
132
|
+
"default": "./get.js"
|
|
133
133
|
},
|
|
134
134
|
"./grid": {
|
|
135
|
-
"
|
|
135
|
+
"default": "./grid.js"
|
|
136
136
|
},
|
|
137
137
|
"./hash": {
|
|
138
|
-
"
|
|
138
|
+
"default": "./hash.js"
|
|
139
139
|
},
|
|
140
140
|
"./hiccup": {
|
|
141
|
-
"
|
|
141
|
+
"default": "./hiccup.js"
|
|
142
142
|
},
|
|
143
143
|
"./id": {
|
|
144
|
-
"
|
|
144
|
+
"default": "./id.js"
|
|
145
145
|
},
|
|
146
146
|
"./indexed": {
|
|
147
|
-
"
|
|
147
|
+
"default": "./indexed.js"
|
|
148
148
|
},
|
|
149
149
|
"./into": {
|
|
150
|
-
"
|
|
150
|
+
"default": "./into.js"
|
|
151
151
|
},
|
|
152
152
|
"./keyval": {
|
|
153
|
-
"
|
|
153
|
+
"default": "./keyval.js"
|
|
154
154
|
},
|
|
155
155
|
"./length": {
|
|
156
|
-
"
|
|
156
|
+
"default": "./length.js"
|
|
157
157
|
},
|
|
158
158
|
"./meta": {
|
|
159
|
-
"
|
|
159
|
+
"default": "./meta.js"
|
|
160
160
|
},
|
|
161
161
|
"./mixin": {
|
|
162
|
-
"
|
|
162
|
+
"default": "./mixin.js"
|
|
163
163
|
},
|
|
164
164
|
"./mixins/ienable": {
|
|
165
|
-
"
|
|
165
|
+
"default": "./mixins/ienable.js"
|
|
166
166
|
},
|
|
167
167
|
"./mixins/igrid": {
|
|
168
|
-
"
|
|
168
|
+
"default": "./mixins/igrid.js"
|
|
169
169
|
},
|
|
170
170
|
"./mixins/inotify": {
|
|
171
|
-
"
|
|
171
|
+
"default": "./mixins/inotify.js"
|
|
172
172
|
},
|
|
173
173
|
"./mixins/iterable": {
|
|
174
|
-
"
|
|
174
|
+
"default": "./mixins/iterable.js"
|
|
175
175
|
},
|
|
176
176
|
"./mixins/iwatch": {
|
|
177
|
-
"
|
|
177
|
+
"default": "./mixins/iwatch.js"
|
|
178
178
|
},
|
|
179
179
|
"./null": {
|
|
180
|
-
"
|
|
180
|
+
"default": "./null.js"
|
|
181
181
|
},
|
|
182
182
|
"./object": {
|
|
183
|
-
"
|
|
183
|
+
"default": "./object.js"
|
|
184
184
|
},
|
|
185
185
|
"./path": {
|
|
186
|
-
"
|
|
186
|
+
"default": "./path.js"
|
|
187
187
|
},
|
|
188
188
|
"./predicate": {
|
|
189
|
-
"
|
|
189
|
+
"default": "./predicate.js"
|
|
190
190
|
},
|
|
191
191
|
"./prim": {
|
|
192
|
-
"
|
|
192
|
+
"default": "./prim.js"
|
|
193
193
|
},
|
|
194
194
|
"./range": {
|
|
195
|
-
"
|
|
195
|
+
"default": "./range.js"
|
|
196
196
|
},
|
|
197
197
|
"./release": {
|
|
198
|
-
"
|
|
198
|
+
"default": "./release.js"
|
|
199
199
|
},
|
|
200
200
|
"./reset": {
|
|
201
|
-
"
|
|
201
|
+
"default": "./reset.js"
|
|
202
202
|
},
|
|
203
203
|
"./select": {
|
|
204
|
-
"
|
|
204
|
+
"default": "./select.js"
|
|
205
205
|
},
|
|
206
206
|
"./seq": {
|
|
207
|
-
"
|
|
207
|
+
"default": "./seq.js"
|
|
208
208
|
},
|
|
209
209
|
"./set": {
|
|
210
|
-
"
|
|
210
|
+
"default": "./set.js"
|
|
211
211
|
},
|
|
212
212
|
"./stack": {
|
|
213
|
-
"
|
|
213
|
+
"default": "./stack.js"
|
|
214
214
|
},
|
|
215
215
|
"./tuple": {
|
|
216
|
-
"
|
|
216
|
+
"default": "./tuple.js"
|
|
217
217
|
},
|
|
218
218
|
"./typedarray": {
|
|
219
|
-
"
|
|
219
|
+
"default": "./typedarray.js"
|
|
220
220
|
},
|
|
221
221
|
"./watch": {
|
|
222
|
-
"
|
|
222
|
+
"default": "./watch.js"
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
|
-
"gitHead": "
|
|
225
|
+
"gitHead": "5ee1feb590dd935593b1dd4e7f38a3ed3ba64765\n"
|
|
226
226
|
}
|
package/typedarray.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ export declare const asInt: (...args: number[]) => number[];
|
|
|
115
115
|
/**
|
|
116
116
|
* Returns byte size for given {@link Type} ID or {@link GLType} enum.
|
|
117
117
|
*
|
|
118
|
-
* @param type
|
|
118
|
+
* @param type -
|
|
119
119
|
*/
|
|
120
120
|
export declare const sizeOf: (type: GLType | Type) => number;
|
|
121
121
|
/**
|
|
@@ -131,7 +131,7 @@ export declare function typedArray<T extends Type | GLType>(type: T, buf: ArrayB
|
|
|
131
131
|
* Takes an {@link NumericArray} and returns its corresponding {@link Type} ID.
|
|
132
132
|
* Standard JS arrays will default to {@link "f64"}.
|
|
133
133
|
*
|
|
134
|
-
* @param x
|
|
134
|
+
* @param x -
|
|
135
135
|
*/
|
|
136
136
|
export declare const typedArrayType: (x: NumericArray) => Type;
|
|
137
137
|
/**
|
|
@@ -151,13 +151,13 @@ export declare const intTypeForSize: (x: number) => IntType;
|
|
|
151
151
|
/**
|
|
152
152
|
* Returns suitable {@link UintType} for given bit size (`[0,32]` range)
|
|
153
153
|
*
|
|
154
|
-
* @param x
|
|
154
|
+
* @param x -
|
|
155
155
|
*/
|
|
156
156
|
export declare const uintTypeForBits: (x: number) => UintType;
|
|
157
157
|
/**
|
|
158
158
|
* Returns suitable {@link IntType} for given bit size (`[0,32]` range)
|
|
159
159
|
*
|
|
160
|
-
* @param x
|
|
160
|
+
* @param x -
|
|
161
161
|
*/
|
|
162
162
|
export declare const intTypeForBits: (x: number) => IntType;
|
|
163
163
|
//# sourceMappingURL=typedarray.d.ts.map
|
package/typedarray.js
CHANGED
|
@@ -118,7 +118,7 @@ export const asInt = (...args) => args.map((x) => x | 0);
|
|
|
118
118
|
/**
|
|
119
119
|
* Returns byte size for given {@link Type} ID or {@link GLType} enum.
|
|
120
120
|
*
|
|
121
|
-
* @param type
|
|
121
|
+
* @param type -
|
|
122
122
|
*/
|
|
123
123
|
export const sizeOf = (type) => SIZEOF[asNativeType(type)];
|
|
124
124
|
export function typedArray(type, ...xs) {
|
|
@@ -128,7 +128,7 @@ export function typedArray(type, ...xs) {
|
|
|
128
128
|
* Takes an {@link NumericArray} and returns its corresponding {@link Type} ID.
|
|
129
129
|
* Standard JS arrays will default to {@link "f64"}.
|
|
130
130
|
*
|
|
131
|
-
* @param x
|
|
131
|
+
* @param x -
|
|
132
132
|
*/
|
|
133
133
|
export const typedArrayType = (x) => {
|
|
134
134
|
if (Array.isArray(x))
|
|
@@ -156,12 +156,12 @@ export const intTypeForSize = (x) => x >= -0x80 && x < 0x80 ? "i8" : x >= -0x800
|
|
|
156
156
|
/**
|
|
157
157
|
* Returns suitable {@link UintType} for given bit size (`[0,32]` range)
|
|
158
158
|
*
|
|
159
|
-
* @param x
|
|
159
|
+
* @param x -
|
|
160
160
|
*/
|
|
161
161
|
export const uintTypeForBits = (x) => x > 16 ? "u32" : x > 8 ? "u16" : "u8";
|
|
162
162
|
/**
|
|
163
163
|
* Returns suitable {@link IntType} for given bit size (`[0,32]` range)
|
|
164
164
|
*
|
|
165
|
-
* @param x
|
|
165
|
+
* @param x -
|
|
166
166
|
*/
|
|
167
167
|
export const intTypeForBits = (x) => x > 16 ? "i32" : x > 8 ? "i16" : "i8";
|