@markless/router 0.4.0 → 0.6.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.
@@ -0,0 +1,2 @@
1
+ import { a as __marklessDebugInvalidateElement, c as __marklessDebugRegisterDelegatedEvents, d as __marklessDebugSetBoundaries, f as __marklessDebugStartContainer, i as __marklessDebugDisposeContainer, l as __marklessDebugRegisterRouter, n as __marklessDebugBootstrapSource, o as __marklessDebugRecordInteraction, r as __marklessDebugChannelForTest, s as __marklessDebugRecordViolation, t as __marklessDebugActivateContainer, u as __marklessDebugResetForTest } from "./debug-channel-Di6SppZv.js";
2
+ export { __marklessDebugActivateContainer, __marklessDebugBootstrapSource, __marklessDebugChannelForTest, __marklessDebugDisposeContainer, __marklessDebugInvalidateElement, __marklessDebugRecordInteraction, __marklessDebugRecordViolation, __marklessDebugRegisterDelegatedEvents, __marklessDebugRegisterRouter, __marklessDebugResetForTest, __marklessDebugSetBoundaries, __marklessDebugStartContainer };
@@ -1,20 +1,4 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true
8
- });
9
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
- return target;
11
- };
12
- //#endregion
13
1
  //#region ../web/src/debug-channel.ts
14
- var debug_channel_exports = /* @__PURE__ */ __exportAll({
15
- __marklessDebugBootstrapSource: () => __marklessDebugBootstrapSource,
16
- __marklessDebugRegisterRouter: () => __marklessDebugRegisterRouter
17
- });
18
2
  function installDebugChannelLayer(root, initialPhase, initiallyActive = true) {
19
3
  const global = globalThis;
20
4
  const previous = global.__MARKLESS_DEBUG__?.version === 1 ? global.__MARKLESS_DEBUG__ : void 0;
@@ -247,9 +231,33 @@ function safely(run) {
247
231
  return;
248
232
  }
249
233
  }
234
+ function __marklessDebugRegisterDelegatedEvents(root, eventNames) {
235
+ safely(() => moduleRoots.get(root)?.delegated(eventNames));
236
+ }
250
237
  function __marklessDebugBootstrapSource() {
251
238
  return `((root,phase,active)=>{const controls=(${installDebugChannelLayer.toString()})(root,phase,active);return Object.freeze({record:(element,eventName,input)=>controls.record(element,eventName,input),delegated:(eventNames)=>controls.delegated(eventNames),router:(source)=>controls.router(source),activate:()=>controls.activate()})})`;
252
239
  }
