@wavelo/async 0.0.0-stage → 0.9.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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -2
  3. package/dist/action-button.d.ts +12 -0
  4. package/dist/action-button.js +53 -0
  5. package/dist/ai-stream.d.ts +24 -0
  6. package/dist/ai-stream.js +54 -0
  7. package/dist/angular.d.ts +26 -0
  8. package/dist/angular.js +35 -0
  9. package/dist/announcer.d.ts +33 -0
  10. package/dist/announcer.js +102 -0
  11. package/dist/boundary.d.ts +37 -0
  12. package/dist/boundary.js +147 -0
  13. package/dist/controller.d.ts +7 -0
  14. package/dist/controller.js +363 -0
  15. package/dist/dom.d.ts +35 -0
  16. package/dist/dom.js +243 -0
  17. package/dist/export-tool.d.ts +38 -0
  18. package/dist/export-tool.js +89 -0
  19. package/dist/group.d.ts +65 -0
  20. package/dist/group.js +235 -0
  21. package/dist/index.d.ts +6 -0
  22. package/dist/index.js +3 -0
  23. package/dist/innovation-progress.d.ts +101 -0
  24. package/dist/innovation-progress.js +276 -0
  25. package/dist/innovation-session.d.ts +70 -0
  26. package/dist/innovation-session.js +130 -0
  27. package/dist/innovation-ui.d.ts +55 -0
  28. package/dist/innovation-ui.js +122 -0
  29. package/dist/react.d.ts +17 -0
  30. package/dist/react.js +166 -0
  31. package/dist/registry-ext.d.ts +24 -0
  32. package/dist/registry-ext.js +41 -0
  33. package/dist/router.d.ts +25 -0
  34. package/dist/router.js +47 -0
  35. package/dist/runtime.d.ts +40 -0
  36. package/dist/runtime.js +140 -0
  37. package/dist/schema.d.ts +108 -0
  38. package/dist/schema.js +56 -0
  39. package/dist/skeleton.d.ts +53 -0
  40. package/dist/skeleton.js +152 -0
  41. package/dist/stages.d.ts +69 -0
  42. package/dist/stages.js +206 -0
  43. package/dist/svelte.d.ts +27 -0
  44. package/dist/svelte.js +44 -0
  45. package/dist/testing.d.ts +10 -0
  46. package/dist/testing.js +45 -0
  47. package/dist/themes.d.ts +29 -0
  48. package/dist/themes.js +66 -0
  49. package/dist/transfer.d.ts +57 -0
  50. package/dist/transfer.js +165 -0
  51. package/dist/types.d.ts +63 -0
  52. package/dist/types.js +1 -0
  53. package/dist/vue.d.ts +26 -0
  54. package/dist/vue.js +53 -0
  55. package/dist/web-components.d.ts +2 -0
  56. package/dist/web-components.js +22 -0
  57. package/package.json +157 -4
