@askrjs/askr 0.2.3 → 0.3.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 (117) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/access-CEA2pOry.js +1046 -0
  3. package/dist/actions/index.d.ts +16 -2
  4. package/dist/actions/index.js +5 -5
  5. package/dist/{activity-ZxJXI9hF.js → activity-oy2YFTFF.js} +22 -16
  6. package/dist/benchmark.js +8 -9
  7. package/dist/boot/index.d.ts +21 -9
  8. package/dist/boot/index.js +1 -1
  9. package/dist/{boot-D4GaLA0d.js → boot-BMBMWUGI.js} +680 -440
  10. package/dist/capabilities-Bbf0mlp9.js +42 -0
  11. package/dist/components/index.d.ts +11 -8
  12. package/dist/components/index.js +1 -1
  13. package/dist/{compose-ref-Bfaf4kUC.js → compose-ref-v0qGlHoN.js} +7 -1
  14. package/dist/control/index.d.ts +20 -2
  15. package/dist/control/index.js +1 -1
  16. package/dist/{control-57x3wa4J.js → control-BR_mrX__.js} +4 -4
  17. package/dist/core.d.ts +163 -0
  18. package/dist/csp-nonce-BfFWcd0w.js +173 -0
  19. package/dist/data/index.d.ts +74 -2
  20. package/dist/data/index.js +3 -3
  21. package/dist/{data-B7XCDeC8.js → data-2edW0jhF.js} +133 -138
  22. package/dist/{data-runtime-7t_Y0iv3.js → data-runtime-CxoY98lX.js} +22 -15
  23. package/dist/{deferred-BELyvMsC.js → deferred-CbgNhf67.js} +5 -5
  24. package/dist/dom-renderer.d.ts +77 -0
  25. package/dist/domains/actions.d.ts +70 -0
  26. package/dist/domains/component.d.ts +119 -0
  27. package/dist/domains/context.d.ts +73 -0
  28. package/dist/domains/control.d.ts +328 -0
  29. package/dist/domains/data.d.ts +461 -0
  30. package/dist/domains/diagnostics.d.ts +21 -0
  31. package/dist/domains/lifecycle.d.ts +112 -0
  32. package/dist/domains/refs.d.ts +18 -0
  33. package/dist/domains/renderer.d.ts +127 -0
  34. package/dist/domains/routing.d.ts +501 -0
  35. package/dist/domains/scheduler.d.ts +79 -0
  36. package/dist/domains/server.d.ts +112 -0
  37. package/dist/domains/state.d.ts +129 -0
  38. package/dist/domains/telemetry.d.ts +29 -0
  39. package/dist/eager-control.d.ts +8 -0
  40. package/dist/{effect-4LwBwV58.js → effect-C3Zsc1k6.js} +14 -41
  41. package/dist/{types-DkVJhVs9.d.ts → elements.d.ts} +84 -42
  42. package/dist/{for-internal-DeoSg_AV.js → for-state-BDykeOJL.js} +623 -511
  43. package/dist/foundations/icon/index.d.ts +67 -16
  44. package/dist/foundations/icon/index.js +1 -1
  45. package/dist/foundations/index.d.ts +26 -3
  46. package/dist/foundations/index.js +1 -1
  47. package/dist/foundations/interactions/index.d.ts +73 -34
  48. package/dist/foundations/interactions/index.js +1 -1
  49. package/dist/foundations/state/index.d.ts +12 -5
  50. package/dist/foundations/state/index.js +1 -1
  51. package/dist/foundations/structures/index.d.ts +44 -3
  52. package/dist/foundations/structures/index.js +1 -1
  53. package/dist/foundations/utilities/index.d.ts +34 -3
  54. package/dist/foundations/utilities/index.js +1 -1
  55. package/dist/fx/index.d.ts +72 -25
  56. package/dist/fx/index.js +8 -8
  57. package/dist/index.d.ts +121 -4
  58. package/dist/index.js +316 -47
  59. package/dist/{component-internal-Dl02WQKS.js → instance-VAFYVJOa.js} +495 -283
  60. package/dist/{interactions-D102JxBR.js → interactions-CTeACdT_.js} +1 -1
  61. package/dist/jsx-dev-runtime.d.ts +51 -11
  62. package/dist/jsx-globals.d.ts +2 -0
  63. package/dist/jsx-runtime-CPJXAOBF.js +43 -0
  64. package/dist/jsx-runtime.d.ts +17 -3
  65. package/dist/jsx-runtime.js +2 -42
  66. package/dist/jsx.d.ts +108 -0
  67. package/dist/{manifest-D6rfj_jC.js → manifest-D1P3UNWV.js} +4 -9
  68. package/dist/{navigate-C46GtScG.js → navigate-prC5V8XV.js} +204 -476
  69. package/dist/{navigate-wel1e6cU.d.ts → navigation.d.ts} +10 -8
  70. package/dist/{readable-CEcteIDE.js → notify-DxxuDPeY.js} +96 -34
  71. package/dist/{query-registry-Bua3cDyb.js → query-registry-LrYpQsDJ.js} +1 -1
  72. package/dist/{compose-ref-DOJHoW5X.d.ts → refs.d.ts} +11 -7
  73. package/dist/{ssr-BaC5qHEw.js → render-resolved-BC0W7_5b.js} +165 -558
  74. package/dist/{renderer-BhXofszH.js → renderer-CT0HeY58.js} +6866 -5715
  75. package/dist/{resolution-t8J0yNaU.js → resolution-3DskUkjG.js} +189 -180
  76. package/dist/{resource-operation-B8q-QRUx.js → resource-18-sFRl9.js} +98 -58
  77. package/dist/resources/index.d.ts +64 -46
  78. package/dist/resources/index.js +215 -9
  79. package/dist/route-activity.d.ts +21 -0
  80. package/dist/{route-matching-Bo6UqG-5.js → route-matching-CUzZ31gT.js} +68 -82
  81. package/dist/router/index.d.ts +378 -79
  82. package/dist/router/index.js +9 -9
  83. package/dist/router-internal-7nuNEHfG.js +36 -0
  84. package/dist/scope-Cq_iYbTR.js +403 -0
  85. package/dist/{selector-C7rIpOnN.js → selector-BSPVkjKP.js} +41 -41
  86. package/dist/{shared-CGrx2AOL.js → shared-kU8yvryp.js} +3 -6
  87. package/dist/{snapshot-source-BB42xgwb.js → snapshot-source-An4iKajG.js} +1 -1
  88. package/dist/ssg/index.d.ts +51 -15
  89. package/dist/ssg/index.js +269 -209
  90. package/dist/ssr/index.d.ts +121 -68
  91. package/dist/ssr/index.js +2 -1
  92. package/dist/ssr-CiNm6Vzl.js +393 -0
  93. package/dist/{ssr-DSHd_Q9K.js → ssr-EPjwJH5R.js} +5 -1
  94. package/dist/{state-BzhOW2TX.js → state-BXJfudq1.js} +10 -15
  95. package/dist/{structures-BwfeO4Iz.js → structures-CjEzfj4h.js} +37 -57
  96. package/dist/{index-r5THqzPN.d.ts → structures.d.ts} +57 -36
  97. package/dist/testing/index.d.ts +125 -24
  98. package/dist/testing/index.js +26 -62
  99. package/dist/timer-C7uqnJVt.js +85 -0
  100. package/dist/{index-B1gu0_m0.d.ts → utilities.d.ts} +24 -13
  101. package/dist/{verify-hydration-_Q6avFp0.js → verify-hydration-ikaxotf7.js} +8 -5
  102. package/package.json +13 -15
  103. package/dist/access-Rr7CMa06.js +0 -507
  104. package/dist/activity-CAJ5eho-.d.ts +0 -14
  105. package/dist/benchmark.d.ts +0 -26
  106. package/dist/cleanup-DsrbV-rr.js +0 -535
  107. package/dist/component-cleanup-DjpwO9WX.js +0 -143
  108. package/dist/component-scope-4I3yEMkb.js +0 -195
  109. package/dist/control-DdFw-Caz.d.ts +0 -8
  110. package/dist/csp-nonce-C9OuML0U.js +0 -72
  111. package/dist/css-BuPaTOfe.js +0 -70
  112. package/dist/fastlane-Buz1Rvlr.js +0 -166
  113. package/dist/index-DSqXWc77.d.ts +0 -1402
  114. package/dist/jsx-runtime-BTzDdBJ_.d.ts +0 -2
  115. package/dist/jsx-runtime-Cdd6Gkb0.d.ts +0 -38
  116. package/dist/lifecycle-batch-Be-CLDjV.js +0 -253
  117. package/dist/lifecycle-operations-C5m03NQc.js +0 -195
