@askrjs/askr 0.0.91 → 0.0.94
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/CHANGELOG.md +3 -0
- package/dist/{access-Dpfoi4cA.js → access-d_DCdwqn.js} +8 -2
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +4 -3
- package/dist/{activity-dKH6nlpj.js → activity-BshyLB3_.js} +9 -5
- package/dist/{activity-CF2_JvJs.d.ts → activity-CJIQyo5X.d.ts} +5 -1
- package/dist/benchmark.d.ts +1 -1
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +12 -4
- package/dist/boot/index.js +1 -1
- package/dist/{boot-D3zVVWuN.js → boot-BsMB_ySP.js} +34 -22
- package/dist/{cleanup-c837KVij.js → cleanup-DefafSjG.js} +8 -5
- package/dist/{component-cleanup-BUfUleGZ.js → component-cleanup-hrqSikl2.js} +3 -3
- package/dist/{component-internal-C4uwwUaK.js → component-internal-DOVVMjG7.js} +8 -6
- package/dist/{component-scope-DzJEbYGE.js → component-scope-4I3yEMkb.js} +13 -1
- package/dist/components/index.d.ts +7 -2
- package/dist/components/index.js +2 -2
- package/dist/{compose-ref-Cc_YkUpM.js → compose-ref-1Fhs7mbF.js} +13 -0
- package/dist/{compose-ref-Cizq72-x.d.ts → compose-ref-DOJHoW5X.d.ts} +3 -0
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-CsGs2bLS.d.ts → control-DdFw-Caz.d.ts} +1 -1
- package/dist/{control-CON10J1p.js → control-DqOzkgc7.js} +9 -5
- package/dist/{csp-nonce-DH0TrDij.js → csp-nonce-BBxq1zq4.js} +8 -1
- package/dist/data/index.d.ts +1 -2
- package/dist/data/index.js +3 -3
- package/dist/{data-Bh_3OETq.js → data-DYqokZzc.js} +23 -12
- package/dist/{data-runtime-wbooGyu7.js → data-runtime-JxoRgrrt.js} +3 -1
- package/dist/{deferred-D6nZaIPs.js → deferred-BS0Xpstg.js} +10 -5
- package/dist/{effect-lnxQIpJG.js → effect-BdvdgMvV.js} +73 -14
- package/dist/{fastlane-CrfB3QG0.js → fastlane-DGo7SxBQ.js} +23 -4
- package/dist/{for-internal-Bsm0B8GZ.js → for-internal-jrliHZmF.js} +6 -6
- package/dist/foundations/icon/index.d.ts +14 -3
- package/dist/foundations/icon/index.js +8 -0
- package/dist/foundations/index.d.ts +2 -2
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +18 -2
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.d.ts +8 -1
- package/dist/foundations/state/index.js +7 -1
- package/dist/foundations/structures/index.d.ts +2 -2
- package/dist/foundations/structures/index.js +1 -1
- package/dist/foundations/utilities/index.d.ts +2 -2
- package/dist/foundations/utilities/index.js +1 -1
- package/dist/fx/index.d.ts +10 -1
- package/dist/fx/index.js +8 -2
- package/dist/{index-Cf2ANwPL.d.ts → index-C29SEGIv.d.ts} +30 -3
- package/dist/{index-BnU0NPwM.d.ts → index-CzH-0LcA.d.ts} +18 -0
- package/dist/index-KQ7Vl4-8.d.ts +1364 -0
- package/dist/index.d.ts +3 -7
- package/dist/index.js +34 -18
- package/dist/{interactions-CWkNEq_C.js → interactions-B4XaFxt1.js} +6 -1
- package/dist/{jsx-C3IECePB.js → jsx-DRS-qjiN.js} +2 -0
- package/dist/jsx-dev-runtime.d.ts +2 -3
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime-BTzDdBJ_.d.ts +2 -0
- package/dist/{jsx-runtime-LHh5tcTe.d.ts → jsx-runtime-Cdd6Gkb0.d.ts} +4 -3
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js +1 -1
- package/dist/{lifecycle-batch-Dfpid9-A.js → lifecycle-batch-BH0fax4F.js} +2 -2
- package/dist/{lifecycle-operations-CMK1AN2C.js → lifecycle-operations-Qxq6ABrC.js} +7 -2
- package/dist/{manifest-fBb2ynKL.js → manifest-D6rfj_jC.js} +5 -1
- package/dist/{navigate-BO7M2iUG.d.ts → navigate-BL_FIIJ6.d.ts} +6 -1
- package/dist/{navigate-CnQMXze1.js → navigate-CECCMPAr.js} +16 -11
- package/dist/{query-registry-B4LpVtlT.js → query-registry-CimB1YeW.js} +11 -1
- package/dist/{readable-B5NtV7V0.js → readable-BsdGWsDE.js} +9 -6
- package/dist/{renderer-y2DL627q.js → renderer-CLvq458M.js} +235 -189
- package/dist/{resolution-C9A31xQi.js → resolution-D8PgnTzh.js} +12 -6
- package/dist/{resource-operation-whZDJAYv.js → resource-operation-CLQXCn1p.js} +5 -5
- package/dist/resources/index.d.ts +15 -2
- package/dist/resources/index.js +7 -6
- package/dist/{route-matching-xlgdQXg_.js → route-matching-Bo6UqG-5.js} +13 -4
- package/dist/router/index.d.ts +46 -6
- package/dist/router/index.js +16 -9
- package/dist/{selector-BLNkRZ2i.js → selector-CyK-sDwB.js} +24 -6
- package/dist/ssg/index.d.ts +5 -2
- package/dist/ssg/index.js +6 -6
- package/dist/ssr/index.d.ts +16 -5
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-DNJUPmMq.js → ssr-8_vHDWqV.js} +20 -12
- package/dist/{state-DCjONcHK.js → state-DmkGM_LN.js} +5 -5
- package/dist/{structures-m-cphWI-.js → structures-umvVUD-M.js} +20 -6
- package/dist/testing/index.d.ts +31 -3
- package/dist/testing/index.js +24 -6
- package/dist/{jsx-BYXe_Nnk.d.ts → types-DkVJhVs9.d.ts} +20 -0
- package/dist/{verify-hydration-D8938Fw2.js → verify-hydration-jf8X2V3x.js} +1 -1
- package/package.json +1 -1
- package/dist/control-D-FIa-n-.d.ts +0 -451
- package/dist/index-BU17hud9.d.ts +0 -52
- package/dist/index-CPlPDbEY.d.ts +0 -64
- package/dist/index-Izwp_ESC.d.ts +0 -458
- package/dist/jsx-runtime-BqhMEuT4.d.ts +0 -2
- package/dist/scheduler-CmLO4Dfm.d.ts +0 -65
- package/dist/types-CsPtBGWb.d.ts +0 -16
- package/dist/types-iAmDSV6o.d.ts +0 -179
package/dist/index-Izwp_ESC.d.ts
DELETED
|
@@ -1,458 +0,0 @@
|
|
|
1
|
-
import { a as ComponentInstance, b as StateTuple, i as ReadableSource, n as ChildScope, o as Scope, r as DOMRange, u as RenderableChild } from "./control-D-FIa-n-.js";
|
|
2
|
-
import { r as JSXElement } from "./jsx-BYXe_Nnk.js";
|
|
3
|
-
import { f as QueryPrefetchContext } from "./types-iAmDSV6o.js";
|
|
4
|
-
import { t as Scheduler } from "./scheduler-CmLO4Dfm.js";
|
|
5
|
-
import { _ as CoreTelemetry } from "./index-CPlPDbEY.js";
|
|
6
|
-
import "./jsx-runtime-BqhMEuT4.js";
|
|
7
|
-
import { AuthContext, AuthRequirement } from "@askrjs/auth";
|
|
8
|
-
import { InferSchema, ObjectSchema } from "@askrjs/schema";
|
|
9
|
-
//#region src/runtime/component-scope.d.ts
|
|
10
|
-
/**
|
|
11
|
-
* Get the abort signal for the current component.
|
|
12
|
-
*
|
|
13
|
-
* The signal is guaranteed to be aborted when:
|
|
14
|
-
* - Component unmounts
|
|
15
|
-
* - Navigation occurs (different route)
|
|
16
|
-
* - Parent is destroyed
|
|
17
|
-
*/
|
|
18
|
-
declare function getSignal(): AbortSignal;
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/runtime/runtime.d.ts
|
|
21
|
-
interface RuntimeKeyedReorderDecision {
|
|
22
|
-
useFastPath: boolean;
|
|
23
|
-
totalKeyed: number;
|
|
24
|
-
totalChildren: number;
|
|
25
|
-
currentKeyCount: number;
|
|
26
|
-
moveCount: number;
|
|
27
|
-
lisLen: number;
|
|
28
|
-
hasPropChanges: boolean;
|
|
29
|
-
isWholeKeyedList: boolean;
|
|
30
|
-
}
|
|
31
|
-
interface RuntimeRendererHost {
|
|
32
|
-
evaluate(node: unknown, target: Element | null, context?: object, retainedOwner?: ComponentInstance): void;
|
|
33
|
-
cleanupInstancesUnder(node: Node): void;
|
|
34
|
-
replaceComponentRange(instance: ComponentInstance, result: unknown, host: Element | Comment): Node | null;
|
|
35
|
-
resolveChildScopeRange?(scope: ChildScope): DOMRange | null;
|
|
36
|
-
teardownNodeSubtree(root: Node): void;
|
|
37
|
-
populateKeyMapForElement(parent: Element): void;
|
|
38
|
-
getKeyMapForElement(parent: Element): Map<string | number, Element> | undefined;
|
|
39
|
-
isKeyedReorderFastPathEligible(parent: Element, children: unknown[], oldKeyMap: Map<string | number, Element> | undefined): RuntimeKeyedReorderDecision;
|
|
40
|
-
markReactivePropsDirtySource(source: ReadableSource<unknown>): void;
|
|
41
|
-
}
|
|
42
|
-
interface AskrRuntimeOptions {
|
|
43
|
-
scheduler?: Scheduler;
|
|
44
|
-
renderer?: RuntimeRendererHost;
|
|
45
|
-
}
|
|
46
|
-
declare class AskrRuntime {
|
|
47
|
-
readonly scheduler: Scheduler;
|
|
48
|
-
private rendererHost;
|
|
49
|
-
constructor(options?: AskrRuntimeOptions);
|
|
50
|
-
get renderer(): RuntimeRendererHost;
|
|
51
|
-
configureRenderer(renderer: RuntimeRendererHost): void;
|
|
52
|
-
}
|
|
53
|
-
declare function createRuntime(options?: AskrRuntimeOptions): AskrRuntime;
|
|
54
|
-
declare function getDefaultRuntime(): AskrRuntime;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/runtime/snapshot-source.d.ts
|
|
57
|
-
declare const SNAPSHOT_SOURCE_BRAND: unique symbol;
|
|
58
|
-
type SnapshotSourceBrand = {
|
|
59
|
-
readonly [SNAPSHOT_SOURCE_BRAND]: true;
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/runtime/derive.d.ts
|
|
63
|
-
interface Derived<T> extends ReadableSource<T> {
|
|
64
|
-
(): T;
|
|
65
|
-
}
|
|
66
|
-
type SnapshotSource<T> = {
|
|
67
|
-
value: T | null;
|
|
68
|
-
pending?: boolean;
|
|
69
|
-
error?: Error | null;
|
|
70
|
-
} & SnapshotSourceBrand;
|
|
71
|
-
/** Creates a render-scoped derived value; must be called during component render. */
|
|
72
|
-
declare function derive<TOut>(fn: () => TOut): Derived<TOut>;
|
|
73
|
-
declare function derive<TIn, TOut>(source: SnapshotSource<TIn> | TIn | (() => TIn), map: (value: TIn) => TOut): Derived<TOut | null>;
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/runtime/render-diagnostics.d.ts
|
|
76
|
-
interface RenderDiagnosticsOptions {
|
|
77
|
-
/** Emit one warning per component instance when a render exceeds the threshold. */
|
|
78
|
-
slowRenderWarnings?: boolean;
|
|
79
|
-
/** Slow-render threshold in milliseconds. The default is 5. */
|
|
80
|
-
slowRenderThresholdMs?: number;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Configure development render diagnostics and return a function that restores
|
|
84
|
-
* the previous configuration. Component counters and timing remain enabled
|
|
85
|
-
* when warning output is disabled.
|
|
86
|
-
*/
|
|
87
|
-
declare function configureRenderDiagnostics(options: RenderDiagnosticsOptions): () => void;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/runtime/selector.d.ts
|
|
90
|
-
interface Selector<T> {
|
|
91
|
-
(candidate: T): boolean;
|
|
92
|
-
}
|
|
93
|
-
type SelectorEquals<T> = {
|
|
94
|
-
bivarianceHack(a: T, b: T): boolean;
|
|
95
|
-
}['bivarianceHack'];
|
|
96
|
-
/**
|
|
97
|
-
* Creates a render-scoped predicate for keyed membership in reactive list rows.
|
|
98
|
-
*
|
|
99
|
-
* Use this when a `<For>` child needs to compare each stable item with a
|
|
100
|
-
* changing selected value. Unlike a plain closure capture, the predicate
|
|
101
|
-
* subscribes the affected rows and updates them without rebuilding the list.
|
|
102
|
-
* Must be called during component render.
|
|
103
|
-
*/
|
|
104
|
-
declare function selector<T>(source: () => T, equals?: SelectorEquals<T>): Selector<T>;
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/csp-nonce.d.ts
|
|
107
|
-
declare const CspNonceScope: Scope<string | undefined>;
|
|
108
|
-
declare function cspNonce(): string | undefined;
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/common/router.d.ts
|
|
111
|
-
/**
|
|
112
|
-
* Common call contracts: Router types
|
|
113
|
-
*/
|
|
114
|
-
type RouteParams = Record<string, string>;
|
|
115
|
-
type StripRoutePathSuffix<Path extends string> = Path extends `${infer Base}?${string}` ? StripRoutePathSuffix<Base> : Path extends `${infer Base}#${string}` ? StripRoutePathSuffix<Base> : Path;
|
|
116
|
-
type TrimRoutePathSlashes<Path extends string> = Path extends `/${infer Rest}` ? TrimRoutePathSlashes<Rest> : Path extends `${infer Rest}/` ? TrimRoutePathSlashes<Rest> : Path;
|
|
117
|
-
type TrimRoutePathWhitespace<Path extends string> = Path extends `${' ' | '\n' | '\t' | '\r'}${infer Rest}` ? TrimRoutePathWhitespace<Rest> : Path extends `${infer Rest}${' ' | '\n' | '\t' | '\r'}` ? TrimRoutePathWhitespace<Rest> : Path;
|
|
118
|
-
type ExtractRouteSegmentParam<Segment extends string> = Segment extends `{${infer Param}}` ? TrimRoutePathWhitespace<Param> extends `*${infer SplatParam}` ? TrimRoutePathWhitespace<SplatParam> extends '' ? never : TrimRoutePathWhitespace<SplatParam> extends '*' ? never : TrimRoutePathWhitespace<SplatParam> : TrimRoutePathWhitespace<Param> extends '' ? never : TrimRoutePathWhitespace<Param> : Segment extends '*' ? '*' : never;
|
|
119
|
-
type ExtractRoutePathParamNames<Path extends string> = TrimRoutePathSlashes<StripRoutePathSuffix<Path>> extends `${infer Segment}/${infer Rest}` ? ExtractRouteSegmentParam<Segment> | ExtractRoutePathParamNames<Rest> : ExtractRouteSegmentParam<TrimRoutePathSlashes<StripRoutePathSuffix<Path>>>;
|
|
120
|
-
type RoutePathParams<Path extends string> = [ExtractRoutePathParamNames<Path>] extends [never] ? Record<never, string> : { [Key in ExtractRoutePathParamNames<Path>]: string; };
|
|
121
|
-
/**
|
|
122
|
-
* A route page component: a regular component that receives route params as
|
|
123
|
-
* props derived from the URL pattern.
|
|
124
|
-
*
|
|
125
|
-
* Components may accept no params at all — zero-argument components are still
|
|
126
|
-
* assignable.
|
|
127
|
-
*/
|
|
128
|
-
type RouteComponent<TParams extends RouteParams = RouteParams> = (props: TParams) => RenderableChild;
|
|
129
|
-
type RouteMode = 'spa' | 'ssr' | 'ssg';
|
|
130
|
-
type AccessRedirectStatus = 301 | 302 | 303 | 307 | 308;
|
|
131
|
-
type AccessDenyStatus = 401 | 403 | 404;
|
|
132
|
-
interface AccessAllowDecision {
|
|
133
|
-
kind: 'allow';
|
|
134
|
-
}
|
|
135
|
-
interface AccessRedirectDecision {
|
|
136
|
-
kind: 'redirect';
|
|
137
|
-
to: string;
|
|
138
|
-
status?: AccessRedirectStatus;
|
|
139
|
-
replace?: boolean;
|
|
140
|
-
}
|
|
141
|
-
interface AccessDenyDecision {
|
|
142
|
-
kind: 'deny';
|
|
143
|
-
status: AccessDenyStatus;
|
|
144
|
-
}
|
|
145
|
-
type AccessDecision = AccessAllowDecision | AccessRedirectDecision | AccessDenyDecision;
|
|
146
|
-
interface RouteContext<TParams extends RouteParams = RouteParams> {
|
|
147
|
-
mode: RouteMode;
|
|
148
|
-
params: TParams;
|
|
149
|
-
pathname: string;
|
|
150
|
-
search: string;
|
|
151
|
-
hash: string;
|
|
152
|
-
href: string;
|
|
153
|
-
auth: AuthContext;
|
|
154
|
-
signal: AbortSignal;
|
|
155
|
-
}
|
|
156
|
-
type RoutePolicy = (context: RouteContext) => AccessDecision | PromiseLike<AccessDecision>;
|
|
157
|
-
type RouteAuthResolver = (context: Omit<RouteContext, 'auth'>) => AuthContext | PromiseLike<AuthContext>;
|
|
158
|
-
interface RouteAuthOptions {
|
|
159
|
-
resolve: RouteAuthResolver;
|
|
160
|
-
loginPath?: string | ((context: RouteContext) => string | PromiseLike<string>);
|
|
161
|
-
authenticatedRedirectTo?: string | ((context: RouteContext) => string | PromiseLike<string>);
|
|
162
|
-
}
|
|
163
|
-
interface CommonAccessOptions {
|
|
164
|
-
auth?: AuthRequirement;
|
|
165
|
-
policies?: readonly RoutePolicy[];
|
|
166
|
-
}
|
|
167
|
-
type RouteMetaSource<TParams extends RouteParams = RouteParams> = RouteMeta | ((context: RouteContext<TParams>) => RouteMeta | PromiseLike<RouteMeta>);
|
|
168
|
-
/**
|
|
169
|
-
* Options for `route()` declarations.
|
|
170
|
-
*
|
|
171
|
-
* - `loader`: server data loader called before render, result passed as SSR data
|
|
172
|
-
* - `entries`: SSG entry generator — returns one param map per static page
|
|
173
|
-
* - `title`: page title hint used by SSG and document-meta integrations
|
|
174
|
-
* - `namespace`: MFE namespace key for grouped route management
|
|
175
|
-
*/
|
|
176
|
-
interface RouteOptions<TParams extends RouteParams = RouteParams, TSearchSchema extends ObjectSchema<RouteSearch> | undefined = ObjectSchema<RouteSearch> | undefined, TLoaderData = unknown, TDehydratedData = TLoaderData> extends CommonAccessOptions {
|
|
177
|
-
loader?: (context: RouteContext<TParams> & {
|
|
178
|
-
request?: Request;
|
|
179
|
-
}) => TLoaderData | PromiseLike<TLoaderData>;
|
|
180
|
-
/**
|
|
181
|
-
* Select the loader data transported to the browser for initial hydration.
|
|
182
|
-
*
|
|
183
|
-
* Server rendering still receives the complete loader value. The selector
|
|
184
|
-
* must be synchronous; client navigations rerun the loader and receive its
|
|
185
|
-
* complete result.
|
|
186
|
-
*/
|
|
187
|
-
dehydrate?: (data: TLoaderData, context: RouteContext<TParams> & {
|
|
188
|
-
request?: Request;
|
|
189
|
-
}) => TDehydratedData extends PromiseLike<unknown> ? never : TDehydratedData;
|
|
190
|
-
preload?: (context: RouteContext<TParams> & {
|
|
191
|
-
request?: Request;
|
|
192
|
-
data: QueryPrefetchContext;
|
|
193
|
-
}) => unknown;
|
|
194
|
-
entries?: () => Array<TParams> | Promise<Array<TParams>>;
|
|
195
|
-
/** Optional invalidation keys used by incremental SSG generation. */
|
|
196
|
-
invalidationKeys?: readonly string[];
|
|
197
|
-
title?: string;
|
|
198
|
-
namespace?: string;
|
|
199
|
-
search?: TSearchSchema;
|
|
200
|
-
meta?: RouteMetaSource<TParams>;
|
|
201
|
-
actions?: readonly ActionDescriptor[];
|
|
202
|
-
}
|
|
203
|
-
interface RouteMeta {
|
|
204
|
-
title?: string;
|
|
205
|
-
description?: string;
|
|
206
|
-
canonical?: string;
|
|
207
|
-
robots?: string;
|
|
208
|
-
openGraph?: Record<string, string>;
|
|
209
|
-
links?: readonly {
|
|
210
|
-
rel: string;
|
|
211
|
-
href: string;
|
|
212
|
-
[key: string]: string;
|
|
213
|
-
}[];
|
|
214
|
-
jsonLd?: unknown | readonly unknown[];
|
|
215
|
-
html?: {
|
|
216
|
-
lang?: string;
|
|
217
|
-
dir?: 'ltr' | 'rtl' | 'auto';
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
/** A stable, typed reference returned by route() for destination construction. */
|
|
221
|
-
type RouteSearchValue = string | number | boolean | null | undefined | readonly (string | number | boolean | null)[];
|
|
222
|
-
type RouteSearch = Record<string, RouteSearchValue>;
|
|
223
|
-
interface RouteRef<TParams extends RouteParams = RouteParams, TSearch = RouteSearch> {
|
|
224
|
-
readonly path: string;
|
|
225
|
-
/** @internal Executable schema retained for destination validation. */
|
|
226
|
-
readonly searchSchema?: ObjectSchema<TSearch & RouteSearch>;
|
|
227
|
-
/** @internal Public mount point captured by createRouteRegistry(). */
|
|
228
|
-
readonly basePath?: string;
|
|
229
|
-
readonly __params?: TParams;
|
|
230
|
-
readonly __search?: TSearch;
|
|
231
|
-
}
|
|
232
|
-
type RouteRefSearch<TSchema extends ObjectSchema<RouteSearch> | undefined> = TSchema extends ObjectSchema<RouteSearch> ? InferSchema<TSchema> : RouteSearch;
|
|
233
|
-
interface RouteDestination {
|
|
234
|
-
readonly href: string;
|
|
235
|
-
}
|
|
236
|
-
interface PageHelperOptions extends CommonAccessOptions {
|
|
237
|
-
preload?: (context: RouteContext & {
|
|
238
|
-
request?: Request;
|
|
239
|
-
data: QueryPrefetchContext;
|
|
240
|
-
}) => unknown;
|
|
241
|
-
meta?: RouteMetaSource;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* A single parsed segment from a route path.
|
|
245
|
-
*
|
|
246
|
-
* - `static`: a literal path segment, e.g. `"users"` in `/users/{id}`
|
|
247
|
-
* - `param`: a `{name}` capture group — `value` holds the param name
|
|
248
|
-
* - `wildcard`: a bare `*` segment that captures exactly one segment
|
|
249
|
-
* - `splat`: a `{*name}` capture group that captures the remaining path
|
|
250
|
-
* - `catchall`: the `/*` catch-all that matches any depth
|
|
251
|
-
*/
|
|
252
|
-
interface ParsedSegment {
|
|
253
|
-
kind: 'static' | 'param' | 'wildcard' | 'splat' | 'catchall';
|
|
254
|
-
/** For static/wildcard/catchall: the literal text; for param: the param name. */
|
|
255
|
-
value: string;
|
|
256
|
-
}
|
|
257
|
-
/** Resolved layout component as stored in a route record's layout chain. */
|
|
258
|
-
interface LayoutScopeRecord {
|
|
259
|
-
component: (props: {
|
|
260
|
-
children?: RenderableChild;
|
|
261
|
-
}) => RenderableChild;
|
|
262
|
-
}
|
|
263
|
-
/** Resolved page host component as stored in a route record's page chain. */
|
|
264
|
-
interface PageScopeRecord {
|
|
265
|
-
component: RouteComponent;
|
|
266
|
-
}
|
|
267
|
-
interface RouteRegistryOptions {
|
|
268
|
-
auth?: RouteAuthOptions;
|
|
269
|
-
/** Public pathname prefix for applications mounted below the origin root. */
|
|
270
|
-
basePath?: string;
|
|
271
|
-
}
|
|
272
|
-
type RouteDefinition = () => void;
|
|
273
|
-
interface RouteRequestOptions {
|
|
274
|
-
/** Explicit route source shared by the application renderers. */
|
|
275
|
-
registry: RouteRegistry;
|
|
276
|
-
mode?: RouteMode;
|
|
277
|
-
/** @internal Hydration adopts server loader data instead of rerunning it. */
|
|
278
|
-
load?: boolean;
|
|
279
|
-
auth?: RouteAuthOptions;
|
|
280
|
-
authContext?: AuthContext;
|
|
281
|
-
signal?: AbortSignal;
|
|
282
|
-
request?: Request;
|
|
283
|
-
telemetry?: CoreTelemetry;
|
|
284
|
-
}
|
|
285
|
-
interface RouteRenderResult<TParams extends RouteParams = RouteParams> {
|
|
286
|
-
kind: 'render';
|
|
287
|
-
handler: RouteHandler<TParams>;
|
|
288
|
-
params: TParams;
|
|
289
|
-
record?: RouteRecord;
|
|
290
|
-
}
|
|
291
|
-
type RouteRequestResult<TParams extends RouteParams = RouteParams> = RouteRenderResult<TParams> | AccessRedirectDecision | AccessDenyDecision | null;
|
|
292
|
-
interface GroupHelperOptions extends CommonAccessOptions {
|
|
293
|
-
layout?: (props: {
|
|
294
|
-
children?: RenderableChild;
|
|
295
|
-
}) => RenderableChild;
|
|
296
|
-
meta?: RouteMetaSource;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* A fully normalized route record produced by `route(path, Component, options?)`.
|
|
300
|
-
*
|
|
301
|
-
* This is the canonical representation shared by:
|
|
302
|
-
* - SPA matching and navigation
|
|
303
|
-
* - SSR request resolution
|
|
304
|
-
* - SSG manifest expansion
|
|
305
|
-
*/
|
|
306
|
-
interface RouteRecord {
|
|
307
|
-
/** Canonical normalized absolute path, e.g. `/posts/{slug}` */
|
|
308
|
-
path: string;
|
|
309
|
-
/** The page component to render when this route is active */
|
|
310
|
-
component: RouteComponent;
|
|
311
|
-
/** Pre-parsed segment list for fast matching and typed param extraction */
|
|
312
|
-
segments: ParsedSegment[];
|
|
313
|
-
/** Pre-computed specificity rank (higher = more specific) */
|
|
314
|
-
rank: number;
|
|
315
|
-
/** Layout chain from outermost to innermost, applied automatically on render */
|
|
316
|
-
layoutChain: LayoutScopeRecord[];
|
|
317
|
-
/** Page chain from outermost to innermost, composed through Outlet before layouts apply */
|
|
318
|
-
pageChain: PageScopeRecord[];
|
|
319
|
-
/** Route metadata: loader, entries, policies, title, namespace */
|
|
320
|
-
options: RouteOptions;
|
|
321
|
-
/** Metadata sources ordered from outermost group/page to the route leaf. */
|
|
322
|
-
metaChain?: readonly RouteMetaSource[];
|
|
323
|
-
/** True when this is the `/*` catch-all fallback route */
|
|
324
|
-
isFallback: boolean;
|
|
325
|
-
/**
|
|
326
|
-
* Runtime-ready handler with layout composition baked in.
|
|
327
|
-
* Compatible with the low-level `RouteHandler` signature so that navigation
|
|
328
|
-
* and SSR rendering do not need to know about layout chains.
|
|
329
|
-
*/
|
|
330
|
-
handler: RouteHandler;
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* The normalized route manifest produced by registered route definitions.
|
|
334
|
-
* declarations. Pass it to `createSPA`, `hydrateSPA`, or `renderToString`
|
|
335
|
-
* instead of assembling plain `Route[]` arrays.
|
|
336
|
-
*
|
|
337
|
-
* ```ts
|
|
338
|
-
* import { createRouteRegistry } from '@askrjs/askr/router';
|
|
339
|
-
* const registry = createRouteRegistry(() => { ... });
|
|
340
|
-
* await createSPA({ root: '#app', registry });
|
|
341
|
-
* ```
|
|
342
|
-
*/
|
|
343
|
-
interface RouteManifest {
|
|
344
|
-
records: RouteRecord[];
|
|
345
|
-
auth?: RouteAuthOptions;
|
|
346
|
-
/** Normalized public pathname prefix. Empty and root mounts omit it. */
|
|
347
|
-
basePath?: string;
|
|
348
|
-
}
|
|
349
|
-
declare const routeRegistryBrand: unique symbol;
|
|
350
|
-
interface RouteHandler<TParams extends RouteParams = RouteParams> {
|
|
351
|
-
(params: TParams, context?: {
|
|
352
|
-
signal: AbortSignal;
|
|
353
|
-
}): RenderableChild;
|
|
354
|
-
}
|
|
355
|
-
interface Route<TParams extends RouteParams = RouteParams> {
|
|
356
|
-
path: string;
|
|
357
|
-
handler: RouteHandler<TParams>;
|
|
358
|
-
namespace?: string;
|
|
359
|
-
}
|
|
360
|
-
interface RouteRegistry {
|
|
361
|
-
/** Internal brand: registries must come from createRouteRegistry(). */
|
|
362
|
-
readonly [routeRegistryBrand]: true;
|
|
363
|
-
manifest: RouteManifest;
|
|
364
|
-
routes: readonly Route[];
|
|
365
|
-
}
|
|
366
|
-
interface RouteMatch<TParams extends RouteParams = RouteParams> {
|
|
367
|
-
path: string;
|
|
368
|
-
params: Readonly<TParams>;
|
|
369
|
-
name?: string;
|
|
370
|
-
namespace?: string;
|
|
371
|
-
}
|
|
372
|
-
interface RouteQuery {
|
|
373
|
-
get(key: string): string | null;
|
|
374
|
-
getAll(key: string): string[];
|
|
375
|
-
has(key: string): boolean;
|
|
376
|
-
toJSON(): Record<string, string | string[]>;
|
|
377
|
-
}
|
|
378
|
-
interface RouteSnapshot<TParams extends RouteParams = RouteParams> {
|
|
379
|
-
path: string;
|
|
380
|
-
params: Readonly<TParams>;
|
|
381
|
-
query: Readonly<RouteQuery>;
|
|
382
|
-
hash: string | null;
|
|
383
|
-
name?: string;
|
|
384
|
-
namespace?: string;
|
|
385
|
-
matches: readonly RouteMatch<TParams>[];
|
|
386
|
-
}
|
|
387
|
-
//#endregion
|
|
388
|
-
//#region src/common/render-context.d.ts
|
|
389
|
-
interface DeferredBoundaryRegistration {
|
|
390
|
-
id: string;
|
|
391
|
-
promise: Promise<unknown>;
|
|
392
|
-
fulfilled(value: unknown): RenderableChild;
|
|
393
|
-
rejected(error: unknown): RenderableChild;
|
|
394
|
-
}
|
|
395
|
-
interface SSRPortalHostRegistration {
|
|
396
|
-
token: string;
|
|
397
|
-
automatic: boolean;
|
|
398
|
-
}
|
|
399
|
-
interface SSRPortalSlot {
|
|
400
|
-
hasValue: boolean;
|
|
401
|
-
value: RenderableChild | undefined;
|
|
402
|
-
hosts: SSRPortalHostRegistration[];
|
|
403
|
-
}
|
|
404
|
-
interface SSRPortalState {
|
|
405
|
-
slots: Map<object, SSRPortalSlot>;
|
|
406
|
-
nextHostId: number;
|
|
407
|
-
}
|
|
408
|
-
/** Register request-local CSS produced during SSR without importing the SSR renderer in clients. */
|
|
409
|
-
declare function registerSSRStyle(id: string, cssText: string): void;
|
|
410
|
-
//#endregion
|
|
411
|
-
//#region src/ref.d.ts
|
|
412
|
-
/**
|
|
413
|
-
* Creates a stable holder for an intrinsic element ref.
|
|
414
|
-
*
|
|
415
|
-
* The renderer mutates `current` during commit and clears it during cleanup.
|
|
416
|
-
* Updating the holder never schedules a render.
|
|
417
|
-
*/
|
|
418
|
-
interface Ref<T extends Element = Element> {
|
|
419
|
-
current: T | null;
|
|
420
|
-
}
|
|
421
|
-
declare function createRef<T extends Element = Element>(): Ref<T>;
|
|
422
|
-
//#endregion
|
|
423
|
-
//#region src/actions/index.d.ts
|
|
424
|
-
interface ActionDescriptor<TInput extends Record<string, unknown> = Record<string, unknown>> {
|
|
425
|
-
readonly id: string;
|
|
426
|
-
readonly input: ObjectSchema<TInput>;
|
|
427
|
-
readonly invalidates: readonly string[];
|
|
428
|
-
}
|
|
429
|
-
declare function defineAction<TInput extends Record<string, unknown>>(options: {
|
|
430
|
-
readonly id: string;
|
|
431
|
-
readonly input: ObjectSchema<TInput>;
|
|
432
|
-
readonly invalidates?: readonly string[];
|
|
433
|
-
}): ActionDescriptor<TInput>;
|
|
434
|
-
/** A native form bound to a declared action; it is not a synthetic event API. */
|
|
435
|
-
declare function ActionForm<TInput extends Record<string, unknown>>({ action, children, ...props }: {
|
|
436
|
-
readonly action: ActionDescriptor<TInput>;
|
|
437
|
-
readonly children?: RenderableChild;
|
|
438
|
-
readonly [key: string]: unknown;
|
|
439
|
-
}): JSXElement;
|
|
440
|
-
interface ActionValidationError {
|
|
441
|
-
readonly kind: 'invalid';
|
|
442
|
-
readonly action: string;
|
|
443
|
-
readonly values: Readonly<Record<string, unknown>>;
|
|
444
|
-
readonly issues: readonly unknown[];
|
|
445
|
-
readonly fieldErrors: Readonly<Record<string, readonly string[]>>;
|
|
446
|
-
}
|
|
447
|
-
interface ActionStatus<TResult = unknown> {
|
|
448
|
-
readonly pending: boolean;
|
|
449
|
-
readonly result?: TResult;
|
|
450
|
-
readonly error?: unknown;
|
|
451
|
-
}
|
|
452
|
-
/** Returns a command handle, rather than a hook. */
|
|
453
|
-
declare function action<TInput extends Record<string, unknown>, TResult = unknown>(descriptor: ActionDescriptor<TInput>): {
|
|
454
|
-
state: StateTuple<ActionStatus<TResult>>;
|
|
455
|
-
submit(input: TInput): Promise<TResult>;
|
|
456
|
-
};
|
|
457
|
-
//#endregion
|
|
458
|
-
export { cspNonce as $, RouteHandler as A, RouteQuery as B, Route as C, RouteContext as D, RouteComponent as E, RouteMode as F, RouteRegistryOptions as G, RouteRef as H, RouteOptions as I, RouteRequestResult as J, RouteRenderResult as K, RouteParams as L, RouteMatch as M, RouteMeta as N, RouteDefinition as O, RouteMetaSource as P, CspNonceScope as Q, RoutePathParams as R, ParsedSegment as S, RouteAuthResolver as T, RouteRefSearch as U, RouteRecord as V, RouteRegistry as W, RouteSearchValue as X, RouteSearch as Y, RouteSnapshot as Z, AccessRedirectStatus as _, action as a, derive as at, PageHelperOptions as b, createRef as c, RuntimeKeyedReorderDecision as ct, registerSSRStyle as d, getDefaultRuntime as dt, Selector as et, AccessAllowDecision as f, getSignal as ft, AccessRedirectDecision as g, AccessDenyStatus as h, ActionValidationError as i, Derived as it, RouteManifest as j, RouteDestination as k, DeferredBoundaryRegistration as l, RuntimeRendererHost as lt, AccessDenyDecision as m, ActionForm as n, RenderDiagnosticsOptions as nt, defineAction as o, AskrRuntime as ot, AccessDecision as p, RouteRequestOptions as q, ActionStatus as r, configureRenderDiagnostics as rt, Ref as s, AskrRuntimeOptions as st, ActionDescriptor as t, selector as tt, SSRPortalState as u, createRuntime as ut, GroupHelperOptions as v, RouteAuthOptions as w, PageScopeRecord as x, LayoutScopeRecord as y, RoutePolicy as z };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
//#region src/runtime/scheduler.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Serialized update scheduler — safer design (no inline execution, explicit flush)
|
|
4
|
-
*
|
|
5
|
-
* Key ideas:
|
|
6
|
-
* - Never execute a task inline from `enqueue`.
|
|
7
|
-
* - `flush()` is explicit and non-reentrant.
|
|
8
|
-
* - `runWithSyncProgress()` allows enqueues temporarily but does not run tasks
|
|
9
|
-
* inline; it runs `fn` and then does an explicit `flush()`.
|
|
10
|
-
* - `waitForFlush()` is race-free with a monotonic `flushVersion`.
|
|
11
|
-
*/
|
|
12
|
-
type Task = () => void;
|
|
13
|
-
type SchedulerLane = 'derived' | 'component' | 'reactive' | 'post';
|
|
14
|
-
type SchedulerBulkCommitProbe = () => boolean;
|
|
15
|
-
declare class Scheduler {
|
|
16
|
-
private bulkCommitProbe;
|
|
17
|
-
private lanes;
|
|
18
|
-
private running;
|
|
19
|
-
private inHandler;
|
|
20
|
-
private depth;
|
|
21
|
-
private executionDepth;
|
|
22
|
-
private flushVersion;
|
|
23
|
-
private kickScheduled;
|
|
24
|
-
private allowSyncProgress;
|
|
25
|
-
private waiters;
|
|
26
|
-
private taskCount;
|
|
27
|
-
setBulkCommitProbe(probe: SchedulerBulkCommitProbe): void;
|
|
28
|
-
private isBulkCommitActive;
|
|
29
|
-
private hasPendingTasks;
|
|
30
|
-
private getPendingTaskCount;
|
|
31
|
-
private compactLane;
|
|
32
|
-
private scheduleFlushKick;
|
|
33
|
-
enqueue(task: Task): void;
|
|
34
|
-
enqueueInLane(lane: SchedulerLane, task: Task): void;
|
|
35
|
-
flush(): void;
|
|
36
|
-
runWithSyncProgress<T>(fn: () => T): T;
|
|
37
|
-
waitForFlush(targetVersion?: number, timeoutMs?: number): Promise<void>;
|
|
38
|
-
getState(): {
|
|
39
|
-
queueLength: number;
|
|
40
|
-
running: boolean;
|
|
41
|
-
depth: number;
|
|
42
|
-
executionDepth: number;
|
|
43
|
-
taskCount: number;
|
|
44
|
-
flushVersion: number;
|
|
45
|
-
laneQueues: {
|
|
46
|
-
derived: number;
|
|
47
|
-
component: number;
|
|
48
|
-
reactive: number;
|
|
49
|
-
post: number;
|
|
50
|
-
};
|
|
51
|
-
inHandler: boolean;
|
|
52
|
-
allowSyncProgress: boolean;
|
|
53
|
-
};
|
|
54
|
-
getFlushVersion(): number;
|
|
55
|
-
flushIfQueued(): void;
|
|
56
|
-
runInHandlerScope<T>(fn: () => T, flushMode?: 'defer' | 'sync'): T;
|
|
57
|
-
setInHandler(v: boolean): void;
|
|
58
|
-
isInHandler(): boolean;
|
|
59
|
-
isExecuting(): boolean;
|
|
60
|
-
clearPendingSyncTasks(): number;
|
|
61
|
-
private resolveWaiters;
|
|
62
|
-
}
|
|
63
|
-
declare function scheduleEventHandler(handler: EventListener): EventListener;
|
|
64
|
-
//#endregion
|
|
65
|
-
export { scheduleEventHandler as n, Scheduler as t };
|
package/dist/types-CsPtBGWb.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./jsx-BYXe_Nnk.js";
|
|
2
|
-
//#region src/jsx/types.d.ts
|
|
3
|
-
declare global {
|
|
4
|
-
namespace JSX {
|
|
5
|
-
interface Element extends JSXElement {
|
|
6
|
-
readonly __askrJsxElementBrand?: never;
|
|
7
|
-
}
|
|
8
|
-
interface IntrinsicElements extends KnownIntrinsicElementProps {}
|
|
9
|
-
interface ElementAttributesProperty {
|
|
10
|
-
props: Props;
|
|
11
|
-
}
|
|
12
|
-
interface ElementChildrenAttribute {
|
|
13
|
-
children: unknown;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|