@@ -0,0 +1,89 @@
1
+ import { loaderRegistry, renderLoader } from '@wavelo/core';
2
+ import { allStyles } from '@wavelo/core/css';
3
+ /**
4
+ * Build-time loader export tool (F30).
5
+ * Validates selected IDs, deduplicates stylesheet slices, emits optional `@layer` CSS,
6
+ * and reports actual byte savings against the full catalog stylesheet.
7
+ */
8
+ export function exportLoaderBundle(allowlist, options = {}) {
9
+ if (!Array.isArray(allowlist) || allowlist.length === 0) {
10
+ throw new Error('Allowlist must include at least one design ID.');
11
+ }
12
+ const byId = new Map(loaderRegistry.map((d) => [d.id, d]));
13
+ const uniqueIds = [...new Set(allowlist)];
14
+ const slices = new Map();
15
+ const snippets = {};
16
+ for (const id of uniqueIds) {
17
+ const def = byId.get(id);
18
+ if (!def)
19
+ throw new Error(`Unknown design ID "${id}" in export allowlist.`);
20
+ const result = renderLoader({ type: id });
21
+ if (!slices.has(result.styleKey)) {
22
+ slices.set(result.styleKey, result.css);
23
+ }
24
+ const camel = id.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
25
+ snippets[id] = `import { ${camel} } from '@wavelo/core/loaders/${id}';`;
26
+ }
27
+ let css = [...slices.values()].join('\n');
28
+ if (options.layer) {
29
+ const layerName = options.layerName ?? 'wavelo';
30
+ if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(layerName))
31
+ throw new Error(`Unsafe @layer name: ${layerName}`);
32
+ css = `@layer ${layerName} {\n${css}\n}`;
33
+ }
34
+ const encoder = new TextEncoder();
35
+ const selectedCssBytes = encoder.encode(css).byteLength;
36
+ const fullCatalogCssBytes = encoder.encode(allStyles).byteLength;
37
+ return {
38
+ designs: uniqueIds,
39
+ slicesUsed: [...slices.keys()],
40
+ css,
41
+ snippets,
42
+ bytes: {
43
+ selectedCssBytes,
44
+ fullCatalogCssBytes,
45
+ savedBytes: Math.max(0, fullCatalogCssBytes - selectedCssBytes)
46
+ }
47
+ };
48
+ }
49
+ const SAFE_CLASS = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
50
+ const SAFE_LENGTH = /^(?:\d+(?:\.\d+)?(?:px|rem|em|%)|0)$/;
51
+ const SAFE_COLOR = /^(?:#[0-9a-f]{3}(?:[0-9a-f]{3})?|rgba?\(\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?(?:\s*,\s*(?:\d{1,3}%?|\d*\.\d+)\s*)?\)|hsla?\(\s*\d{1,3}(?:deg)?\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%(?:\s*,\s*(?:\d{1,3}%?|\d*\.\d+)\s*)?\)|currentColor|transparent)$/i;
52
+ /**
53
+ * Strict-CSP static export mode (F41).
54
+ * Emits external CSS classes for a bounded config allowlist so consumers running
55
+ * `style-src-attr 'none'` need zero inline `style="..."` attributes.
56
+ */
57
+ export function exportStaticStrictCsp(entries) {
58
+ const base = exportLoaderBundle(entries.map((e) => e.type));
59
+ const rules = [];
60
+ const diagnostics = [];
61
+ for (const entry of entries) {
62
+ if (!SAFE_CLASS.test(entry.className)) {
63
+ diagnostics.push(`Invalid className "${entry.className}" skipped.`);
64
+ continue;
65
+ }
66
+ const decls = [];
67
+ if (entry.size !== undefined) {
68
+ if (!SAFE_LENGTH.test(entry.size))
69
+ diagnostics.push(`Invalid size "${entry.size}" skipped for .${entry.className}.`);
70
+ else
71
+ decls.push(`--wavelo-size:${entry.size}`);
72
+ }
73
+ if (entry.color !== undefined) {
74
+ if (!SAFE_COLOR.test(entry.color))
75
+ diagnostics.push(`Invalid color "${entry.color}" skipped for .${entry.className}.`);
76
+ else
77
+ decls.push(`--wavelo-color:${entry.color}`);
78
+ }
79
+ if (decls.length > 0)
80
+ rules.push(`.${entry.className}{${decls.join(';')}}`);
81
+ }
82
+ const css = `${base.css}\n${rules.join('\n')}`.trim();
83
+ return {
84
+ css,
85
+ classCount: rules.length,
86
+ cssBytes: new TextEncoder().encode(css).byteLength,
87
+ diagnostics
88
+ };
89
+ }
@@ -0,0 +1,65 @@
1
+ export interface TaskRegistration {
2
+ weight?: number;
3
+ total?: number;
4
+ }
5
+ /**
6
+ * Sanitized failure record exposed through `TaskGroupSnapshot.errors`.
7
+ * Only the task id plus clipped `name`/`message` strings are retained; the
8
+ * original error object (and any payloads attached to it) is never stored.
9
+ */
10
+ export interface TaskFailureInfo {
11
+ id: string;
12
+ name: string;
13
+ message: string;
14
+ }
15
+ export interface TaskGroupSnapshot {
16
+ busy: boolean;
17
+ pendingCount: number;
18
+ completedCount: number;
19
+ failedCount: number;
20
+ cancelledCount: number;
21
+ totalCount: number;
22
+ indeterminate: boolean;
23
+ percent: number | undefined;
24
+ partialPercent: number | undefined;
25
+ /** Sanitized failure summaries for tasks currently in the `error` state, in registration order. */
26
+ errors: readonly TaskFailureInfo[];
27
+ disposed: boolean;
28
+ }
29
+ export interface TaskGroupOptions {
30
+ /**
31
+ * How many failure summaries `TaskGroupSnapshot.errors` retains at once. Past the cap the
32
+ * least recently failed task loses its summary; the task stays failed and still counts in
33
+ * `failedCount`. Default 20, minimum 1.
34
+ */
35
+ maxRetainedFailures?: number;
36
+ }
37
+ export interface TaskGroup {
38
+ getSnapshot: () => TaskGroupSnapshot;
39
+ subscribe: (listener: (snapshot: TaskGroupSnapshot) => void) => () => void;
40
+ register: (id: string, options?: TaskRegistration) => void;
41
+ start: (id: string, options?: TaskRegistration) => void;
42
+ update: (id: string, completed: number, total?: number) => void;
43
+ complete: (id: string) => void;
44
+ fail: (id: string, error?: unknown) => void;
45
+ cancel: (id: string) => void;
46
+ remove: (id: string) => void;
47
+ reset: () => void;
48
+ dispose: () => void;
49
+ }
50
+ /**
51
+ * Scoped task group and weighted progress aggregator (F03).
52
+ * Tracks multiple independent operations without scheduling the underlying work.
53
+ *
54
+ * Failure retention (F03 error reporting): `fail(id, error)` reduces the failure to
55
+ * a bounded `TaskFailureInfo` (`name` clipped to 64 characters, `message` to 280).
56
+ * Only these primitives are stored and exposed via `TaskGroupSnapshot.errors` in
57
+ * registration order; the original error object is not referenced, so attached
58
+ * payloads are released immediately. Re-`fail`ing a task replaces its summary,
59
+ * settling a task otherwise (success/cancel), restarting it, `remove`, `reset`, and
60
+ * `dispose` all drop its error entry, keeping retained failure data bounded by the
61
+ * live task count. `maxRetainedFailures` (default 20) caps how many summaries are
62
+ * kept at once; past the cap the least recently failed task loses its summary while
63
+ * staying failed, so retention is bounded by the option and not by how many tasks failed.
64
+ */
65
+ export declare function createTaskGroup(options?: TaskGroupOptions): TaskGroup;
package/dist/group.js ADDED
@@ -0,0 +1,235 @@
1
+ const MAX_FAILURE_NAME_LENGTH = 64;
2
+ const MAX_FAILURE_MESSAGE_LENGTH = 280;
3
+ function clipText(value, maxLength, fallback) {
4
+ const trimmed = typeof value === 'string' && value.length > 0 ? value : fallback;
5
+ return trimmed.length > maxLength ? trimmed.slice(0, maxLength) : trimmed;
6
+ }
7
+ /**
8
+ * Reduces an arbitrary failure value to bounded primitive strings so the snapshot
9
+ * never retains error objects, attached payloads, or large message bodies.
10
+ */
11
+ function sanitizeFailure(error) {
12
+ if (error === undefined)
13
+ return { name: 'Error', message: 'Task failed' };
14
+ if (typeof error === 'string') {
15
+ return { name: 'Error', message: clipText(error, MAX_FAILURE_MESSAGE_LENGTH, 'Task failed') };
16
+ }
17
+ if (typeof error === 'object' && error !== null) {
18
+ const record = error;
19
+ const name = typeof record.name === 'string' ? record.name : 'Error';
20
+ const message = typeof record.message === 'string' ? record.message : describeUnknownFailure(error);
21
+ return {
22
+ name: clipText(name, MAX_FAILURE_NAME_LENGTH, 'Error'),
23
+ message: clipText(message, MAX_FAILURE_MESSAGE_LENGTH, 'Task failed')
24
+ };
25
+ }
26
+ return { name: 'Error', message: clipText(describeUnknownFailure(error), MAX_FAILURE_MESSAGE_LENGTH, 'Task failed') };
27
+ }
28
+ function describeUnknownFailure(error) {
29
+ try {
30
+ return String(error);
31
+ }
32
+ catch {
33
+ return 'Task failed';
34
+ }
35
+ }
36
+ function assertValidWeight(weight) {
37
+ if (!Number.isFinite(weight) || weight <= 0) {
38
+ throw new RangeError(`Task weight must be a positive finite number; received ${weight}`);
39
+ }
40
+ return weight;
41
+ }
42
+ function sanitizeTotal(total) {
43
+ if (total === undefined)
44
+ return undefined;
45
+ if (!Number.isFinite(total) || total <= 0)
46
+ return undefined;
47
+ return total;
48
+ }
49
+ function computeSnapshot(tasks, disposed) {
50
+ let pendingCount = 0;
51
+ let completedCount = 0;
52
+ let failedCount = 0;
53
+ let cancelledCount = 0;
54
+ let knownWeightSum = 0;
55
+ let knownWeightedFraction = 0;
56
+ let hasUnknownProgress = false;
57
+ const errors = [];
58
+ for (const [id, task] of tasks.entries()) {
59
+ if (task.status === 'pending')
60
+ pendingCount++;
61
+ else if (task.status === 'success')
62
+ completedCount++;
63
+ else if (task.status === 'error') {
64
+ failedCount++;
65
+ if (task.error)
66
+ errors.push({ id, name: task.error.name, message: task.error.message });
67
+ }
68
+ else if (task.status === 'cancelled')
69
+ cancelledCount++;
70
+ if (task.total !== undefined) {
71
+ const fraction = task.status === 'success' ? 1 : Math.max(0, Math.min(1, task.completed / task.total));
72
+ knownWeightSum += task.weight;
73
+ knownWeightedFraction += task.weight * fraction;
74
+ }
75
+ else if (task.status !== 'cancelled') {
76
+ hasUnknownProgress = true;
77
+ }
78
+ }
79
+ const partialPercent = knownWeightSum > 0 ? Math.round((knownWeightedFraction / knownWeightSum) * 100) : undefined;
80
+ const indeterminate = tasks.size === 0 || hasUnknownProgress || partialPercent === undefined;
81
+ return {
82
+ busy: pendingCount > 0,
83
+ pendingCount,
84
+ completedCount,
85
+ failedCount,
86
+ cancelledCount,
87
+ totalCount: tasks.size,
88
+ indeterminate,
89
+ percent: indeterminate ? undefined : partialPercent,
90
+ partialPercent,
91
+ errors,
92
+ disposed
93
+ };
94
+ }
95
+ /**
96
+ * Scoped task group and weighted progress aggregator (F03).
97
+ * Tracks multiple independent operations without scheduling the underlying work.
98
+ *
99
+ * Failure retention (F03 error reporting): `fail(id, error)` reduces the failure to
100
+ * a bounded `TaskFailureInfo` (`name` clipped to 64 characters, `message` to 280).
101
+ * Only these primitives are stored and exposed via `TaskGroupSnapshot.errors` in
102
+ * registration order; the original error object is not referenced, so attached
103
+ * payloads are released immediately. Re-`fail`ing a task replaces its summary,
104
+ * settling a task otherwise (success/cancel), restarting it, `remove`, `reset`, and
105
+ * `dispose` all drop its error entry, keeping retained failure data bounded by the
106
+ * live task count. `maxRetainedFailures` (default 20) caps how many summaries are
107
+ * kept at once; past the cap the least recently failed task loses its summary while
108
+ * staying failed, so retention is bounded by the option and not by how many tasks failed.
109
+ */
110
+ export function createTaskGroup(options = {}) {
111
+ const maxRetainedFailures = Math.max(1, Math.floor(options.maxRetainedFailures ?? 20));
112
+ const tasks = new Map();
113
+ const listeners = new Set();
114
+ let disposed = false;
115
+ let failureCounter = 0;
116
+ let snapshot = computeSnapshot(tasks, false);
117
+ // Retention is bounded to the most recently failed tasks: past the cap the older summaries
118
+ // are dropped, and with them the strings they held. The tasks stay failed and still count
119
+ // in failedCount, so the cap bounds what the snapshot carries, never what happened.
120
+ const pruneRetention = () => {
121
+ const failed = [...tasks.values()].filter((task) => task.error !== undefined);
122
+ if (failed.length <= maxRetainedFailures)
123
+ return;
124
+ failed.sort((a, b) => (a.failureSeq ?? 0) - (b.failureSeq ?? 0));
125
+ for (const task of failed.slice(0, failed.length - maxRetainedFailures)) {
126
+ task.error = undefined;
127
+ task.failureSeq = undefined;
128
+ }
129
+ };
130
+ const emit = () => {
131
+ snapshot = computeSnapshot(tasks, disposed);
132
+ if (disposed)
133
+ return;
134
+ for (const listener of [...listeners]) {
135
+ listener(snapshot);
136
+ }
137
+ };
138
+ const upsert = (id, status, options = {}) => {
139
+ if (disposed)
140
+ return;
141
+ const existing = tasks.get(id);
142
+ const weight = options.weight !== undefined ? assertValidWeight(options.weight) : (existing?.weight ?? 1);
143
+ const total = options.total !== undefined ? sanitizeTotal(options.total) : existing?.total;
144
+ tasks.set(id, {
145
+ weight,
146
+ completed: existing?.completed ?? 0,
147
+ total,
148
+ status
149
+ });
150
+ emit();
151
+ };
152
+ const settleTask = (id, status, error) => {
153
+ if (disposed)
154
+ return;
155
+ const task = tasks.get(id);
156
+ if (!task)
157
+ return;
158
+ if (status === 'error') {
159
+ const info = sanitizeFailure(error);
160
+ const unchanged = task.status === 'error' && task.error && task.error.name === info.name && task.error.message === info.message;
161
+ if (unchanged)
162
+ return;
163
+ task.status = 'error';
164
+ task.error = info;
165
+ task.failureSeq = ++failureCounter;
166
+ pruneRetention();
167
+ emit();
168
+ return;
169
+ }
170
+ if (task.status === status)
171
+ return;
172
+ task.status = status;
173
+ task.error = undefined;
174
+ task.failureSeq = undefined;
175
+ if (status === 'success' && task.total !== undefined) {
176
+ task.completed = task.total;
177
+ }
178
+ emit();
179
+ };
180
+ return {
181
+ getSnapshot: () => snapshot,
182
+ subscribe: (listener) => {
183
+ if (disposed)
184
+ return () => { };
185
+ listeners.add(listener);
186
+ return () => {
187
+ listeners.delete(listener);
188
+ };
189
+ },
190
+ register: (id, options) => upsert(id, 'idle', options),
191
+ start: (id, options) => upsert(id, 'pending', options),
192
+ update: (id, completed, total) => {
193
+ if (disposed)
194
+ return;
195
+ const task = tasks.get(id);
196
+ if (!task)
197
+ return;
198
+ if (total !== undefined)
199
+ task.total = sanitizeTotal(total);
200
+ if (Number.isFinite(completed) && completed >= 0) {
201
+ task.completed = completed;
202
+ }
203
+ emit();
204
+ },
205
+ complete: (id) => settleTask(id, 'success'),
206
+ fail: (id, error) => settleTask(id, 'error', error),
207
+ cancel: (id) => settleTask(id, 'cancelled'),
208
+ remove: (id) => {
209
+ if (disposed || !tasks.delete(id))
210
+ return;
211
+ emit();
212
+ },
213
+ reset: () => {
214
+ if (disposed)
215
+ return;
216
+ tasks.clear();
217
+ emit();
218
+ },
219
+ dispose: () => {
220
+ if (disposed)
221
+ return;
222
+ disposed = true;
223
+ tasks.clear();
224
+ // Same terminal-notification rule as the controller: a subscriber that is still
225
+ // attached learns the group is empty and disposed instead of holding a busy state.
226
+ const final = computeSnapshot(tasks, true);
227
+ const notify = [...listeners];
228
+ listeners.clear();
229
+ snapshot = final;
230
+ for (const listener of notify) {
231
+ listener(final);
232
+ }
233
+ }
234
+ };
235
+ }
@@ -0,0 +1,6 @@
1
+ export { createLoadingController } from './controller.js';
2
+ export { createTaskGroup } from './group.js';
3
+ export { createAnnouncementPolicy } from './announcer.js';
4
+ export type { LoadingController, LoadingControllerOptions, LoadingSnapshot, LoadingStatus, OperationContext, ProgressSnapshot, StartOperationOptions, TimerScheduler } from './types.js';
5
+ export type { TaskGroup, TaskGroupOptions, TaskGroupSnapshot, TaskRegistration, TaskFailureInfo } from './group.js';
6
+ export type { AnnouncementEvent, AnnouncementKind, AnnouncementMessages, AnnouncementPolicy, AnnouncementPolicyOptions } from './announcer.js';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { createLoadingController } from './controller.js';
2
+ export { createTaskGroup } from './group.js';
3
+ export { createAnnouncementPolicy } from './announcer.js';
@@ -0,0 +1,101 @@
1
+ import type { LoadingController, OperationContext, TimerScheduler } from './types.js';
2
+ export interface StallSnapshot {
3
+ stalled: boolean;
4
+ reason: string | undefined;
5
+ deadlineMs: number | undefined;
6
+ }
7
+ /**
8
+ * Stall explanation & recovery monitor (F35).
9
+ * Distinguishes elapsed slowness from lack of observed progress updates.
10
+ */
11
+ export declare function createStallMonitor(controller: LoadingController, options?: {
12
+ stallTimeoutMs?: number;
13
+ scheduler?: TimerScheduler;
14
+ }): {
15
+ getSnapshot: () => StallSnapshot;
16
+ subscribe(listener: (s: StallSnapshot) => void): () => boolean;
17
+ setReason(reason: string, deadlineMs?: number): void;
18
+ dispose(): void;
19
+ };
20
+ export type WorkerProgressMessageType = 'progress' | 'complete' | 'error' | 'cancel';
21
+ export interface WorkerProgressEnvelope {
22
+ v: 1;
23
+ operationId: number;
24
+ seq: number;
25
+ type: WorkerProgressMessageType;
26
+ value?: number;
27
+ max?: number;
28
+ }
29
+ export interface MessagePortLike {
30
+ addEventListener: (type: 'message', listener: (event: {
31
+ data: unknown;
32
+ }) => void) => void;
33
+ removeEventListener: (type: 'message', listener: (event: {
34
+ data: unknown;
35
+ }) => void) => void;
36
+ }
37
+ export interface WorkerCancelRequest {
38
+ operationId: number | null;
39
+ }
40
+ export interface WorkerProgressBridgeOptions {
41
+ /**
42
+ * Explicit operation to bridge. Defaults to the controller's current pending
43
+ * operation (if any). The bridge never starts or disposes an operation itself.
44
+ */
45
+ operation?: OperationContext;
46
+ /**
47
+ * Bounded progress application rate. Within one window only the latest
48
+ * buffered value is applied. Default 50ms; 0 applies every valid update.
49
+ */
50
+ coalesceMs?: number;
51
+ /** Timer scheduler for the coalescing window (defaults to real timers). */
52
+ scheduler?: TimerScheduler;
53
+ /** Convenience callback fired on `requestCancel()`, equivalent to subscribing via `onCancelRequest`. */
54
+ onCancelRequest?: (request: WorkerCancelRequest) => void;
55
+ }
56
+ export interface WorkerProgressBridge {
57
+ /** Id of the currently bridged operation, or null when detached. */
58
+ readonly operationId: number | null;
59
+ /** True while a cancellation has been requested but not yet acknowledged by an inbound `cancel` envelope. */
60
+ readonly cancelRequested: boolean;
61
+ /** (Re)bind to an explicit operation or the controller's current pending one; resets sequence and coalescing state. */
62
+ attach: (operation?: OperationContext) => number | null;
63
+ /** Apply the buffered progress update immediately. */
64
+ flush: () => void;
65
+ /**
66
+ * Emit an explicit cancellation request so the application can forward it over
67
+ * its worker channel. Cancellation is a request until the worker acknowledges
68
+ * with a `cancel` envelope; the bridged operation is not settled here.
69
+ */
70
+ requestCancel: () => void;
71
+ onCancelRequest: (listener: (request: WorkerCancelRequest) => void) => () => void;
72
+ dispose: () => void;
73
+ }
74
+ /**
75
+ * Worker progress bridge (F36).
76
+ * Validates versioned envelopes, rejects stale operationIds and out-of-order seq
77
+ * numbers, coalesces progress updates to a bounded application rate, and never
78
+ * starts or disposes the application-owned controller as a side effect.
79
+ * Construction bridges the supplied operation or the controller's current pending
80
+ * operation; when neither exists, messages are rejected until `attach()` binds one.
81
+ * Transport cancellation is surfaced as an explicit request event rather than
82
+ * pretended to be acknowledged: only an inbound `cancel` envelope settles the
83
+ * operation as cancelled. Releasing the bridge removes port listeners and timers
84
+ * only — the application's worker, controller, and in-flight operation survive.
85
+ */
86
+ export declare function createWorkerProgressBridge(port: MessagePortLike, controller: LoadingController, options?: WorkerProgressBridgeOptions): WorkerProgressBridge;
87
+ /**
88
+ * Truthful progress smoother (F42).
89
+ * Interpolates displayValue toward the latest confirmed value without ever exceeding it,
90
+ * snapping immediately on reset/lower values and disabling smoothing under reduced motion.
91
+ */
92
+ export declare function createTruthfulSmoother(options?: {
93
+ reducedMotion?: boolean;
94
+ stepFactor?: number;
95
+ }): {
96
+ getDisplayValue: () => number | undefined;
97
+ getConfirmedValue: () => number | undefined;
98
+ push(nextValue: number | undefined): number | undefined;
99
+ tick(): number | undefined;
100
+ reset(): void;
101
+ };