solve-engine 2.30.0 → 2.31.1
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/{DateCalendar-B85t6Vk6.d.ts → DateCalendar-CTz538dw.d.ts} +41 -1
- package/dist/{DateCalendar-CUGI1fT4.d.cts → DateCalendar-GFQDX1ng.d.cts} +41 -1
- package/dist/{chunk-V7LXOTCU.js → chunk-6LA7HC46.js} +3 -3
- package/dist/{chunk-V7LXOTCU.js.map → chunk-6LA7HC46.js.map} +1 -1
- package/dist/{chunk-2PGGPFF3.js → chunk-AF6NDOIE.js} +2 -2
- package/dist/{chunk-2PGGPFF3.js.map → chunk-AF6NDOIE.js.map} +1 -1
- package/dist/chunk-BSGZ3OEL.cjs +3 -0
- package/dist/chunk-BSGZ3OEL.cjs.map +1 -0
- package/dist/chunk-BWTVJD5L.js +2 -0
- package/dist/chunk-BWTVJD5L.js.map +1 -0
- package/dist/chunk-KBRSNJMQ.js +3 -0
- package/dist/chunk-KBRSNJMQ.js.map +1 -0
- package/dist/{chunk-RAFOQ4T5.cjs → chunk-LCYQQFUH.cjs} +2 -2
- package/dist/{chunk-RAFOQ4T5.cjs.map → chunk-LCYQQFUH.cjs.map} +1 -1
- package/dist/chunk-MDTIL3UT.cjs +5 -0
- package/dist/chunk-MDTIL3UT.cjs.map +1 -0
- package/dist/{chunk-W7NN77PH.cjs → chunk-MZQ3ED6J.cjs} +3 -3
- package/dist/{chunk-W7NN77PH.cjs.map → chunk-MZQ3ED6J.cjs.map} +1 -1
- package/dist/{chunk-YN5H54GM.js → chunk-OE2DBN4K.js} +2 -2
- package/dist/{chunk-YN5H54GM.js.map → chunk-OE2DBN4K.js.map} +1 -1
- package/dist/chunk-PHWIO4P3.cjs +2 -0
- package/dist/chunk-PHWIO4P3.cjs.map +1 -0
- package/dist/chunk-SNYFNARL.js +5 -0
- package/dist/chunk-SNYFNARL.js.map +1 -0
- package/dist/{chunk-CIC2YO2M.js → chunk-TP5EQCGH.js} +2 -2
- package/dist/chunk-TP5EQCGH.js.map +1 -0
- package/dist/{chunk-GWV273KZ.cjs → chunk-UNKZ5XRC.cjs} +2 -2
- package/dist/{chunk-GWV273KZ.cjs.map → chunk-UNKZ5XRC.cjs.map} +1 -1
- package/dist/{chunk-RHRAONDK.cjs → chunk-VYQNPCM5.cjs} +2 -2
- package/dist/chunk-VYQNPCM5.cjs.map +1 -0
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/engine.cjs +1 -1
- package/dist/engine.d.cts +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/engine.js +1 -1
- package/dist/engine.worker.cjs +2 -0
- package/dist/engine.worker.cjs.map +1 -0
- package/dist/engine.worker.d.cts +2 -0
- package/dist/engine.worker.d.ts +2 -0
- package/dist/engine.worker.js +2 -0
- package/dist/engine.worker.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/language.cjs +1 -1
- package/dist/language.js +1 -1
- package/dist/packages.cjs +1 -1
- package/dist/packages.js +1 -1
- package/dist/testing.cjs +2 -2
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/uom.cjs +1 -1
- package/dist/uom.js +1 -1
- package/dist/vm.cjs +1 -1
- package/dist/vm.js +1 -1
- package/dist/worker.cjs +2 -2
- package/dist/worker.js +2 -2
- package/dist/worker.js.map +1 -1
- package/package.json +11 -1
- package/dist/chunk-4CNYGIND.js +0 -2
- package/dist/chunk-4CNYGIND.js.map +0 -1
- package/dist/chunk-CIC2YO2M.js.map +0 -1
- package/dist/chunk-FNSQ6O4Y.js +0 -3
- package/dist/chunk-FNSQ6O4Y.js.map +0 -1
- package/dist/chunk-NNRTDLGC.cjs +0 -3
- package/dist/chunk-NNRTDLGC.cjs.map +0 -1
- package/dist/chunk-NOZKHMML.js +0 -5
- package/dist/chunk-NOZKHMML.js.map +0 -1
- package/dist/chunk-PNHTC3FM.cjs +0 -5
- package/dist/chunk-PNHTC3FM.cjs.map +0 -1
- package/dist/chunk-RHRAONDK.cjs.map +0 -1
- package/dist/chunk-ZKFCKAIX.cjs +0 -2
- package/dist/chunk-ZKFCKAIX.cjs.map +0 -1
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
import { C as CalendarBackend, a as CalendarFields, Z as ZonedFields } from './CalendarBackend-MdS3Bb4P.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Where a host says how to start an engine worker.
|
|
5
|
+
*
|
|
6
|
+
* The engine's offloaded compile and execute paths need a `Worker`, and a
|
|
7
|
+
* library cannot make one on its own: the file a worker runs has to be a URL
|
|
8
|
+
* the host's bundler produced, and every bundler spells that differently. So
|
|
9
|
+
* the engine asks rather than guesses. A host that wants the offload registers
|
|
10
|
+
* a factory once, and both paths use it; a host that registers nothing gets the
|
|
11
|
+
* main thread, which is what every published build does today and what the
|
|
12
|
+
* fallbacks were always written for.
|
|
13
|
+
*
|
|
14
|
+
* This module deliberately imports nothing. It is the whole reason the worker
|
|
15
|
+
* body, and the vocabulary it registers, stay out of a consumer's main bundle:
|
|
16
|
+
* `ExecutionPool` and `CompilationWorkerManager` reach the worker through this
|
|
17
|
+
* hook instead of importing the worker module, so nothing but a host that opts
|
|
18
|
+
* in ever pulls it in.
|
|
19
|
+
*
|
|
20
|
+
* @module WorkerFactory
|
|
21
|
+
*/
|
|
22
|
+
/** Makes a `Worker` running the engine's worker entry. */
|
|
23
|
+
type EngineWorkerFactory = () => Worker;
|
|
24
|
+
/**
|
|
25
|
+
* Register how to start an engine worker, or pass null to go back to the main
|
|
26
|
+
* thread.
|
|
27
|
+
*
|
|
28
|
+
* The factory must return a `Worker` running the engine's worker entry
|
|
29
|
+
* (`solve-engine/engine-worker`), which is a bundle of its own carrying the
|
|
30
|
+
* full package vocabulary. Registering is a whole-process switch rather than a
|
|
31
|
+
* per-engine option, because the pools that use it are shared.
|
|
32
|
+
*
|
|
33
|
+
* @param factory - Makes a worker, or null to unregister.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { setEngineWorkerFactory } from "solve-engine";
|
|
37
|
+
*
|
|
38
|
+
* setEngineWorkerFactory(() => new Worker(new URL("solve-engine/engine-worker", import.meta.url), { type: "module" }));
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare function setEngineWorkerFactory(factory: EngineWorkerFactory | null): void;
|
|
42
|
+
|
|
3
43
|
/**
|
|
4
44
|
* The default {@link CalendarBackend}: the JavaScript `Date` object, read in
|
|
5
45
|
* the host process's time zone, with `Intl.DateTimeFormat` for named zones.
|
|
@@ -87,4 +127,4 @@ declare function calendarOf(context?: {
|
|
|
87
127
|
*/
|
|
88
128
|
declare function dateCalendarInZone(zone: string): CalendarBackend;
|
|
89
129
|
|
|
90
|
-
export { DATE_CALENDAR as D, DateCalendar as a, calendarOf as c, dateCalendarInZone as d };
|
|
130
|
+
export { DATE_CALENDAR as D, type EngineWorkerFactory as E, DateCalendar as a, calendarOf as c, dateCalendarInZone as d, setEngineWorkerFactory as s };
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
import { C as CalendarBackend, a as CalendarFields, Z as ZonedFields } from './CalendarBackend-MdS3Bb4P.cjs';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Where a host says how to start an engine worker.
|
|
5
|
+
*
|
|
6
|
+
* The engine's offloaded compile and execute paths need a `Worker`, and a
|
|
7
|
+
* library cannot make one on its own: the file a worker runs has to be a URL
|
|
8
|
+
* the host's bundler produced, and every bundler spells that differently. So
|
|
9
|
+
* the engine asks rather than guesses. A host that wants the offload registers
|
|
10
|
+
* a factory once, and both paths use it; a host that registers nothing gets the
|
|
11
|
+
* main thread, which is what every published build does today and what the
|
|
12
|
+
* fallbacks were always written for.
|
|
13
|
+
*
|
|
14
|
+
* This module deliberately imports nothing. It is the whole reason the worker
|
|
15
|
+
* body, and the vocabulary it registers, stay out of a consumer's main bundle:
|
|
16
|
+
* `ExecutionPool` and `CompilationWorkerManager` reach the worker through this
|
|
17
|
+
* hook instead of importing the worker module, so nothing but a host that opts
|
|
18
|
+
* in ever pulls it in.
|
|
19
|
+
*
|
|
20
|
+
* @module WorkerFactory
|
|
21
|
+
*/
|
|
22
|
+
/** Makes a `Worker` running the engine's worker entry. */
|
|
23
|
+
type EngineWorkerFactory = () => Worker;
|
|
24
|
+
/**
|
|
25
|
+
* Register how to start an engine worker, or pass null to go back to the main
|
|
26
|
+
* thread.
|
|
27
|
+
*
|
|
28
|
+
* The factory must return a `Worker` running the engine's worker entry
|
|
29
|
+
* (`solve-engine/engine-worker`), which is a bundle of its own carrying the
|
|
30
|
+
* full package vocabulary. Registering is a whole-process switch rather than a
|
|
31
|
+
* per-engine option, because the pools that use it are shared.
|
|
32
|
+
*
|
|
33
|
+
* @param factory - Makes a worker, or null to unregister.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { setEngineWorkerFactory } from "solve-engine";
|
|
37
|
+
*
|
|
38
|
+
* setEngineWorkerFactory(() => new Worker(new URL("solve-engine/engine-worker", import.meta.url), { type: "module" }));
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare function setEngineWorkerFactory(factory: EngineWorkerFactory | null): void;
|
|
42
|
+
|
|
3
43
|
/**
|
|
4
44
|
* The default {@link CalendarBackend}: the JavaScript `Date` object, read in
|
|
5
45
|
* the host process's time zone, with `Intl.DateTimeFormat` for named zones.
|
|
@@ -87,4 +127,4 @@ declare function calendarOf(context?: {
|
|
|
87
127
|
*/
|
|
88
128
|
declare function dateCalendarInZone(zone: string): CalendarBackend;
|
|
89
129
|
|
|
90
|
-
export { DATE_CALENDAR as D, DateCalendar as a, calendarOf as c, dateCalendarInZone as d };
|
|
130
|
+
export { DATE_CALENDAR as D, type EngineWorkerFactory as E, DateCalendar as a, calendarOf as c, dateCalendarInZone as d, setEngineWorkerFactory as s };
|