@uwrl/qc-utils 0.0.19 → 0.0.20

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.
Files changed (51) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.js +863 -862
  3. package/dist/index.umd.cjs +14 -14
  4. package/dist/models/dataSource.d.ts +173 -0
  5. package/dist/models/index.d.ts +2 -0
  6. package/dist/models/payload.d.ts +24 -0
  7. package/dist/models/settings.d.ts +65 -0
  8. package/dist/models/timestamp.d.ts +150 -0
  9. package/dist/services/__tests__/createPatchObject.spec.d.ts +1 -0
  10. package/dist/services/__tests__/requestInterceptor.spec.d.ts +1 -0
  11. package/dist/services/__tests__/responseInterceptor.spec.d.ts +1 -0
  12. package/dist/services/api.d.ts +147 -0
  13. package/dist/services/apiMethods.d.ts +8 -0
  14. package/dist/services/createPatchObject.d.ts +17 -0
  15. package/dist/services/getCSRFToken.d.ts +1 -0
  16. package/dist/services/index.d.ts +6 -0
  17. package/dist/services/requestInterceptor.d.ts +12 -0
  18. package/dist/services/responseInterceptor.d.ts +2 -0
  19. package/dist/types/index.d.ts +372 -0
  20. package/dist/utils/__tests__/ellapsed-time.spec.d.ts +1 -0
  21. package/dist/utils/__tests__/format.spec.d.ts +1 -0
  22. package/dist/utils/__tests__/notifications.spec.d.ts +1 -0
  23. package/dist/utils/__tests__/observations.spec.d.ts +1 -0
  24. package/dist/utils/ellapsed-time.d.ts +4 -0
  25. package/dist/utils/format.d.ts +4 -0
  26. package/dist/utils/index.d.ts +6 -0
  27. package/dist/utils/notifications.d.ts +46 -0
  28. package/dist/utils/observations.d.ts +5 -0
  29. package/dist/utils/plotting/__tests__/calibration.spec.d.ts +16 -0
  30. package/dist/utils/plotting/__tests__/mock.d.ts +4 -0
  31. package/dist/utils/plotting/__tests__/observation-record-paths.spec.d.ts +21 -0
  32. package/dist/utils/plotting/__tests__/observation-record.spec.d.ts +1 -0
  33. package/dist/utils/plotting/__tests__/operation-cores.spec.d.ts +12 -0
  34. package/dist/utils/plotting/__tests__/workerMocks.d.ts +119 -0
  35. package/dist/utils/plotting/__tests__/workers.spec.d.ts +18 -0
  36. package/dist/utils/plotting/add-data.worker.d.ts +1 -0
  37. package/dist/utils/plotting/calibration.d.ts +99 -0
  38. package/dist/utils/plotting/change-values.worker.d.ts +1 -0
  39. package/dist/utils/plotting/change.worker.d.ts +1 -0
  40. package/dist/utils/plotting/delete-data.worker.d.ts +1 -0
  41. package/dist/utils/plotting/drift-correction.worker.d.ts +1 -0
  42. package/dist/utils/plotting/fill-gaps.worker.d.ts +1 -0
  43. package/dist/utils/plotting/find-gaps.worker.d.ts +1 -0
  44. package/dist/utils/plotting/interpolate.worker.d.ts +1 -0
  45. package/dist/utils/plotting/observation-record.d.ts +281 -0
  46. package/dist/utils/plotting/operation-cores.d.ts +139 -0
  47. package/dist/utils/plotting/persistence.worker.d.ts +1 -0
  48. package/dist/utils/plotting/rate-of-change.worker.d.ts +1 -0
  49. package/dist/utils/plotting/shift-datetimes.worker.d.ts +1 -0
  50. package/dist/utils/plotting/value-threshold.worker.d.ts +1 -0
  51. package/package.json +1 -1
