wickchart 1.6.0 → 2.0.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.
@@ -0,0 +1,11 @@
1
+ /** Rebuild the bar-object tape from a columnar snapshot (worker-side only —
2
+ * this cost never touches the main thread). */
3
+ export declare function barsFromCols(cols: any): any[];
4
+ /**
5
+ * Create a worker-core state + dispatcher.
6
+ * @returns {{sessions: Map, handle(message: object): object}} the reply object
7
+ */
8
+ export declare function createWorkerCore(): {
9
+ sessions: Map<any, any>;
10
+ handle(message: object): object;
11
+ };
@@ -0,0 +1,36 @@
1
+ import { WickChart } from './wick-chart.js';
2
+ export { WickChart };
3
+ /**
4
+ * A single-Worker task runner. The factory is injectable so tests can drive
5
+ * the protocol with a fake Worker; the default spawns the module worker
6
+ * sitting next to this file.
7
+ */
8
+ export declare class ChartWorkerPool {
9
+ _factory: () => Worker;
10
+ available: boolean;
11
+ _worker: Worker;
12
+ _seq: number;
13
+ _pending: Map<any, any>;
14
+ /** @param {() => Worker} [factory] */
15
+ constructor(factory?: () => Worker);
16
+ /**
17
+ * Post a task; resolves with the reply's `res`, rejects on failure or
18
+ * worker death (a `stale` rejection means: resend the epoch data first).
19
+ * @param {object} msg task message without the id
20
+ * @returns {Promise<any>}
21
+ */
22
+ run(msg: object): Promise<any>;
23
+ _spawn(): void;
24
+ /** Reject everything in flight and drop the worker; the next run() respawns
25
+ * — a transient worker crash must not permanently kill the mode. */
26
+ _die(): void;
27
+ /** Shut the pool down for good (in-flight tasks reject). */
28
+ terminate(): void;
29
+ }
30
+ /** The page-wide pool (created on first use). */
31
+ export declare function getSharedPool(): any;
32
+ /**
33
+ * Point the chart class at a pool (or null to disable the worker path).
34
+ * @param {ChartWorkerPool|null} pool
35
+ */
36
+ export declare function setChartWorkerPool(pool: ChartWorkerPool | null): ChartWorkerPool;