@absolutejs/absolute 0.20.0-beta.169 → 0.20.0-beta.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +232 -0
  3. package/changelog.json +228 -0
  4. package/dist/angular/browser.js +7 -8
  5. package/dist/angular/browser.js.map +6 -5
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +6 -2
  7. package/dist/angular/components/core/streamingSlotRegistry.js +7 -3
  8. package/dist/angular/index.js +555 -156
  9. package/dist/angular/index.js.map +29 -23
  10. package/dist/angular/server.js +555 -156
  11. package/dist/angular/server.js.map +29 -23
  12. package/dist/build/buildWorker.js +14 -8
  13. package/dist/build.js +4949 -1941
  14. package/dist/build.js.map +72 -42
  15. package/dist/cli/{add-7azr0c83.js → add-6a7pjkn9.js} +11 -7
  16. package/dist/cli/{analyze-3cyek6v3.js → analyze-606fshwa.js} +1 -1
  17. package/dist/cli/{build-25rz8v25.js → build-g81xqbb9.js} +1 -1
  18. package/dist/cli/{compile-4jnfxts9.js → compile-9y1w9zpj.js} +3 -3
  19. package/dist/cli/config/server.js +10699 -1538
  20. package/dist/cli/{dev-9tk5hn2e.js → dev-hyeb89hp.js} +5 -1
  21. package/dist/cli/{doctor-4nv2c2j3.js → doctor-h55y9hj1.js} +1 -1
  22. package/dist/cli/{generate-v75p2fct.js → generate-20x1pkf7.js} +4 -4
  23. package/dist/cli/{htmx-427swtdz.js → htmx-6mz2h7k1.js} +2 -2
  24. package/dist/cli/{index-bhbs6d5z.js → index-32ge2w1f.js} +12 -4
  25. package/dist/cli/{index-a4ws2jwd.js → index-3wz3mktm.js} +1 -1
  26. package/dist/cli/{index-b7hjgknf.js → index-9sksd8c8.js} +13 -4
  27. package/dist/cli/{index-eyzwc7gz.js → index-qbrzvmh9.js} +4 -2
  28. package/dist/cli/index-qw98g1p6.js +269 -0
  29. package/dist/cli/{index-434b7j4a.js → index-vtp20gwf.js} +69 -1
  30. package/dist/cli/{index-h7qhz02e.js → index-wk0pyxrg.js} +3 -0
  31. package/dist/cli/{index-k3y8cb6c.js → index-z6f43b20.js} +1 -1
  32. package/dist/cli/index.js +16 -16
  33. package/dist/cli/{islands-8sgky9gh.js → islands-dc54e5y1.js} +1 -1
  34. package/dist/cli/{ls-4m4yqwww.js → ls-b6zz24nt.js} +1 -1
  35. package/dist/cli/{mobile-hcxjr2gf.js → mobile-ajnnvqtv.js} +3 -3
  36. package/dist/cli/prerender-fqpp0m1j.js +10 -0
  37. package/dist/cli/{remove-1ycjx85k.js → remove-t8x1mrxg.js} +4 -4
  38. package/dist/cli/{start-mbaejxhm.js → start-d6p831ny.js} +3 -3
  39. package/dist/cli/{typecheck-dr068pmh.js → typecheck-stbt0qt5.js} +6 -1
  40. package/dist/cli/{workspace-1sycp9g1.js → workspace-61hh6jq1.js} +1 -1
  41. package/dist/client/chunks/index-6b66nzyf.js +381 -0
  42. package/dist/client/chunks/index-6b66nzyf.js.map +11 -0
  43. package/dist/client/chunks/{islands-rc28k5sx.js → islands-s2ta5ajb.js} +5 -2
  44. package/dist/client/chunks/{islands-rc28k5sx.js.map → islands-s2ta5ajb.js.map} +7 -6
  45. package/dist/client/index.js +160 -3
  46. package/dist/client/index.js.map +6 -4
  47. package/dist/client/navigation.js +764 -0
  48. package/dist/client/navigation.js.map +10 -0
  49. package/dist/client/prefetch.js +33 -375
  50. package/dist/client/prefetch.js.map +3 -4
  51. package/dist/core/streamingSlotRegistrar.js +5 -2
  52. package/dist/core/streamingSlotRegistrar.js.map +5 -4
  53. package/dist/core/streamingSlotRegistry.js +5 -2
  54. package/dist/core/streamingSlotRegistry.js.map +5 -4
  55. package/dist/dev/client/cspNonce.ts +28 -0
  56. package/dist/dev/client/handlers/html.ts +4 -3
  57. package/dist/dev/client/handlers/htmx.ts +3 -2
  58. package/dist/dev/client/handlers/svelte.ts +15 -90
  59. package/dist/dev/client/syncDevtools.ts +2 -1
  60. package/dist/dev/serverBootstrap.js +11 -4
  61. package/dist/i18n/index.js +543 -0
  62. package/dist/i18n/index.js.map +15 -0
  63. package/dist/index.js +6339 -2233
  64. package/dist/index.js.map +89 -54
  65. package/dist/islands/index.js +282 -40
  66. package/dist/islands/index.js.map +14 -10
  67. package/dist/mobile/browser.js +7 -2
  68. package/dist/mobile/browser.js.map +5 -4
  69. package/dist/mobile/index.js +7 -2
  70. package/dist/mobile/index.js.map +5 -4
  71. package/dist/mobile/remoteMacAgentEntry.js +1 -1
  72. package/dist/react/components/browser/index.js +94 -4
  73. package/dist/react/components/index.js +150 -10
  74. package/dist/react/components/index.js.map +15 -10
  75. package/dist/react/hooks/index.js +479 -13
  76. package/dist/react/hooks/index.js.map +12 -4
  77. package/dist/react/index.js +769 -166
  78. package/dist/react/index.js.map +32 -21
  79. package/dist/react/router/browser.js +21 -4
  80. package/dist/react/router/browser.js.map +5 -4
  81. package/dist/react/router/index.js +21 -4
  82. package/dist/react/router/index.js.map +5 -4
  83. package/dist/react/server.js +597 -203
  84. package/dist/react/server.js.map +25 -15
  85. package/dist/src/angular/zoneRuntime.d.ts +5 -0
  86. package/dist/src/build/buildReactServerComponents.d.ts +22 -0
  87. package/dist/src/build/downlevelAsyncForZone.d.ts +1 -0
  88. package/dist/src/build/fileRoutes.d.ts +65 -0
  89. package/dist/src/build/fonts/buildFonts.d.ts +25 -0
  90. package/dist/src/build/fonts/fallbackMetrics.d.ts +13 -0
  91. package/dist/src/build/fonts/googleFonts.d.ts +18 -0
  92. package/dist/src/build/fonts/injectFontTags.d.ts +7 -0
  93. package/dist/src/build/fonts/parseFontMetrics.d.ts +4 -0
  94. package/dist/src/build/generateReactIndexes.d.ts +7 -1
  95. package/dist/src/build/htmlIncludes.d.ts +16 -0
  96. package/dist/src/build/inlineSourceMapComment.d.ts +1 -0
  97. package/dist/src/build/scanConventions.d.ts +3 -0
  98. package/dist/src/build/vitals.d.ts +21 -0
  99. package/dist/src/client/formActions.d.ts +29 -0
  100. package/dist/src/client/index.d.ts +2 -0
  101. package/dist/src/client/navigation.d.ts +16 -0
  102. package/dist/src/client/prefetch.d.ts +2 -30
  103. package/dist/src/core/build.d.ts +2 -2
  104. package/dist/src/core/cspNonce.d.ts +12 -0
  105. package/dist/src/core/fileRouteAdapter.d.ts +15 -0
  106. package/dist/src/core/fileRoutes.d.ts +5 -0
  107. package/dist/src/core/formActionFlash.d.ts +25 -0
  108. package/dist/src/core/formActions.d.ts +249 -0
  109. package/dist/src/core/index.d.ts +5 -0
  110. package/dist/src/core/partialPrerender.d.ts +28 -0
  111. package/dist/src/core/partialPrerenderServe.d.ts +24 -0
  112. package/dist/src/core/precompressed.d.ts +11 -1
  113. package/dist/src/core/prerenderNonce.d.ts +9 -0
  114. package/dist/src/core/productionRuntime.d.ts +4 -2
  115. package/dist/src/core/serverOnlyStaticFiles.d.ts +8 -0
  116. package/dist/src/core/staticHtmlNonce.d.ts +2 -0
  117. package/dist/src/core/vitals.d.ts +108 -0
  118. package/dist/src/dev/angular/fastHmrCompiler.d.ts +1 -1
  119. package/dist/src/dev/client/cspNonce.d.ts +2 -0
  120. package/dist/src/dev/fileRouteRefresher.d.ts +5 -0
  121. package/dist/src/dev/importCost/instrument.d.ts +1 -1
  122. package/dist/src/dev/reactServerComponentsRebuild.d.ts +3 -0
  123. package/dist/src/i18n/defineMessages.d.ts +5 -0
  124. package/dist/src/i18n/formatMessage.d.ts +26 -0
  125. package/dist/src/i18n/index.d.ts +6 -0
  126. package/dist/src/i18n/intlCache.d.ts +5 -0
  127. package/dist/src/i18n/routing.d.ts +28 -0
  128. package/dist/src/i18n/translator.d.ts +11 -0
  129. package/dist/src/mobile/androidRelease.d.ts +2 -2
  130. package/dist/src/mobile/iosRelease.d.ts +4 -4
  131. package/dist/src/mobile/materializedBundle.d.ts +1 -1
  132. package/dist/src/mobile/mobileInspect.d.ts +1 -1
  133. package/dist/src/mobile/releaseArtifact.d.ts +2 -2
  134. package/dist/src/mobile/remoteMacProtocol.d.ts +2 -2
  135. package/dist/src/plugins/i18n.d.ts +30 -0
  136. package/dist/src/plugins/index.d.ts +2 -1
  137. package/dist/src/plugins/secureHeaders.d.ts +48 -0
  138. package/dist/src/react/components/Head.d.ts +1 -1
  139. package/dist/src/react/components/StreamSlot.browser.d.ts +1 -0
  140. package/dist/src/react/components/StreamSlot.d.ts +5 -1
  141. package/dist/src/react/components/SuspenseSlot.browser.d.ts +2 -0
  142. package/dist/src/react/components/SuspenseSlot.d.ts +12 -0
  143. package/dist/src/react/fileRoute.d.ts +18 -0
  144. package/dist/src/react/hooks/index.d.ts +4 -0
  145. package/dist/src/react/hooks/useFormAction.d.ts +42 -0
  146. package/dist/src/react/hooks/useI18n.d.ts +15 -0
  147. package/dist/src/react/index.d.ts +2 -0
  148. package/dist/src/react/server.d.ts +2 -0
  149. package/dist/src/react/serverComponents/constants.d.ts +11 -0
  150. package/dist/src/react/serverComponents/flightPayload.d.ts +2 -0
  151. package/dist/src/react/serverComponents/pageHandler.d.ts +14 -0
  152. package/dist/src/svelte/browser.d.ts +1 -0
  153. package/dist/src/svelte/fileRoute.d.ts +15 -0
  154. package/dist/src/svelte/i18n.d.ts +8 -0
  155. package/dist/src/svelte/index.d.ts +2 -0
  156. package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +5 -1
  157. package/dist/src/svelte/renderToReadableStream.d.ts +10 -2
  158. package/dist/src/svelte/router/browser.d.ts +3 -1
  159. package/dist/src/svelte/router/goto.d.ts +13 -10
  160. package/dist/src/svelte/router/guards.d.ts +43 -0
  161. package/dist/src/svelte/router/index.d.ts +3 -1
  162. package/dist/src/svelte/router/lazy.d.ts +17 -0
  163. package/dist/src/svelte/router/lazyModule.d.ts +29 -0
  164. package/dist/src/svelte/router/navigation.d.ts +55 -0
  165. package/dist/src/svelte/router/pushState.d.ts +4 -2
  166. package/dist/src/svelte/router/scroll.d.ts +34 -0
  167. package/dist/src/svelte/routerSsr.d.ts +9 -0
  168. package/dist/src/svelte/server.d.ts +1 -0
  169. package/dist/src/utils/cspNonceRef.d.ts +8 -0
  170. package/dist/src/utils/fontAssets.d.ts +17 -0
  171. package/dist/src/utils/formActionProtocol.d.ts +10 -0
  172. package/dist/src/utils/generateHeadElement.d.ts +1 -1
  173. package/dist/src/utils/index.d.ts +1 -0
  174. package/dist/src/utils/inlinePageCss.d.ts +18 -0
  175. package/dist/src/utils/loadConfig.d.ts +5 -0
  176. package/dist/src/utils/localeRef.d.ts +10 -0
  177. package/dist/src/utils/resolveConvention.d.ts +6 -1
  178. package/dist/src/utils/streamingSlots.d.ts +5 -0
  179. package/dist/src/vue/browser.d.ts +2 -0
  180. package/dist/src/vue/components/Image.d.ts +2 -2
  181. package/dist/src/vue/index.d.ts +2 -0
  182. package/dist/src/vue/serverDataPayload.d.ts +32 -0
  183. package/dist/src/vue/serverDataState.d.ts +9 -0
  184. package/dist/src/vue/useServerData.browser.d.ts +6 -0
  185. package/dist/src/vue/useServerData.d.ts +24 -0
  186. package/dist/svelte/browser.js +330 -3
  187. package/dist/svelte/browser.js.map +8 -4
  188. package/dist/svelte/components/AwaitSlot.svelte +5 -0
  189. package/dist/svelte/components/Head.svelte +50 -0
  190. package/dist/svelte/components/JsonLd.svelte +9 -1
  191. package/dist/svelte/components/StreamSlot.svelte +5 -0
  192. package/dist/svelte/index.js +1017 -117
  193. package/dist/svelte/index.js.map +38 -24
  194. package/dist/svelte/router/Link.svelte +40 -8
  195. package/dist/svelte/router/Route.svelte +157 -12
  196. package/dist/svelte/router/Route.svelte.d.ts +39 -5
  197. package/dist/svelte/router/Router.svelte +140 -25
  198. package/dist/svelte/router/Router.svelte.d.ts +5 -1
  199. package/dist/svelte/router/browser.ts +10 -0
  200. package/dist/svelte/router/goto.ts +15 -86
  201. package/dist/svelte/router/guards.ts +112 -0
  202. package/dist/svelte/router/index.ts +10 -0
  203. package/dist/svelte/router/lazy.ts +82 -0
  204. package/dist/svelte/router/lazyModule.ts +74 -0
  205. package/dist/svelte/router/navigation.ts +412 -0
  206. package/dist/svelte/router/pushState.ts +7 -4
  207. package/dist/svelte/router/scroll.ts +286 -0
  208. package/dist/svelte/server.js +747 -252
  209. package/dist/svelte/server.js.map +30 -20
  210. package/dist/types/angular.d.ts +2 -0
  211. package/dist/types/build.d.ts +37 -0
  212. package/dist/types/conventions.d.ts +3 -0
  213. package/dist/types/fileRoutes.d.ts +72 -0
  214. package/dist/types/fonts.d.ts +86 -0
  215. package/dist/types/formAction.d.ts +54 -0
  216. package/dist/types/globals.d.ts +10 -0
  217. package/dist/types/i18n.d.ts +185 -0
  218. package/dist/types/index.d.ts +4 -0
  219. package/dist/types/metadata.d.ts +11 -0
  220. package/dist/types/navigation.d.ts +37 -0
  221. package/dist/types/prefetch.d.ts +10 -0
  222. package/dist/types/sitemap.d.ts +4 -0
  223. package/dist/types/svelteRouter.d.ts +89 -2
  224. package/dist/types/svelteRouter.ts +112 -2
  225. package/dist/types/vue.d.ts +46 -1
  226. package/dist/utils/iconVersion.ts +34 -0
  227. package/dist/vue/browser.js +107 -11
  228. package/dist/vue/browser.js.map +7 -4
  229. package/dist/vue/components/index.js +5 -2
  230. package/dist/vue/components/index.js.map +5 -4
  231. package/dist/vue/index.js +712 -158
  232. package/dist/vue/index.js.map +32 -23
  233. package/dist/vue/server.js +310 -79
  234. package/dist/vue/server.js.map +20 -15
  235. package/package.json +9 -1
  236. package/dist/cli/prerender-mfnwsvyt.js +0 -7
  237. package/dist/src/plugins/pageRouter.d.ts +0 -1
  238. /package/dist/cli/{index-j7m8pq48.js → index-rervww4p.js} +0 -0
