@danielsimonjr/mathts-functions 0.17.1 → 0.17.2
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/dist/index.js +10 -1
- package/dist/utils/map.d.ts +18 -0
- package/dist/utils/map.d.ts.map +1 -1
- package/package.json +4 -3
- package/types/assemblyscript.d.ts +101 -0
- package/types/index.d.ts +7801 -0
- package/types/modules.d.ts +19 -0
package/dist/index.js
CHANGED
|
@@ -30739,7 +30739,16 @@ var ObjectWrappingMap = class {
|
|
|
30739
30739
|
[Symbol.toStringTag] = "ObjectWrappingMap";
|
|
30740
30740
|
constructor(object) {
|
|
30741
30741
|
this.wrappedObject = object;
|
|
30742
|
-
|
|
30742
|
+
}
|
|
30743
|
+
/**
|
|
30744
|
+
* Declared as a real method rather than assigned in the constructor through a
|
|
30745
|
+
* cast. The old form satisfied the runtime but never appeared in the emitted
|
|
30746
|
+
* type, so `implements Map<K, V>` was a lie that only surfaced downstream:
|
|
30747
|
+
* consumers compiling with `skipLibCheck: false` got TS2420 ("incorrectly
|
|
30748
|
+
* implements interface 'Map'... '[Symbol.iterator]' is missing").
|
|
30749
|
+
*/
|
|
30750
|
+
[Symbol.iterator]() {
|
|
30751
|
+
return this.entries();
|
|
30743
30752
|
}
|
|
30744
30753
|
// @ts-expect-error: Implementation is compatible but TS can't infer it
|
|
30745
30754
|
keys() {
|
package/dist/utils/map.d.ts
CHANGED
|
@@ -6,10 +6,25 @@
|
|
|
6
6
|
* will stop using this method, as all objects will be Maps, rather than
|
|
7
7
|
* more security prone objects.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* The iterator type `Map` itself declares, derived from the installed TS lib
|
|
11
|
+
* rather than hard-coded: older libs say `IterableIterator<[K, V]>`, TS >= 5.6
|
|
12
|
+
* says `MapIterator<[K, V]>` (which additionally requires `[Symbol.dispose]`).
|
|
13
|
+
* Deriving it keeps `implements Map<K, V>` honest on every TS version.
|
|
14
|
+
*/
|
|
15
|
+
type MapEntryIterator<K, V> = ReturnType<Map<K, V>[typeof Symbol.iterator]>;
|
|
9
16
|
export declare class ObjectWrappingMap<K = string, V = unknown> implements Map<K, V> {
|
|
10
17
|
wrappedObject: Record<string, V>;
|
|
11
18
|
readonly [Symbol.toStringTag]: string;
|
|
12
19
|
constructor(object: Record<string, V>);
|
|
20
|
+
/**
|
|
21
|
+
* Declared as a real method rather than assigned in the constructor through a
|
|
22
|
+
* cast. The old form satisfied the runtime but never appeared in the emitted
|
|
23
|
+
* type, so `implements Map<K, V>` was a lie that only surfaced downstream:
|
|
24
|
+
* consumers compiling with `skipLibCheck: false` got TS2420 ("incorrectly
|
|
25
|
+
* implements interface 'Map'... '[Symbol.iterator]' is missing").
|
|
26
|
+
*/
|
|
27
|
+
[Symbol.iterator](): MapEntryIterator<K, V>;
|
|
13
28
|
keys(): IterableIterator<K>;
|
|
14
29
|
get(key: K): V | undefined;
|
|
15
30
|
set(key: K, value: V): this;
|
|
@@ -46,6 +61,8 @@ export declare class PartitionedMap<K = unknown, V = unknown> implements Map<K,
|
|
|
46
61
|
* @param bKeys - Set of keys that should be read/written to map b
|
|
47
62
|
*/
|
|
48
63
|
constructor(a: Map<K, V>, b: Map<K, V>, bKeys: Set<K>);
|
|
64
|
+
/** See the note on `ObjectWrappingMap[Symbol.iterator]` — same fix. */
|
|
65
|
+
[Symbol.iterator](): MapEntryIterator<K, V>;
|
|
49
66
|
get(key: K): V | undefined;
|
|
50
67
|
set(key: K, value: V): this;
|
|
51
68
|
has(key: K): boolean;
|
|
@@ -85,4 +102,5 @@ export declare function assign<K = unknown, V = unknown>(map: Map<K, V>, ...obje
|
|
|
85
102
|
* `map.ts` — that import was the sole edge closing the `is`/`map` cycle.
|
|
86
103
|
*/
|
|
87
104
|
export declare function isObjectWrappingMap(object: unknown): object is ObjectWrappingMap;
|
|
105
|
+
export {};
|
|
88
106
|
//# sourceMappingURL=map.d.ts.map
|
package/dist/utils/map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/utils/map.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,qBAAa,iBAAiB,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO,CAAE,YAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1E,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACjC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAuB;gBAEhD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/utils/map.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH;;;;;GAKG;AACH,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE5E,qBAAa,iBAAiB,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO,CAAE,YAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1E,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACjC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAuB;gBAEhD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAIrC;;;;;;OAMG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC;IAK3C,IAAI,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAM3B,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAI1B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,K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gB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,iBAAiB,CAIhF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielsimonjr/mathts-functions",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
|
|
5
5
|
"author": "Daniel Simon Jr.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
+
"types",
|
|
19
20
|
"README.md"
|
|
20
21
|
],
|
|
21
22
|
"scripts": {
|
|
@@ -35,8 +36,8 @@
|
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"@danielsimonjr/mathts-core": "^0.6.0",
|
|
37
38
|
"@danielsimonjr/mathts-expression": "^0.6.0",
|
|
38
|
-
"@danielsimonjr/mathts-gpu": "^0.1.
|
|
39
|
-
"@danielsimonjr/mathts-matrix": "^0.3.
|
|
39
|
+
"@danielsimonjr/mathts-gpu": "^0.1.1",
|
|
40
|
+
"@danielsimonjr/mathts-matrix": "^0.3.2",
|
|
40
41
|
"@danielsimonjr/mathts-parallel": "^0.3.4",
|
|
41
42
|
"bignumber.js": "^9.1.2",
|
|
42
43
|
"complex.js": "^2.2.5",
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient type declarations for AssemblyScript builtins.
|
|
3
|
+
* These types are provided by the AssemblyScript compiler at build time
|
|
4
|
+
* but need declarations for TypeScript type-checking when WASM files
|
|
5
|
+
* are transitively included via imports from src/function/.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// AssemblyScript numeric types
|
|
9
|
+
declare type usize = number;
|
|
10
|
+
declare type i64 = number;
|
|
11
|
+
declare type u8 = number;
|
|
12
|
+
declare type u32 = number;
|
|
13
|
+
declare type f32 = number;
|
|
14
|
+
|
|
15
|
+
// f64: type alias + namespace with constants
|
|
16
|
+
declare type f64 = number;
|
|
17
|
+
declare namespace f64 {
|
|
18
|
+
const NaN: f64;
|
|
19
|
+
const POSITIVE_INFINITY: f64;
|
|
20
|
+
const NEGATIVE_INFINITY: f64;
|
|
21
|
+
const MAX_VALUE: f64;
|
|
22
|
+
const MIN_VALUE: f64;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// i32: type alias + namespace with builtins
|
|
26
|
+
declare type i32 = number;
|
|
27
|
+
declare namespace i32 {
|
|
28
|
+
function clz(value: i32): i32;
|
|
29
|
+
function ctz(value: i32): i32;
|
|
30
|
+
function rotl(value: i32, shift: i32): i32;
|
|
31
|
+
function rotr(value: i32, shift: i32): i32;
|
|
32
|
+
const MAX_VALUE: i32;
|
|
33
|
+
const MIN_VALUE: i32;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** SIMD 128-bit vector type */
|
|
37
|
+
declare type v128 = object;
|
|
38
|
+
|
|
39
|
+
/** v128 SIMD intrinsics namespace */
|
|
40
|
+
declare namespace v128 {
|
|
41
|
+
function load(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
|
|
42
|
+
function store(ptr: usize, value: v128, immOffset?: u32, immAlign?: u32): void;
|
|
43
|
+
function splat<T>(value: T): v128;
|
|
44
|
+
function extract_lane<T>(vec: v128, idx: u8): T;
|
|
45
|
+
function replace_lane<T>(vec: v128, idx: u8, value: T): v128;
|
|
46
|
+
function add<T>(a: v128, b: v128): v128;
|
|
47
|
+
function sub<T>(a: v128, b: v128): v128;
|
|
48
|
+
function mul<T>(a: v128, b: v128): v128;
|
|
49
|
+
function div<T>(a: v128, b: v128): v128;
|
|
50
|
+
function neg<T>(a: v128): v128;
|
|
51
|
+
function abs<T>(a: v128): v128;
|
|
52
|
+
function sqrt<T>(a: v128): v128;
|
|
53
|
+
function min<T>(a: v128, b: v128): v128;
|
|
54
|
+
function max<T>(a: v128, b: v128): v128;
|
|
55
|
+
function and(a: v128, b: v128): v128;
|
|
56
|
+
function or(a: v128, b: v128): v128;
|
|
57
|
+
function xor(a: v128, b: v128): v128;
|
|
58
|
+
function not(a: v128): v128;
|
|
59
|
+
function shuffle<T>(a: v128, b: v128, ...lanes: u8[]): v128;
|
|
60
|
+
function swizzle(a: v128, s: v128): v128;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** f64x2 SIMD namespace (2 x f64 packed into v128) */
|
|
64
|
+
declare namespace f64x2 {
|
|
65
|
+
function splat(value: f64): v128;
|
|
66
|
+
function extract_lane(vec: v128, idx: 0 | 1): f64;
|
|
67
|
+
function replace_lane(vec: v128, idx: 0 | 1, value: f64): v128;
|
|
68
|
+
function add(a: v128, b: v128): v128;
|
|
69
|
+
function sub(a: v128, b: v128): v128;
|
|
70
|
+
function mul(a: v128, b: v128): v128;
|
|
71
|
+
function div(a: v128, b: v128): v128;
|
|
72
|
+
function neg(a: v128): v128;
|
|
73
|
+
function abs(a: v128): v128;
|
|
74
|
+
function sqrt(a: v128): v128;
|
|
75
|
+
function min(a: v128, b: v128): v128;
|
|
76
|
+
function max(a: v128, b: v128): v128;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// AssemblyScript type cast functions (e.g., f64(intValue) converts i32 to f64)
|
|
80
|
+
declare function f64(value: number): number;
|
|
81
|
+
declare function i32(value: number): number;
|
|
82
|
+
declare function i64(value: number): number;
|
|
83
|
+
declare function u32(value: number): number;
|
|
84
|
+
|
|
85
|
+
// AssemblyScript builtins
|
|
86
|
+
declare function unchecked<T>(expr: T): T;
|
|
87
|
+
declare function changetype<T>(value: unknown): T;
|
|
88
|
+
declare function isFinite<T>(value: T): boolean;
|
|
89
|
+
declare function isNaN<T>(value: T): boolean;
|
|
90
|
+
declare function sizeof<T>(): usize;
|
|
91
|
+
declare function assert<T>(value: T, message?: string): T;
|
|
92
|
+
declare function idof<T>(): u32;
|
|
93
|
+
|
|
94
|
+
// AssemblyScript memory intrinsics
|
|
95
|
+
declare function load<T>(ptr: usize, immOffset?: u32): T;
|
|
96
|
+
declare function store<T>(ptr: usize, value: T, immOffset?: u32): void;
|
|
97
|
+
|
|
98
|
+
declare namespace memory {
|
|
99
|
+
function grow(pages: i32): i32;
|
|
100
|
+
function size(): i32;
|
|
101
|
+
}
|