@@ -1,507 +0,0 @@
1
- import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-4I3yEMkb.js";
2
- //#region src/common/env.ts
3
- function normalizeEnv(source) {
4
- if (!source) return {};
5
- const normalized = {};
6
- for (const [key, value] of Object.entries(source)) if (typeof value === "string") normalized[key] = value;
7
- else if (typeof value === "boolean" || typeof value === "number") normalized[key] = String(value);
8
- return normalized;
9
- }
10
- function getBuildTimeEnv() {
11
- const metaEnv = import.meta.env;
12
- const normalized = normalizeEnv(metaEnv);
13
- if (normalized.NODE_ENV == null && metaEnv) {
14
- if (typeof metaEnv.MODE === "string" && metaEnv.MODE.length > 0) normalized.NODE_ENV = metaEnv.MODE;
15
- else if (metaEnv.PROD === true || metaEnv.PROD === "true") normalized.NODE_ENV = "production";
16
- else if (metaEnv.DEV === true || metaEnv.DEV === "true") normalized.NODE_ENV = "development";
17
- }
18
- return normalized;
19
- }
20
- function resolveNodeEnv(processNodeEnv, buildNodeEnv) {
21
- if (buildNodeEnv === "production") return "production";
22
- if (processNodeEnv != null) return processNodeEnv;
23
- if (buildNodeEnv === "development") return "development";
24
- return buildNodeEnv === "test" ? void 0 : buildNodeEnv;
25
- }
26
- function getRuntimeEnv() {
27
- const processEnv = globalThis.process?.env ?? {};
28
- const buildTimeEnv = getBuildTimeEnv();
29
- return {
30
- ...processEnv,
31
- ...buildTimeEnv,
32
- NODE_ENV: resolveNodeEnv(processEnv.NODE_ENV, buildTimeEnv.NODE_ENV)
33
- };
34
- }
35
- function isProductionEnvironment() {
36
- return getRuntimeEnv().NODE_ENV === "production";
37
- }
38
- function isDevelopmentEnvironment() {
39
- return !isProductionEnvironment();
40
- }
41
- //#endregion
42
- //#region src/common/invariant.ts
43
- /**
44
- * Invariant assertions shared by production runtime code.
45
- */
46
- function invariant(condition, message, context) {
47
- if (!condition) {
48
- const contextStr = context ? "\n" + JSON.stringify(context, null, 2) : "";
49
- throw new Error(`[Askr Invariant] ${message}${contextStr}`);
50
- }
51
- }
52
- function assertSchedulingPrecondition(condition, violationMessage) {
53
- invariant(condition, `[Scheduler Precondition] ${violationMessage}`);
54
- }
55
- //#endregion
56
- //#region src/common/logger.ts
57
- /**
58
- * Shared logger interface for runtime and tooling code.
59
- *
60
- * Debug, info, and warn stay silent in production. Errors always log.
61
- */
62
- function callConsole(method, args) {
63
- const c = typeof console !== "undefined" ? console : void 0;
64
- if (!c) return;
65
- const fn = c[method];
66
- if (typeof fn === "function") try {
67
- fn.apply(console, args);
68
- } catch {}
69
- }
70
- const logger = {
71
- debug: (...args) => {
72
- if (isProductionEnvironment()) return;
73
- callConsole("debug", args);
74
- },
75
- info: (...args) => {
76
- if (isProductionEnvironment()) return;
77
- callConsole("info", args);
78
- },
79
- warn: (...args) => {
80
- if (isProductionEnvironment()) return;
81
- callConsole("warn", args);
82
- },
83
- error: (...args) => {
84
- callConsole("error", args);
85
- }
86
- };
87
- //#endregion
88
- //#region src/runtime/perf-metrics.ts
89
- const incrementPerfMetric = () => {};
90
- const addPerfDuration = () => {};
91
- //#endregion
92
- //#region src/runtime/scheduler.ts
93
- /**
94
- * Serialized update scheduler — safer design (no inline execution, explicit flush)
95
- *
96
- * Key ideas:
97
- * - Never execute a task inline from `enqueue`.
98
- * - `flush()` is explicit and non-reentrant.
99
- * - `runWithSyncProgress()` allows enqueues temporarily but does not run tasks
100
- * inline; it runs `fn` and then does an explicit `flush()`.
101
- * - `waitForFlush()` is race-free with a monotonic `flushVersion`.
102
- */
103
- const MAX_FLUSH_DEPTH = 50;
104
- const SCHEDULER_LANES = [
105
- "derived",
106
- "component",
107
- "reactive",
108
- "post"
109
- ];
110
- var Scheduler = class {
111
- constructor() {
112
- this.bulkCommitProbe = () => false;
113
- this.lanes = {
114
- derived: {
115
- tasks: [],
116
- head: 0
117
- },
118
- component: {
119
- tasks: [],
120
- head: 0
121
- },
122
- reactive: {
123
- tasks: [],
124
- head: 0
125
- },
126
- post: {
127
- tasks: [],
128
- head: 0
129
- }
130
- };
131
- this.running = false;
132
- this.inHandler = false;
133
- this.depth = 0;
134
- this.executionDepth = 0;
135
- this.flushVersion = 0;
136
- this.kickScheduled = false;
137
- this.allowSyncProgress = false;
138
- this.waiters = [];
139
- this.taskCount = 0;
140
- }
141
- setBulkCommitProbe(probe) {
142
- this.bulkCommitProbe = probe;
143
- }
144
- isBulkCommitActive() {
145
- try {
146
- return this.bulkCommitProbe();
147
- } catch (e) {
148
- return false;
149
- }
150
- }
151
- hasPendingTasks() {
152
- for (const lane of SCHEDULER_LANES) {
153
- const queue = this.lanes[lane];
154
- if (queue.head < queue.tasks.length) return true;
155
- }
156
- return false;
157
- }
158
- getPendingTaskCount() {
159
- let total = 0;
160
- for (const lane of SCHEDULER_LANES) {
161
- const queue = this.lanes[lane];
162
- total += queue.tasks.length - queue.head;
163
- }
164
- return total;
165
- }
166
- compactLane(queue) {
167
- if (queue.head >= queue.tasks.length) {
168
- queue.tasks.length = 0;
169
- queue.head = 0;
170
- return;
171
- }
172
- if (queue.head <= 0) return;
173
- const remaining = queue.tasks.length - queue.head;
174
- for (let i = 0; i < remaining; i++) queue.tasks[i] = queue.tasks[queue.head + i];
175
- queue.tasks.length = remaining;
176
- queue.head = 0;
177
- }
178
- scheduleFlushKick() {
179
- if (this.running || this.kickScheduled || this.inHandler || this.allowSyncProgress || this.isBulkCommitActive() || !this.hasPendingTasks()) return;
180
- this.kickScheduled = true;
181
- queueMicrotask(() => {
182
- this.kickScheduled = false;
183
- if (this.running || this.isBulkCommitActive() || !this.hasPendingTasks()) return;
184
- try {
185
- this.flush();
186
- } catch (err) {
187
- setTimeout(() => {
188
- throw err;
189
- });
190
- }
191
- });
192
- }
193
- enqueue(task) {
194
- this.enqueueInLane("component", task);
195
- }
196
- enqueueInLane(lane, task) {
197
- assertSchedulingPrecondition(typeof task === "function", "enqueue() requires a function");
198
- if (this.isBulkCommitActive() && !this.allowSyncProgress) {
199
- if (isDevelopmentEnvironment()) throw new Error("[Scheduler] enqueue() during bulk commit (not allowed)");
200
- return;
201
- }
202
- this.lanes[lane].tasks.push(task);
203
- this.taskCount++;
204
- this.scheduleFlushKick();
205
- }
206
- flush() {
207
- invariant(!this.running, "[Scheduler] flush() called while already running");
208
- if (isDevelopmentEnvironment()) {
209
- if (this.isBulkCommitActive() && !this.allowSyncProgress) throw new Error("[Scheduler] flush() started during bulk commit (not allowed)");
210
- }
211
- this.running = true;
212
- this.depth = 0;
213
- const failures = [];
214
- let executedTaskCount = 0;
215
- const executionsByTask = isDevelopmentEnvironment() ? /* @__PURE__ */ new Map() : null;
216
- try {
217
- while (true) {
218
- let didRunTask = false;
219
- for (const lane of SCHEDULER_LANES) {
220
- const laneQueue = this.lanes[lane];
221
- let executedInLane = 0;
222
- while (laneQueue.head < laneQueue.tasks.length) {
223
- const task = laneQueue.tasks[laneQueue.head++];
224
- if (executionsByTask) {
225
- const taskExecutions = (executionsByTask.get(task) ?? 0) + 1;
226
- executionsByTask.set(task, taskExecutions);
227
- this.depth = Math.max(this.depth, taskExecutions);
228
- if (taskExecutions > MAX_FLUSH_DEPTH) throw new Error(`[Scheduler] exceeded MAX_FLUSH_DEPTH (${MAX_FLUSH_DEPTH}). Likely infinite update loop.`);
229
- }
230
- try {
231
- this.executionDepth++;
232
- task();
233
- } catch (err) {
234
- failures.push(err);
235
- } finally {
236
- if (this.executionDepth > 0) this.executionDepth--;
237
- executedTaskCount++;
238
- executedInLane++;
239
- didRunTask = true;
240
- }
241
- }
242
- if (executedInLane > 0) this.taskCount = Math.max(0, this.taskCount - executedInLane);
243
- }
244
- if (!didRunTask) break;
245
- }
246
- } finally {
247
- this.running = false;
248
- this.depth = 0;
249
- this.executionDepth = 0;
250
- for (const lane of SCHEDULER_LANES) {
251
- const queue = this.lanes[lane];
252
- if (queue.head > 0) this.compactLane(queue);
253
- }
254
- this.flushVersion++;
255
- this.resolveWaiters();
256
- }
257
- if (failures.length === 1) throw failures[0];
258
- if (failures.length > 1) throw new AggregateError(failures, "Scheduler task failures");
259
- }
260
- runWithSyncProgress(fn) {
261
- const prev = this.allowSyncProgress;
262
- this.allowSyncProgress = true;
263
- const startVersion = this.flushVersion;
264
- try {
265
- const res = fn();
266
- if (!this.running && this.hasPendingTasks()) this.flush();
267
- if (isDevelopmentEnvironment()) {
268
- if (!this.running && this.hasPendingTasks()) throw new Error("[Scheduler] tasks remain after runWithSyncProgress flush");
269
- }
270
- return res;
271
- } finally {
272
- try {
273
- if (this.flushVersion === startVersion) {
274
- this.flushVersion++;
275
- this.resolveWaiters();
276
- }
277
- } catch (e) {}
278
- this.allowSyncProgress = prev;
279
- }
280
- }
281
- waitForFlush(targetVersion, timeoutMs = 2e3) {
282
- const target = typeof targetVersion === "number" ? targetVersion : this.flushVersion + 1;
283
- if (this.flushVersion >= target) return Promise.resolve();
284
- return new Promise((resolve, reject) => {
285
- const waiter = {
286
- target,
287
- resolve,
288
- reject
289
- };
290
- waiter.timer = setTimeout(() => {
291
- const index = this.waiters.indexOf(waiter);
292
- if (index >= 0) this.waiters.splice(index, 1);
293
- if (waiter.timer !== void 0) clearTimeout(waiter.timer);
294
- const diag = {
295
- flushVersion: this.flushVersion,
296
- queueLen: this.getPendingTaskCount(),
297
- running: this.running,
298
- inHandler: this.inHandler,
299
- bulk: this.isBulkCommitActive()
300
- };
301
- reject(/* @__PURE__ */ new Error(`waitForFlush timeout ${timeoutMs}ms: ${JSON.stringify(diag)}`));
302
- }, timeoutMs);
303
- this.waiters.push(waiter);
304
- });
305
- }
306
- getState() {
307
- return {
308
- queueLength: this.getPendingTaskCount(),
309
- running: this.running,
310
- depth: this.depth,
311
- executionDepth: this.executionDepth,
312
- taskCount: this.taskCount,
313
- flushVersion: this.flushVersion,
314
- laneQueues: {
315
- derived: this.lanes.derived.tasks.length - this.lanes.derived.head,
316
- component: this.lanes.component.tasks.length - this.lanes.component.head,
317
- reactive: this.lanes.reactive.tasks.length - this.lanes.reactive.head,
318
- post: this.lanes.post.tasks.length - this.lanes.post.head
319
- },
320
- inHandler: this.inHandler,
321
- allowSyncProgress: this.allowSyncProgress
322
- };
323
- }
324
- getFlushVersion() {
325
- return this.flushVersion;
326
- }
327
- flushIfQueued() {
328
- if (!this.running && this.hasPendingTasks()) this.flush();
329
- }
330
- runInHandlerScope(fn, flushMode = "defer") {
331
- const prevInHandler = this.inHandler;
332
- this.inHandler = true;
333
- try {
334
- return fn();
335
- } finally {
336
- this.inHandler = prevInHandler;
337
- if (!this.inHandler) if (flushMode === "sync") this.flushIfQueued();
338
- else this.scheduleFlushKick();
339
- }
340
- }
341
- setInHandler(v) {
342
- this.inHandler = v;
343
- if (!v) this.scheduleFlushKick();
344
- }
345
- isInHandler() {
346
- return this.inHandler;
347
- }
348
- isExecuting() {
349
- return this.running || this.executionDepth > 0;
350
- }
351
- clearPendingSyncTasks() {
352
- const remaining = this.getPendingTaskCount();
353
- if (remaining <= 0) return 0;
354
- if (this.running) {
355
- for (const lane of SCHEDULER_LANES) {
356
- const queue = this.lanes[lane];
357
- queue.tasks.length = queue.head;
358
- }
359
- this.taskCount = Math.max(0, this.taskCount - remaining);
360
- queueMicrotask(() => {
361
- try {
362
- this.flushVersion++;
363
- this.resolveWaiters();
364
- } catch (e) {}
365
- });
366
- return remaining;
367
- }
368
- for (const lane of SCHEDULER_LANES) {
369
- const queue = this.lanes[lane];
370
- queue.tasks.length = 0;
371
- queue.head = 0;
372
- }
373
- this.taskCount = Math.max(0, this.taskCount - remaining);
374
- this.flushVersion++;
375
- this.resolveWaiters();
376
- return remaining;
377
- }
378
- resolveWaiters() {
379
- if (this.waiters.length === 0) return;
380
- const ready = [];
381
- const remaining = [];
382
- for (const w of this.waiters) if (this.flushVersion >= w.target) {
383
- if (w.timer !== void 0) clearTimeout(w.timer);
384
- ready.push(w.resolve);
385
- } else remaining.push(w);
386
- this.waiters = remaining;
387
- for (const r of ready) r();
388
- }
389
- };
390
- const globalScheduler = new Scheduler();
391
- function scheduleEventHandler(handler) {
392
- return (event) => {
393
- try {
394
- globalScheduler.runInHandlerScope(() => {
395
- handler.call(null, event);
396
- });
397
- } catch (error) {
398
- logger.error("[Askr] Event handler error:", error);
399
- }
400
- };
401
- }
402
- //#endregion
403
- //#region src/runtime/runtime.ts
404
- function createMissingRendererHost() {
405
- const missing = (method) => {
406
- throw new Error(`[Askr] renderer host is not configured; cannot call ${method}().`);
407
- };
408
- return {
409
- evaluate() {
410
- missing("evaluate");
411
- },
412
- cleanupInstancesUnder() {
413
- missing("cleanupInstancesUnder");
414
- },
415
- replaceComponentRange() {
416
- return missing("replaceComponentRange");
417
- },
418
- teardownNodeSubtree() {
419
- missing("teardownNodeSubtree");
420
- },
421
- populateKeyMapForElement() {},
422
- getKeyMapForElement() {},
423
- isKeyedReorderFastPathEligible() {
424
- return {
425
- useFastPath: false,
426
- totalKeyed: 0,
427
- totalChildren: 0,
428
- currentKeyCount: 0,
429
- moveCount: 0,
430
- lisLen: 0,
431
- hasPropChanges: false,
432
- isWholeKeyedList: false
433
- };
434
- },
435
- markReactivePropsDirtySource() {}
436
- };
437
- }
438
- /** A scheduler + renderer host pairing; owns scheduling and renderer wiring for an app instance. */
439
- var AskrRuntime = class {
440
- constructor(options = {}) {
441
- this.scheduler = options.scheduler ?? globalScheduler;
442
- this.rendererHost = options.renderer ?? createMissingRendererHost();
443
- }
444
- get renderer() {
445
- return this.rendererHost;
446
- }
447
- configureRenderer(renderer) {
448
- this.rendererHost = renderer;
449
- }
450
- };
451
- const defaultRuntime = new AskrRuntime({ scheduler: globalScheduler });
452
- /** Create a new {@link AskrRuntime} instance with its own scheduler/renderer wiring. */
453
- function createRuntime(options = {}) {
454
- return new AskrRuntime(options);
455
- }
456
- /** Get the process-wide default {@link AskrRuntime}. */
457
- function getDefaultRuntime() {
458
- return defaultRuntime;
459
- }
460
- function configureRuntimeRenderer(renderer, runtime = defaultRuntime) {
461
- runtime.configureRenderer(renderer);
462
- }
463
- //#endregion
464
- //#region src/runtime/access.ts
465
- function getRuntimeScheduler() {
466
- return getDefaultRuntime().scheduler;
467
- }
468
- function getDefaultRuntimeInstance() {
469
- return getDefaultRuntime();
470
- }
471
- function getRuntimeRenderer() {
472
- return getDefaultRuntime().renderer;
473
- }
474
- function enqueueRuntimeTask(task) {
475
- getRuntimeScheduler().enqueue(task);
476
- }
477
- function enqueueRuntimeLane(lane, task) {
478
- getRuntimeScheduler().enqueueInLane(lane, task);
479
- }
480
- function runRuntimeHandlerScope(fn, flushMode = "defer") {
481
- const savedScope = clearCurrentComponentScope();
482
- try {
483
- return getRuntimeScheduler().runInHandlerScope(fn, flushMode);
484
- } finally {
485
- restoreCurrentComponentScope(savedScope);
486
- }
487
- }
488
- function runRuntimeWithSyncProgress(fn) {
489
- return getRuntimeScheduler().runWithSyncProgress(fn);
490
- }
491
- function isRuntimeSchedulerExecuting() {
492
- return getRuntimeScheduler().isExecuting();
493
- }
494
- function getRuntimeFlushVersion() {
495
- return getRuntimeScheduler().getFlushVersion();
496
- }
497
- function flushRuntimeScheduler() {
498
- getRuntimeScheduler().flush();
499
- }
500
- function setRuntimeBulkCommitProbe(probe) {
501
- getRuntimeScheduler().setBulkCommitProbe(probe);
502
- }
503
- function markRuntimeReactivePropsDirtySource(source) {
504
- getRuntimeRenderer().markReactivePropsDirtySource(source);
505
- }
506
- //#endregion
507
- export { isProductionEnvironment as S, addPerfDuration as _, getRuntimeFlushVersion as a, getRuntimeEnv as b, markRuntimeReactivePropsDirtySource as c, setRuntimeBulkCommitProbe as d, AskrRuntime as f, scheduleEventHandler as g, getDefaultRuntime as h, getDefaultRuntimeInstance as i, runRuntimeHandlerScope as l, createRuntime as m, enqueueRuntimeTask as n, getRuntimeRenderer as o, configureRuntimeRenderer as p, flushRuntimeScheduler as r, isRuntimeSchedulerExecuting as s, enqueueRuntimeLane as t, runRuntimeWithSyncProgress as u, incrementPerfMetric as v, isDevelopmentEnvironment as x, logger as y };
@@ -1,14 +0,0 @@
1
- import { Rt as RouteSnapshot, wt as RouteParams } from "./index-DSqXWc77.js";
2
- //#region src/router/activity.d.ts
3
- /** Options for {@link onRouteChange}. */
4
- interface RouteChangeOptions {
5
- immediate?: boolean;
6
- }
7
- /** Optional cleanup returned by an {@link onRouteChange} callback, run before the next change. */
8
- type RouteChangeCleanup = void | (() => void);
9
- /** Register a callback to run whenever the active route changes, with optional cleanup. */
10
- declare function onRouteChange(fn: (current: RouteSnapshot, previous: RouteSnapshot | null) => RouteChangeCleanup, options?: RouteChangeOptions): void;
11
- /** Read the currently active route's {@link RouteSnapshot}; reactive during component render. */
12
- declare function currentRoute<TParams extends RouteParams = RouteParams>(): RouteSnapshot<TParams>;
13
- //#endregion
14
- export { onRouteChange as i, RouteChangeOptions as n, currentRoute as r, RouteChangeCleanup as t };
@@ -1,26 +0,0 @@
1
- import "./jsx-runtime-BTzDdBJ_.js";
2
- //#region src/bench/components/benchmark-row.d.ts
3
- interface BenchmarkRowData {
4
- id: number;
5
- label: string;
6
- }
7
- //#endregion
8
- //#region src/bench/benchmark-entry.d.ts
9
- type RowData = BenchmarkRowData;
10
- interface BenchmarkMetadata {
11
- packageName: string;
12
- packageVersion: string;
13
- buildLabel: string;
14
- }
15
- declare const benchmarkMetadata: BenchmarkMetadata;
16
- declare function getBenchmarkMetadata(): BenchmarkMetadata;
17
- declare function mountBenchmark(root: Element, initialRows?: RowData[]): {
18
- setRows(rows: RowData[]): void;
19
- setSelected(id: number | null): void;
20
- cleanup(): void;
21
- };
22
- declare const _default: {
23
- mountBenchmark: typeof mountBenchmark;
24
- };
25
- //#endregion
26
- export { BenchmarkMetadata, benchmarkMetadata, _default as default, getBenchmarkMetadata, mountBenchmark };