@@ -0,0 +1,249 @@
1
+ import { type UnwrapSchema } from 'elysia';
2
+ import type { TObject } from 'typebox';
3
+ import type { ActionErrorState, ActionFieldErrors, ActionResult, ActionData, ActionSuccessState, AnyFormAction, FormActionDefinition } from '../../types/formAction';
4
+ /** What `fail(...)` returns; the action answers with an error state. */
5
+ export declare class ActionFailure<Fields extends string = string> {
6
+ readonly errors: ActionFieldErrors<Fields>;
7
+ readonly message: string | undefined;
8
+ constructor(errors: ActionFieldErrors<Fields>, message?: string);
9
+ }
10
+ export type ActionCsrfOptions = {
11
+ /** Origins (scheme://host[:port]) allowed to post besides the page's
12
+ * own, e.g. a separate front-end domain. */
13
+ trustedOrigins?: readonly string[];
14
+ };
15
+ /** What a handler returning `Result` hands the page on success. */
16
+ export type ActionDataOf<Result, Fields extends string = string> = Exclude<Awaited<Result>, ActionFailure<Fields> | Response>;
17
+ export type ActionHandlerContext<Body, Fields extends string> = {
18
+ body: Body;
19
+ /** The full Elysia context (derived values such as the signed-in user
20
+ * live here). Untyped in Phase 1. */
21
+ context: Record<string, unknown>;
22
+ /** Answer with field errors (and an optional form-level message)
23
+ * instead of a result. */
24
+ fail: (errors: ActionFieldErrors<Fields>, message?: string) => ActionFailure<Fields>;
25
+ request: Request;
26
+ set: {
27
+ headers: Record<string, unknown>;
28
+ status?: unknown;
29
+ };
30
+ };
31
+ export type DefineActionOptions<Schema extends TObject, Result, Fields extends string = Extract<keyof UnwrapSchema<Schema>, string>> = {
32
+ /** The form's fields (an Elysia `t.Object`). Field names are the keys;
33
+ * add `error: 'message'` to a property for a friendlier message than
34
+ * the validator's. */
35
+ body: Schema;
36
+ /** Runs after validation, before the handler; return a response (e.g.
37
+ * `status(401)`) to stop. Use it for auth checks. */
38
+ beforeHandle?: (context: {
39
+ request: Request;
40
+ set: {
41
+ headers: Record<string, unknown>;
42
+ status?: unknown;
43
+ };
44
+ }) => unknown;
45
+ /** Cross-origin protection: requests whose `Sec-Fetch-Site` / `Origin`
46
+ * say another site sent them get 403. Default on; `false` turns it
47
+ * off (for an API meant to be called from other sites). */
48
+ csrf?: ActionCsrfOptions | false;
49
+ handler: (context: ActionHandlerContext<UnwrapSchema<Schema>, Fields>) => Result | Promise<Result>;
50
+ /** HTMX requests only: the HTML fragment to swap in for a result
51
+ * (answered with 200, which HTMX swaps by default). Return undefined
52
+ * to fall back to the no-JavaScript behaviour (`HX-Redirect`). The
53
+ * result's type comes from `handler` only. */
54
+ htmx?: (result: ActionResult<NoInfer<ActionDataOf<Result, Fields>>, Fields>, request: Request) => string | undefined | Promise<string | undefined>;
55
+ /** Bytes; requests that declare a larger body get 413 before it is
56
+ * read. Default 10 MiB. */
57
+ maxBodySize?: number;
58
+ /** Echo what the user typed back to the page after a failed
59
+ * submission without JavaScript (files and secret-looking fields are
60
+ * never echoed). Default true. */
61
+ preserveValues?: boolean;
62
+ /** Where to send the browser after success. Default: back to the page
63
+ * the form was on. */
64
+ redirect?: string | ((data: NoInfer<ActionDataOf<Result, Fields>>) => string);
65
+ };
66
+ export declare const isCrossOriginRequest: (request: Request, trustedOrigins?: readonly string[]) => boolean;
67
+ /** Defines a form action: a POST route at `path` that validates its body
68
+ * against `options.body` and works with or without JavaScript. Mount it
69
+ * with `app.use(action)`. */
70
+ export declare const defineAction: <const Path extends string, const Schema extends TObject, Result>(path: Path, options: DefineActionOptions<Schema, Result>) => import("elysia/types").AddRoute<"", "local", import("elysia").DefaultSingleton, {
71
+ typebox: {};
72
+ error: [];
73
+ }, import("elysia").DefaultMetadata, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral, "post", Path, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
74
+ beforeHandle: ((context: {
75
+ request: Request;
76
+ set: {
77
+ headers: Record<string, unknown>;
78
+ status?: unknown;
79
+ };
80
+ }) => unknown) | undefined;
81
+ body: Schema;
82
+ error: unknown;
83
+ parse: unknown;
84
+ transform: unknown;
85
+ }, {}, import("elysia/types").JoinPath<"", Path>>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, (context: {
86
+ body: import("elysia/types").IntersectIfObject<import("elysia/types").UnwrapBodySchema<Schema, {}, "output">, unknown> extends infer T ? T extends import("elysia/types").IntersectIfObject<import("elysia/types").UnwrapBodySchema<Schema, {}, "output">, unknown> ? T extends object ? { [K in keyof T]: T[K]; } : T : never : never;
87
+ query: Record<string, string | undefined>;
88
+ params: undefined extends import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown> ? Record<string, string> : import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown> extends infer T_1 ? T_1 extends import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown> ? T_1 extends object ? { [K_1 in keyof T_1]: T_1[K_1]; } : T_1 : never : never;
89
+ headers: Record<string, string | undefined>;
90
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
91
+ server: import("elysia").Server | null;
92
+ redirect: import("elysia").redirect;
93
+ set: {
94
+ headers: import("elysia").HTTPHeaders;
95
+ status?: number | keyof import("elysia").StatusMap;
96
+ cookie?: Record<string, import("elysia").BaseCookie>;
97
+ redirect?: never;
98
+ };
99
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T_2 = import("elysia").StatusResponse<Code>>(code: Code, response?: T_2) => import("elysia").ElysiaStatus<Code, T_2, import("elysia").NumericStatus<Code>>;
100
+ problem: typeof import("elysia").problem;
101
+ defer: (fn: import("elysia/types").AfterResponseHandler<NoInfer<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
102
+ beforeHandle: ((context: {
103
+ request: Request;
104
+ set: {
105
+ headers: Record<string, unknown>;
106
+ status?: unknown;
107
+ };
108
+ }) => unknown) | undefined;
109
+ body: Schema;
110
+ error: unknown;
111
+ parse: unknown;
112
+ transform: unknown;
113
+ }, {}, import("elysia/types").JoinPath<"", Path>>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>>, NoInfer<import("elysia").DefaultSingleton & {
114
+ derive: {};
115
+ }>>) => import("elysia/types").MaybePromise<void>;
116
+ readonly path: string;
117
+ route?: string | undefined;
118
+ rid?: string | undefined;
119
+ request: Request;
120
+ store: {};
121
+ }) => Promise<Response>, {
122
+ beforeHandle: ((context: {
123
+ request: Request;
124
+ set: {
125
+ headers: Record<string, unknown>;
126
+ status?: unknown;
127
+ };
128
+ }) => unknown) | undefined;
129
+ body: Schema;
130
+ error: ({ error, request }: {
131
+ body: import("elysia/types").IntersectIfObject<import("elysia/types").UnwrapBodySchema<Schema, {}, "output">, unknown>;
132
+ query: Record<string, string | undefined>;
133
+ params: undefined extends import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown> ? {
134
+ [x: string]: string;
135
+ } : import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>;
136
+ headers: Record<string, string | undefined>;
137
+ cookie: Record<string, import("elysia").Cookie<string | undefined>>;
138
+ server: import("elysia").Server | null;
139
+ redirect: import("elysia").redirect;
140
+ set: {
141
+ headers: import("elysia").HTTPHeaders;
142
+ status?: number | keyof import("elysia").StatusMap;
143
+ cookie?: Record<string, import("elysia").BaseCookie>;
144
+ redirect?: never;
145
+ };
146
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = import("elysia").StatusResponse<Code>>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, import("elysia").NumericStatus<Code>>;
147
+ problem: typeof import("elysia").problem;
148
+ defer: (fn: import("elysia/types").AfterResponseHandler<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
149
+ beforeHandle: ((context: {
150
+ request: Request;
151
+ set: {
152
+ headers: Record<string, unknown>;
153
+ status?: unknown;
154
+ };
155
+ }) => unknown) | undefined;
156
+ body: Schema;
157
+ error: unknown;
158
+ parse: unknown;
159
+ transform: unknown;
160
+ }, {}, import("elysia/types").JoinPath<"", Path>>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {
161
+ store: {};
162
+ decorator: {};
163
+ derive: {};
164
+ }>) => import("elysia/types").MaybePromise<void>;
165
+ readonly path: string;
166
+ route?: string | undefined;
167
+ rid?: string | undefined;
168
+ request: Request;
169
+ store: {};
170
+ } & {
171
+ error: T_1[number]["error"] | unknown;
172
+ }) => Response | Promise<Response> | undefined;
173
+ parse: ({ request }: Omit<{
174
+ body: unknown;
175
+ query: Record<string, string | undefined>;
176
+ params: undefined extends { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; } ? Record<string, string> : { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; } extends infer T_1 ? T_1 extends { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; } ? T_1 extends object ? { [K_1 in keyof T_1]: T_1[K_1]; } : T_1 : never : never;
177
+ headers: Record<string, string | undefined>;
178
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
179
+ server: import("elysia").Server | null;
180
+ redirect: import("elysia").redirect;
181
+ set: {
182
+ headers: import("elysia").HTTPHeaders;
183
+ status?: number | keyof import("elysia").StatusMap;
184
+ cookie?: Record<string, import("elysia").BaseCookie>;
185
+ redirect?: never;
186
+ };
187
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = import("elysia").StatusResponse<Code>>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, import("elysia").NumericStatus<Code>>;
188
+ problem: typeof import("elysia").problem;
189
+ defer: (fn: import("elysia/types").AfterResponseHandler<{
190
+ params: { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; };
191
+ query: undefined;
192
+ response: unknown;
193
+ }, {
194
+ decorator: {};
195
+ store: {};
196
+ derive: {};
197
+ } & {
198
+ decorator: {
199
+ contentType: string;
200
+ };
201
+ }>) => import("elysia/types").MaybePromise<void>;
202
+ readonly path: string;
203
+ route?: string | undefined;
204
+ rid?: string | undefined;
205
+ request: Request;
206
+ store: {};
207
+ contentType: string;
208
+ }, "cookie"> & {
209
+ cookie: undefined;
210
+ }) => {} | undefined;
211
+ transform: ({ body, request }: Omit<{
212
+ body: unknown;
213
+ query: Record<string, string | undefined>;
214
+ params: undefined extends { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; } ? Record<string, string> : { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; } extends infer T_1 ? T_1 extends { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; } ? T_1 extends object ? { [K_1 in keyof T_1]: T_1[K_1]; } : T_1 : never : never;
215
+ headers: Record<string, string | undefined>;
216
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
217
+ server: import("elysia").Server | null;
218
+ redirect: import("elysia").redirect;
219
+ set: {
220
+ headers: import("elysia").HTTPHeaders;
221
+ status?: number | keyof import("elysia").StatusMap;
222
+ cookie?: Record<string, import("elysia").BaseCookie>;
223
+ redirect?: never;
224
+ };
225
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = import("elysia").StatusResponse<Code>>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, import("elysia").NumericStatus<Code>>;
226
+ problem: typeof import("elysia").problem;
227
+ defer: (fn: import("elysia/types").AfterResponseHandler<{
228
+ params: { [K in keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Path>>, unknown>]: string; };
229
+ query: undefined;
230
+ response: unknown;
231
+ }, {
232
+ decorator: {};
233
+ store: {};
234
+ derive: {};
235
+ }>) => import("elysia/types").MaybePromise<void>;
236
+ readonly path: string;
237
+ route?: string | undefined;
238
+ rid?: string | undefined;
239
+ request: Request;
240
+ store: {};
241
+ }, "cookie"> & {
242
+ cookie: undefined;
243
+ }) => void;
244
+ }> & FormActionDefinition<Path, UnwrapSchema<Schema>, Exclude<Awaited<Result>, Response | ActionFailure<Extract<keyof UnwrapSchema<Schema>, string>>>>;
245
+ /** The result the last submission of `action` left for this page, when
246
+ * the browser posted without JavaScript and was redirected here. Read it
247
+ * in the page's route and pass it to the page as a prop. Undefined when
248
+ * there is none. */
249
+ export declare const getActionState: <Action extends AnyFormAction>(action: Action | Action["actionPath"], request?: Request | undefined) => ActionErrorState<string> | ActionSuccessState<ActionData<Action>> | undefined;
@@ -1,4 +1,5 @@
1
1
  export * from './lookup';