240
+ function __marklessDebugChannelForTest() {
241
+ return globalThis.__MARKLESS_DEBUG__;
242
+ }
243
+ function __marklessDebugStartContainer(root, phase, active = true) {
244
+ return safely(() => controlsFor(root, phase, active).start(phase, active)) ?? "";
245
+ }
246
+ function __marklessDebugActivateContainer(root) {
247
+ safely(() => controlsFor(root, "ssr-resume").activate());
248
+ }
249
+ function __marklessDebugDisposeContainer(root) {
250
+ safely(() => moduleRoots.get(root)?.dispose());
251
+ }
252
+ function __marklessDebugInvalidateElement(root, element) {
253
+ safely(() => moduleRoots.get(root)?.invalidate(element));
254
+ }
255
+ function __marklessDebugRecordInteraction(root, element, eventName, input) {
256
+ safely(() => (moduleRoots.get(root) ?? controlsFor(root, "csr")).record(element, eventName, input));
257
+ }
258
+ function __marklessDebugRecordViolation(input) {
259
+ safely(() => latestControls?.violation(input));
260
+ }
253
261
  function __marklessDebugRegisterRouter(root, source) {
254
262
  if (root) safely(() => (moduleRoots.get(root) ?? controlsFor(root, "ssr-resume")).router(source));
255
263
  else safely(() => {
@@ -258,5 +266,16 @@ function __marklessDebugRegisterRouter(root, source) {
258
266
  (latestControls ?? inlineControls)?.router(source);
259
267
  });
260
268
  }
269
+ function __marklessDebugSetBoundaries(root, boundaries) {
270
+ safely(() => moduleRoots.get(root)?.boundaries(boundaries));
271
+ }
272
+ function __marklessDebugResetForTest() {
273
+ const global = globalThis;
274
+ moduleRoots = /* @__PURE__ */ new WeakMap();
275
+ latestControls = void 0;
276
+ delete global.__MARKLESS_DEBUG__;
277
+ delete global[Symbol.for("markless.debug.channel.v1.bootstrap")];
278
+ delete global[Symbol.for("markless.debug.channel.v1.router-sources")];
279
+ }
261
280
  //#endregion
262
- export { debug_channel_exports as n, __exportAll as r, __marklessDebugBootstrapSource as t };
281
+ export { __marklessDebugInvalidateElement as a, __marklessDebugRegisterDelegatedEvents as c, __marklessDebugSetBoundaries as d, __marklessDebugStartContainer as f, __marklessDebugDisposeContainer as i, __marklessDebugRegisterRouter as l, __marklessDebugBootstrapSource as n, __marklessDebugRecordInteraction as o, __marklessDebugChannelForTest as r, __marklessDebugRecordViolation as s, __marklessDebugActivateContainer as t, __marklessDebugResetForTest as u };
@@ -0,0 +1,248 @@
1
+ import { createExternalDelegateStructureTokens, createExternalDelegateView } from "@markless/web/fns/external-delegate";
2
+ //#region src/route-dom.d.ts
3
+ declare const HTML_ATTRIBUTES_SLOT = "__marklessRouterHtmlAttributes";
4
+ //#endregion
5
+ //#region src/route-manifest.d.ts
6
+ interface RouteManifestRoute {
7
+ readonly pathname: string;
8
+ readonly pattern: string;
9
+ readonly file: string;
10
+ readonly params: readonly RouteManifestParam[];
11
+ }
12
+ interface RouteManifestParam {
13
+ readonly name: string;
14
+ readonly kind: 'dynamic' | 'catch-all';
15
+ }
16
+ interface RouteManifestStatusPages {
17
+ readonly notFound?: string;
18
+ readonly error?: string;
19
+ }
20
+ interface RouteManifest {
21
+ readonly routes: readonly RouteManifestRoute[];
22
+ readonly statusPages: RouteManifestStatusPages;
23
+ }
24
+ interface RouteManifestMatch {
25
+ readonly route: RouteManifestRoute;
26
+ readonly params: Readonly<Record<string, string>>;
27
+ }
28
+ declare function buildRouteManifestFromFileIds(fileIds: readonly string[]): RouteManifest;
29
+ declare function normalizeRequestPathname(pathname: string): string;
30
+ declare function normalizeRouteFileId(fileId: string): string;
31
+ declare function matchRouteManifest(pathname: string, manifest: RouteManifest): RouteManifestMatch | undefined;
32
+ //#endregion
33
+ //#region src/request-files.d.ts
34
+ type RequestFileDiagnosticCode = 'http-method-export' | 'invalid-cache-metadata' | 'missing-default-function';
35
+ interface RequestFileDiagnostic {
36
+ readonly code: RequestFileDiagnosticCode;
37
+ readonly message: string;
38
+ }
39
+ interface RequestFileDefaultExport {
40
+ readonly kind: 'function';
41
+ readonly parameterName?: string;
42
+ }
43
+ interface RequestFileParam {
44
+ readonly name: string;
45
+ readonly kind: 'dynamic' | 'catch-all';
46
+ }
47
+ interface ApiRequestFileRoute {
48
+ readonly pathname: string;
49
+ readonly pattern: string;
50
+ readonly params: readonly RequestFileParam[];
51
+ }
52
+ interface ApiRequestFileCache {
53
+ readonly maxAge: number;
54
+ }
55
+ interface RequestFileTransformResult {
56
+ readonly code: string;
57
+ readonly file: string;
58
+ readonly kind: 'api' | 'middleware';
59
+ }
60
+ type ApiRequestFileMethod = 'all' | 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
61
+ type RequestFileParseResult = {
62
+ readonly diagnostics: readonly [];
63
+ readonly file: string;
64
+ readonly kind: 'none';
65
+ } | {
66
+ readonly cache?: ApiRequestFileCache;
67
+ readonly defaultExport?: RequestFileDefaultExport;
68
+ readonly diagnostics: readonly RequestFileDiagnostic[];
69
+ readonly file: string;
70
+ readonly kind: 'api';
71
+ readonly method: ApiRequestFileMethod;
72
+ readonly route: ApiRequestFileRoute;
73
+ } | {
74
+ readonly defaultExport?: RequestFileDefaultExport;
75
+ readonly diagnostics: readonly RequestFileDiagnostic[];
76
+ readonly file: string;
77
+ readonly kind: 'middleware';
78
+ };
79
+ declare function parseRequestFile(fileId: string, sourceText: string): RequestFileParseResult;
80
+ declare function normalizeRequestFileId(fileId: string): string;
81
+ declare function transformRequestFileSource(fileId: string, sourceText: string): RequestFileTransformResult | undefined;
82
+ //#endregion
83
+ //#region src/navigate.d.ts
84
+ interface NavigateOptions {
85
+ /** Replace the current history entry instead of adding one. */
86
+ readonly replace?: boolean;
87
+ /** `false` keeps the scroll position. */
88
+ readonly scroll?: boolean;
89
+ }
90
+ /**
91
+ * Navigates to `href` exactly as a click on `<Link href={href}>` would: a page of this app swaps in
92
+ * place, anything else loads as a document. The promise resolves once the new page is in place; a
93
+ * navigation that loads a new document leaves this page, so its promise never settles.
94
+ * Runs in the browser only.
95
+ */
96
+ declare function navigate(href: string | URL, options?: NavigateOptions): Promise<void>;
97
+ //#endregion
98
+ //#region src/route-renderer.d.ts
99
+ declare function startRouteUpdateRenderer(document?: Document): void;
100
+ //#endregion
101
+ //#region src/spa-navigation.d.ts
102
+ type MarklessRouterNavigationRuntime = Pick<Navigation, 'addEventListener' | 'navigate'>;
103
+ interface MarklessRouterNavigationWindow {
104
+ readonly document: Document;
105
+ readonly location: Location;
106
+ navigation?: MarklessRouterNavigationRuntime;
107
+ addEventListener(type: 'click', listener: (event: MouseEvent) => void, options?: boolean | AddEventListenerOptions): void;
108
+ }
109
+ interface MarklessRouterNavigationPolyfillModule {
110
+ applyPolyfill(options: {
111
+ readonly interceptEvents: boolean;
112
+ readonly window: MarklessRouterNavigationWindow;
113
+ }): unknown;
114
+ }
115
+ interface StartSpaNavigationOptions {
116
+ readonly documentModuleLoader?: () => Promise<unknown>;
117
+ readonly documentNavigation?: 'client' | 'document';
118
+ readonly loadPolyfill?: () => Promise<MarklessRouterNavigationPolyfillModule>;
119
+ readonly pageModuleLoaders: Record<string, () => Promise<unknown>>;
120
+ readonly preloadRouteModule?: (file: string) => unknown;
121
+ readonly routeFileIds: readonly string[];
122
+ readonly window?: MarklessRouterNavigationWindow;
123
+ }
124
+ declare function __marklessRouterStartSpaNavigation(options: StartSpaNavigationOptions): Promise<void>;
125
+ declare function ensureNavigationRuntime(runtimeWindow?: MarklessRouterNavigationWindow, loadPolyfill?: () => Promise<MarklessRouterNavigationPolyfillModule>): Promise<MarklessRouterNavigationRuntime>;
126
+ //#endregion
127
+ //#region src/route-state.d.ts
128
+ declare const MARKLESS_ROUTER_ROUTE_EVENT = "marklessrouternavigate";
129
+ declare const MARKLESS_ROUTER_RENDERED_EVENT = "marklessrouterrendered";
130
+ interface RouteState {
131
+ readonly file: string;
132
+ readonly params: Readonly<Record<string, string>>;
133
+ readonly status: number;
134
+ readonly url: string;
135
+ }
136
+ interface RoutePageModule {
137
+ readonly default?: unknown;
138
+ }
139
+ interface RouteDocumentModule {
140
+ readonly default?: unknown;
141
+ }
142
+ interface RouteUpdate {
143
+ readonly document?: RouteDocumentModule;
144
+ readonly page: RoutePageModule;
145
+ readonly route: RouteState;
146
+ readonly signal?: AbortSignal;
147
+ readonly onRendered?: () => void;
148
+ }
149
+ declare function routePageProps(route: RouteState): Omit<PageProps, 'http'>;
150
+ declare function dispatchRouteUpdate(document: Document, update: RouteUpdate): void;
151
+ //#endregion
152
+ //#region src/index.d.ts
153
+ interface PageProps<Params extends object = Readonly<Record<string, string>>, Locals extends object = AppLocals> {
154
+ /**
155
+ * The request and the response being written, the same object API routes and middleware get.
156
+ * It exists only while the page renders on the server: the compiler refuses any read of it from
157
+ * code that runs in the browser. Set `http.response.status` and `http.response.headers` before the
158
+ * first byte is sent; a later write that changes them throws `MARKLESS_ROUTER_RESPONSE_COMMITTED`.
159
+ */
160
+ readonly http: HttpContext<Locals>;
161
+ readonly params: Readonly<Params>;
162
+ readonly url: {
163
+ readonly href: string;
164
+ readonly pathname: string;
165
+ readonly search: string;
166
+ };
167
+ readonly status: number;
168
+ }
169
+ interface MarklessRouterGeneratedRoutes {}
170
+ interface LinkNavigationProps {
171
+ /**
172
+ * `false`: nothing for this link downloads before it is clicked. Only page routes are ever
173
+ * prefetched (with a `Purpose: prefetch` header), never `/api` endpoints; set `false` on a link to
174
+ * a page whose GET has side effects (a one-time token, a counter) so only the click requests it.
175
+ */
176
+ readonly prefetch?: boolean;
177
+ readonly replace?: boolean;
178
+ readonly scroll?: boolean;
179
+ }
180
+ type DefaultLinkProps = {
181
+ readonly href?: string;
182
+ readonly children?: __MarklessTypeService.Child;
183
+ readonly class?: string;
184
+ readonly id?: string;
185
+ readonly target?: string;
186
+ readonly rel?: string;
187
+ readonly [prop: string]: unknown;
188
+ } & LinkNavigationProps;
189
+ type LinkProps = MarklessRouterGeneratedRoutes extends {
190
+ readonly link: infer Props;
191
+ } ? Props & Pick<DefaultLinkProps, 'children' | 'class' | 'id' | 'target' | 'rel'> & {
192
+ readonly [prop: string]: unknown;
193
+ } : DefaultLinkProps;
194
+ interface AppLocals {}
195
+ interface HttpResponse {
196
+ readonly headers: Headers;
197
+ status?: number;
198
+ statusText?: string;
199
+ }
200
+ interface HttpContext<Locals extends object = AppLocals> {
201
+ readonly locals: Locals;
202
+ readonly request: Request;
203
+ readonly response: HttpResponse;
204
+ readonly url: URL;
205
+ }
206
+ interface EndpointHttpContext<Params extends object = Readonly<Record<string, string>>, Locals extends object = AppLocals> extends HttpContext<Locals> {
207
+ readonly params: Readonly<Params>;
208
+ }
209
+ interface MiddlewareHttpContext<Locals extends object = AppLocals> extends HttpContext<Locals> {}
210
+ type RuntimeHttpEvent = {
211
+ readonly context?: Record<string, unknown>;
212
+ readonly req?: Request;
213
+ readonly res?: HttpResponse;
214
+ readonly url?: URL;
215
+ };
216
+ declare function __marklessCreateHttpContext<Params extends object = Readonly<Record<string, string>>, Locals extends object = AppLocals>(event: RuntimeHttpEvent): EndpointHttpContext<Params, Locals>;
217
+ declare const Html: ((props: {
218
+ readonly children?: __MarklessTypeService.Child;
219
+ }) => unknown) & {
220
+ renderSsr(props?: {
221
+ readonly children?: __MarklessTypeService.Child;
222
+ readonly [name: string]: unknown;
223
+ }, renderContext?: {
224
+ readonly [HTML_ATTRIBUTES_SLOT]?: Record<string, unknown>;
225
+ }): {
226
+ html: string;
227
+ elementCount: number;
228
+ };
229
+ };
230
+ type LinkComponent = {
231
+ (props?: LinkProps): unknown;
232
+ renderCsr(props?: LinkProps): {
233
+ root: HTMLAnchorElement;
234
+ view: ReturnType<typeof createExternalDelegateView>;
235
+ liveHostNodes: Map<string, HTMLAnchorElement>;
236
+ };
237
+ renderSsr(props?: LinkProps, renderContext?: {
238
+ readonly idPrefix?: string;
239
+ }): {
240
+ html: string;
241
+ elementCount: number;
242
+ structureTokens: ReturnType<typeof createExternalDelegateStructureTokens>;
243
+ view: ReturnType<typeof createExternalDelegateView>;
244
+ };
245
+ };
246
+ declare const Link: LinkComponent;
247
+ //#endregion
248
+ export { RequestFileDefaultExport as A, RouteManifestMatch as B, ensureNavigationRuntime as C, ApiRequestFileCache as D, navigate as E, RequestFileTransformResult as F, matchRouteManifest as G, RouteManifestRoute as H, normalizeRequestFileId as I, normalizeRequestPathname as K, parseRequestFile as L, RequestFileDiagnosticCode as M, RequestFileParam as N, ApiRequestFileMethod as O, RequestFileParseResult as P, transformRequestFileSource as R, __marklessRouterStartSpaNavigation as S, NavigateOptions as T, RouteManifestStatusPages as U, RouteManifestParam as V, buildRouteManifestFromFileIds as W, RoutePageModule as _, HttpContext as a, dispatchRouteUpdate as b, LinkNavigationProps as c, MiddlewareHttpContext as d, PageProps as f, RouteDocumentModule as g, MARKLESS_ROUTER_ROUTE_EVENT as h, Html as i, RequestFileDiagnostic as j, ApiRequestFileRoute as k, LinkProps as l, MARKLESS_ROUTER_RENDERED_EVENT as m, DefaultLinkProps as n, HttpResponse as o, __marklessCreateHttpContext as p, normalizeRouteFileId as q, EndpointHttpContext as r, Link as s, AppLocals as t, MarklessRouterGeneratedRoutes as u, RouteState as v, startRouteUpdateRenderer as w, routePageProps as x, RouteUpdate as y, RouteManifest as z };
package/dist/index.d.ts CHANGED
@@ -1,212 +1,2 @@
1
- import { createExternalDelegateStructureTokens, createExternalDelegateView } from "@markless/web/fns/external-delegate";
2
-
3
- //#region src/route-manifest.d.ts
4
- interface RouteManifestRoute {
5
- readonly pathname: string;
6
- readonly pattern: string;
7
- readonly file: string;
8
- readonly params: readonly RouteManifestParam[];
9
- }
10
- interface RouteManifestParam {
11
- readonly name: string;
12
- readonly kind: 'dynamic' | 'catch-all';
13
- }
14
- interface RouteManifestStatusPages {
15
- readonly notFound?: string;
16
- readonly error?: string;
17
- }
18
- interface RouteManifest {
19
- readonly routes: readonly RouteManifestRoute[];
20
- readonly statusPages: RouteManifestStatusPages;
21
- }
22
- interface RouteManifestMatch {
23
- readonly route: RouteManifestRoute;
24
- readonly params: Readonly<Record<string, string>>;
25
- }
26
- declare function buildRouteManifestFromFileIds(fileIds: readonly string[]): RouteManifest;
27
- declare function normalizeRequestPathname(pathname: string): string;
28
- declare function normalizeRouteFileId(fileId: string): string;
29
- declare function matchRouteManifest(pathname: string, manifest: RouteManifest): RouteManifestMatch | undefined;
30
- //#endregion
31
- //#region src/request-files.d.ts
32
- type RequestFileDiagnosticCode = 'http-method-export' | 'invalid-cache-metadata' | 'missing-default-function';
33
- interface RequestFileDiagnostic {
34
- readonly code: RequestFileDiagnosticCode;
35
- readonly message: string;
36
- }
37
- interface RequestFileDefaultExport {
38
- readonly kind: 'function';
39
- readonly parameterName?: string;
40
- }
41
- interface RequestFileParam {
42
- readonly name: string;
43
- readonly kind: 'dynamic' | 'catch-all';
44
- }
45
- interface ApiRequestFileRoute {
46
- readonly pathname: string;
47
- readonly pattern: string;
48
- readonly params: readonly RequestFileParam[];
49
- }
50
- interface ApiRequestFileCache {
51
- readonly maxAge: number;
52
- }
53
- interface RequestFileTransformResult {
54
- readonly code: string;
55
- readonly file: string;
56
- readonly kind: 'api' | 'middleware';
57
- }
58
- type ApiRequestFileMethod = 'all' | 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
59
- type RequestFileParseResult = {
60
- readonly diagnostics: readonly [];
61
- readonly file: string;
62
- readonly kind: 'none';
63
- } | {
64
- readonly cache?: ApiRequestFileCache;
65
- readonly defaultExport?: RequestFileDefaultExport;
66
- readonly diagnostics: readonly RequestFileDiagnostic[];
67
- readonly file: string;
68
- readonly kind: 'api';
69
- readonly method: ApiRequestFileMethod;
70
- readonly route: ApiRequestFileRoute;
71
- } | {
72
- readonly defaultExport?: RequestFileDefaultExport;
73
- readonly diagnostics: readonly RequestFileDiagnostic[];
74
- readonly file: string;
75
- readonly kind: 'middleware';
76
- };
77
- declare function parseRequestFile(fileId: string, sourceText: string): RequestFileParseResult;
78
- declare function normalizeRequestFileId(fileId: string): string;
79
- declare function transformRequestFileSource(fileId: string, sourceText: string): RequestFileTransformResult | undefined;
80
- //#endregion
81
- //#region src/route-renderer.d.ts
82
- declare function startRouteUpdateRenderer(document?: Document): void;
83
- //#endregion
84
- //#region src/spa-navigation.d.ts
85
- type MarklessRouterNavigationRuntime = Pick<Navigation, 'addEventListener' | 'navigate'>;
86
- interface MarklessRouterNavigationWindow {
87
- readonly document: Document;
88
- readonly location: Location;
89
- navigation?: MarklessRouterNavigationRuntime;
90
- addEventListener(type: 'click', listener: (event: MouseEvent) => void, options?: boolean | AddEventListenerOptions): void;
91
- }
92
- interface MarklessRouterNavigationPolyfillModule {
93
- applyPolyfill(options: {
94
- readonly interceptEvents: boolean;
95
- readonly window: MarklessRouterNavigationWindow;
96
- }): unknown;
97
- }
98
- interface StartSpaNavigationOptions {
99
- readonly documentModuleLoader?: () => Promise<unknown>;
100
- readonly loadPolyfill?: () => Promise<MarklessRouterNavigationPolyfillModule>;
101
- readonly pageModuleLoaders: Record<string, () => Promise<unknown>>;
102
- readonly preloadRouteModule?: (file: string) => unknown;
103
- readonly routeFileIds: readonly string[];
104
- readonly window?: MarklessRouterNavigationWindow;
105
- }
106
- declare function __marklessRouterStartSpaNavigation(options: StartSpaNavigationOptions): Promise<void>;
107
- declare function ensureNavigationRuntime(runtimeWindow?: MarklessRouterNavigationWindow, loadPolyfill?: () => Promise<MarklessRouterNavigationPolyfillModule>): Promise<MarklessRouterNavigationRuntime>;
108
- //#endregion
109
- //#region src/route-state.d.ts
110
- declare const MARKLESS_ROUTER_ROUTE_EVENT = "marklessrouternavigate";
111
- interface RouteState {
112
- readonly file: string;
113
- readonly params: Readonly<Record<string, string>>;
114
- readonly status: number;
115
- readonly url: string;
116
- }
117
- interface RoutePageModule {
118
- readonly default?: unknown;
119
- }
120
- interface RouteDocumentModule {
121
- readonly default?: unknown;
122
- }
123
- interface RouteUpdate {
124
- readonly document?: RouteDocumentModule;
125
- readonly page: RoutePageModule;
126
- readonly route: RouteState;
127
- readonly signal?: AbortSignal;
128
- readonly onRendered?: () => void;
129
- }
130
- declare function routePageProps(route: RouteState): PageProps;
131
- declare function dispatchRouteUpdate(document: Document, update: RouteUpdate): void;
132
- //#endregion
133
- //#region src/index.d.ts
134
- interface PageProps<Params extends object = Readonly<Record<string, string>>> {
135
- readonly params: Readonly<Params>;
136
- readonly url: {
137
- readonly href: string;
138
- readonly pathname: string;
139
- readonly search: string;
140
- };
141
- readonly status: number;
142
- }
143
- interface MarklessRouterGeneratedRoutes {}
144
- interface LinkNavigationProps {
145
- readonly prefetch?: boolean | 'intent' | 'viewport';
146
- readonly replace?: boolean;
147
- readonly scroll?: boolean;
148
- }
149
- type DefaultLinkProps = {
150
- readonly href?: string;
151
- readonly children?: __MarklessTypeService.Child;
152
- readonly class?: string;
153
- readonly id?: string;
154
- readonly target?: string;
155
- readonly rel?: string;
156
- readonly [prop: string]: unknown;
157
- } & LinkNavigationProps;
158
- type LinkProps = MarklessRouterGeneratedRoutes extends {
159
- readonly link: infer Props;
160
- } ? Props : DefaultLinkProps;
161
- interface AppLocals {}
162
- interface HttpResponse {
163
- readonly headers: Headers;
164
- status?: number;
165
- statusText?: string;
166
- }
167
- interface HttpContext<Locals extends object = AppLocals> {
168
- readonly locals: Locals;
169
- readonly request: Request;
170
- readonly response: HttpResponse;
171
- readonly url: URL;
172
- }
173
- interface EndpointHttpContext<Params extends object = Readonly<Record<string, string>>, Locals extends object = AppLocals> extends HttpContext<Locals> {
174
- readonly params: Readonly<Params>;
175
- }
176
- interface MiddlewareHttpContext<Locals extends object = AppLocals> extends HttpContext<Locals> {}
177
- type RuntimeHttpEvent = {
178
- readonly context?: Record<string, unknown>;
179
- readonly req?: Request;
180
- readonly res?: HttpResponse;
181
- readonly url?: URL;
182
- };
183
- declare function __marklessCreateHttpContext<Params extends object = Readonly<Record<string, string>>, Locals extends object = AppLocals>(event: RuntimeHttpEvent): EndpointHttpContext<Params, Locals>;
184
- declare const Html: ((props: {
185
- readonly children?: __MarklessTypeService.Child;
186
- }) => unknown) & {
187
- renderSsr(props?: {
188
- readonly children?: __MarklessTypeService.Child;
189
- }): {
190
- html: string;
191
- elementCount: number;
192
- };
193
- };
194
- type LinkComponent = {
195
- (props?: LinkProps): unknown;
196
- renderCsr(props?: LinkProps): {
197
- root: HTMLAnchorElement;
198
- view: ReturnType<typeof createExternalDelegateView>;
199
- liveHostNodes: Map<string, HTMLAnchorElement>;
200
- };
201
- renderSsr(props?: LinkProps, renderContext?: {
202
- readonly idPrefix?: string;
203
- }): {
204
- html: string;
205
- elementCount: number;
206
- structureTokens: ReturnType<typeof createExternalDelegateStructureTokens>;
207
- view: ReturnType<typeof createExternalDelegateView>;
208
- };
209
- };
210
- declare const Link: LinkComponent;
211
- //#endregion
212
- export { type ApiRequestFileCache, type ApiRequestFileMethod, type ApiRequestFileRoute, AppLocals, DefaultLinkProps, EndpointHttpContext, Html, HttpContext, HttpResponse, Link, LinkNavigationProps, LinkProps, MARKLESS_ROUTER_ROUTE_EVENT, MarklessRouterGeneratedRoutes, MiddlewareHttpContext, PageProps, type RequestFileDefaultExport, type RequestFileDiagnostic, type RequestFileDiagnosticCode, type RequestFileParam, type RequestFileParseResult, type RequestFileTransformResult, type RouteDocumentModule, type RouteManifest, type RouteManifestMatch, type RouteManifestParam, type RouteManifestRoute, type RouteManifestStatusPages, type RoutePageModule, type RouteState, type RouteUpdate, __marklessCreateHttpContext, __marklessRouterStartSpaNavigation, buildRouteManifestFromFileIds, dispatchRouteUpdate, ensureNavigationRuntime, matchRouteManifest, normalizeRequestFileId, normalizeRequestPathname, normalizeRouteFileId, parseRequestFile, routePageProps, startRouteUpdateRenderer, transformRequestFileSource };
1
+ import { A as RequestFileDefaultExport, B as RouteManifestMatch, C as ensureNavigationRuntime, D as ApiRequestFileCache, E as navigate, F as RequestFileTransformResult, G as matchRouteManifest, H as RouteManifestRoute, I as normalizeRequestFileId, K as normalizeRequestPathname, L as parseRequestFile, M as RequestFileDiagnosticCode, N as RequestFileParam, O as ApiRequestFileMethod, P as RequestFileParseResult, R as transformRequestFileSource, S as __marklessRouterStartSpaNavigation, T as NavigateOptions, U as RouteManifestStatusPages, V as RouteManifestParam, W as buildRouteManifestFromFileIds, _ as RoutePageModule, a as HttpContext, b as dispatchRouteUpdate, c as LinkNavigationProps, d as MiddlewareHttpContext, f as PageProps, g as RouteDocumentModule, h as MARKLESS_ROUTER_ROUTE_EVENT, i as Html, j as RequestFileDiagnostic, k as ApiRequestFileRoute, l as LinkProps, m as MARKLESS_ROUTER_RENDERED_EVENT, n as DefaultLinkProps, o as HttpResponse, p as __marklessCreateHttpContext, q as normalizeRouteFileId, r as EndpointHttpContext, s as Link, t as AppLocals, u as MarklessRouterGeneratedRoutes, v as RouteState, w as startRouteUpdateRenderer, x as routePageProps, y as RouteUpdate, z as RouteManifest } from "./index-BjxpxRL7.js";
2
+ export { type ApiRequestFileCache, type ApiRequestFileMethod, type ApiRequestFileRoute, AppLocals, DefaultLinkProps, EndpointHttpContext, Html, HttpContext, HttpResponse, Link, LinkNavigationProps, LinkProps, MARKLESS_ROUTER_RENDERED_EVENT, MARKLESS_ROUTER_ROUTE_EVENT, MarklessRouterGeneratedRoutes, MiddlewareHttpContext, type NavigateOptions, PageProps, type RequestFileDefaultExport, type RequestFileDiagnostic, type RequestFileDiagnosticCode, type RequestFileParam, type RequestFileParseResult, type RequestFileTransformResult, type RouteDocumentModule, type RouteManifest, type RouteManifestMatch, type RouteManifestParam, type RouteManifestRoute, type RouteManifestStatusPages, type RoutePageModule, type RouteState, type RouteUpdate, __marklessCreateHttpContext, __marklessRouterStartSpaNavigation, buildRouteManifestFromFileIds, dispatchRouteUpdate, ensureNavigationRuntime, matchRouteManifest, navigate, normalizeRequestFileId, normalizeRequestPathname, normalizeRouteFileId, parseRequestFile, routePageProps, startRouteUpdateRenderer, transformRequestFileSource };