@danielsimonjr/mathts-core 0.14.3 → 0.15.0
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/arithmetic/scalar.d.ts +56 -0
- package/dist/arithmetic/scalar.d.ts.map +1 -0
- package/dist/array.d.ts +253 -0
- package/dist/array.d.ts.map +1 -0
- package/dist/bignumber-formatter.d.ts +135 -0
- package/dist/bignumber-formatter.d.ts.map +1 -0
- package/dist/collection.d.ts +67 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/constants.d.ts +30 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/customs.d.ts +44 -0
- package/dist/customs.d.ts.map +1 -0
- package/dist/error/DimensionError.d.ts +26 -0
- package/dist/error/DimensionError.d.ts.map +1 -0
- package/dist/error/IndexError.d.ts +33 -0
- package/dist/error/IndexError.d.ts.map +1 -0
- package/dist/error/MathjsError.d.ts +13 -0
- package/dist/error/MathjsError.d.ts.map +1 -0
- package/dist/factory/factory.d.ts +154 -0
- package/dist/factory/factory.d.ts.map +1 -0
- package/dist/factory/index.d.ts +6 -0
- package/dist/factory/index.d.ts.map +1 -0
- package/dist/factory.d.ts +112 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/index.d.ts +24 -2593
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -13
- package/dist/internal.d.ts +33 -1344
- package/dist/internal.d.ts.map +1 -0
- package/dist/is.d.ts +102 -0
- package/dist/is.d.ts.map +1 -0
- package/dist/map.d.ts +113 -0
- package/dist/map.d.ts.map +1 -0
- package/dist/number.d.ts +314 -0
- package/dist/number.d.ts.map +1 -0
- package/dist/numeric/stable.d.ts +130 -0
- package/dist/numeric/stable.d.ts.map +1 -0
- package/dist/object.d.ts +119 -0
- package/dist/object.d.ts.map +1 -0
- package/dist/shared.d.ts +41 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/string.d.ts +70 -0
- package/dist/string.d.ts.map +1 -0
- package/dist/switch.d.ts +9 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/typed/index.d.ts +7 -0
- package/dist/typed/index.d.ts.map +1 -0
- package/dist/typed/mathts-typed.d.ts +246 -0
- package/dist/typed/mathts-typed.d.ts.map +1 -0
- package/dist/typed/type-bridge.d.ts +2 -0
- package/dist/typed/type-bridge.d.ts.map +1 -0
- package/dist/types/bignumber.d.ts +367 -0
- package/dist/types/bignumber.d.ts.map +1 -0
- package/dist/types/complex.d.ts +284 -0
- package/dist/types/complex.d.ts.map +1 -0
- package/dist/types/dual-rules.d.ts +129 -0
- package/dist/types/dual-rules.d.ts.map +1 -0
- package/dist/types/dual.d.ts +36 -0
- package/dist/types/dual.d.ts.map +1 -0
- package/dist/types/fraction.d.ts +215 -0
- package/dist/types/fraction.d.ts.map +1 -0
- package/dist/types/interfaces.d.ts +143 -0
- package/dist/types/interfaces.d.ts.map +1 -0
- package/dist/types/matrix/Range.d.ts +767 -0
- package/dist/types/matrix/Range.d.ts.map +1 -0
- package/dist/types/unit/Unit.d.ts +3 -0
- package/dist/types/unit/Unit.d.ts.map +1 -0
- package/dist/types/unit/dependencies.d.ts +4 -0
- package/dist/types/unit/dependencies.d.ts.map +1 -0
- package/dist/types/unit/errors.d.ts +18 -0
- package/dist/types/unit/errors.d.ts.map +1 -0
- package/dist/types/unit/index.d.ts +7 -0
- package/dist/types/unit/index.d.ts.map +1 -0
- package/dist/types/unit/unit-types.d.ts +231 -0
- package/dist/types/unit/unit-types.d.ts.map +1 -0
- package/dist/types/unit-definitions.d.ts +79 -0
- package/dist/types/unit-definitions.d.ts.map +1 -0
- package/dist/types/unit-prefixes.d.ts +29 -0
- package/dist/types/unit-prefixes.d.ts.map +1 -0
- package/dist/types/unit.d.ts +28 -0
- package/dist/types/unit.d.ts.map +1 -0
- package/dist/types/wasm-loader.d.ts +35 -0
- package/dist/types/wasm-loader.d.ts.map +1 -0
- package/dist/wasm-loader.d.ts +97 -0
- package/dist/wasm-loader.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/index-B4LIOfHN.d.ts +0 -449
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../../src/types/matrix/Range.ts"],"names":[],"mappings":"AAKA,UAAU,SAAS;IACjB,QAAQ,IAAI,MAAM,CAAC;CACpB;AAKD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,KAAK,CAAC,CAAC;AAExF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,aAAa,GAAG,MAAM,CAAC;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,gBAAgB;iBAsFb,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,QACpC,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,SACjC,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI;QA7C3C;;WAEG;uBACY,MAAM;QAErB;;WAEG;0BACe,OAAO;QAEzB;;WAEG;eACI,MAAM;QAEb;;WAEG;aACE,MAAM;QAEX;;WAEG;cACG,MAAM;QAEZ;;;;;;;;;;;WAWG;gBAC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AAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,MAAM;QAUnF;;;;WAIG;oBACS,MAAM;QAIlB;;;;;WAKG;kBACO,SAAS;QAzNgB,IAAI;IAkOvC;;;;;;OAMG;mBACmB,SAAS;QAjV/B;;WAEG;uBACY,MAAM;QAErB;;WAEG;0BACe,OAAO;QAEzB;;WAEG;eACI,MAAM;QAEb;;WAEG;aACE,MAAM;QAEX;;WAEG;cACG,MAAM;QAEZ;;;;;;;;;;;WAWG;gBACK,MAAM,EAAE,GAAG,IAAI;sBACT,MAAM;oBACR,MAAM;qBACL,MAAM;QA2FnB;;;WAGG;;QAKH;;;;;WAKG;gBACK,MAAM,EAAE;QAmBhB;;;;WAIG;eACI,MAAM,GAAG,SAAS;QAgBzB;;;;WAIG;eACI,MAAM,GAAG,SAAS;QAgBzB;;;;;;WAMG;0BACe,oBAAoB,GAAG,IAAI;QAqB7C;;;;;;;;WAQG;YACC,CAAC,YAAY,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;QAQ1C;;;;WAIG;mBACQ,MAAM,EAAE;QAQnB;;;;WAIG;mBACQ,MAAM,EAAE;QAiBnB;;;;;;;;;WASG;yBACc,kBAAkB,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,MAAM;QAUnF;;;;WAIG;oBACS,MAAM;QAIlB;;;;;WAKG;kBACO,SAAS;;CA+BgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../../src/types/unit/Unit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAcV,eAAe,EAQhB,MAAM,iBAAiB,CAAC;AAkCzB,eAAO,MAAM,eAAe,6DAgvH3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../src/types/unit/dependencies.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EASV,gBAAgB,EAEjB,MAAM,iBAAiB,CAAC;AA8DzB,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,EAAE,gBAkB9B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed error classes for the Unit. Kept in their own module (with no Unit
|
|
3
|
+
* imports) so both the merged `Unit` (`Unit.ts`) and the `core/src/types/unit.ts`
|
|
4
|
+
* compatibility surface can import them without a circular dependency, and so
|
|
5
|
+
* callers can `catch (e) { if (e instanceof UnitParseError) … }` as before the
|
|
6
|
+
* two Unit implementations merged.
|
|
7
|
+
*/
|
|
8
|
+
/** Thrown when a unit notation string cannot be parsed against the registry. */
|
|
9
|
+
export declare class UnitParseError extends Error {
|
|
10
|
+
readonly name = "UnitParseError";
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
/** Thrown when an operation requires two units to share a base dimension and they do not. */
|
|
14
|
+
export declare class DimensionMismatchError extends Error {
|
|
15
|
+
readonly name = "DimensionMismatchError";
|
|
16
|
+
constructor(message: string);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/types/unit/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gFAAgF;AAChF,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,oBAAoB;IACjC,YAAY,OAAO,EAAE,MAAM,EAE1B;CACF;AAED,6FAA6F;AAC7F,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,4BAA4B;IACzC,YAAY,OAAO,EAAE,MAAM,EAE1B;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UnitConstructor } from './unit-types.js';
|
|
2
|
+
export { createUnitClass } from './Unit.js';
|
|
3
|
+
export { unitDependencies } from './dependencies.js';
|
|
4
|
+
export type * from './unit-types.js';
|
|
5
|
+
/** The core `Unit` class, pre-wired to core's numeric primitives. */
|
|
6
|
+
export declare const Unit: UnitConstructor;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/unit/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,mBAAmB,iBAAiB,CAAC;AAErC,qEAAqE;AACrE,eAAO,MAAM,IAAI,EAAE,eAEC,CAAC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TypeScript interfaces for the Unit factory (`Unit.ts`).
|
|
3
|
+
*
|
|
4
|
+
* The Unit type is a "function-as-class" (a constructor function whose
|
|
5
|
+
* prototype is built up imperatively) ported from mathjs. These interfaces
|
|
6
|
+
* describe the runtime shapes precisely so `Unit.ts` can be fully type-checked
|
|
7
|
+
* under strict mode without suppression directives or escape-hatch typing.
|
|
8
|
+
*
|
|
9
|
+
* @module @danielsimonjr/mathts-core/types/unit/unit-types
|
|
10
|
+
*/
|
|
11
|
+
import type { Complex } from '../../is.js';
|
|
12
|
+
/** A complex number value (re/im pair), as produced by the `Complex` type. */
|
|
13
|
+
export type ComplexValue = Complex;
|
|
14
|
+
/**
|
|
15
|
+
* Minimal structural view of a BigNumber value: only the instance methods that
|
|
16
|
+
* the Unit factory actually calls when computing angle constants.
|
|
17
|
+
*/
|
|
18
|
+
export interface BigNumberValue {
|
|
19
|
+
div(other: BigNumberValue | number | string): BigNumberValue;
|
|
20
|
+
times(other: BigNumberValue | number | string): BigNumberValue;
|
|
21
|
+
}
|
|
22
|
+
/** Structural view of a Fraction value (numerator/denominator/sign). */
|
|
23
|
+
export interface FractionValue {
|
|
24
|
+
n: number;
|
|
25
|
+
d: number;
|
|
26
|
+
s: number;
|
|
27
|
+
isFraction?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Any numeric value a Unit can carry. Mirrors what `isNumeric`/`isComplex`
|
|
31
|
+
* accept at the constructor boundary (number, bigint, boolean, BigNumber,
|
|
32
|
+
* Fraction, Complex). Boolean/bigint flow through unchanged for valueless
|
|
33
|
+
* units and are coerced by the scalar operations otherwise.
|
|
34
|
+
*/
|
|
35
|
+
export type Numeric = number | bigint | boolean | BigNumberValue | FractionValue | ComplexValue;
|
|
36
|
+
/** A prefix definition such as `{ name: 'k', value: 1e3, scientific: true }`. */
|
|
37
|
+
export interface PrefixDef {
|
|
38
|
+
name: string;
|
|
39
|
+
value: number;
|
|
40
|
+
scientific: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** A named table of prefixes (e.g. PREFIXES.SHORT), keyed by prefix name. */
|
|
43
|
+
export type PrefixTable = Record<string, PrefixDef>;
|
|
44
|
+
/** A base dimension definition (the 9-element exponent vector + its key). */
|
|
45
|
+
export interface BaseUnitDef {
|
|
46
|
+
dimensions: number[];
|
|
47
|
+
key?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A unit definition entry in the UNITS table. `dimensions` and `base.key` are
|
|
51
|
+
* populated after the literal is created (see the module-init loops), hence
|
|
52
|
+
* optional; `value` is `null` for angle units until `calculateAngleValues`
|
|
53
|
+
* runs at module init, before any unit is parsed.
|
|
54
|
+
*/
|
|
55
|
+
export interface UnitDef {
|
|
56
|
+
name: string;
|
|
57
|
+
base?: BaseUnitDef;
|
|
58
|
+
prefixes?: PrefixTable;
|
|
59
|
+
value: Numeric | null;
|
|
60
|
+
offset: number;
|
|
61
|
+
dimensions?: number[];
|
|
62
|
+
reciprocal?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** A single component of a Unit's unit list (e.g. the `m` in `m/s^2`). */
|
|
65
|
+
export interface UnitComponent {
|
|
66
|
+
unit: UnitDef;
|
|
67
|
+
prefix: PrefixDef;
|
|
68
|
+
power: number;
|
|
69
|
+
}
|
|
70
|
+
/** An entry in a unit system, pairing a unit with a default prefix. */
|
|
71
|
+
export interface UnitSystemEntry {
|
|
72
|
+
unit: UnitDef;
|
|
73
|
+
prefix: PrefixDef;
|
|
74
|
+
}
|
|
75
|
+
/** A unit system (e.g. `si`, `cgs`, `us`, `auto`), keyed by base-dimension. */
|
|
76
|
+
export type UnitSystem = Record<string, UnitSystemEntry>;
|
|
77
|
+
/** JSON serialization shape produced by `Unit#toJSON`. */
|
|
78
|
+
export interface UnitJSON {
|
|
79
|
+
mathjs: 'Unit';
|
|
80
|
+
value: Numeric | null;
|
|
81
|
+
unit: string | null;
|
|
82
|
+
fixPrefix: boolean;
|
|
83
|
+
skipSimp: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** A numeric-type converter (number → BigNumber/Fraction/Complex/number). */
|
|
86
|
+
export type ConverterFn = (x: Numeric) => Numeric;
|
|
87
|
+
/** The table of numeric-type converters exposed on `Unit.typeConverters`. */
|
|
88
|
+
export interface TypeConverters {
|
|
89
|
+
BigNumber: ConverterFn;
|
|
90
|
+
Fraction: ConverterFn;
|
|
91
|
+
Complex: ConverterFn;
|
|
92
|
+
number: ConverterFn;
|
|
93
|
+
[key: string]: ConverterFn;
|
|
94
|
+
}
|
|
95
|
+
/** Options accepted by `Unit.parse`. */
|
|
96
|
+
export interface ParseOptions {
|
|
97
|
+
allowNoUnits?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/** Formatting options accepted by `Unit#format` / `Unit#toBest`. */
|
|
100
|
+
export interface UnitFormatOptions {
|
|
101
|
+
offset?: number;
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
}
|
|
104
|
+
/** Options accepted by `Unit.createUnit`. */
|
|
105
|
+
export interface CreateUnitOptions {
|
|
106
|
+
override?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** Object form of a `createUnit` / `createUnitSingle` definition. */
|
|
109
|
+
export interface CreateUnitDefObject {
|
|
110
|
+
definition?: string | UnitInstance;
|
|
111
|
+
prefixes?: string;
|
|
112
|
+
offset?: number;
|
|
113
|
+
baseName?: string;
|
|
114
|
+
aliases?: string[];
|
|
115
|
+
}
|
|
116
|
+
/** Config object the Unit factory reads (`config` dep + `on('config')`). */
|
|
117
|
+
export interface UnitConfig {
|
|
118
|
+
number: string;
|
|
119
|
+
predictable?: boolean;
|
|
120
|
+
}
|
|
121
|
+
/** Constructor (with static `.I`) for Complex values. */
|
|
122
|
+
export interface ComplexConstructor {
|
|
123
|
+
readonly I: ComplexValue;
|
|
124
|
+
}
|
|
125
|
+
/** Constructor for BigNumber values. */
|
|
126
|
+
export interface BigNumberConstructor {
|
|
127
|
+
new (value: number | string): BigNumberValue;
|
|
128
|
+
}
|
|
129
|
+
/** Constructor for Fraction values. */
|
|
130
|
+
export interface FractionConstructor {
|
|
131
|
+
new (value: Numeric | string, denominator?: number): FractionValue;
|
|
132
|
+
}
|
|
133
|
+
/** `subtractScalar` is polymorphic: it also subtracts two Units (in splitUnit). */
|
|
134
|
+
export interface SubtractScalar {
|
|
135
|
+
(a: UnitInstance, b: UnitInstance): UnitInstance;
|
|
136
|
+
(a: Numeric, b: Numeric): Numeric;
|
|
137
|
+
}
|
|
138
|
+
/** A binary scalar operation (add/multiply/divide/pow). */
|
|
139
|
+
export type ScalarBinaryOp = (a: Numeric, b: Numeric) => Numeric;
|
|
140
|
+
/** A unary scalar operation (abs/fix/round). */
|
|
141
|
+
export type ScalarUnaryOp = (x: Numeric) => Numeric;
|
|
142
|
+
/**
|
|
143
|
+
* The dependency object injected into the Unit factory by the factory system.
|
|
144
|
+
* `on` is optional (`?on` in the dependency list). The index signature reflects that
|
|
145
|
+
* this is a factory *scope* (a string-keyed dependency record that may also carry
|
|
146
|
+
* deps beyond the ones the Unit itself reads), and lets it satisfy the `factory`
|
|
147
|
+
* helper's `Record<string, unknown>` constraint.
|
|
148
|
+
*/
|
|
149
|
+
export interface UnitDependencies {
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
on?: (event: string, callback: (curr: UnitConfig, prev: UnitConfig) => void) => void;
|
|
152
|
+
config: UnitConfig;
|
|
153
|
+
addScalar: ScalarBinaryOp;
|
|
154
|
+
subtractScalar: SubtractScalar;
|
|
155
|
+
multiplyScalar: ScalarBinaryOp;
|
|
156
|
+
divideScalar: ScalarBinaryOp;
|
|
157
|
+
pow: ScalarBinaryOp;
|
|
158
|
+
abs: ScalarUnaryOp;
|
|
159
|
+
fix: ScalarUnaryOp;
|
|
160
|
+
round: ScalarUnaryOp;
|
|
161
|
+
equal: (a: unknown, b: unknown) => boolean;
|
|
162
|
+
isNumeric: (x: unknown) => boolean;
|
|
163
|
+
format: (value: unknown, options?: unknown) => string;
|
|
164
|
+
number: (x: unknown) => number;
|
|
165
|
+
Complex: ComplexConstructor;
|
|
166
|
+
BigNumber: BigNumberConstructor;
|
|
167
|
+
Fraction: FractionConstructor;
|
|
168
|
+
}
|
|
169
|
+
/** An instance of Unit (the prototype methods + per-instance fields). */
|
|
170
|
+
export interface UnitInstance {
|
|
171
|
+
value: Numeric | null;
|
|
172
|
+
units: UnitComponent[];
|
|
173
|
+
dimensions: number[];
|
|
174
|
+
fixPrefix: boolean;
|
|
175
|
+
skipAutomaticSimplification: boolean;
|
|
176
|
+
type: 'Unit';
|
|
177
|
+
isUnit: boolean;
|
|
178
|
+
constructor: UnitConstructor;
|
|
179
|
+
clone(): UnitInstance;
|
|
180
|
+
valueType(): string;
|
|
181
|
+
_isDerived(): boolean;
|
|
182
|
+
_normalize(value: Numeric | null | undefined): Numeric | null;
|
|
183
|
+
_denormalize(value: Numeric | null, prefixValue?: Numeric): Numeric | null;
|
|
184
|
+
hasBase(base: BaseUnitDef | string | undefined): boolean;
|
|
185
|
+
equalBase(other: {
|
|
186
|
+
dimensions: number[];
|
|
187
|
+
}): boolean;
|
|
188
|
+
equals(other: UnitInstance): boolean;
|
|
189
|
+
multiply(other: UnitInstance | Numeric): UnitInstance | Numeric;
|
|
190
|
+
divideInto(numerator: Numeric): UnitInstance | Numeric;
|
|
191
|
+
divide(other: UnitInstance | Numeric): UnitInstance | Numeric;
|
|
192
|
+
pow(p: number): UnitInstance | Numeric;
|
|
193
|
+
abs(): UnitInstance;
|
|
194
|
+
to(valuelessUnit: string | UnitInstance): UnitInstance;
|
|
195
|
+
toNumber(valuelessUnit?: string | UnitInstance): number;
|
|
196
|
+
toNumeric(valuelessUnit?: string | UnitInstance): Numeric | null;
|
|
197
|
+
toString(): string;
|
|
198
|
+
toJSON(): UnitJSON;
|
|
199
|
+
valueOf(): string;
|
|
200
|
+
simplify(): UnitInstance;
|
|
201
|
+
toSI(): UnitInstance;
|
|
202
|
+
formatUnits(): string;
|
|
203
|
+
toBest(unitList?: Array<string | UnitInstance>, options?: UnitFormatOptions): UnitInstance;
|
|
204
|
+
format(options?: UnitFormatOptions): string;
|
|
205
|
+
_bestPrefix(offset?: number): PrefixDef;
|
|
206
|
+
splitUnit(parts: Array<string | UnitInstance>): UnitInstance[];
|
|
207
|
+
_numberConverter(): ConverterFn;
|
|
208
|
+
}
|
|
209
|
+
/** The Unit constructor function together with its static members. */
|
|
210
|
+
export interface UnitConstructor {
|
|
211
|
+
new (value?: Numeric | null, valuelessUnit?: string | UnitInstance): UnitInstance;
|
|
212
|
+
prototype: UnitInstance;
|
|
213
|
+
name: string;
|
|
214
|
+
parse(str: string, options?: ParseOptions): UnitInstance;
|
|
215
|
+
isValuelessUnit(name: string): boolean;
|
|
216
|
+
isValidAlpha(c: string): boolean;
|
|
217
|
+
fromJSON(json: UnitJSON): UnitInstance;
|
|
218
|
+
setUnitSystem(name: string): void;
|
|
219
|
+
getUnitSystem(): string | undefined;
|
|
220
|
+
createUnit(obj: Record<string, unknown>, options?: CreateUnitOptions): UnitInstance | undefined;
|
|
221
|
+
createUnitSingle(name: string, obj?: unknown): UnitInstance;
|
|
222
|
+
deleteUnit(name: string): void;
|
|
223
|
+
_getNumberConverter(type: string): ConverterFn;
|
|
224
|
+
typeConverters: TypeConverters;
|
|
225
|
+
PREFIXES: Record<string, PrefixTable>;
|
|
226
|
+
BASE_DIMENSIONS: string[];
|
|
227
|
+
BASE_UNITS: Record<string, BaseUnitDef>;
|
|
228
|
+
UNIT_SYSTEMS: Record<string, UnitSystem>;
|
|
229
|
+
UNITS: Record<string, UnitDef>;
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=unit-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-types.d.ts","sourceRoot":"","sources":["../../../src/types/unit/unit-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,8EAA8E;AAC9E,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;IAC7D,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;CAChE;AAED,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;AAEhG,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,6EAA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,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAAC;IAChG,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAC5D,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAE/C,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit definitions for the Unit type.
|
|
3
|
+
*
|
|
4
|
+
* The seven SI base units, plus common derived and imperial units. Each
|
|
5
|
+
* definition stores its multiplicative factor (to base SI) and dimensional
|
|
6
|
+
* exponents. Temperatures carry an additive offset for the K↔°C↔°F
|
|
7
|
+
* conversions.
|
|
8
|
+
*
|
|
9
|
+
* @module @danielsimonjr/mathts-core/types/unit-definitions
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The seven SI base dimensions, expressed as a vector of (possibly fractional)
|
|
13
|
+
* exponents.
|
|
14
|
+
*/
|
|
15
|
+
export interface Dimensions {
|
|
16
|
+
/** Length, base unit metre */
|
|
17
|
+
length: number;
|
|
18
|
+
/** Mass, base unit kilogram */
|
|
19
|
+
mass: number;
|
|
20
|
+
/** Time, base unit second */
|
|
21
|
+
time: number;
|
|
22
|
+
/** Electric current, base unit ampere */
|
|
23
|
+
current: number;
|
|
24
|
+
/** Thermodynamic temperature, base unit kelvin */
|
|
25
|
+
temperature: number;
|
|
26
|
+
/** Amount of substance, base unit mole */
|
|
27
|
+
amount: number;
|
|
28
|
+
/** Luminous intensity, base unit candela */
|
|
29
|
+
luminosity: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The zero-dimensional vector (a dimensionless quantity).
|
|
33
|
+
*/
|
|
34
|
+
export declare const DIMENSIONLESS: Dimensions;
|
|
35
|
+
/**
|
|
36
|
+
* Construct a Dimensions record from a partial spec.
|
|
37
|
+
*
|
|
38
|
+
* Missing fields default to 0, so `dim({ length: 1 })` returns the dimension
|
|
39
|
+
* vector for length.
|
|
40
|
+
*/
|
|
41
|
+
export declare function dim(partial: Partial<Dimensions>): Dimensions;
|
|
42
|
+
/**
|
|
43
|
+
* Definition of a single named unit.
|
|
44
|
+
*/
|
|
45
|
+
export interface UnitDef {
|
|
46
|
+
/** Multiplicative factor: value-in-base = input * multiplier (+ offset). */
|
|
47
|
+
multiplier: number;
|
|
48
|
+
/** Additive offset, used for non-multiplicative units like °C and °F. */
|
|
49
|
+
offset?: number;
|
|
50
|
+
/** Dimensional signature. */
|
|
51
|
+
dimensions: Dimensions;
|
|
52
|
+
/** Whether SI prefixes (k, M, µ, …) may be applied to this notation. */
|
|
53
|
+
prefixable?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The seven SI base units.
|
|
57
|
+
*/
|
|
58
|
+
export declare const BASE_UNITS: Record<string, UnitDef>;
|
|
59
|
+
/**
|
|
60
|
+
* Common derived units (SI named units, imperial units, and convenience units).
|
|
61
|
+
*
|
|
62
|
+
* This is *not* exhaustive — it covers the most common ~40 units needed for
|
|
63
|
+
* dimensional-analysis tests. Add more as needed by downstream callers.
|
|
64
|
+
*/
|
|
65
|
+
export declare const DERIVED_UNITS: Record<string, UnitDef>;
|
|
66
|
+
/**
|
|
67
|
+
* Combined registry — both base and derived units in one map.
|
|
68
|
+
*/
|
|
69
|
+
export declare const ALL_UNITS: Record<string, UnitDef>;
|
|
70
|
+
/**
|
|
71
|
+
* Convenience aliases mapping common Unicode/ASCII variants to the canonical
|
|
72
|
+
* notation key. Used by the parser; not part of the registered notation set.
|
|
73
|
+
*/
|
|
74
|
+
export declare const UNIT_ALIASES: Record<string, string>;
|
|
75
|
+
/**
|
|
76
|
+
* Lookup an exact (non-prefixed) unit definition.
|
|
77
|
+
*/
|
|
78
|
+
export declare function getUnitDef(name: string): UnitDef | undefined;
|
|
79
|
+
//# sourceMappingURL=unit-definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-definitions.d.ts","sourceRoot":"","sources":["../../src/types/unit-definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,UAQ1B,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAU5D;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,wEAAwE;IACxE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAU9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAoHjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAuC,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM/C,CAAC;AAEF;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE5D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SI prefixes for the Unit type.
|
|
3
|
+
*
|
|
4
|
+
* Maps single- and double-letter prefixes to their multiplicative factor in
|
|
5
|
+
* base units. The full SI prefix range (from y = 1e-24 to Y = 1e24) is
|
|
6
|
+
* supported, plus the binary prefixes used for digital information units.
|
|
7
|
+
*
|
|
8
|
+
* @module @danielsimonjr/mathts-core/types/unit-prefixes
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Standard SI prefixes (mass/length/energy/etc.).
|
|
12
|
+
*
|
|
13
|
+
* Note the ambiguity-resolution priority: longer prefixes (e.g. `da`)
|
|
14
|
+
* must be tried before single-letter ones (`d`, `a`) in parsers.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SI_PREFIXES: Record<string, number>;
|
|
17
|
+
/**
|
|
18
|
+
* Set of "good" prefixes to use in `toBest()` selection.
|
|
19
|
+
*
|
|
20
|
+
* Excludes `h`, `da`, `d`, `c` (commonly only used for centimeters and similar
|
|
21
|
+
* legacy notations); using these in `toBest()` would produce awkward outputs
|
|
22
|
+
* like "0.4 hg" instead of "40 g".
|
|
23
|
+
*/
|
|
24
|
+
export declare const BEST_PREFIXES: ReadonlyArray<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Look up an SI prefix multiplier. Returns `undefined` if not a known prefix.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getPrefix(name: string): number | undefined;
|
|
29
|
+
//# sourceMappingURL=unit-prefixes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-prefixes.d.ts","sourceRoot":"","sources":["../../src/types/unit-prefixes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAyB9C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,MAAM,CAkB/C,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The core `Unit` — now the single, feature-complete implementation under
|
|
3
|
+
* `./unit/` (the mathjs-derived Unit relocated into core by the Unit merge).
|
|
4
|
+
*
|
|
5
|
+
* This module previously held a separate, simpler `Unit` class (canonical-value
|
|
6
|
+
* subset). That has been RETIRED: the two Unit implementations are one now. This
|
|
7
|
+
* file preserves the historical public surface — `Unit`, the typed error classes,
|
|
8
|
+
* `isUnit`, and the dimension helpers — by re-exporting them, so
|
|
9
|
+
* `@danielsimonjr/mathts-core` consumers see no import churn.
|
|
10
|
+
*
|
|
11
|
+
* Behavioral notes for callers of the former core `Unit`:
|
|
12
|
+
* - Arithmetic (`add`/`sub`/`mul`/`div`) is done at the OPERATOR level (via the
|
|
13
|
+
* `functions` package `add`/`subtract`/`multiply`/`divide`), not as Unit methods.
|
|
14
|
+
* - `equalBase(other)` replaces the former `dimensionsEqual(other)`.
|
|
15
|
+
* - Dimensions are a 9-element exponent array (incl. angle + bit), not a struct.
|
|
16
|
+
* - `toBest()`, `to()`, `toSI()`, `simplify()`, `format()`, unit systems,
|
|
17
|
+
* `createUnit`, physical constants, and `°C`/`°F` parsing are all supported.
|
|
18
|
+
* - `fromJSON` accepts both the `{ mathjs, … }` and the old `{ mathts, … }` envelopes.
|
|
19
|
+
*
|
|
20
|
+
* @module @danielsimonjr/mathts-core/types/unit
|
|
21
|
+
*/
|
|
22
|
+
export { Unit, createUnitClass, unitDependencies } from './unit/index.js';
|
|
23
|
+
export type { UnitInstance } from './unit/index.js';
|
|
24
|
+
export { DimensionMismatchError, UnitParseError } from './unit/errors.js';
|
|
25
|
+
export { isUnit } from '../is.js';
|
|
26
|
+
export { DIMENSIONLESS, dim } from './unit-definitions.js';
|
|
27
|
+
export type { Dimensions, UnitDef } from './unit-definitions.js';
|
|
28
|
+
//# sourceMappingURL=unit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit.d.ts","sourceRoot":"","sources":["../../src/types/unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG1E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type-only shapes for the two independent WASM loader implementations
|
|
3
|
+
* (`functions/src/wasm/WasmLoader.ts` and `matrix/src/backends/WasmLoader.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Both packages bind to the same `mathts-as.wasm` AssemblyScript binary but each
|
|
6
|
+
* declares its own package-scoped subset of the exported function ABI (`WasmModule`
|
|
7
|
+
* genuinely differs between the two — matrix only needs matrix-relevant exports,
|
|
8
|
+
* functions needs the full breadth including signal/geometry/special-function
|
|
9
|
+
* kernels — so `WasmModule` stays local to each package). `LoadingMetrics` (perf
|
|
10
|
+
* timings) and `WasmManifest` (the SHA-384 integrity manifest shape) were,
|
|
11
|
+
* however, byte-for-byte identical copies with no principled reason to diverge;
|
|
12
|
+
* consolidated here (cross-package type-dedup pass,
|
|
13
|
+
* docs/Architecture/duplicate-symbols.json).
|
|
14
|
+
*
|
|
15
|
+
* @module @danielsimonjr/mathts-core/types/wasm-loader
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Loading performance metrics for a WASM module load/instantiate cycle.
|
|
19
|
+
*/
|
|
20
|
+
export interface LoadingMetrics {
|
|
21
|
+
fileReadMs: number;
|
|
22
|
+
compileMs: number;
|
|
23
|
+
instantiateMs: number;
|
|
24
|
+
totalMs: number;
|
|
25
|
+
fromCache: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* SHA-384 integrity manifest: maps a `.wasm` filename to its
|
|
29
|
+
* `"sha384-<base64 digest>"` value (SRI-style), as generated by
|
|
30
|
+
* `tools/generate-wasm-manifest.mjs`.
|
|
31
|
+
*/
|
|
32
|
+
export interface WasmManifest {
|
|
33
|
+
[fileName: string]: string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=wasm-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm-loader.d.ts","sourceRoot":"","sources":["../../src/types/wasm-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared WASM-loader runtime logic — SHA-384 integrity verification + packaged
|
|
3
|
+
* artifact path resolution — consolidated here so `functions` and `matrix` build
|
|
4
|
+
* on ONE copy instead of maintaining byte-identical forks.
|
|
5
|
+
*
|
|
6
|
+
* Why core: `matrix` cannot import from `functions` (functions depends on matrix,
|
|
7
|
+
* which would invert the edge and create a cycle), so the historical solution was
|
|
8
|
+
* to duplicate this logic in both packages. Both packages already depend on
|
|
9
|
+
* `core`, so `@danielsimonjr/mathts-core/internal` is a home reachable from both
|
|
10
|
+
* WITHOUT introducing a cycle. Exposed ONLY via the `/internal` subpath (never the
|
|
11
|
+
* browser-facing `.` entry); every filesystem/crypto access uses a LAZY dynamic
|
|
12
|
+
* `import()` so this module stays browser-safe (no static `node:` imports).
|
|
13
|
+
*
|
|
14
|
+
* SECURITY INVARIANT (CLAUDE.md "Security Invariants" #1): the SHA-384
|
|
15
|
+
* hash-and-compare-before-instantiate is preserved BYTE-FOR-BYTE from the former
|
|
16
|
+
* per-package `integrity.ts` copies — same algorithm, same fail-closed/soft-warn
|
|
17
|
+
* behavior. Do NOT bypass, weaken to a non-cryptographic check, or skip on
|
|
18
|
+
* streaming compile paths. Regression-covered by
|
|
19
|
+
* `functions/tests/security/wasm-integrity.test.ts` and
|
|
20
|
+
* `matrix/tests/security/wasm-integrity.test.ts`.
|
|
21
|
+
*
|
|
22
|
+
* The build pipeline writes a JSON manifest beside the .wasm artefact:
|
|
23
|
+
*
|
|
24
|
+
* {
|
|
25
|
+
* "mathts-as.wasm": "sha384-<base64-of-binary-digest>"
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* At load time the runtime hashes the freshly read buffer with SHA-384 and
|
|
29
|
+
* compares against the manifest. A mismatch throws — preventing silent
|
|
30
|
+
* code-injection if the .wasm artefact is tampered with on disk or in transit
|
|
31
|
+
* (e.g. a CDN/MITM compromise).
|
|
32
|
+
*
|
|
33
|
+
* Browser path uses `crypto.subtle.digest('SHA-384', buf)`.
|
|
34
|
+
* Node path uses `crypto.createHash('sha384').update(buf).digest()`.
|
|
35
|
+
*
|
|
36
|
+
* If the manifest is missing or has no entry for the given file, we emit a
|
|
37
|
+
* console warning and fall through. This keeps existing unsigned builds usable
|
|
38
|
+
* while making signed builds tamper-evident.
|
|
39
|
+
*
|
|
40
|
+
* @module @danielsimonjr/mathts-core/internal (wasm-loader)
|
|
41
|
+
*/
|
|
42
|
+
import type { WasmManifest } from './types/wasm-loader.js';
|
|
43
|
+
export type { WasmManifest };
|
|
44
|
+
/**
|
|
45
|
+
* Compute the SHA-384 digest of a buffer and return base64 encoding,
|
|
46
|
+
* prefixed with "sha384-" to match SRI conventions.
|
|
47
|
+
*/
|
|
48
|
+
export declare function sha384OfBuffer(buffer: ArrayBuffer | Uint8Array): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Load the manifest sitting next to the .wasm artefact.
|
|
51
|
+
*
|
|
52
|
+
* @param wasmPath Resolved path or URL to the .wasm file.
|
|
53
|
+
* @returns parsed manifest, or `null` if the manifest cannot be located.
|
|
54
|
+
*/
|
|
55
|
+
export declare function loadWasmManifest(wasmPath: string): Promise<WasmManifest | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Verify a freshly loaded WASM buffer against the manifest.
|
|
58
|
+
*
|
|
59
|
+
* @throws Error if the buffer's SHA-384 differs from the manifest entry.
|
|
60
|
+
*/
|
|
61
|
+
export declare function verifyWasmIntegrity(buffer: ArrayBuffer | Uint8Array, wasmPath: string, options?: {
|
|
62
|
+
manifest?: WasmManifest | null;
|
|
63
|
+
required?: boolean;
|
|
64
|
+
}): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Robustly locate a packaged `.wasm` artifact across both the monorepo-source
|
|
67
|
+
* layout and the published-package layout (Node only).
|
|
68
|
+
*
|
|
69
|
+
* The historical loaders hard-coded `../../../lib/wasm/<file>` relative to
|
|
70
|
+
* `import.meta.url`, which only resolved for the monorepo source layout and
|
|
71
|
+
* pointed outside the package once bundled/published — so the wasm was never
|
|
72
|
+
* found and every consumer silently fell back to JS. This walks up from the
|
|
73
|
+
* calling module's directory probing `<dir>/wasm/<file>` and
|
|
74
|
+
* `<dir>/dist/wasm/<file>` at each level, matching bundled dist, unbundled dist,
|
|
75
|
+
* and monorepo source.
|
|
76
|
+
*
|
|
77
|
+
* The caller injects its OWN `metaUrl` (its `import.meta.url`) so resolution is
|
|
78
|
+
* relative to the calling package, not to core.
|
|
79
|
+
*
|
|
80
|
+
* @returns absolute path to the artifact, or `null` if not found.
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolvePackagedWasm(metaUrl: string, wasmFile: string): Promise<string | null>;
|
|
83
|
+
/**
|
|
84
|
+
* Canonical fallback location for the packaged wasm when {@link resolvePackagedWasm}
|
|
85
|
+
* finds nothing: `<packageRoot>/dist/wasm/<wasmFile>`, with the package root found
|
|
86
|
+
* by walking up from `metaUrl` to the nearest `package.json`. This replaces the
|
|
87
|
+
* historical `../../../lib/wasm/<file>` fabrication, which was only correct for the
|
|
88
|
+
* pre-bundling source layout. The returned path is where the binary SHOULD be, so
|
|
89
|
+
* the missing-binary warning tells the user exactly what to build.
|
|
90
|
+
*
|
|
91
|
+
* In browser mode (no filesystem) it returns the bundle-relative `./wasm/<file>`
|
|
92
|
+
* URL — correct for a served `dist/`, which is the only layout browsers see.
|
|
93
|
+
*/
|
|
94
|
+
export declare function defaultWasmLocation(metaUrl: string, wasmFile: string, opts?: {
|
|
95
|
+
browser?: boolean;
|
|
96
|
+
}): Promise<string>;
|
|
97
|
+
//# sourceMappingURL=wasm-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm-loader.d.ts","sourceRoot":"","sources":["../src/wasm-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,CAAC;AAI7B;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBtF;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAmBrF;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,WAAW,GAAG,UAAU,EAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACnE,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmBxB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3B,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielsimonjr/mathts-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Core types, utilities, and configuration for MathTS",
|
|
5
5
|
"author": "Daniel Simon Jr.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "tsup",
|
|
26
|
+
"build": "tsup && tsc -p tsconfig.dts.json",
|
|
27
27
|
"dev": "tsup --watch",
|
|
28
|
-
"test": "
|
|
28
|
+
"test": "bun test --isolate --timeout 30000",
|
|
29
29
|
"test:watch": "vitest",
|
|
30
|
-
"test:coverage": "
|
|
30
|
+
"test:coverage": "bun test --isolate --timeout 30000 --coverage",
|
|
31
31
|
"typecheck": "tsc --noEmit",
|
|
32
|
-
"lint": "
|
|
33
|
-
"lint:fix": "
|
|
32
|
+
"lint": "oxlint src",
|
|
33
|
+
"lint:fix": "oxlint src --fix",
|
|
34
34
|
"clean": "rm -rf dist",
|
|
35
35
|
"build:prod": "tsup --minify --treeshake"
|
|
36
36
|
},
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^26.4.0",
|
|
42
42
|
"tsup": "^8.0.0",
|
|
43
|
-
"typescript": "^
|
|
44
|
-
"vitest": "^
|
|
43
|
+
"typescript": "^7.0.2",
|
|
44
|
+
"vitest": "^5.0.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|