@askrjs/askr 0.0.21 → 0.0.25
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/LICENSE +201 -201
- package/README.md +160 -46
- package/dist/_virtual/___vite-browser-external.js +1 -0
- package/dist/_virtual/__vite-browser-external.js +1 -0
- package/dist/_virtual/_commonjsHelpers.js +1 -0
- package/dist/_virtual/main.js +1 -0
- package/dist/_virtual/preload-helper.js +1 -0
- package/dist/{benchmark.d.ts → bench/benchmark-entry.d.ts} +3 -3
- package/dist/bench/benchmark-entry.d.ts.map +1 -0
- package/dist/benchmark.js +1 -1
- package/dist/boot/index.d.ts +70 -0
- package/dist/boot/index.d.ts.map +1 -0
- package/dist/boot/index.js +2 -0
- package/dist/common/component.d.ts +16 -0
- package/dist/common/component.d.ts.map +1 -0
- package/dist/common/errors.d.ts +53 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/jsx.d.ts +17 -0
- package/dist/common/jsx.d.ts.map +1 -0
- package/dist/common/jsx.js +1 -0
- package/dist/{jsx-CPjsGyEg.d.ts → common/props.d.ts} +6 -18
- package/dist/common/props.d.ts.map +1 -0
- package/dist/{router-DaGtH1Sq.d.ts → common/router.d.ts} +10 -7
- package/dist/common/router.d.ts.map +1 -0
- package/dist/common/ssr-errors.d.ts +8 -0
- package/dist/common/ssr-errors.d.ts.map +1 -0
- package/dist/common/ssr-errors.js +1 -0
- package/dist/common/ssr.d.ts +17 -0
- package/dist/common/ssr.d.ts.map +1 -0
- package/dist/common/vnode.d.ts +17 -0
- package/dist/common/vnode.d.ts.map +1 -0
- package/dist/common/vnode.js +1 -0
- package/dist/components/link.d.ts +56 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +1 -0
- package/dist/dev/invariant.d.ts +83 -0
- package/dist/dev/invariant.d.ts.map +1 -0
- package/dist/dev/invariant.js +2 -0
- package/dist/dev/logger.d.ts +13 -0
- package/dist/dev/logger.d.ts.map +1 -0
- package/dist/dev/logger.js +1 -0
- package/dist/dev/vite-plugin-askr.d.ts +18 -0
- package/dist/dev/vite-plugin-askr.d.ts.map +1 -0
- package/dist/dev/warnings.d.ts +5 -0
- package/dist/dev/warnings.d.ts.map +1 -0
- package/dist/for/for.d.ts +16 -0
- package/dist/for/for.d.ts.map +1 -0
- package/dist/for/for.js +1 -0
- package/dist/for/index.d.ts +2 -63
- package/dist/for/index.d.ts.map +1 -0
- package/dist/for/index.js +1 -1
- package/dist/foundations/core.d.ts +23 -0
- package/dist/foundations/core.d.ts.map +1 -0
- package/dist/foundations/core.js +1 -0
- package/dist/foundations/index.d.ts +3 -669
- package/dist/foundations/index.d.ts.map +1 -0
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/dismissable.d.ts +58 -0
- package/dist/foundations/interactions/dismissable.d.ts.map +1 -0
- package/dist/foundations/interactions/dismissable.js +1 -0
- package/dist/foundations/interactions/focusable.d.ts +16 -0
- package/dist/foundations/interactions/focusable.d.ts.map +1 -0
- package/dist/foundations/interactions/focusable.js +1 -0
- package/dist/foundations/interactions/hoverable.d.ts +19 -0
- package/dist/foundations/interactions/hoverable.d.ts.map +1 -0
- package/dist/foundations/interactions/hoverable.js +1 -0
- package/dist/foundations/interactions/index.d.ts +5 -0
- package/dist/foundations/interactions/index.d.ts.map +1 -0
- package/dist/foundations/interactions/interaction-policy.d.ts +96 -0
- package/dist/foundations/interactions/interaction-policy.d.ts.map +1 -0
- package/dist/foundations/interactions/interaction-policy.js +1 -0
- package/dist/foundations/interactions/pressable.d.ts +54 -0
- package/dist/foundations/interactions/pressable.d.ts.map +1 -0
- package/dist/foundations/interactions/pressable.js +1 -0
- package/dist/foundations/interactions/roving-focus.d.ts +117 -0
- package/dist/foundations/interactions/roving-focus.d.ts.map +1 -0
- package/dist/foundations/interactions/roving-focus.js +1 -0
- package/dist/foundations/state/controllable.d.ts +53 -0
- package/dist/foundations/state/controllable.d.ts.map +1 -0
- package/dist/foundations/state/controllable.js +1 -0
- package/dist/foundations/state/index.d.ts +2 -0
- package/dist/foundations/state/index.d.ts.map +1 -0
- package/dist/foundations/structures/collection.d.ts +67 -0
- package/dist/foundations/structures/collection.d.ts.map +1 -0
- package/dist/foundations/structures/collection.js +1 -0
- package/dist/foundations/structures/index.d.ts +5 -0
- package/dist/foundations/structures/index.d.ts.map +1 -0
- package/dist/foundations/structures/layer.d.ts +102 -0
- package/dist/foundations/structures/layer.d.ts.map +1 -0
- package/dist/foundations/structures/layer.js +1 -0
- package/dist/{layout-BINPv-nz.d.ts → foundations/structures/layout.d.ts} +3 -4
- package/dist/foundations/structures/layout.d.ts.map +1 -0
- package/dist/foundations/structures/layout.js +1 -0
- package/dist/foundations/structures/portal.d.ts +33 -0
- package/dist/foundations/structures/portal.d.ts.map +1 -0
- package/dist/foundations/structures/portal.js +1 -0
- package/dist/foundations/structures/presence.d.ts +30 -0
- package/dist/foundations/structures/presence.d.ts.map +1 -0
- package/dist/foundations/structures/presence.js +1 -0
- package/dist/foundations/structures/slot.d.ts +31 -0
- package/dist/foundations/structures/slot.d.ts.map +1 -0
- package/dist/foundations/structures/slot.js +1 -0
- package/dist/foundations/structures.d.ts +14 -0
- package/dist/foundations/structures.d.ts.map +1 -0
- package/dist/foundations/structures.js +1 -0
- package/dist/foundations/utilities/aria.d.ts +13 -0
- package/dist/foundations/utilities/aria.d.ts.map +1 -0
- package/dist/foundations/utilities/aria.js +1 -0
- package/dist/foundations/utilities/compose-handlers.d.ts +34 -0
- package/dist/foundations/utilities/compose-handlers.d.ts.map +1 -0
- package/dist/foundations/utilities/compose-handlers.js +1 -0
- package/dist/foundations/utilities/compose-ref.d.ts +24 -0
- package/dist/foundations/utilities/compose-ref.d.ts.map +1 -0
- package/dist/foundations/utilities/compose-ref.js +1 -0
- package/dist/foundations/utilities/event-types.d.ts +17 -0
- package/dist/foundations/utilities/event-types.d.ts.map +1 -0
- package/dist/foundations/utilities/index.d.ts +7 -0
- package/dist/foundations/utilities/index.d.ts.map +1 -0
- package/dist/foundations/utilities/merge-props.d.ts +2 -0
- package/dist/foundations/utilities/merge-props.d.ts.map +1 -0
- package/dist/foundations/utilities/merge-props.js +1 -0
- package/dist/foundations/utilities/use-id.d.ts +29 -0
- package/dist/foundations/utilities/use-id.d.ts.map +1 -0
- package/dist/foundations/utilities/use-id.js +1 -0
- package/dist/fx/fx.d.ts +30 -0
- package/dist/fx/fx.d.ts.map +1 -0
- package/dist/fx/fx.js +1 -0
- package/dist/fx/index.d.ts +5 -184
- package/dist/fx/index.d.ts.map +1 -0
- package/dist/fx/index.js +1 -1
- package/dist/fx/noop.d.ts +12 -0
- package/dist/fx/noop.d.ts.map +1 -0
- package/dist/fx/noop.js +1 -0
- package/dist/fx/timing.d.ts +155 -0
- package/dist/fx/timing.d.ts.map +1 -0
- package/dist/fx/timing.js +1 -0
- package/dist/index.d.ts +18 -37
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/jsx/index.d.ts +4 -0
- package/dist/jsx/index.d.ts.map +1 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/jsx-dev-runtime.d.ts +4 -0
- package/dist/jsx/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx/jsx-runtime.d.ts +10 -0
- package/dist/jsx/jsx-runtime.d.ts.map +1 -0
- package/dist/{types-BTT0Fc9S.d.ts → jsx/types.d.ts} +6 -3
- package/dist/jsx/types.d.ts.map +1 -0
- package/dist/jsx/types.js +1 -0
- package/dist/jsx/utils.d.ts +4 -0
- package/dist/jsx/utils.d.ts.map +1 -0
- package/dist/jsx/utils.js +1 -0
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/node_modules/esbuild/lib/main.js +65 -0
- package/dist/renderer/cleanup.d.ts +25 -0
- package/dist/renderer/cleanup.d.ts.map +1 -0
- package/dist/renderer/cleanup.js +1 -0
- package/dist/renderer/dom.d.ts +44 -0
- package/dist/renderer/dom.d.ts.map +1 -0
- package/dist/renderer/dom.js +1 -0
- package/dist/renderer/evaluate.d.ts +4 -0
- package/dist/renderer/evaluate.d.ts.map +1 -0
- package/dist/renderer/evaluate.js +1 -0
- package/dist/renderer/fastpath.d.ts +7 -0
- package/dist/renderer/fastpath.d.ts.map +1 -0
- package/dist/renderer/fastpath.js +1 -0
- package/dist/renderer/index.d.ts +6 -0
- package/dist/renderer/index.d.ts.map +1 -0
- package/dist/renderer/index.js +1 -0
- package/dist/renderer/keyed.d.ts +23 -0
- package/dist/renderer/keyed.d.ts.map +1 -0
- package/dist/renderer/keyed.js +1 -0
- package/dist/renderer/reconcile.d.ts +88 -0
- package/dist/renderer/reconcile.d.ts.map +1 -0
- package/dist/renderer/reconcile.js +1 -0
- package/dist/renderer/types.d.ts +3 -0
- package/dist/renderer/types.d.ts.map +1 -0
- package/dist/renderer/types.js +1 -0
- package/dist/renderer/utils.d.ts +63 -0
- package/dist/renderer/utils.d.ts.map +1 -0
- package/dist/renderer/utils.js +1 -0
- package/dist/resources/index.d.ts +7 -22
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +1 -1
- package/dist/router/index.d.ts +8 -87
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +1 -1
- package/dist/router/match.d.ts +22 -0
- package/dist/router/match.d.ts.map +1 -0
- package/dist/router/match.js +1 -0
- package/dist/router/navigate.d.ts +20 -0
- package/dist/router/navigate.d.ts.map +1 -0
- package/dist/router/navigate.js +1 -0
- package/dist/router/route.d.ts +52 -0
- package/dist/router/route.d.ts.map +1 -0
- package/dist/router/route.js +1 -0
- package/dist/runtime/component.d.ts +123 -0
- package/dist/runtime/component.d.ts.map +1 -0
- package/dist/runtime/component.js +1 -0
- package/dist/runtime/context.d.ts +80 -0
- package/dist/runtime/context.d.ts.map +1 -0
- package/dist/runtime/context.js +1 -0
- package/dist/runtime/derive.d.ts +7 -0
- package/dist/runtime/derive.d.ts.map +1 -0
- package/dist/runtime/derive.js +1 -0
- package/dist/runtime/dev-namespace.d.ts +31 -0
- package/dist/runtime/dev-namespace.d.ts.map +1 -0
- package/dist/runtime/dev-namespace.js +1 -0
- package/dist/runtime/events.d.ts +52 -0
- package/dist/runtime/events.d.ts.map +1 -0
- package/dist/runtime/events.js +1 -0
- package/dist/runtime/execution-model.d.ts +4 -0
- package/dist/runtime/execution-model.d.ts.map +1 -0
- package/dist/runtime/execution-model.js +1 -0
- package/dist/runtime/fastlane.d.ts +27 -0
- package/dist/runtime/fastlane.d.ts.map +1 -0
- package/dist/runtime/fastlane.js +1 -0
- package/dist/runtime/for.d.ts +52 -0
- package/dist/runtime/for.d.ts.map +1 -0
- package/dist/runtime/for.js +1 -0
- package/dist/runtime/hydration.d.ts +25 -0
- package/dist/runtime/hydration.d.ts.map +1 -0
- package/dist/runtime/operations.d.ts +39 -0
- package/dist/runtime/operations.d.ts.map +1 -0
- package/dist/runtime/operations.js +1 -0
- package/dist/runtime/resource-cell.d.ts +35 -0
- package/dist/runtime/resource-cell.d.ts.map +1 -0
- package/dist/runtime/resource-cell.js +1 -0
- package/dist/runtime/scheduler.d.ts +48 -0
- package/dist/runtime/scheduler.d.ts.map +1 -0
- package/dist/runtime/scheduler.js +1 -0
- package/dist/runtime/snapshot.d.ts +25 -0
- package/dist/runtime/snapshot.d.ts.map +1 -0
- package/dist/runtime/ssr-bridge.d.ts +10 -0
- package/dist/runtime/ssr-bridge.d.ts.map +1 -0
- package/dist/runtime/ssr-bridge.js +1 -0
- package/dist/runtime/state.d.ts +56 -0
- package/dist/runtime/state.d.ts.map +1 -0
- package/dist/runtime/state.js +1 -0
- package/dist/ssr/attrs.d.ts +26 -0
- package/dist/ssr/attrs.d.ts.map +1 -0
- package/dist/ssr/attrs.js +1 -0
- package/dist/ssr/context.d.ts +47 -0
- package/dist/ssr/context.d.ts.map +1 -0
- package/dist/ssr/context.js +1 -0
- package/dist/ssr/create-ssr.d.ts +19 -0
- package/dist/ssr/create-ssr.d.ts.map +1 -0
- package/dist/ssr/errors.d.ts +6 -0
- package/dist/ssr/errors.d.ts.map +1 -0
- package/dist/ssr/errors.js +1 -0
- package/dist/ssr/escape.d.ts +38 -0
- package/dist/ssr/escape.d.ts.map +1 -0
- package/dist/ssr/escape.js +1 -0
- package/dist/ssr/index.d.ts +18 -94
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/render-keys.d.ts +39 -0
- package/dist/ssr/render-keys.d.ts.map +1 -0
- package/dist/ssr/render-keys.js +1 -0
- package/dist/ssr/sink.d.ts +23 -0
- package/dist/ssr/sink.d.ts.map +1 -0
- package/dist/ssr/sink.js +1 -0
- package/dist/ssr/stream-render.d.ts +7 -0
- package/dist/ssr/stream-render.d.ts.map +1 -0
- package/dist/ssr/stream-render.js +1 -0
- package/dist/ssr/types.d.ts +21 -0
- package/dist/ssr/types.d.ts.map +1 -0
- package/dist/vite/index.js +3 -1
- package/package.json +11 -10
- package/dist/chunk-37RC6ZT3.js +0 -1
- package/dist/chunk-3L6PFAJ3.js +0 -1
- package/dist/chunk-47D5SNYH.js +0 -1
- package/dist/chunk-4RTKQ7SC.js +0 -1
- package/dist/chunk-5PLQPS3O.js +0 -1
- package/dist/chunk-62D2TNHX.js +0 -1
- package/dist/chunk-BP2CKUO6.js +0 -1
- package/dist/chunk-D2JSJKCW.js +0 -1
- package/dist/chunk-EQ5S5GU4.js +0 -1
- package/dist/chunk-HGMOQ3I7.js +0 -1
- package/dist/chunk-HZKAD5DE.js +0 -1
- package/dist/chunk-ILZCMHZM.js +0 -2
- package/dist/chunk-NL44ANML.js +0 -2
- package/dist/chunk-YRY4OLQF.js +0 -1
- package/dist/component-AJMg1Gmv.d.ts +0 -177
- package/dist/jsx-dev-runtime.d.ts +0 -7
- package/dist/jsx-runtime.d.ts +0 -14
- package/dist/logger-NGZDJLVS.js +0 -1
- package/dist/main-EPE35NMW.js +0 -65
- package/dist/navigate-4VAVLF3A.js +0 -1
- package/dist/route-IVG3V65Y.js +0 -1
- package/dist/vite/index.d.ts +0 -17
package/dist/fx/index.d.ts
CHANGED
|
@@ -1,186 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Standard library — pure helpers for common patterns
|
|
3
|
+
* Zero framework coupling
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
interface ThrottleOptions {
|
|
10
|
-
leading?: boolean;
|
|
11
|
-
trailing?: boolean;
|
|
12
|
-
}
|
|
13
|
-
interface RetryOptions$1 {
|
|
14
|
-
maxAttempts?: number;
|
|
15
|
-
delayMs?: number;
|
|
16
|
-
backoff?: (attemptIndex: number) => number;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Debounce — delay execution, coalesce rapid calls
|
|
20
|
-
*
|
|
21
|
-
* Useful for: text input, resize, autosave
|
|
22
|
-
*
|
|
23
|
-
* @param fn Function to debounce
|
|
24
|
-
* @param ms Delay in milliseconds
|
|
25
|
-
* @param options trailing (default true), leading
|
|
26
|
-
* @returns Debounced function with cancel() method
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const save = debounce((text) => api.save(text), 500);
|
|
31
|
-
* input.addEventListener('input', (e) => save(e.target.value));
|
|
32
|
-
* save.cancel(); // stop any pending execution
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, ms: number, options?: DebounceOptions): T & {
|
|
36
|
-
cancel(): void;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Throttle — rate-limit execution, keep first/last
|
|
40
|
-
*
|
|
41
|
-
* Useful for: scroll, mouse move, high-frequency events
|
|
42
|
-
*
|
|
43
|
-
* @param fn Function to throttle
|
|
44
|
-
* @param ms Minimum interval between calls in milliseconds
|
|
45
|
-
* @param options leading (default true), trailing (default true)
|
|
46
|
-
* @returns Throttled function with cancel() method
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* const handleScroll = throttle(updateUI, 100);
|
|
51
|
-
* window.addEventListener('scroll', handleScroll);
|
|
52
|
-
* handleScroll.cancel();
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare function throttle<T extends (...args: unknown[]) => unknown>(fn: T, ms: number, options?: ThrottleOptions): T & {
|
|
56
|
-
cancel(): void;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Once — guard against double execution
|
|
60
|
-
*
|
|
61
|
-
* Useful for: init logic, event safety
|
|
62
|
-
*
|
|
63
|
-
* @param fn Function to call at most once
|
|
64
|
-
* @returns Function that executes fn only on first call
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```ts
|
|
68
|
-
* const init = once(setup);
|
|
69
|
-
* init(); // runs
|
|
70
|
-
* init(); // does nothing
|
|
71
|
-
* init(); // does nothing
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
declare function once<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
75
|
-
/**
|
|
76
|
-
* Defer — schedule on microtask queue
|
|
77
|
-
*
|
|
78
|
-
* Useful for: run-after-current-stack logic
|
|
79
|
-
* More reliable than setTimeout(..., 0)
|
|
80
|
-
*
|
|
81
|
-
* @param fn Function to defer
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```ts
|
|
85
|
-
* defer(() => update()); // runs after current stack, before next macrotask
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
declare function defer(fn: () => void): void;
|
|
89
|
-
/**
|
|
90
|
-
* RAF — coalesce multiple updates into single frame
|
|
91
|
-
*
|
|
92
|
-
* Useful for: animation, layout work, render updates
|
|
93
|
-
*
|
|
94
|
-
* @param fn Function to schedule on next animation frame
|
|
95
|
-
* @returns Function that schedules fn on requestAnimationFrame
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* const update = raf(render);
|
|
100
|
-
* update(); // schedules on next frame
|
|
101
|
-
* update(); // same frame, no duplicate
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
declare function raf<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
105
|
-
/**
|
|
106
|
-
* Idle — schedule low-priority work
|
|
107
|
-
*
|
|
108
|
-
* Useful for: background prep, non-urgent updates
|
|
109
|
-
* Falls back to setTimeout if requestIdleCallback unavailable
|
|
110
|
-
*
|
|
111
|
-
* @param fn Function to call when idle
|
|
112
|
-
* @param options timeout for fallback
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```ts
|
|
116
|
-
* idle(() => prefetchData());
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
declare function idle(fn: () => void, options?: {
|
|
120
|
-
timeout?: number;
|
|
121
|
-
}): void;
|
|
122
|
-
/**
|
|
123
|
-
* Timeout — Promise-based delay
|
|
124
|
-
*
|
|
125
|
-
* Useful for: readable async code, waiting between retries
|
|
126
|
-
*
|
|
127
|
-
* @param ms Milliseconds to wait
|
|
128
|
-
* @returns Promise that resolves after delay
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```ts
|
|
132
|
-
* await timeout(300);
|
|
133
|
-
* console.log('300ms later');
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
declare function timeout(ms: number): Promise<void>;
|
|
137
|
-
/**
|
|
138
|
-
* Retry — attempt function with backoff
|
|
139
|
-
*
|
|
140
|
-
* Useful for: network calls, transient failures
|
|
141
|
-
*
|
|
142
|
-
* @param fn Async function to retry
|
|
143
|
-
* @param options maxAttempts, delayMs, backoff function
|
|
144
|
-
* @returns Promise with final result or error
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* const data = await retry(() => fetch(url), {
|
|
149
|
-
* maxAttempts: 3,
|
|
150
|
-
* delayMs: 100,
|
|
151
|
-
* });
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
declare function retry<T>(fn: () => Promise<T>, options?: RetryOptions$1): Promise<T>;
|
|
155
|
-
|
|
156
|
-
type CancelFn = () => void;
|
|
157
|
-
declare function debounceEvent(ms: number, handler: EventListener, options?: {
|
|
158
|
-
leading?: boolean;
|
|
159
|
-
trailing?: boolean;
|
|
160
|
-
}): EventListener & {
|
|
161
|
-
cancel(): void;
|
|
162
|
-
flush(): void;
|
|
163
|
-
};
|
|
164
|
-
declare function throttleEvent(ms: number, handler: EventListener, options?: {
|
|
165
|
-
leading?: boolean;
|
|
166
|
-
trailing?: boolean;
|
|
167
|
-
}): EventListener & {
|
|
168
|
-
cancel(): void;
|
|
169
|
-
};
|
|
170
|
-
declare function rafEvent(handler: EventListener): EventListener & {
|
|
171
|
-
cancel(): void;
|
|
172
|
-
};
|
|
173
|
-
declare function scheduleTimeout(ms: number, fn: () => void): CancelFn;
|
|
174
|
-
declare function scheduleIdle(fn: () => void, options?: {
|
|
175
|
-
timeout?: number;
|
|
176
|
-
}): CancelFn;
|
|
177
|
-
interface RetryOptions {
|
|
178
|
-
maxAttempts?: number;
|
|
179
|
-
delayMs?: number;
|
|
180
|
-
backoff?: (attemptIndex: number) => number;
|
|
181
|
-
}
|
|
182
|
-
declare function scheduleRetry<T>(fn: () => Promise<T>, options?: RetryOptions): {
|
|
183
|
-
cancel(): void;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
export { type DebounceOptions, type RetryOptions$1 as RetryOptions, type ThrottleOptions, debounce, debounceEvent, defer, idle, once, raf, rafEvent, retry, scheduleIdle, scheduleRetry, scheduleTimeout, throttle, throttleEvent, timeout };
|
|
5
|
+
export { debounce, throttle, once, defer, raf, idle, timeout, retry, type DebounceOptions, type ThrottleOptions, type RetryOptions, } from './timing';
|
|
6
|
+
export { debounceEvent, throttleEvent, rafEvent, scheduleTimeout, scheduleIdle, scheduleRetry, } from './fx';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fx/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,GAAG,EACH,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,GAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,aAAa,GACd,MAAM,MAAM,CAAC"}
|
package/dist/fx/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{debounce as r,defer as o,idle as d,once as l,raf as u,retry as c,throttle as n,timeout as f}from"./timing.js";import{debounceEvent as m,rafEvent as i,scheduleIdle as s,scheduleRetry as v,scheduleTimeout as E,throttleEvent as a}from"./fx.js";export{r as debounce,m as debounceEvent,o as defer,d as idle,l as once,u as raf,i as rafEvent,c as retry,s as scheduleIdle,v as scheduleRetry,E as scheduleTimeout,n as throttle,a as throttleEvent,f as timeout};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const noop: () => void;
|
|
2
|
+
export declare const noopEventListener: EventListener & {
|
|
3
|
+
cancel(): void;
|
|
4
|
+
};
|
|
5
|
+
export declare const noopEventListenerWithFlush: EventListener & {
|
|
6
|
+
cancel(): void;
|
|
7
|
+
flush(): void;
|
|
8
|
+
};
|
|
9
|
+
export declare const noopCancel: {
|
|
10
|
+
cancel(): void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=noop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../src/fx/noop.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAE,MAAM,IAAe,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,aAAa,GAAG;IAAE,MAAM,IAAI,IAAI,CAAA;CACX,CAAC;AAEtD,eAAO,MAAM,0BAA0B,EAAE,aAAa,GAAG;IACvD,MAAM,IAAI,IAAI,CAAC;IACf,KAAK,IAAI,IAAI,CAAC;CACmD,CAAC;AAEpE,eAAO,MAAM,UAAU,EAAE;IAAE,MAAM,IAAI,IAAI,CAAA;CAAoB,CAAC"}
|
package/dist/fx/noop.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=()=>{},c=Object.assign(n=>{},{cancel(){}}),o=Object.assign(n=>{},{cancel(){},flush(){}}),s={cancel(){}};export{e as noop,s as noopCancel,c as noopEventListener,o as noopEventListenerWithFlush};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timing utilities — pure helpers for common async patterns
|
|
3
|
+
* No framework coupling. No lifecycle awareness.
|
|
4
|
+
*/
|
|
5
|
+
export interface DebounceOptions {
|
|
6
|
+
leading?: boolean;
|
|
7
|
+
trailing?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ThrottleOptions {
|
|
10
|
+
leading?: boolean;
|
|
11
|
+
trailing?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface RetryOptions {
|
|
14
|
+
maxAttempts?: number;
|
|
15
|
+
delayMs?: number;
|
|
16
|
+
backoff?: (attemptIndex: number) => number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Debounce — delay execution, coalesce rapid calls
|
|
20
|
+
*
|
|
21
|
+
* Useful for: text input, resize, autosave
|
|
22
|
+
*
|
|
23
|
+
* @param fn Function to debounce
|
|
24
|
+
* @param ms Delay in milliseconds
|
|
25
|
+
* @param options trailing (default true), leading
|
|
26
|
+
* @returns Debounced function with cancel() method
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const save = debounce((text) => api.save(text), 500);
|
|
31
|
+
* input.addEventListener('input', (e) => save(e.target.value));
|
|
32
|
+
* save.cancel(); // stop any pending execution
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, ms: number, options?: DebounceOptions): T & {
|
|
36
|
+
cancel(): void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Throttle — rate-limit execution, keep first/last
|
|
40
|
+
*
|
|
41
|
+
* Useful for: scroll, mouse move, high-frequency events
|
|
42
|
+
*
|
|
43
|
+
* @param fn Function to throttle
|
|
44
|
+
* @param ms Minimum interval between calls in milliseconds
|
|
45
|
+
* @param options leading (default true), trailing (default true)
|
|
46
|
+
* @returns Throttled function with cancel() method
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const handleScroll = throttle(updateUI, 100);
|
|
51
|
+
* window.addEventListener('scroll', handleScroll);
|
|
52
|
+
* handleScroll.cancel();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function throttle<T extends (...args: unknown[]) => unknown>(fn: T, ms: number, options?: ThrottleOptions): T & {
|
|
56
|
+
cancel(): void;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Once — guard against double execution
|
|
60
|
+
*
|
|
61
|
+
* Useful for: init logic, event safety
|
|
62
|
+
*
|
|
63
|
+
* @param fn Function to call at most once
|
|
64
|
+
* @returns Function that executes fn only on first call
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const init = once(setup);
|
|
69
|
+
* init(); // runs
|
|
70
|
+
* init(); // does nothing
|
|
71
|
+
* init(); // does nothing
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function once<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
75
|
+
/**
|
|
76
|
+
* Defer — schedule on microtask queue
|
|
77
|
+
*
|
|
78
|
+
* Useful for: run-after-current-stack logic
|
|
79
|
+
* More reliable than setTimeout(..., 0)
|
|
80
|
+
*
|
|
81
|
+
* @param fn Function to defer
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* defer(() => update()); // runs after current stack, before next macrotask
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function defer(fn: () => void): void;
|
|
89
|
+
/**
|
|
90
|
+
* RAF — coalesce multiple updates into single frame
|
|
91
|
+
*
|
|
92
|
+
* Useful for: animation, layout work, render updates
|
|
93
|
+
*
|
|
94
|
+
* @param fn Function to schedule on next animation frame
|
|
95
|
+
* @returns Function that schedules fn on requestAnimationFrame
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* const update = raf(render);
|
|
100
|
+
* update(); // schedules on next frame
|
|
101
|
+
* update(); // same frame, no duplicate
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare function raf<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
105
|
+
/**
|
|
106
|
+
* Idle — schedule low-priority work
|
|
107
|
+
*
|
|
108
|
+
* Useful for: background prep, non-urgent updates
|
|
109
|
+
* Falls back to setTimeout if requestIdleCallback unavailable
|
|
110
|
+
*
|
|
111
|
+
* @param fn Function to call when idle
|
|
112
|
+
* @param options timeout for fallback
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* idle(() => prefetchData());
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare function idle(fn: () => void, options?: {
|
|
120
|
+
timeout?: number;
|
|
121
|
+
}): void;
|
|
122
|
+
/**
|
|
123
|
+
* Timeout — Promise-based delay
|
|
124
|
+
*
|
|
125
|
+
* Useful for: readable async code, waiting between retries
|
|
126
|
+
*
|
|
127
|
+
* @param ms Milliseconds to wait
|
|
128
|
+
* @returns Promise that resolves after delay
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* await timeout(300);
|
|
133
|
+
* console.log('300ms later');
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export declare function timeout(ms: number): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Retry — attempt function with backoff
|
|
139
|
+
*
|
|
140
|
+
* Useful for: network calls, transient failures
|
|
141
|
+
*
|
|
142
|
+
* @param fn Async function to retry
|
|
143
|
+
* @param options maxAttempts, delayMs, backoff function
|
|
144
|
+
* @returns Promise with final result or error
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* const data = await retry(() => fetch(url), {
|
|
149
|
+
* maxAttempts: 3,
|
|
150
|
+
* delayMs: 100,
|
|
151
|
+
* });
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare function retry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
|
|
155
|
+
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/fx/timing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAChE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,eAAe,GACxB,CAAC,GAAG;IAAE,MAAM,IAAI,IAAI,CAAA;CAAE,CAuCxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAChE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,eAAe,GACxB,CAAC,GAAG;IAAE,MAAM,IAAI,IAAI,CAAA;CAAE,CA4CxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAWxE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAE1C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAiBvE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASzE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,CAAC,CAAC,CAsBZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function d(e,l,i){let t=null;const{leading:n=!1,trailing:o=!0}=i||{};let u=null,a=null,r=0;const c=function(...f){const s=Date.now();u=f,a=this,t!==null&&clearTimeout(t),n&&s-r>=l&&(e.apply(this,f),r=s),o&&(t=setTimeout(()=>{e.apply(a,u),t=null,r=Date.now()},l))};return c.cancel=()=>{t!==null&&(clearTimeout(t),t=null)},c}function h(e,l,i){let t=0,n=null;const{leading:o=!0,trailing:u=!0}=i||{};let a=null,r=null;const c=function(...f){const s=Date.now();a=f,r=this,o&&s-t>=l?(e.apply(this,f),t=s,n!==null&&(clearTimeout(n),n=null)):!o&&t===0&&(t=s),u&&n===null&&(n=setTimeout(()=>{e.apply(r,a),t=Date.now(),n=null},l-(s-t)))};return c.cancel=()=>{n!==null&&(clearTimeout(n),n=null)},c}function T(e){let l=!1,i;return((...t)=>(l||(l=!0,i=e(...t)),i))}function p(e){Promise.resolve().then(e)}function y(e){let l=null,i=null,t=null;return function(...n){i=n,t=this,l===null&&(l=requestAnimationFrame(()=>{e.apply(t,i),l=null}))}}function w(e,l){typeof requestIdleCallback<"u"?requestIdleCallback(e,l?{timeout:l.timeout}:void 0):Promise.resolve().then(()=>{setTimeout(e,0)})}function m(e){return new Promise(l=>setTimeout(l,e))}async function b(e,l){const{maxAttempts:i=3,delayMs:t=100,backoff:n=u=>t*Math.pow(2,u)}=l||{};let o=null;for(let u=0;u<i;u++)try{return await e()}catch(a){if(o=a,u<i-1){const r=n(u);await m(r)}}throw o||new Error("Retry failed")}export{d as debounce,p as defer,w as idle,T as once,y as raf,b as retry,h as throttle,m as timeout};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,39 +1,20 @@
|
|
|
1
|
-
import { C as ComponentFunction } from './component-AJMg1Gmv.js';
|
|
2
|
-
export { S as State, s as state } from './component-AJMg1Gmv.js';
|
|
3
|
-
import { R as Route } from './router-DaGtH1Sq.js';
|
|
4
|
-
export { For, ForOptions } from './for/index.js';
|
|
5
|
-
export { P as Props } from './jsx-CPjsGyEg.js';
|
|
6
|
-
|
|
7
1
|
/**
|
|
8
|
-
*
|
|
2
|
+
* Askr: Actor-backed deterministic UI framework
|
|
3
|
+
*
|
|
4
|
+
* Public API surface — autopilot-safe core only.
|
|
5
|
+
*
|
|
6
|
+
* Root exports are intentionally minimal and free of timing/lifecycle nuance.
|
|
7
|
+
* Lower tiers are exposed via explicit subpaths:
|
|
8
|
+
* - askr/for (list iteration primitive)
|
|
9
|
+
* - askr/resources (async data policy)
|
|
10
|
+
* - askr/fx (timing / side effects)
|
|
9
11
|
*/
|
|
10
|
-
|
|
11
|
-
type IslandConfig
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
routes: Route[];
|
|
20
|
-
cleanupStrict?: boolean;
|
|
21
|
-
component?: never;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* createIsland: Enhances existing DOM (no router, mounts once)
|
|
25
|
-
*/
|
|
26
|
-
declare function createIsland(config: IslandConfig): void;
|
|
27
|
-
/**
|
|
28
|
-
* createSPA: Initializes router and mounts the app with provided route table
|
|
29
|
-
*/
|
|
30
|
-
declare function createSPA(config: SPAConfig): Promise<void>;
|
|
31
|
-
|
|
32
|
-
declare function derive<TOut>(fn: () => TOut): TOut | null;
|
|
33
|
-
declare function derive<TIn, TOut>(source: {
|
|
34
|
-
value: TIn | null;
|
|
35
|
-
pending?: boolean;
|
|
36
|
-
error?: Error | null;
|
|
37
|
-
} | TIn | (() => TIn), map: (value: TIn) => TOut): TOut | null;
|
|
38
|
-
|
|
39
|
-
export { type IslandConfig, type SPAConfig, createIsland, createSPA, derive };
|
|
12
|
+
export { createSPA, createIsland } from './boot';
|
|
13
|
+
export type { SPAConfig, IslandConfig } from './boot';
|
|
14
|
+
export { state } from './runtime/state';
|
|
15
|
+
export type { State } from './runtime/state';
|
|
16
|
+
export { derive } from './runtime/derive';
|
|
17
|
+
export { For } from './for';
|
|
18
|
+
export type { Props } from './common/props';
|
|
19
|
+
export { isEventDelegationEnabled, disableEventDelegation, enableEventDelegation, setGlobalDelegationContainer, } from './runtime/events';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACjD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,YAAY,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{createIsland as r,createSPA as a}from"./boot/index.js";import{state as l}from"./runtime/state.js";import{derive as m}from"./runtime/derive.js";import"./for/index.js";import{disableEventDelegation as f,enableEventDelegation as s,isEventDelegationEnabled as x,setGlobalDelegationContainer as b}from"./runtime/events.js";import{For as g}from"./for/for.js";export{g as For,r as createIsland,a as createSPA,m as derive,f as disableEventDelegation,s as enableEventDelegation,x as isEventDelegationEnabled,b as setGlobalDelegationContainer,l as state};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jsx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./types.js";import{cloneElement as t,isElement as l}from"./utils.js";export{t as cloneElement,l as isElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACrC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GACpB,UAAU,CAOZ;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSX runtime factory
|
|
3
|
+
* Same element shape as production runtime.
|
|
4
|
+
*/
|
|
5
|
+
import { Fragment, type JSXElement } from './types';
|
|
6
|
+
export declare function jsxDEV(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
|
|
7
|
+
export declare function jsx(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
|
|
8
|
+
export declare function jsxs(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
|
|
9
|
+
export { Fragment };
|
|
10
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAgB,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACrC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GACpB,UAAU,CAOZ;AAGD,wBAAgB,GAAG,CACjB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACrC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,cAGtB;AAED,wBAAgB,IAAI,CAClB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACrC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,cAGtB;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { J as JSXElement, P as Props } from './jsx-CPjsGyEg.js';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* JSX type definitions
|
|
5
3
|
*
|
|
@@ -9,7 +7,10 @@ import { J as JSXElement, P as Props } from './jsx-CPjsGyEg.js';
|
|
|
9
7
|
* - Slot / cloneElement
|
|
10
8
|
* - the reconciler
|
|
11
9
|
*/
|
|
12
|
-
|
|
10
|
+
import type { Props } from '../common/props';
|
|
11
|
+
import type { JSXElement } from '../common/jsx';
|
|
12
|
+
export { ELEMENT_TYPE, Fragment } from '../common/jsx';
|
|
13
|
+
export type { JSXElement } from '../common/jsx';
|
|
13
14
|
declare global {
|
|
14
15
|
namespace JSX {
|
|
15
16
|
interface Element extends JSXElement {
|
|
@@ -23,3 +24,5 @@ declare global {
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/jsx/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,GAAG,CAAC;QAEZ,UAAU,OAAQ,SAAQ,UAAU;YAClC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,KAAK,CAAC;SACxC;QAED,UAAU,iBAAiB;YACzB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;SACvB;QAED,UAAU,yBAAyB;YACjC,KAAK,EAAE,KAAK,CAAC;SACd;KACF;CACF;AAED,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ELEMENT_TYPE as e,Fragment as m}from"../common/jsx.js";export{e as ELEMENT_TYPE,m as Fragment};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/jsx/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,SAAS,CAAC;AAEnD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAM7D;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,UAAU,CAKZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./types.js";import{ELEMENT_TYPE as r}from"../common/jsx.js";function e(o){return typeof o=="object"&&o!==null&&o.$$typeof===r}function E(o,t){return{...o,props:{...o.props,...t}}}export{E as cloneElement,e as isElement};
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./jsx/types.js";import{ELEMENT_TYPE as p}from"./common/jsx.js";import{Fragment as i}from"./common/jsx.js";function n(r,o,t){return{$$typeof:p,type:r,props:o??{},key:t??null}}export{i as Fragment,n as jsxDEV};
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import"./jsx/types.js";import{ELEMENT_TYPE as e}from"./common/jsx.js";import{Fragment as x}from"./common/jsx.js";function o(r,t,n){return{$$typeof:e,type:r,props:t??{},key:n??null}}function f(r,t,n){return o(r,t,n)}function i(r,t,n){return o(r,t,n)}export{x as Fragment,f as jsx,o as jsxDEV,i as jsxs};
|