@thi.ng/api 8.9.29 → 8.9.31
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/deref.d.ts +1 -1
- package/equiv.d.ts +3 -1
- package/package.json +6 -6
- package/typedarray.d.ts +29 -11
package/CHANGELOG.md
CHANGED
package/deref.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type Derefed<T> = T extends IDeref<any> ? ReturnType<T["deref"]> : T;
|
|
|
18
18
|
* attempts to resolve each given key via {@link Derefed}.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
|
-
* ```ts
|
|
21
|
+
* ```ts tangle:../export/deref.ts
|
|
22
22
|
* import type { DerefedKeys, IDeref } from "@thi.ng/api";
|
|
23
23
|
*
|
|
24
24
|
* interface Foo {
|
package/equiv.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export interface IEquiv {
|
|
2
2
|
/**
|
|
3
3
|
* Returns `true` if this *value* is equivalent to `o`. Also see
|
|
4
|
-
*
|
|
4
|
+
* [ICompare.compare](https://docs.thi.ng/umbrella/api/interfaces/ICompare.html#compare)
|
|
5
|
+
* and
|
|
6
|
+
* [IHash.hash](https://docs.thi.ng/umbrella/api/interfaces/IHash.html#hash).
|
|
5
7
|
*
|
|
6
8
|
* @param o - value to check for equivalence
|
|
7
9
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/api",
|
|
3
|
-
"version": "8.9.
|
|
3
|
+
"version": "8.9.31",
|
|
4
4
|
"description": "Common, generic types, interfaces & mixins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@microsoft/api-extractor": "^7.
|
|
43
|
-
"esbuild": "^0.20.
|
|
42
|
+
"@microsoft/api-extractor": "^7.43.0",
|
|
43
|
+
"esbuild": "^0.20.2",
|
|
44
44
|
"rimraf": "^5.0.5",
|
|
45
|
-
"typedoc": "^0.25.
|
|
46
|
-
"typescript": "^5.
|
|
45
|
+
"typedoc": "^0.25.12",
|
|
46
|
+
"typescript": "^5.4.3"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"assert",
|
|
@@ -226,5 +226,5 @@
|
|
|
226
226
|
"default": "./watch.js"
|
|
227
227
|
}
|
|
228
228
|
},
|
|
229
|
-
"gitHead": "
|
|
229
|
+
"gitHead": "feb3b24654f2c931cd3c3308c1c0c807ee14d0e4\n"
|
|
230
230
|
}
|
package/typedarray.d.ts
CHANGED
|
@@ -116,11 +116,18 @@ export interface BigTypedArrayTypeMap extends Record<BigType, BigTypedArray> {
|
|
|
116
116
|
* attempting to resolve it as {@link GLType} enum.
|
|
117
117
|
*
|
|
118
118
|
* @example
|
|
119
|
-
* ```ts
|
|
120
|
-
* import { asNativeType } from "@thi.ng/api";
|
|
119
|
+
* ```ts tangle:../export/as-native-type.ts
|
|
120
|
+
* import { asNativeType, GLType } from "@thi.ng/api";
|
|
121
121
|
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
122
|
+
* console.log(
|
|
123
|
+
* asNativeType(GLType.F32)
|
|
124
|
+
* );
|
|
125
|
+
* // "f32"
|
|
126
|
+
*
|
|
127
|
+
* console.log(
|
|
128
|
+
* asNativeType("f32")
|
|
129
|
+
* );
|
|
130
|
+
* // "f32"
|
|
124
131
|
* ```
|
|
125
132
|
*
|
|
126
133
|
* @param type -
|
|
@@ -130,11 +137,18 @@ export declare const asNativeType: (type: GLType | Type) => Type;
|
|
|
130
137
|
* Returns suitable {@link GLType} enum of `type`.
|
|
131
138
|
*
|
|
132
139
|
* @example
|
|
133
|
-
* ```ts
|
|
134
|
-
* import { asGLType } from "@thi.ng/api";
|
|
140
|
+
* ```ts tangle:../export/as-gl-type.ts
|
|
141
|
+
* import { asGLType, GLType } from "@thi.ng/api";
|
|
142
|
+
*
|
|
143
|
+
* console.log(
|
|
144
|
+
* asGLType("f32")
|
|
145
|
+
* );
|
|
146
|
+
* // 5126 (aka GLType.F32)
|
|
135
147
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
148
|
+
* console.log(
|
|
149
|
+
* asGLType(GLType.F32)
|
|
150
|
+
* );
|
|
151
|
+
* // 5126 (aka GLType.F32)
|
|
138
152
|
* ```
|
|
139
153
|
*
|
|
140
154
|
* @param type -
|
|
@@ -172,15 +186,19 @@ export declare function typedArray<T extends BigType>(type: T, buf: ArrayBufferL
|
|
|
172
186
|
* item/vector given.
|
|
173
187
|
*
|
|
174
188
|
* @example
|
|
175
|
-
* ```ts
|
|
189
|
+
* ```ts tangle:../export/typed-array.ts
|
|
176
190
|
* import { typedArrayOfVec } from "@thi.ng/api";
|
|
177
191
|
*
|
|
178
192
|
* // inferred stride=2 (2d vectors)
|
|
179
|
-
*
|
|
193
|
+
* console.log(
|
|
194
|
+
* typedArrayOfVec("f32", [[1,2], [3,4], [-10,20]])
|
|
195
|
+
* );
|
|
180
196
|
* // Float32Array(6) [ 1, 2, 3, 4, -10, 20 ]
|
|
181
197
|
*
|
|
182
198
|
* // with custom stride=4
|
|
183
|
-
*
|
|
199
|
+
* console.log(
|
|
200
|
+
* typedArrayOfVec("f32", [[1,2], [3,4], [-10,20]], 4)
|
|
201
|
+
* );
|
|
184
202
|
* // Float32Array(12) [ 1, 2, 0, 0, 3,4, 0, 0, -10, 20, 0, 0 ]
|
|
185
203
|
* ```
|
|
186
204
|
*
|