2
+ export { fileRoutes } from './fileRoutes';
2
3
  export * from './islands';
3
4
  export * from './pageHandlers';
4
5
  export * from './prepare';
@@ -6,4 +7,8 @@ export * from './requestContext';
6
7
  export * from './renderIslandMarkup';
7
8
  export * from './responseEnhancers';
8
9
  export * from './wrapPageHandlerWithStreamingSlots';
10
+ export * from './formActions';
11
+ export { formActionRuntime } from './formActionFlash';
9
12
  export { onHotDispose } from '../dev/hotResources';
13
+ export { getCspNonce } from './cspNonce';
14
+ export { onVital, type VitalHandler, type VitalReport, type VitalName } from './vitals';
@@ -0,0 +1,28 @@
1
+ import type { StreamingSlot } from '../utils/streamingSlots';
2
+ /** Response header listing a captured shell's dynamic slot ids. */
3
+ export declare const PARTIAL_HOLES_HEADER = "X-Absolute-Partial-Holes";
4
+ /** Request header asking a page render for its static shell. */
5
+ export declare const PARTIAL_SHELL_HEADER = "X-Absolute-Partial-Shell";
6
+ type HolesSink = {
7
+ slots: StreamingSlot[] | undefined;
8
+ };
9
+ /** The hole sink of the request being rendered, when it's a hole
10
+ * collection render. */
11
+ export declare const activePartialHolesSink: () => HolesSink | undefined;
12
+ /** Runs `render` (a request through the app) and returns the dynamic
13
+ * slots the page registered. `slots` is undefined when the request never
14
+ * reached a page that collects streaming slots. */
15
+ export declare const collectPartialHoles: (render: () => Promise<Response> | Response) => Promise<{
16
+ response: Response;
17
+ slots: StreamingSlot[] | undefined;
18
+ }>;
19
+ export declare const decodePartialHoles: (value: string | null | undefined) => string[];
20
+ export declare const encodePartialHoles: (ids: string[]) => string;
21
+ export declare const isDynamicStreamingSlot: (slot: StreamingSlot) => boolean;
22
+ export declare const isPartialShellCapture: (request: Request | undefined) => boolean;
23
+ /** Dynamic slot ids a shell was captured with; none for a fully
24
+ * pre-rendered page. */
25
+ export declare const readPartialHoles: (htmlPath: string) => string[];
26
+ /** Stores (or clears) the holes a shell render reported, returning them. */
27
+ export declare const writePartialHoles: (htmlPath: string, response: Response) => Promise<string[]>;
28
+ export {};
@@ -0,0 +1,24 @@
1
+ type AppHandle = (request: Request) => Promise<Response> | Response;
2
+ export type ServePartialPrerenderInput = {
3
+ /** The route's pre-rendered shell. */
4
+ filePath: string;
5
+ /** The app's request handler, used to render the route's holes. */
6
+ handle: AppHandle;
7
+ /** Dynamic slot ids the shell was captured with. */
8
+ holes: string[];
9
+ /** Header that makes the app skip the pre-render cache. */
10
+ bypassHeader: string;
11
+ request: Request;
12
+ /** This request's CSP nonce and security headers under secureHeaders(). */
13
+ nonce?: string;
14
+ securityHeaders?: Record<string, string>;
15
+ };
16
+ /** The response for a partially pre-rendered page: the cached shell at
17
+ * once, its dynamic holes streamed in as they resolve. Returns the headers
18
+ * to drop when the shell can't be served under the CSP (see
19
+ * servePrerenderedPage). */
20
+ export declare const servePartialPrerender: (input: ServePartialPrerenderInput) => Promise<{
21
+ dropHeaders: string[];
22
+ response: Response;
23
+ }>;
24
+ export {};
@@ -10,10 +10,20 @@ export declare const acceptedEncodings: (header: string | null) => ({
10
10
  /** The cache policy for a static file: forever for a content-hashed name,
11
11
  * revalidate for anything else. */
12
12
  export declare const assetCacheControl: (pathname: string) => "public, max-age=31536000, immutable" | "public, max-age=0, must-revalidate";
13
+ /** Applies `assetCacheControl` to static-file responses. @elysia/static
14
+ * answers a plain GET with the file itself and its blanket policy on
15
+ * `set.headers`, and a precompressed or HEAD answer with a `Response`;
16
+ * both get the policy replaced (not appended). Only paths with an
17
+ * extension are touched, and a non-Response value only when a policy was
18
+ * already set, so pages and APIs keep their own headers. */
19
+ export declare const createAssetCachePlugin: () => import("elysia/types").GlobalHookReturn<"", "local", import("elysia").DefaultSingleton, {
20
+ typebox: {};
21
+ error: [];
22
+ }, import("elysia").DefaultMetadata, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral, {}>;
13
23
  /** Serves the precompressed copy of a static file to a browser that accepts
14
24
  * it. Files without copies, and browsers that accept neither, fall through
15
25
  * to the regular static handler. */
16
- export declare const createPrecompressedPlugin: (buildDir: string) => Promise<Elysia<"", "local", import("elysia").DefaultSingleton, {
26
+ export declare const createPrecompressedPlugin: (buildDir: string, ignorePatterns?: readonly (string | RegExp)[]) => Promise<Elysia<"", "local", import("elysia").DefaultSingleton, {
17
27
  typebox: {};
18
28
  error: [];
19
29
  }, import("elysia").DefaultMetadata, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral>>;
@@ -0,0 +1,9 @@
1
+ export declare const renderedNonce: (response: Response) => string | undefined;
2
+ export declare const writeRenderedNonce: (htmlPath: string, nonce: string | undefined) => Promise<void>;
3
+ /** The response for a cached page, given this request's nonce and security
4
+ * headers. Returns the headers to drop when the page can't be served
5
+ * under the policy. */
6
+ export declare const servePrerenderedPage: (htmlPath: string, nonce: string, securityHeaders: Record<string, string>) => Promise<{
7
+ dropHeaders: string[];
8
+ response: Response;
9
+ }>;
@@ -1,7 +1,9 @@
1
1
  import type { BuildConfig } from '../../types/build';
2
2
  export declare const PRODUCTION_RUNTIME_FILE = "absolute-runtime.json";
3
- declare const RUNTIME_KEYS: readonly ["angularDirectory", "assetsDirectory", "astroDirectory", "emberDirectory", "htmlDirectory", "htmxDirectory", "images", "islands", "mobile", "openapi", "publicDirectory", "reactDirectory", "static", "svelteDirectory", "telemetry", "vueDirectory"];
4
- export type ProductionRuntimeConfig = Pick<BuildConfig, (typeof RUNTIME_KEYS)[number]>;
3
+ declare const RUNTIME_KEYS: readonly ["angularDirectory", "assetsDirectory", "astroDirectory", "emberDirectory", "htmlDirectory", "htmxDirectory", "images", "islands", "mobile", "openapi", "publicDirectory", "reactDirectory", "static", "svelteDirectory", "telemetry", "vitals", "vueDirectory"];
4
+ export type ProductionRuntimeConfig = Pick<BuildConfig, (typeof RUNTIME_KEYS)[number]> & {
5
+ angular?: Pick<NonNullable<BuildConfig['angular']>, 'changeDetection'>;
6
+ };
5
7
  export declare const productionRuntimeConfigOf: (config: BuildConfig) => ProductionRuntimeConfig;
6
8
  export declare const writeProductionRuntime: (config: BuildConfig, buildDirectory: string) => void;
7
9
  /** The build's runtime config, or null when this build has none (built by
@@ -0,0 +1,8 @@
1
+ /** Written by the build: every file the server pass produced, relative to
2
+ * the build directory. */
3
+ export declare const SERVER_OUTPUTS_FILE = "server-outputs.json";
4
+ /** Static-plugin ignore patterns for a production build directory.
5
+ * `serverBundle` is the running server's entry file (`Bun.main` under
6
+ * `absolute start`); when it lives inside the build directory, it and its
7
+ * compressed copies are excluded too. */
8
+ export declare const productionStaticIgnorePatterns: (buildDir: string, serverBundle: string) => (string | RegExp)[];
@@ -0,0 +1,2 @@
1
+ export declare const nonceStaticHtml: (html: string, nonce?: string | undefined) => Promise<string>;
2
+ export declare const withHtmxStyleNonce: (html: string, nonce?: string | undefined) => Promise<string>;
@@ -0,0 +1,108 @@
1
+ export type VitalName = 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';
2
+ export type VitalReport = {
3
+ delta?: number;
4
+ /** Unique per metric instance and page load (web-vitals' `id`). */
5
+ id: string;
6
+ name: VitalName;
7
+ navigationType?: string;
8
+ rating?: 'good' | 'needs-improvement' | 'poor';
9
+ /** The page's path when it loaded. */
10
+ route: string;
11
+ value: number;
12
+ };
13
+ export type VitalHandler = (report: VitalReport, request: Request) => void | Promise<void>;
14
+ /** Receives every web vital the built-in endpoint accepts. Returns a
15
+ * function that removes the handler. */
16
+ export declare const onVital: (handler: VitalHandler) => () => void;
17
+ export declare const vitalsBatchSchema: import("typebox").TObject<{
18
+ metrics: import("typebox").TArray<import("typebox").TObject<{
19
+ delta: import("typebox").TOptional<import("typebox").TNumber>;
20
+ id: import("typebox").TString;
21
+ name: import("typebox").TUnion<[import("typebox").TLiteral<"CLS">, import("typebox").TLiteral<"FCP">, import("typebox").TLiteral<"INP">, import("typebox").TLiteral<"LCP">, import("typebox").TLiteral<"TTFB">]>;
22
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
23
+ rating: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"good">, import("typebox").TLiteral<"needs-improvement">, import("typebox").TLiteral<"poor">]>>;
24
+ value: import("typebox").TNumber;
25
+ }>>;
26
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
27
+ route: import("typebox").TString;
28
+ }>;
29
+ /** POST `path`: validates a batch and passes each metric to the `onVital`
30
+ * handlers. Answers 204; a handler that throws is logged, not surfaced. */
31
+ export declare const createVitalsPlugin: (path: string) => import("elysia/types").AddRoute<"", "local", import("elysia").DefaultSingleton, {
32
+ typebox: {};
33
+ error: [];
34
+ }, import("elysia").DefaultMetadata, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral, "post", string, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
35
+ body: import("typebox").TObject<{
36
+ metrics: import("typebox").TArray<import("typebox").TObject<{
37
+ delta: import("typebox").TOptional<import("typebox").TNumber>;
38
+ id: import("typebox").TString;
39
+ name: import("typebox").TUnion<[import("typebox").TLiteral<"CLS">, import("typebox").TLiteral<"FCP">, import("typebox").TLiteral<"INP">, import("typebox").TLiteral<"LCP">, import("typebox").TLiteral<"TTFB">]>;
40
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
41
+ rating: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"good">, import("typebox").TLiteral<"needs-improvement">, import("typebox").TLiteral<"poor">]>>;
42
+ value: import("typebox").TNumber;
43
+ }>>;
44
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
45
+ route: import("typebox").TString;
46
+ }>;
47
+ }, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, ({ body, request, set }: {
48
+ body: {
49
+ navigationType?: string | undefined;
50
+ route: string;
51
+ metrics: {
52
+ delta?: number | undefined;
53
+ navigationType?: string | undefined;
54
+ rating?: "good" | "needs-improvement" | "poor" | undefined;
55
+ name: "CLS" | "FCP" | "INP" | "LCP" | "TTFB";
56
+ value: number;
57
+ id: string;
58
+ }[];
59
+ };
60
+ query: Record<string, string | undefined>;
61
+ params: {};
62
+ headers: Record<string, string | undefined>;
63
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
64
+ server: import("elysia").Server | null;
65
+ redirect: import("elysia").redirect;
66
+ set: {
67
+ headers: import("elysia").HTTPHeaders;
68
+ status?: number | keyof import("elysia").StatusMap;
69
+ cookie?: Record<string, import("elysia").BaseCookie>;
70
+ redirect?: never;
71
+ };
72
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = import("elysia").StatusResponse<Code>>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, import("elysia").NumericStatus<Code>>;
73
+ problem: typeof import("elysia").problem;
74
+ defer: (fn: import("elysia/types").AfterResponseHandler<NoInfer<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
75
+ body: import("typebox").TObject<{
76
+ metrics: import("typebox").TArray<import("typebox").TObject<{
77
+ delta: import("typebox").TOptional<import("typebox").TNumber>;
78
+ id: import("typebox").TString;
79
+ name: import("typebox").TUnion<[import("typebox").TLiteral<"CLS">, import("typebox").TLiteral<"FCP">, import("typebox").TLiteral<"INP">, import("typebox").TLiteral<"LCP">, import("typebox").TLiteral<"TTFB">]>;
80
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
81
+ rating: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"good">, import("typebox").TLiteral<"needs-improvement">, import("typebox").TLiteral<"poor">]>>;
82
+ value: import("typebox").TNumber;
83
+ }>>;
84
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
85
+ route: import("typebox").TString;
86
+ }>;
87
+ }, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>>, NoInfer<import("elysia").DefaultSingleton & {
88
+ derive: {};
89
+ }>>) => import("elysia/types").MaybePromise<void>;
90
+ readonly path: string;
91
+ route?: string | undefined;
92
+ rid?: string | undefined;
93
+ request: Request;
94
+ store: {};
95
+ }) => Promise<null>, {
96
+ body: import("typebox").TObject<{
97
+ metrics: import("typebox").TArray<import("typebox").TObject<{
98
+ delta: import("typebox").TOptional<import("typebox").TNumber>;
99
+ id: import("typebox").TString;
100
+ name: import("typebox").TUnion<[import("typebox").TLiteral<"CLS">, import("typebox").TLiteral<"FCP">, import("typebox").TLiteral<"INP">, import("typebox").TLiteral<"LCP">, import("typebox").TLiteral<"TTFB">]>;
101
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
102
+ rating: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"good">, import("typebox").TLiteral<"needs-improvement">, import("typebox").TLiteral<"poor">]>>;
103
+ value: import("typebox").TNumber;
104
+ }>>;
105
+ navigationType: import("typebox").TOptional<import("typebox").TString>;
106
+ route: import("typebox").TString;
107
+ }>;
108
+ }>;
@@ -1,6 +1,6 @@
1
1
  import ts from 'typescript';