@@ -0,0 +1,372 @@
1
+ import { DataSource } from "@/models";
2
+ import { ObservationRecord } from "@/utils/plotting/observation-record";
3
+ export type EnumDictionary<T extends string | symbol | number, U> = {
4
+ [K in T]: U;
5
+ };
6
+ export declare enum TimeUnit {
7
+ SECOND = "s",
8
+ MINUTE = "m",
9
+ HOUR = "h",
10
+ DAY = "D",
11
+ WEEK = "W",
12
+ MONTH = "M",
13
+ YEAR = "Y"
14
+ }
15
+ export declare enum EnumEditOperations {
16
+ ADD_POINTS = "ADD_POINTS",
17
+ CHANGE_VALUES = "CHANGE_VALUES",
18
+ /**
19
+ * Single-operation assignment of distinct values at distinct indices.
20
+ * Args: `(indices: number[], values: number[])` — parallel arrays where
21
+ * `values[i]` is written to `dataY[indices[i]]`. No workers, no per-row
22
+ * ceremony. Intended for table-driven edits.
23
+ */
24
+ ASSIGN_VALUES_BULK = "ASSIGN_VALUES_BULK",
25
+ DELETE_POINTS = "DELETE_POINTS",
26
+ DRIFT_CORRECTION = "DRIFT_CORRECTION",
27
+ INTERPOLATE = "INTERPOLATE",
28
+ SHIFT_DATETIMES = "SHIFT_DATETIMES",
29
+ /**
30
+ * Single-operation assignment of distinct datetimes at distinct indices.
31
+ * Args: `(indices: number[], datetimes: number[])` — parallel arrays of
32
+ * epoch-milliseconds. Runs one combined delete + add under the hood.
33
+ */
34
+ ASSIGN_DATETIMES_BULK = "ASSIGN_DATETIMES_BULK",
35
+ FILL_GAPS = "FILL_GAPS"
36
+ }
37
+ export declare enum EnumFilterOperations {
38
+ FIND_GAPS = "FIND_GAPS",
39
+ PERSISTENCE = "PERSISTENCE",
40
+ CHANGE = "CHANGE",
41
+ RATE_OF_CHANGE = "RATE_OF_CHANGE",
42
+ VALUE_THRESHOLD = "VALUE_THRESHOLD",
43
+ DATETIME_RANGE = "DATETIME_RANGE",
44
+ SELECTION = "SELECTION"
45
+ }
46
+ export declare enum FilterOperation {
47
+ LT = "Less than",
48
+ LTE = "Less than or equal to",
49
+ GT = "Greater than",
50
+ GTE = "Greater than or equal to",
51
+ E = "Equal"
52
+ }
53
+ export declare enum Operator {
54
+ ADD = "ADD",
55
+ SUB = "SUB",
56
+ MULT = "MULT",
57
+ DIV = "DIV",
58
+ ASSIGN = "ASSIGN"
59
+ }
60
+ export declare enum LogicalOperation {
61
+ LT = "Less than",
62
+ LTE = "Less than or equal to",
63
+ GT = "Greater than",
64
+ GTE = "Greater than or equal to",
65
+ E = "Equal"
66
+ }
67
+ export type HistoryItem = {
68
+ method: EnumEditOperations | EnumFilterOperations;
69
+ icon: string;
70
+ isLoading: boolean;
71
+ args?: any[];
72
+ duration?: number;
73
+ selected?: number[];
74
+ status?: "success" | "failed";
75
+ /**
76
+ * Whether the operation actually ran on a web worker or inline on
77
+ * the main thread. Populated by the `ObservationRecord` dispatch
78
+ * site based on the calibration decision and any always-inline /
79
+ * always-worker handler behaviour. Mainly useful in dev for
80
+ * verifying that the calibration layer is routing as expected —
81
+ * the qc-app surfaces a small badge per history entry when
82
+ * `import.meta.env.DEV` is truthy.
83
+ */
84
+ executionMode?: "worker" | "inline";
85
+ };
86
+ export type DataPoint = {
87
+ date: Date;
88
+ value: number;
89
+ };
90
+ export type DataArray = [string, number][];
91
+ export interface GraphSeries {
92
+ id: string;
93
+ name: string;
94
+ data: ObservationRecord;
95
+ yAxisLabel: string;
96
+ seriesOption: any;
97
+ }
98
+ export type TimeSpacingUnit = "seconds" | "minutes" | "hours" | "days";
99
+ export interface Tag {
100
+ key: string;
101
+ value: string;
102
+ }
103
+ export type Frequency = "daily" | "weekly" | "monthly" | null;
104
+ export declare class HydroShareArchive {
105
+ id: string;
106
+ thingId: string;
107
+ link: string;
108
+ frequency: Frequency;
109
+ path: string;
110
+ datastreamIds: string[];
111
+ publicResource: boolean;
112
+ constructor();
113
+ }
114
+ export declare class PostHydroShareArchive extends HydroShareArchive {
115
+ resourceTitle?: string;
116
+ resourceAbstract?: string;
117
+ resourceKeywords?: string[];
118
+ constructor();
119
+ }
120
+ export declare class Location {
121
+ latitude?: number | "";
122
+ longitude?: number | "";
123
+ elevation_m?: number | "";
124
+ elevationDatum: string;
125
+ state: string;
126
+ county: string;
127
+ country: string;
128
+ constructor();
129
+ }
130
+ export declare class Thing {
131
+ id: string;
132
+ workspaceId: string;
133
+ name: string;
134
+ location: Location;
135
+ tags: Tag[];
136
+ hydroShareArchive?: HydroShareArchive | null;
137
+ siteType: string;
138
+ samplingFeatureCode: string;
139
+ isPrivate: boolean;
140
+ description: string;
141
+ samplingFeatureType: string;
142
+ dataDisclaimer: string;
143
+ constructor();
144
+ }
145
+ export interface ThingWithColor extends Thing {
146
+ color?: {
147
+ borderColor: string;
148
+ background: string;
149
+ glyphColor: string;
150
+ };
151
+ tagValue?: string;
152
+ }
153
+ export declare class Datastream {
154
+ id: string;
155
+ workspaceId: string;
156
+ name: string;
157
+ description: string;
158
+ thingId: string;
159
+ observationType: string;
160
+ resultType?: string;
161
+ status?: string;
162
+ sampledMedium: string;
163
+ noDataValue: number;
164
+ aggregationStatistic: string;
165
+ unitId: string;
166
+ observedPropertyId: string;
167
+ sensorId: string;
168
+ processingLevelId: string;
169
+ isPrivate: boolean;
170
+ isVisible: boolean;
171
+ phenomenonBeginTime?: string | null;
172
+ phenomenonEndTime?: string | null;
173
+ intendedTimeSpacing?: number;
174
+ intendedTimeSpacingUnit?: TimeSpacingUnit | null;
175
+ timeAggregationInterval: number | null;
176
+ timeAggregationIntervalUnit: TimeSpacingUnit;
177
+ dataSourceId?: string | null;
178
+ valueCount: number;
179
+ constructor(thingId?: string);
180
+ }
181
+ export interface DatastreamExtended {
182
+ id: string;
183
+ name: string;
184
+ description: string;
185
+ observationType: string;
186
+ resultType?: string;
187
+ status?: string;
188
+ sampledMedium: string;
189
+ noDataValue: number;
190
+ aggregationStatistic: string;
191
+ isPrivate: boolean;
192
+ isVisible: boolean;
193
+ phenomenonBeginTime?: string | null;
194
+ phenomenonEndTime?: string | null;
195
+ intendedTimeSpacing?: number;
196
+ intendedTimeSpacingUnit?: TimeSpacingUnit | null;
197
+ timeAggregationInterval: number | null;
198
+ timeAggregationIntervalUnit: TimeSpacingUnit;
199
+ dataSourceId?: string | null;
200
+ valueCount: number;
201
+ thing: Thing;
202
+ workspace: Workspace;
203
+ unit: Unit;
204
+ observedProperty: ObservedProperty;
205
+ sensor: Sensor;
206
+ processingLevel: ProcessingLevel;
207
+ dataSource: DataSource;
208
+ }
209
+ export declare class Unit {
210
+ id: string;
211
+ workspaceId: string;
212
+ name: string;
213
+ symbol: string;
214
+ definition: string;
215
+ type: string;
216
+ constructor();
217
+ }
218
+ export declare class Sensor {
219
+ id: string;
220
+ workspaceId: string;
221
+ name: string;
222
+ description: string;
223
+ manufacturer: string;
224
+ model: string;
225
+ methodType: string;
226
+ methodCode: string;
227
+ methodLink: string;
228
+ encodingType: string;
229
+ modelLink: string;
230
+ constructor();
231
+ }
232
+ export declare class ObservedProperty {
233
+ id: string;
234
+ workspaceId: string;
235
+ name: string;
236
+ definition: string;
237
+ description: string;
238
+ type: string;
239
+ code: string;
240
+ constructor();
241
+ }
242
+ export declare class ProcessingLevel {
243
+ id: string;
244
+ workspaceId: string;
245
+ code: string;
246
+ definition: string;
247
+ explanation: string;
248
+ constructor();
249
+ }
250
+ export declare class ResultQualifier {
251
+ id: string;
252
+ workspaceId: string;
253
+ code: string;
254
+ description: string;
255
+ constructor();
256
+ }
257
+ export declare class Organization {
258
+ name?: string;
259
+ code?: string;
260
+ type?: string;
261
+ description?: string;
262
+ link?: string;
263
+ constructor();
264
+ }
265
+ export declare class User {
266
+ id: string;
267
+ email: string;
268
+ password: string;
269
+ firstName: string;
270
+ middleName: string;
271
+ lastName: string;
272
+ phone: string;
273
+ address: string;
274
+ organization?: Organization | null;
275
+ type: string;
276
+ link: string;
277
+ accountType: "admin" | "standard" | "limited";
278
+ hydroShareConnected: boolean;
279
+ constructor();
280
+ }
281
+ export interface Photo {
282
+ name: string;
283
+ link: string;
284
+ }
285
+ export declare class OAuthProvider {
286
+ id: string;
287
+ name: string;
288
+ iconLink: string;
289
+ signupEnabled: boolean;
290
+ connectEnabled: boolean;
291
+ constructor();
292
+ }
293
+ export declare enum PermissionAction {
294
+ Global = "*",
295
+ View = "view",
296
+ Create = "create",
297
+ Edit = "edit",
298
+ Delete = "delete"
299
+ }
300
+ export declare enum PermissionResource {
301
+ Global = "*",
302
+ Workspace = "Workspace",
303
+ Collaborator = "Collaborator",
304
+ Thing = "Thing",
305
+ Datastream = "Datastream",
306
+ Sensor = "Sensor",
307
+ Unit = "Unit",
308
+ ObservedProperty = "ObservedProperty",
309
+ ProcessingLevel = "ProcessingLevel",
310
+ Observation = "Observation"
311
+ }
312
+ export interface Permission {
313
+ action: PermissionAction;
314
+ resource: PermissionResource;
315
+ }
316
+ export interface CollaboratorRole {
317
+ name: string;
318
+ description: string;
319
+ id: string;
320
+ workspaceId: string;
321
+ isApikeyRole: boolean;
322
+ isUserRole: boolean;
323
+ permissions: Permission[];
324
+ }
325
+ export declare class ApiKey {
326
+ id: string;
327
+ key: string;
328
+ name: string;
329
+ description: string;
330
+ isActive: boolean;
331
+ expiresAt: string;
332
+ createdAt: string;
333
+ lastUsed: string;
334
+ workspaceId: string;
335
+ role: CollaboratorRole | null;
336
+ constructor(init?: Partial<ApiKey>);
337
+ }
338
+ export interface WorkspaceData {
339
+ id: string;
340
+ name: string;
341
+ isPrivate: boolean;
342
+ owner: User;
343
+ collaboratorRole: CollaboratorRole;
344
+ pendingTransferTo?: User | null;
345
+ }
346
+ export declare class Workspace {
347
+ id: string;
348
+ name: string;
349
+ isPrivate: boolean;
350
+ owner: UserInfo | null;
351
+ collaboratorRole: CollaboratorRole | null;
352
+ pendingTransferTo?: UserInfo | null;
353
+ constructor();
354
+ }
355
+ export interface UserInfo {
356
+ name: string;
357
+ email: string;
358
+ phone: string;
359
+ address: string;
360
+ link: string;
361
+ type: string;
362
+ organizationName: string;
363
+ }
364
+ export declare class Collaborator {
365
+ user: UserInfo;
366
+ role: CollaboratorRole;
367
+ constructor();
368
+ }
369
+ export interface ApiError {
370
+ status: number;
371
+ message?: string;
372
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const measureEllapsedTime: (fn: () => any, message?: string) => Promise<{
2
+ response: any;
3
+ duration: number;
4
+ }>;
@@ -0,0 +1,4 @@
1
+ import { EnumDictionary, TimeUnit } from '@/types';
2
+ export declare const timeUnitMultipliers: EnumDictionary<TimeUnit, number>;
3
+ export declare const formatDate: (date: Date) => string;
4
+ export declare const formatDuration: (duration: number) => string;
@@ -0,0 +1,6 @@
1
+ export * from './format';
2
+ export * from './ellapsed-time';
3
+ export * from './notifications';
4
+ export * from './observations';
5
+ export * from './plotting/observation-record';
6
+ export * from './plotting/calibration';
@@ -0,0 +1,46 @@
1
+ export declare const DEFAULT_SNACK_DURATION = 3000;
2
+ export declare enum SnackColor {
3
+ Warning = "warning",
4
+ Success = "success",
5
+ Error = "error",
6
+ Info = "info"
7
+ }
8
+ export declare enum SnackIcon {
9
+ Success = "mdi-checkbox-marked-circle",
10
+ Warning = "mdi-alert",
11
+ Error = "mdi-alert-circle",
12
+ Info = "mdi-information",
13
+ None = "none"
14
+ }
15
+ export declare enum SnackTitle {
16
+ Warning = "Warning",
17
+ Success = "Success",
18
+ Error = "Error",
19
+ Info = "Info"
20
+ }
21
+ export declare enum Position {
22
+ Center = "center",
23
+ Left = "left",
24
+ Right = "right",
25
+ Bottom = "bottom",
26
+ Top = "top"
27
+ }
28
+ export declare class Snack {
29
+ message: string;
30
+ color: SnackColor;
31
+ icon: SnackIcon;
32
+ title: SnackTitle;
33
+ timeout: number;
34
+ position: Position;
35
+ visible: boolean;
36
+ constructor(message?: string, color?: SnackColor, icon?: SnackIcon, title?: SnackTitle, timeout?: number, position?: Position, visible?: boolean);
37
+ }
38
+ export declare class Snackbar {
39
+ private static subject;
40
+ static get snack$(): import("rxjs").Observable<Snack>;
41
+ private static createSnackbar;
42
+ static success(message: string): void;
43
+ static warn(message: string): void;
44
+ static error(message: string): void;
45
+ static info(message: string): void;
46
+ }
@@ -0,0 +1,5 @@
1
+ export declare function subtractHours(timestamp: string, hours: number): string;
2
+ /** Returns the index of the first value that is greater or equal to the target value */
3
+ export declare const findFirstGreaterOrEqual: (array: number[] | Float64Array<ArrayBufferLike>, target: number) => number;
4
+ /** Returns the index of the last value that is lesser or equal to the target value */
5
+ export declare const findLastLessOrEqual: (array: number[] | Float64Array<ArrayBufferLike>, target: number) => number;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Unit tests for the public surface of `calibration.ts`.
3
+ *
4
+ * The module imports `value-threshold.worker?worker&inline` eagerly, which
5
+ * Vite transforms in the app build but not in Vitest + happy-dom — so we
6
+ * substitute the same `MockValueThresholdWorker` used by
7
+ * `observation-record.spec.ts` to give `runBenchmarks()` a working worker
8
+ * constructor. The mock round-trips via `queueMicrotask`, which is enough
9
+ * for `ensureCalibration()` to complete synchronously-ish in tests.
10
+ *
11
+ * Module state (`activeProfile`, `lastBenchmarkDetail`, `listeners`,
12
+ * `localStorage`) lives at import scope, so every test begins with a
13
+ * `clearCalibration()` and a `localStorage.clear()` to avoid cross-
14
+ * pollination.
15
+ */
16
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const mockDatastream: {
2
+ phenomenon_time: string[];
3
+ result: number[];
4
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Coverage-focused tests for `observation-record.ts` that exercise
3
+ * paths the baseline spec skips:
4
+ *
5
+ * 1. **Worker fan-out paths** — every `_operation` routes through
6
+ * `shouldUseWorker()` and falls back to an inline core for small
7
+ * inputs. The existing `observation-record.spec.ts` uses tiny
8
+ * datasets, so only the inline branches run. Here we mock
9
+ * `../calibration` so callers can flip `forceWorker = true` and
10
+ * drive the worker branches without needing multi-MB fixtures.
11
+ * 2. **Bulk assignment ops** — `ASSIGN_VALUES_BULK` and
12
+ * `ASSIGN_DATETIMES_BULK` aren't touched by the baseline spec.
13
+ * 3. **Undo / redo** — `undo()` / `redo()` have their own state
14
+ * machines that aren't driven by the `dispatch()` tests.
15
+ * 4. **DATETIME_RANGE, SELECTION pop** — the remaining filter ops.
16
+ *
17
+ * Mocks are hoisted via `vi.mock`; the real calibration module is
18
+ * wrapped so non-mocked helpers (getCalibration, etc.) still work if
19
+ * anything reaches for them.
20
+ */
21
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Direct unit tests for the pure kernels in `operation-cores.ts`. These
3
+ * functions are the shared source of truth for every `*.worker.ts` with an
4
+ * inline equivalent, so once they pass here the worker wrappers only need a
5
+ * thin "message in / message out" check (see `workers.spec.ts`).
6
+ *
7
+ * Cores are deliberately framework-free and accept plain typed arrays, so
8
+ * these tests build buffers from raw `Float32Array` / `Float64Array` rather
9
+ * than `SharedArrayBuffer`. Semantics are identical and happy-dom doesn't
10
+ * require the cross-origin-isolation headers SAB would.
11
+ */
12
+ export {};
@@ -0,0 +1,119 @@
1
+ /**
2
+ * In-process mock implementations of every worker used by `ObservationRecord`.
3
+ *
4
+ * The real workers are loaded via Vite's `?worker&inline` query, which is not
5
+ * available in Vitest + happy-dom. Each mock here re-implements the logic of
6
+ * the matching `*.worker.ts` file and runs synchronously via `queueMicrotask`,
7
+ * which is enough to exercise every code path in `observation-record.ts`
8
+ * end-to-end. The handler is scheduled via microtask so the caller has a chance
9
+ * to assign `onmessage` before the response is dispatched (matching the real
10
+ * Worker API contract).
11
+ */
12
+ export declare const MockDeleteDataWorker: {
13
+ new (): {
14
+ onmessage: ((event: {
15
+ data: any;
16
+ }) => void) | null;
17
+ postMessage(data: any): void;
18
+ terminate(): void;
19
+ };
20
+ };
21
+ export declare const MockAddDataWorker: {
22
+ new (): {
23
+ onmessage: ((event: {
24
+ data: any;
25
+ }) => void) | null;
26
+ postMessage(data: any): void;
27
+ terminate(): void;
28
+ };
29
+ };
30
+ export declare const MockChangeValuesWorker: {
31
+ new (): {
32
+ onmessage: ((event: {
33
+ data: any;
34
+ }) => void) | null;
35
+ postMessage(data: any): void;
36
+ terminate(): void;
37
+ };
38
+ };
39
+ export declare const MockInterpolateWorker: {
40
+ new (): {
41
+ onmessage: ((event: {
42
+ data: any;
43
+ }) => void) | null;
44
+ postMessage(data: any): void;
45
+ terminate(): void;
46
+ };
47
+ };
48
+ export declare const MockDriftCorrectionWorker: {
49
+ new (): {
50
+ onmessage: ((event: {
51
+ data: any;
52
+ }) => void) | null;
53
+ postMessage(data: any): void;
54
+ terminate(): void;
55
+ };
56
+ };
57
+ export declare const MockShiftDatetimesWorker: {
58
+ new (): {
59
+ onmessage: ((event: {
60
+ data: any;
61
+ }) => void) | null;
62
+ postMessage(data: any): void;
63
+ terminate(): void;
64
+ };
65
+ };
66
+ export declare const MockFillGapsWorker: {
67
+ new (): {
68
+ onmessage: ((event: {
69
+ data: any;
70
+ }) => void) | null;
71
+ postMessage(data: any): void;
72
+ terminate(): void;
73
+ };
74
+ };
75
+ export declare const MockFindGapsWorker: {
76
+ new (): {
77
+ onmessage: ((event: {
78
+ data: any;
79
+ }) => void) | null;
80
+ postMessage(data: any): void;
81
+ terminate(): void;
82
+ };
83
+ };
84
+ export declare const MockPersistenceWorker: {
85
+ new (): {
86
+ onmessage: ((event: {
87
+ data: any;
88
+ }) => void) | null;
89
+ postMessage(data: any): void;
90
+ terminate(): void;
91
+ };
92
+ };
93
+ export declare const MockChangeWorker: {
94
+ new (): {
95
+ onmessage: ((event: {
96
+ data: any;
97
+ }) => void) | null;
98
+ postMessage(data: any): void;
99
+ terminate(): void;
100
+ };
101
+ };
102
+ export declare const MockRateOfChangeWorker: {
103
+ new (): {
104
+ onmessage: ((event: {
105
+ data: any;
106
+ }) => void) | null;
107
+ postMessage(data: any): void;
108
+ terminate(): void;
109
+ };
110
+ };
111
+ export declare const MockValueThresholdWorker: {
112
+ new (): {
113
+ onmessage: ((event: {
114
+ data: any;
115
+ }) => void) | null;
116
+ postMessage(data: any): void;
117
+ terminate(): void;
118
+ };
119
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Wiring smoke tests for every `*.worker.ts` module.
3
+ *
4
+ * The algorithmic behaviour of each kernel is covered in
5
+ * `operation-cores.spec.ts`, so these tests only verify the worker
6
+ * handler is installed and forwards its payload to its core — i.e. the
7
+ * thin shell is plumbed correctly. Two workers still carry inline
8
+ * logic that has no core counterpart (`drift-correction.worker.ts` and
9
+ * `shift-datetimes.worker.ts`), so we keep behavioural assertions for
10
+ * those.
11
+ *
12
+ * Each worker file registers its handler via `self.onmessage = ...` at
13
+ * module evaluation time. We import each module once, capture its
14
+ * handler, and invoke it synchronously with `self.postMessage`
15
+ * redirected to a local capture buffer. `self` resolves to the global
16
+ * `Window` under happy-dom.
17
+ */
18
+ export {};
@@ -0,0 +1 @@
1
+ export {};