2
2
  import type { AngularEntityKind } from './resolveOwningComponents';
3
- export type FastHmrFallbackReason = 'file-not-found' | 'class-not-found' | 'no-component-decorator' | 'unsupported-decorator-args' | 'inherits-decorated-class' | 'multiple-decorators-on-class' | 'template-parse-error' | 'template-resource-not-found' | 'style-resource-not-found' | 'structural-change' | 'unexpected-error';
3
+ export type FastHmrFallbackReason = 'file-not-found' | 'class-not-found' | 'no-component-decorator' | 'unsupported-decorator-args' | 'inherits-decorated-class' | 'multiple-decorators-on-class' | 'template-parse-error' | 'template-resource-not-found' | 'style-resource-not-found' | 'style-compile-error' | 'structural-change' | 'unexpected-error';
4
4
  export type ComponentFingerprint = {
5
5
  className: string;
6
6
  selector: string | null;
@@ -0,0 +1,2 @@
1
+ export declare const applyPageNonce: <Element extends HTMLElement>(element: Element) => Element;
2
+ export declare const readPageNonce: () => string | undefined;
@@ -0,0 +1,5 @@
1
+ import type { BuildConfig } from '../../types/build';
2
+ export declare const createFileRouteRefresher: (config: BuildConfig, notify: (path: string) => void) => {
3
+ /** Call for every watcher event; only route folders count. */
4
+ onFileChange: (filePath: string) => void;
5
+ } | null;
@@ -1,5 +1,5 @@
1
1
  export type ImportCostLoader = 'js' | 'jsx' | 'ts' | 'tsx';
2
2
  /** The Bun loader to hand back with the rewritten contents. Bun infers
3
3
  * CommonJS versus ESM from the source, so `.cjs`/`.mjs` both take `js`. */
4
- export declare const importCostLoader: (path: string) => "ts" | "js" | "tsx" | "jsx";
4
+ export declare const importCostLoader: (path: string) => "tsx" | "ts" | "jsx" | "js";
5
5
  export declare const instrumentModuleSource: (source: string, moduleIndex: number) => string;
@@ -0,0 +1,3 @@
1
+ import type { BuildConfig } from '../../types/build';
2
+ import type { HMRState } from './clientManager';
3
+ export declare const rebuildReactServerComponents: (state: HMRState, config: BuildConfig, filePath: string, currentHash: number) => Promise<boolean>;
@@ -0,0 +1,5 @@
1
+ import type { MessageCatalog } from '../../types/i18n';
2
+ /** Declare the default locale's catalog. Returns it unchanged, typed with
3
+ * its literal strings so `t()` checks keys and ICU parameters (the same
4
+ * as writing `as const`). */
5
+ export declare const defineMessages: <const Catalog extends MessageCatalog>(catalog: Catalog) => Catalog;
@@ -0,0 +1,26 @@
1
+ type TextNode = {
2
+ kind: 'text';
3
+ value: string;
4
+ };
5
+ type PoundNode = {
6
+ kind: 'pound';
7
+ };
8
+ type ArgumentNode = {
9
+ kind: 'argument';
10
+ name: string;
11
+ format: string | undefined;
12
+ style: string | undefined;
13
+ };
14
+ type BranchNode = {
15
+ kind: 'plural' | 'select' | 'selectordinal';
16
+ name: string;
17
+ offset: number;
18
+ options: Record<string, MessageNode[]>;
19
+ };
20
+ export type MessageNode = ArgumentNode | BranchNode | PoundNode | TextNode;
21
+ /** Parse an ICU message into nodes. Throws `SyntaxError` on bad syntax. */
22
+ export declare const parseMessage: (source: string) => MessageNode[];
23
+ /** Format an ICU message for `locale`. A message that fails to parse is
24
+ * returned as written; a missing parameter renders as `{name}`. */
25
+ export declare const formatMessage: (locale: string, message: string, params?: Record<string, unknown>) => string;
26
+ export {};
@@ -0,0 +1,6 @@
1
+ export { defineMessages } from './defineMessages';
2
+ export { formatMessage, parseMessage } from './formatMessage';
3
+ export type { MessageNode } from './formatMessage';
4
+ export { alternateLinks, localeDirection, localeFromPath, localizePath, matchLocale, negotiateLocale, parseAcceptLanguage, readCookie, stripLocalePrefix } from './routing';
5
+ export { createTranslator, isI18nPayload, isMessageTree, lookupMessage } from './translator';
6
+ export type * from '../../types/i18n';
@@ -0,0 +1,5 @@
1
+ export declare const getDateTimeFormat: (locale: string, options?: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
2
+ export declare const getListFormat: (locale: string, options?: Intl.ListFormatOptions) => Intl.ListFormat;
3
+ export declare const getNumberFormat: (locale: string, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
4
+ export declare const getPluralRules: (locale: string, options?: Intl.PluralRulesOptions) => Intl.PluralRules;
5
+ export declare const getRelativeTimeFormat: (locale: string, options?: Intl.RelativeTimeFormatOptions) => Intl.RelativeTimeFormat;
@@ -0,0 +1,28 @@
1
+ import type { AlternateLink, LocaleRoutingConfig, TextDirection } from '../../types/i18n';
2
+ /** `rtl` for locales written right to left (Arabic, Hebrew, Persian,
3
+ * Urdu, … or any tag with an RTL script subtag), else `ltr`. */
4
+ export declare const localeDirection: (locale: string) => TextDirection;
5
+ /** Language tags from an `Accept-Language` header, best first. */
6
+ export declare const parseAcceptLanguage: (header: string | null | undefined) => string[];
7
+ /** The locale named by the path's first segment, if it is one. */
8
+ export declare const localeFromPath: <Locale extends string>(pathname: string, locales: readonly Locale[]) => Locale | undefined;
9
+ /** The configured locale that best matches one requested tag: an exact
10
+ * (case-insensitive) match, then the same language (`fr-CA` → `fr`, or
11
+ * `fr` → `fr-FR`). */
12
+ export declare const matchLocale: <Locale extends string>(tag: string, locales: readonly Locale[]) => Locale | undefined;
13
+ /** The first requested tag that matches a configured locale, else
14
+ * `fallback`. */
15
+ export declare const negotiateLocale: <Locale extends string>(requested: readonly string[], locales: readonly Locale[], fallback: Locale) => Locale;
16
+ /** A cookie's value from a `Cookie` header. */
17
+ export declare const readCookie: (header: string | null | undefined, name: string) => string | undefined;
18
+ /** `pathname` without a leading locale segment (`/fr/about` → `/about`). */
19
+ export declare const stripLocalePrefix: (pathname: string, locales: readonly string[]) => string;
20
+ /** `path` as it is addressed in `locale`. Under `prefix` this swaps or
21
+ * adds the locale segment (the default locale stays unprefixed unless
22
+ * `prefixDefault`); other strategies keep one path for every locale. */
23
+ export declare const localizePath: <Locale extends string>(path: string, locale: Locale, routing: LocaleRoutingConfig<Locale>) => string;
24
+ /** hreflang alternates for `path` (with or without a locale prefix): one
25
+ * per locale plus `x-default`. Empty under `negotiate`, where every
26
+ * locale shares one URL. `origin` makes the hrefs absolute, as search
27
+ * engines require. */
28
+ export declare const alternateLinks: <Locale extends string>(path: string, routing: LocaleRoutingConfig<Locale>, origin: string) => AlternateLink[];
@@ -0,0 +1,11 @@
1
+ import type { I18nPayload, MessageCatalog, MessageTree, Translator } from '../../types/i18n';
2
+ /** The message at a dot-separated key, or undefined. */
3
+ export declare const lookupMessage: (messages: MessageTree, key: string) => string | undefined;
4
+ /** Whether `value` is an i18n payload (as passed through page props). */
5
+ export declare const isI18nPayload: (value: unknown) => value is I18nPayload;
6
+ /** Whether `value` is a catalog: nested plain objects of strings. */
7
+ export declare const isMessageTree: (value: unknown) => value is MessageTree;
8
+ /** A translator over a payload's messages. Pass your default catalog's
9
+ * type (`createTranslator<typeof en>(payload)`) to type-check keys and
10
+ * ICU parameters. */
11
+ export declare const createTranslator: <Catalog = MessageCatalog>(payload: I18nPayload) => Translator<Catalog>;