@teyik0/furin 0.2.0-alpha.1 → 0.2.0-alpha.3

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 (84) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +33 -33
  3. package/dist/adapter/static.d.ts +1 -1
  4. package/dist/build/compile-entry.ts +109 -109
  5. package/dist/build/entry-template.ts +156 -156
  6. package/dist/build/index.js +1724 -687
  7. package/dist/build/route-types.d.ts +3 -1
  8. package/dist/build/server-routes-entry.ts +36 -36
  9. package/dist/build/shared.d.ts +1 -0
  10. package/dist/build/ssg-cache.d.ts +1 -1
  11. package/dist/cli/index.js +1673 -658
  12. package/dist/client/link.js +883 -89
  13. package/dist/client/router/index.d.ts +4 -0
  14. package/dist/client/router/link-utils.d.ts +3 -1
  15. package/dist/client/router/navigation.d.ts +10 -0
  16. package/dist/client/router/provider.d.ts +1 -1
  17. package/dist/client/router/search/index.d.ts +18 -0
  18. package/dist/client/router/search-store.d.ts +21 -0
  19. package/dist/client/router/types.d.ts +14 -1
  20. package/dist/client/sync.d.ts +25 -0
  21. package/dist/client.d.ts +1 -0
  22. package/dist/client.js +44 -0
  23. package/dist/furin.d.ts +9 -1
  24. package/dist/furin.js +1578 -258
  25. package/dist/server/auto-invalidate/runtime.d.ts +1 -1
  26. package/dist/server/dev-page-plugin.d.ts +3 -0
  27. package/dist/server/render/assemble.d.ts +2 -0
  28. package/dist/server/render/isr.d.ts +2 -1
  29. package/dist/server/render/ssg.d.ts +3 -2
  30. package/dist/server/render/ssr.d.ts +5 -4
  31. package/dist/server/router/hmr.d.ts +4 -3
  32. package/dist/server/router/index.d.ts +1 -1
  33. package/dist/server/router/index.js +1 -2
  34. package/dist/server/router/index.ts +1 -2
  35. package/dist/server/router/plugin.d.ts +2 -1
  36. package/dist/server/router/schemas.d.ts +25 -17
  37. package/dist/server/sync/config.d.ts +6 -0
  38. package/dist/server/sync/index.d.ts +4 -0
  39. package/dist/server/sync/plugin.d.ts +369 -0
  40. package/dist/server/sync/stream.d.ts +47 -0
  41. package/dist/shared/search-params.d.ts +17 -0
  42. package/package.json +10 -5
  43. package/src/adapter/README.md +13 -13
  44. package/src/adapter/static.ts +23 -6
  45. package/src/build/client.ts +152 -149
  46. package/src/build/compile-entry.ts +109 -109
  47. package/src/build/entry-template.ts +156 -156
  48. package/src/build/hydrate.ts +340 -331
  49. package/src/build/index.ts +152 -152
  50. package/src/build/route-types.ts +145 -115
  51. package/src/build/scan-server.ts +95 -95
  52. package/src/build/server-routes-entry.ts +36 -36
  53. package/src/build/shared.ts +80 -78
  54. package/src/build/ssg-cache.ts +32 -31
  55. package/src/build/types.ts +89 -89
  56. package/src/client/link.tsx +13 -4
  57. package/src/client/router/context.ts +2 -0
  58. package/src/client/router/index.ts +9 -0
  59. package/src/client/router/link-utils.ts +184 -180
  60. package/src/client/router/navigation.ts +61 -0
  61. package/src/client/router/provider.tsx +804 -723
  62. package/src/client/router/search/index.ts +99 -0
  63. package/src/client/router/search-store.ts +86 -0
  64. package/src/client/router/types.ts +276 -263
  65. package/src/client/sync.ts +98 -0
  66. package/src/client.ts +369 -355
  67. package/src/furin.ts +465 -437
  68. package/src/server/auto-invalidate/runtime.ts +134 -133
  69. package/src/server/dev-page-plugin.ts +454 -449
  70. package/src/server/render/assemble.ts +160 -133
  71. package/src/server/render/isr.ts +323 -295
  72. package/src/server/render/not-found.ts +2 -0
  73. package/src/server/render/ssg.ts +15 -4
  74. package/src/server/render/ssr.ts +585 -545
  75. package/src/server/router/hmr.ts +14 -10
  76. package/src/server/router/index.ts +1 -2
  77. package/src/server/router/patterns.ts +5 -0
  78. package/src/server/router/plugin.ts +384 -401
  79. package/src/server/router/schemas.ts +172 -57
  80. package/src/server/sync/config.ts +29 -0
  81. package/src/server/sync/index.ts +14 -0
  82. package/src/server/sync/plugin.ts +108 -0
  83. package/src/server/sync/stream.ts +144 -0
  84. package/src/shared/search-params.ts +182 -0
@@ -4,6 +4,6 @@ export declare function isSuccessfulMutationResponse(ctx: Pick<Context, "set"> &
4
4
  responseValue?: unknown;
5
5
  response?: unknown;
6
6
  }): boolean;
7
- export declare function appendPendingInvalidationHeader(set: Context["set"]): void;
7
+ export declare function appendPendingInvalidationHeader(set: Context["set"]): string[];
8
8
  export declare function revalidateTag(tags: string | readonly string[]): boolean;
9
9
  export declare function runInvalidationRules(input: InvalidationInput): boolean;
@@ -50,6 +50,9 @@
50
50
  * that modules which both import and re-export from the same package are fully
51
51
  * rewritten while string literals in non-import positions are left untouched.
52
52
  */
53
+ export declare const WORKSPACE_SOURCE_FILTER: RegExp;
54
+ /** Converts a native absolute path to Bun's cross-platform import format. */
55
+ export declare function toImportSpecifier(filePath: string): string;
53
56
  /**
54
57
  * Rewrites bare React/react-dom singleton imports in source text to their
55
58
  * absolute resolved paths. Handles explicit static import / re-export forms:
@@ -44,4 +44,6 @@ interface SplitTemplate {
44
44
  }
45
45
  export declare function splitTemplate(template: string): SplitTemplate;
46
46
  export declare function assembleHTML(template: string, headData: ReturnType<typeof buildHeadInjection>, reactHtml: string, data: Record<string, unknown> | undefined): string;
47
+ export declare function buildSyncRuntimeScript(): string;
48
+ export declare function injectSyncRuntimeScript(html: string): string;
47
49
  export {};
@@ -1,3 +1,4 @@
1
1
  import type { Context } from "elysia";
2
+ import type { SearchRouteMetadata } from "../../shared/search-params.ts";
2
3
  import type { ResolvedRoute, RootLayout } from "../router/index.ts";
3
- export declare function handleISR(route: ResolvedRoute, ctx: Context, root: RootLayout, buildId: string | undefined): Promise<string | Response | undefined>;
4
+ export declare function handleISR(route: ResolvedRoute, ctx: Context, root: RootLayout, buildId: string | undefined, searchRoutes?: SearchRouteMetadata[]): Promise<string | Response | undefined>;
@@ -1,8 +1,9 @@
1
+ import type { SearchRouteMetadata } from "../../shared/search-params.ts";
1
2
  import type { SsgCacheEntry } from "../cache/isr-ssg.ts";
2
3
  import type { ResolvedRoute, RootLayout } from "../router/index.ts";
3
- export declare function prerenderSSG(route: ResolvedRoute, params: Record<string, string>, root: RootLayout, origin: string, basePath: string | undefined): Promise<SsgCacheEntry | Response>;
4
+ export declare function prerenderSSG(route: ResolvedRoute, params: Record<string, string>, root: RootLayout, origin: string, basePath?: string, searchRoutes?: SearchRouteMetadata[]): Promise<SsgCacheEntry | Response>;
4
5
  /**
5
6
  * Pre-renders all SSG routes that declare `staticParams` and populates the
6
7
  * in-memory cache before the first real request arrives.
7
8
  */
8
- export declare function warmSSGCache(routes: ResolvedRoute[], root: RootLayout, origin: string): Promise<void>;
9
+ export declare function warmSSGCache(routes: ResolvedRoute[], root: RootLayout, origin: string, searchRoutes?: SearchRouteMetadata[]): Promise<void>;
@@ -2,6 +2,7 @@ import type { Context } from "elysia";
2
2
  import { type ReactNode } from "react";
3
3
  import { renderToReadableStream } from "react-dom/server";
4
4
  import { type RouterContextValue } from "../../client/router/index.ts";
5
+ import type { SearchRouteMetadata } from "../../shared/search-params.ts";
5
6
  import type { ResolvedRoute, RootLayout } from "../router/index.ts";
6
7
  import { buildErrorElement } from "./element.tsx";
7
8
  import { type LoaderResult } from "./loaders.ts";
@@ -94,14 +95,14 @@ export declare function assertDeferredModeAllowed(route: ResolvedRoute, deferred
94
95
  * Returns the redirect Response directly when a loader redirects, so callers
95
96
  * never need try/catch for redirect handling.
96
97
  */
97
- export declare function prepareRender(route: ResolvedRoute, ctx: Context, root: RootLayout, basePath: string | undefined, throwOnFailure: boolean, precomputedLoaderResult: LoaderResult | undefined): Promise<PreparedRender | Response>;
98
- export declare function renderForPath(route: ResolvedRoute, params: Record<string, string>, root: RootLayout, origin: string, mode: "ssg" | "isr", basePath: string | undefined): Promise<RenderResult | Response>;
98
+ export declare function prepareRender(route: ResolvedRoute, ctx: Context, root: RootLayout, basePath: string | undefined, throwOnFailure: boolean, precomputedLoaderResult: LoaderResult | undefined, searchRoutes?: SearchRouteMetadata[]): Promise<PreparedRender | Response>;
99
+ export declare function renderForPath(route: ResolvedRoute, params: Record<string, string>, root: RootLayout, origin: string, mode: "ssg" | "isr", basePath?: string, searchRoutes?: SearchRouteMetadata[]): Promise<RenderResult | Response>;
99
100
  /**
100
101
  * Serialises a loader's `syncData` + `deferredPromises` into the same one-line
101
102
  * NDJSON shape the live `/_furin/data` endpoint emits.
102
103
  */
103
104
  export declare function serializeLoaderDataNdjson(syncData: Record<string, unknown>, deferredPromises: Record<string, Promise<unknown>> | undefined): Promise<string>;
104
- export declare function renderToHTML(route: ResolvedRoute, ctx: Context, root: RootLayout): Promise<RenderResult>;
105
+ export declare function renderToHTML(route: ResolvedRoute, ctx: Context, root: RootLayout, searchRoutes?: SearchRouteMetadata[]): Promise<RenderResult>;
105
106
  export declare function renderToStream(route: ResolvedRoute, ctx: Context, root: RootLayout): Promise<ReadableStream | Response>;
106
- export declare function renderSSR(route: ResolvedRoute, ctx: Context, root: RootLayout, precomputedLoaderResult: LoaderResult | undefined): Promise<Response>;
107
+ export declare function renderSSR(route: ResolvedRoute, ctx: Context, root: RootLayout, precomputedLoaderResult: LoaderResult | undefined, searchRoutes?: SearchRouteMetadata[]): Promise<Response>;
107
108
  export declare function splitBeforeBodyClose(bodyPost: string): [string, string];
@@ -1,5 +1,6 @@
1
1
  import type { Context } from "elysia";
2
2
  import type { RuntimePage, RuntimeRoute } from "../../client.ts";
3
+ import type { SearchRouteMetadata } from "../../shared/search-params.ts";
3
4
  import { type CompileContext } from "../internal.ts";
4
5
  import type { ResolvedRoute, RootLayout } from "./types.ts";
5
6
  type RouteModuleImport = (specifier: string) => Promise<Record<string, unknown>>;
@@ -31,14 +32,14 @@ export declare function refreshLayoutChain(chain: RuntimeRoute[], pagePath: stri
31
32
  */
32
33
  export declare function rebuildDevRoute(base: ResolvedRoute, page: RuntimePage, chain: RuntimeRoute[]): ResolvedRoute;
33
34
  /** @internal Handles a request in dev mode — re-imports the page fresh on every request. */
34
- export declare function handleDevRequest(route: ResolvedRoute, ctx: Context, root: RootLayout): Promise<unknown>;
35
+ export declare function handleDevRequest(route: ResolvedRoute, ctx: Context, root: RootLayout, searchRoutes?: SearchRouteMetadata[]): Promise<unknown>;
35
36
  /**
36
37
  * @internal Dev "Live ISR" — caches loader output, not assembled HTML. On a
37
38
  * fresh cache hit the loader chain is skipped; the React render still runs so
38
39
  * the response embeds the latest dev shell (chunk URL, HMR runtime, …). On
39
40
  * miss, runs loaders normally and stores the merged data record.
40
41
  */
41
- export declare function renderDevISRWithLoaderCache(route: ResolvedRoute, ctx: Context, root: RootLayout): Promise<Response>;
42
+ export declare function renderDevISRWithLoaderCache(route: ResolvedRoute, ctx: Context, root: RootLayout, searchRoutes?: SearchRouteMetadata[]): Promise<Response>;
42
43
  /**
43
44
  * @internal Dev "Live SSG" — same shape as `renderDevISRWithLoaderCache`, but
44
45
  * the cached entry is tagged forever-fresh (`revalidate: Infinity`) so it
@@ -46,7 +47,7 @@ export declare function renderDevISRWithLoaderCache(route: ResolvedRoute, ctx: C
46
47
  * dev SSG behave like production SSG: the loader runs ONCE per cache key,
47
48
  * not on every refresh.
48
49
  */
49
- export declare function renderDevSSGWithLoaderCache(route: ResolvedRoute, ctx: Context, root: RootLayout): Promise<Response>;
50
+ export declare function renderDevSSGWithLoaderCache(route: ResolvedRoute, ctx: Context, root: RootLayout, searchRoutes?: SearchRouteMetadata[]): Promise<Response>;
50
51
  /**
51
52
  * @internal Lists every source file whose contents can affect the render
52
53
  * output for a given page: the page itself, every intermediate `_route.*`
@@ -2,5 +2,5 @@ export { collectRouteTags, loadProdRoutes, scanPages, scanRootLayout } from "./d
2
2
  export { computeRouteDependencies, importFreshRouteModuleCandidate, rebuildDevRoute, refreshLayoutChain, renderDevISRWithLoaderCache, renderDevSSGWithLoaderCache, } from "./hmr.ts";
3
3
  export { buildRouteMatcher, buildRouteRegex, collectIntermediateLayoutDirs, compareRouteSpecificity, compareRouteSpecificity as routeSpecificity, escapeRegExpChar, filePathToPattern, resolveMode, } from "./patterns.ts";
4
4
  export { createDataEndpoint, createRoutePlugin } from "./plugin.ts";
5
- export { applySchemaDefaults, detectQueryDefaultRedirect, mergeRouteSchemas, parseDataEndpointPath, queryDefaultRedirectHook, } from "./schemas.ts";
5
+ export { applySchemaDefaults, createSearchRouteMetadata, mergeRouteSchemas, parseDataEndpointPath, } from "./schemas.ts";
6
6
  export type { ResolvedRoute, RootLayout, SegmentBoundary } from "./types.ts";
@@ -8,14 +8,13 @@ export {
8
8
  renderDevISRWithLoaderCache,
9
9
  refreshLayoutChain,
10
10
  rebuildDevRoute,
11
- queryDefaultRedirectHook,
12
11
  parseDataEndpointPath,
13
12
  mergeRouteSchemas,
14
13
  loadProdRoutes,
15
14
  importFreshRouteModuleCandidate,
16
15
  filePathToPattern,
17
16
  escapeRegExpChar,
18
- detectQueryDefaultRedirect,
17
+ createSearchRouteMetadata,
19
18
  createRoutePlugin,
20
19
  createDataEndpoint,
21
20
  computeRouteDependencies,
@@ -21,9 +21,8 @@ export {
21
21
  export { createDataEndpoint, createRoutePlugin } from "./plugin.ts";
22
22
  export {
23
23
  applySchemaDefaults,
24
- detectQueryDefaultRedirect,
24
+ createSearchRouteMetadata,
25
25
  mergeRouteSchemas,
26
26
  parseDataEndpointPath,
27
- queryDefaultRedirectHook,
28
27
  } from "./schemas.ts";
29
28
  export type { ResolvedRoute, RootLayout, SegmentBoundary } from "./types.ts";
@@ -1,6 +1,7 @@
1
1
  import { type AnyElysia } from "elysia";
2
+ import type { SearchRouteMetadata } from "../../shared/search-params.ts";
2
3
  import type { ResolvedRoute, RootLayout } from "./types.ts";
3
- export declare function createRoutePlugin(route: ResolvedRoute, root: RootLayout, buildId?: string): AnyElysia;
4
+ export declare function createRoutePlugin(route: ResolvedRoute, root: RootLayout, buildId?: string, searchRoutes?: SearchRouteMetadata[]): AnyElysia;
4
5
  /**
5
6
  * Elysia plugin that handles `GET /_furin/data?path=<logicalHref>`.
6
7
  *
@@ -1,19 +1,9 @@
1
- import type { Context } from "elysia";
2
1
  import type { AnySchema } from "elysia/types";
3
2
  import type { RuntimeRoute } from "../../client.ts";
4
- /**
5
- * Detects whether a validator filled in default query values that the original
6
- * URL did not carry, and returns the canonical `pathname + search` to redirect
7
- * to — or `undefined` when the URL already reflects the resolved query.
8
- *
9
- * Pure helper extracted from `queryDefaultRedirectHook` so the `/_furin/data`
10
- * NDJSON endpoint can detect the same condition without going through
11
- * Elysia's `status()` shim (which only emits HTTP 302s, unparseable by the
12
- * SPA client).
13
- *
14
- * @internal Exported for unit testing.
15
- */
16
- export declare function detectQueryDefaultRedirect(request: Request, resolvedQuery: Record<string, unknown>): string | undefined;
3
+ import { type SearchParamsInput, type SearchRouteMetadata } from "../../shared/search-params.ts";
4
+ interface UnknownObject {
5
+ [key: string]: unknown;
6
+ }
17
7
  /**
18
8
  * Parses the `?path=` argument of `/_furin/data`, rejecting absolute /
19
9
  * protocol-relative inputs that would let a caller smuggle a foreign origin
@@ -31,8 +21,21 @@ export declare function parseDataEndpointPath(rawPath: string): {
31
21
  url: URL;
32
22
  pathname: string;
33
23
  } | undefined;
34
- /** @internal Exported for unit testing. */
35
- export declare function queryDefaultRedirectHook({ request, query, status, set }: Context): import("elysia").ElysiaCustomStatusResponse<"Found", "Found", 302> | undefined;
24
+ export type ParseRouteQueryResult = {
25
+ ok: true;
26
+ query: SearchParamsInput;
27
+ } | {
28
+ errors: unknown;
29
+ ok: false;
30
+ };
31
+ /**
32
+ * Parses and validates a logical route URL's search string for the synthetic
33
+ * `/_furin/data` request path. This keeps SPA navigations aligned with the
34
+ * Elysia guard used by the full SSR route.
35
+ *
36
+ * @internal Exported for unit testing.
37
+ */
38
+ export declare function parseRouteQuery(url: URL, schema: AnySchema | undefined): Promise<ParseRouteQueryResult>;
36
39
  /**
37
40
  * Merges TObject schemas from all routeChain entries for a given key.
38
41
  * Properties are spread left-to-right (leaf wins on key conflict).
@@ -43,9 +46,14 @@ export declare function queryDefaultRedirectHook({ request, query, status, set }
43
46
  * @internal Exported for unit testing.
44
47
  */
45
48
  export declare function mergeRouteSchemas(routeChain: RuntimeRoute[], key: "params" | "query"): AnySchema | undefined;
49
+ export declare function createSearchRouteMetadata(routes: Array<{
50
+ pattern: string;
51
+ routeChain: RuntimeRoute[];
52
+ }>): SearchRouteMetadata[];
46
53
  /**
47
54
  * Applies top-level `default` values from a TypeBox TObject schema to a
48
55
  * values record. Used in the `/_furin/data` endpoint so loaders see the same
49
56
  * defaulted query objects that the SSR path produces via Elysia's guard.
50
57
  */
51
- export declare function applySchemaDefaults(schema: Record<string, unknown> | undefined, values: Record<string, unknown>): Record<string, unknown>;
58
+ export declare function applySchemaDefaults(schema: UnknownObject | undefined, values: UnknownObject): UnknownObject;
59
+ export {};
@@ -0,0 +1,6 @@
1
+ export type FurinSyncOption = boolean | {
2
+ streamPath?: string;
3
+ };
4
+ export declare function resolveSyncStreamPath(sync: FurinSyncOption | undefined): string | undefined;
5
+ export declare function getSyncStreamPath(): string | undefined;
6
+ export declare function runWithSyncStreamPath<T>(path: string | undefined, fn: () => T): T;
@@ -0,0 +1,4 @@
1
+ export type { FurinSyncOption } from "./config.ts";
2
+ export { getSyncStreamPath, resolveSyncStreamPath, runWithSyncStreamPath, } from "./config.ts";
3
+ export { furinSync, type SyncInput } from "./plugin.ts";
4
+ export { __resetSyncState, createSyncStreamPlugin, publishSyncInvalidation, type SyncInvalidationEvent, } from "./stream.ts";
@@ -0,0 +1,369 @@
1
+ import { type AfterHandler, Elysia } from "elysia";
2
+ import type { InvalidationInput } from "../auto-invalidate/types.ts";
3
+ export type SyncInput = InvalidationInput | {
4
+ invalidate: InvalidationInput;
5
+ };
6
+ type AnyHandlerContext = Parameters<AfterHandler>[0];
7
+ export declare function furinSync(): Elysia<"", {
8
+ decorator: {};
9
+ store: {};
10
+ derive: {};
11
+ resolve: {};
12
+ }, {
13
+ typebox: {};
14
+ error: {};
15
+ }, {
16
+ schema: {};
17
+ standaloneSchema: {};
18
+ macro: Partial<{
19
+ readonly sync: SyncInput;
20
+ }>;
21
+ macroFn: {
22
+ readonly sync: (input: SyncInput) => {
23
+ readonly beforeHandle: (ctx: {
24
+ body: unknown;
25
+ query: Record<string, string>;
26
+ params: {};
27
+ headers: Record<string, string | undefined>;
28
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
29
+ server: import("elysia/universal/server").Server | null;
30
+ redirect: import("elysia").redirect;
31
+ set: {
32
+ headers: import("elysia").HTTPHeaders;
33
+ status?: number | keyof import("elysia").StatusMap;
34
+ redirect?: string;
35
+ cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
36
+ };
37
+ path: string;
38
+ route: string;
39
+ request: Request;
40
+ store: {};
41
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 301 | 302 | 303 | 307 | 308 | 200 | 300 | 404 | 500 | 304 | 400 | 422 | 100 | 428 | 409 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
42
+ readonly 100: "Continue";
43
+ readonly 101: "Switching Protocols";
44
+ readonly 102: "Processing";
45
+ readonly 103: "Early Hints";
46
+ readonly 200: "OK";
47
+ readonly 201: "Created";
48
+ readonly 202: "Accepted";
49
+ readonly 203: "Non-Authoritative Information";
50
+ readonly 204: "No Content";
51
+ readonly 205: "Reset Content";
52
+ readonly 206: "Partial Content";
53
+ readonly 207: "Multi-Status";
54
+ readonly 208: "Already Reported";
55
+ readonly 300: "Multiple Choices";
56
+ readonly 301: "Moved Permanently";
57
+ readonly 302: "Found";
58
+ readonly 303: "See Other";
59
+ readonly 304: "Not Modified";
60
+ readonly 307: "Temporary Redirect";
61
+ readonly 308: "Permanent Redirect";
62
+ readonly 400: "Bad Request";
63
+ readonly 401: "Unauthorized";
64
+ readonly 402: "Payment Required";
65
+ readonly 403: "Forbidden";
66
+ readonly 404: "Not Found";
67
+ readonly 405: "Method Not Allowed";
68
+ readonly 406: "Not Acceptable";
69
+ readonly 407: "Proxy Authentication Required";
70
+ readonly 408: "Request Timeout";
71
+ readonly 409: "Conflict";
72
+ readonly 410: "Gone";
73
+ readonly 411: "Length Required";
74
+ readonly 412: "Precondition Failed";
75
+ readonly 413: "Payload Too Large";
76
+ readonly 414: "URI Too Long";
77
+ readonly 415: "Unsupported Media Type";
78
+ readonly 416: "Range Not Satisfiable";
79
+ readonly 417: "Expectation Failed";
80
+ readonly 418: "I'm a teapot";
81
+ readonly 420: "Enhance Your Calm";
82
+ readonly 421: "Misdirected Request";
83
+ readonly 422: "Unprocessable Content";
84
+ readonly 423: "Locked";
85
+ readonly 424: "Failed Dependency";
86
+ readonly 425: "Too Early";
87
+ readonly 426: "Upgrade Required";
88
+ readonly 428: "Precondition Required";
89
+ readonly 429: "Too Many Requests";
90
+ readonly 431: "Request Header Fields Too Large";
91
+ readonly 451: "Unavailable For Legal Reasons";
92
+ readonly 500: "Internal Server Error";
93
+ readonly 501: "Not Implemented";
94
+ readonly 502: "Bad Gateway";
95
+ readonly 503: "Service Unavailable";
96
+ readonly 504: "Gateway Timeout";
97
+ readonly 505: "HTTP Version Not Supported";
98
+ readonly 506: "Variant Also Negotiates";
99
+ readonly 507: "Insufficient Storage";
100
+ readonly 508: "Loop Detected";
101
+ readonly 510: "Not Extended";
102
+ readonly 511: "Network Authentication Required";
103
+ }[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaCustomStatusResponse<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
104
+ readonly Continue: 100;
105
+ readonly "Switching Protocols": 101;
106
+ readonly Processing: 102;
107
+ readonly "Early Hints": 103;
108
+ readonly OK: 200;
109
+ readonly Created: 201;
110
+ readonly Accepted: 202;
111
+ readonly "Non-Authoritative Information": 203;
112
+ readonly "No Content": 204;
113
+ readonly "Reset Content": 205;
114
+ readonly "Partial Content": 206;
115
+ readonly "Multi-Status": 207;
116
+ readonly "Already Reported": 208;
117
+ readonly "Multiple Choices": 300;
118
+ readonly "Moved Permanently": 301;
119
+ readonly Found: 302;
120
+ readonly "See Other": 303;
121
+ readonly "Not Modified": 304;
122
+ readonly "Temporary Redirect": 307;
123
+ readonly "Permanent Redirect": 308;
124
+ readonly "Bad Request": 400;
125
+ readonly Unauthorized: 401;
126
+ readonly "Payment Required": 402;
127
+ readonly Forbidden: 403;
128
+ readonly "Not Found": 404;
129
+ readonly "Method Not Allowed": 405;
130
+ readonly "Not Acceptable": 406;
131
+ readonly "Proxy Authentication Required": 407;
132
+ readonly "Request Timeout": 408;
133
+ readonly Conflict: 409;
134
+ readonly Gone: 410;
135
+ readonly "Length Required": 411;
136
+ readonly "Precondition Failed": 412;
137
+ readonly "Payload Too Large": 413;
138
+ readonly "URI Too Long": 414;
139
+ readonly "Unsupported Media Type": 415;
140
+ readonly "Range Not Satisfiable": 416;
141
+ readonly "Expectation Failed": 417;
142
+ readonly "I'm a teapot": 418;
143
+ readonly "Enhance Your Calm": 420;
144
+ readonly "Misdirected Request": 421;
145
+ readonly "Unprocessable Content": 422;
146
+ readonly Locked: 423;
147
+ readonly "Failed Dependency": 424;
148
+ readonly "Too Early": 425;
149
+ readonly "Upgrade Required": 426;
150
+ readonly "Precondition Required": 428;
151
+ readonly "Too Many Requests": 429;
152
+ readonly "Request Header Fields Too Large": 431;
153
+ readonly "Unavailable For Legal Reasons": 451;
154
+ readonly "Internal Server Error": 500;
155
+ readonly "Not Implemented": 501;
156
+ readonly "Bad Gateway": 502;
157
+ readonly "Service Unavailable": 503;
158
+ readonly "Gateway Timeout": 504;
159
+ readonly "HTTP Version Not Supported": 505;
160
+ readonly "Variant Also Negotiates": 506;
161
+ readonly "Insufficient Storage": 507;
162
+ readonly "Loop Detected": 508;
163
+ readonly "Not Extended": 510;
164
+ readonly "Network Authentication Required": 511;
165
+ }[Code] : Code>;
166
+ }) => Response | undefined;
167
+ readonly afterHandle: (ctx: AnyHandlerContext) => void;
168
+ readonly error: ({ request }: {
169
+ body: unknown;
170
+ query: Record<string, string | undefined>;
171
+ params: {};
172
+ headers: Record<string, string | undefined>;
173
+ cookie: Record<string, import("elysia").Cookie<string | undefined>>;
174
+ server: import("elysia/universal/server").Server | null;
175
+ redirect: import("elysia").redirect;
176
+ set: {
177
+ headers: import("elysia").HTTPHeaders;
178
+ status?: number | keyof import("elysia").StatusMap;
179
+ redirect?: string;
180
+ cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
181
+ };
182
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 301 | 302 | 303 | 307 | 308 | 200 | 300 | 404 | 500 | 304 | 400 | 422 | 100 | 428 | 409 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
183
+ readonly 100: "Continue";
184
+ readonly 101: "Switching Protocols";
185
+ readonly 102: "Processing";
186
+ readonly 103: "Early Hints";
187
+ readonly 200: "OK";
188
+ readonly 201: "Created";
189
+ readonly 202: "Accepted";
190
+ readonly 203: "Non-Authoritative Information";
191
+ readonly 204: "No Content";
192
+ readonly 205: "Reset Content";
193
+ readonly 206: "Partial Content";
194
+ readonly 207: "Multi-Status";
195
+ readonly 208: "Already Reported";
196
+ readonly 300: "Multiple Choices";
197
+ readonly 301: "Moved Permanently";
198
+ readonly 302: "Found";
199
+ readonly 303: "See Other";
200
+ readonly 304: "Not Modified";
201
+ readonly 307: "Temporary Redirect";
202
+ readonly 308: "Permanent Redirect";
203
+ readonly 400: "Bad Request";
204
+ readonly 401: "Unauthorized";
205
+ readonly 402: "Payment Required";
206
+ readonly 403: "Forbidden";
207
+ readonly 404: "Not Found";
208
+ readonly 405: "Method Not Allowed";
209
+ readonly 406: "Not Acceptable";
210
+ readonly 407: "Proxy Authentication Required";
211
+ readonly 408: "Request Timeout";
212
+ readonly 409: "Conflict";
213
+ readonly 410: "Gone";
214
+ readonly 411: "Length Required";
215
+ readonly 412: "Precondition Failed";
216
+ readonly 413: "Payload Too Large";
217
+ readonly 414: "URI Too Long";
218
+ readonly 415: "Unsupported Media Type";
219
+ readonly 416: "Range Not Satisfiable";
220
+ readonly 417: "Expectation Failed";
221
+ readonly 418: "I'm a teapot";
222
+ readonly 420: "Enhance Your Calm";
223
+ readonly 421: "Misdirected Request";
224
+ readonly 422: "Unprocessable Content";
225
+ readonly 423: "Locked";
226
+ readonly 424: "Failed Dependency";
227
+ readonly 425: "Too Early";
228
+ readonly 426: "Upgrade Required";
229
+ readonly 428: "Precondition Required";
230
+ readonly 429: "Too Many Requests";
231
+ readonly 431: "Request Header Fields Too Large";
232
+ readonly 451: "Unavailable For Legal Reasons";
233
+ readonly 500: "Internal Server Error";
234
+ readonly 501: "Not Implemented";
235
+ readonly 502: "Bad Gateway";
236
+ readonly 503: "Service Unavailable";
237
+ readonly 504: "Gateway Timeout";
238
+ readonly 505: "HTTP Version Not Supported";
239
+ readonly 506: "Variant Also Negotiates";
240
+ readonly 507: "Insufficient Storage";
241
+ readonly 508: "Loop Detected";
242
+ readonly 510: "Not Extended";
243
+ readonly 511: "Network Authentication Required";
244
+ }[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaCustomStatusResponse<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
245
+ readonly Continue: 100;
246
+ readonly "Switching Protocols": 101;
247
+ readonly Processing: 102;
248
+ readonly "Early Hints": 103;
249
+ readonly OK: 200;
250
+ readonly Created: 201;
251
+ readonly Accepted: 202;
252
+ readonly "Non-Authoritative Information": 203;
253
+ readonly "No Content": 204;
254
+ readonly "Reset Content": 205;
255
+ readonly "Partial Content": 206;
256
+ readonly "Multi-Status": 207;
257
+ readonly "Already Reported": 208;
258
+ readonly "Multiple Choices": 300;
259
+ readonly "Moved Permanently": 301;
260
+ readonly Found: 302;
261
+ readonly "See Other": 303;
262
+ readonly "Not Modified": 304;
263
+ readonly "Temporary Redirect": 307;
264
+ readonly "Permanent Redirect": 308;
265
+ readonly "Bad Request": 400;
266
+ readonly Unauthorized: 401;
267
+ readonly "Payment Required": 402;
268
+ readonly Forbidden: 403;
269
+ readonly "Not Found": 404;
270
+ readonly "Method Not Allowed": 405;
271
+ readonly "Not Acceptable": 406;
272
+ readonly "Proxy Authentication Required": 407;
273
+ readonly "Request Timeout": 408;
274
+ readonly Conflict: 409;
275
+ readonly Gone: 410;
276
+ readonly "Length Required": 411;
277
+ readonly "Precondition Failed": 412;
278
+ readonly "Payload Too Large": 413;
279
+ readonly "URI Too Long": 414;
280
+ readonly "Unsupported Media Type": 415;
281
+ readonly "Range Not Satisfiable": 416;
282
+ readonly "Expectation Failed": 417;
283
+ readonly "I'm a teapot": 418;
284
+ readonly "Enhance Your Calm": 420;
285
+ readonly "Misdirected Request": 421;
286
+ readonly "Unprocessable Content": 422;
287
+ readonly Locked: 423;
288
+ readonly "Failed Dependency": 424;
289
+ readonly "Too Early": 425;
290
+ readonly "Upgrade Required": 426;
291
+ readonly "Precondition Required": 428;
292
+ readonly "Too Many Requests": 429;
293
+ readonly "Request Header Fields Too Large": 431;
294
+ readonly "Unavailable For Legal Reasons": 451;
295
+ readonly "Internal Server Error": 500;
296
+ readonly "Not Implemented": 501;
297
+ readonly "Bad Gateway": 502;
298
+ readonly "Service Unavailable": 503;
299
+ readonly "Gateway Timeout": 504;
300
+ readonly "HTTP Version Not Supported": 505;
301
+ readonly "Variant Also Negotiates": 506;
302
+ readonly "Insufficient Storage": 507;
303
+ readonly "Loop Detected": 508;
304
+ readonly "Not Extended": 510;
305
+ readonly "Network Authentication Required": 511;
306
+ }[Code] : Code>;
307
+ path: string;
308
+ route: string;
309
+ request: Request;
310
+ store: {};
311
+ } & ({
312
+ request: Request;
313
+ code: "UNKNOWN";
314
+ error: Readonly<Error>;
315
+ set: import("elysia").Context["set"];
316
+ } | {
317
+ request: Request;
318
+ code: "VALIDATION";
319
+ error: Readonly<import("elysia").ValidationError>;
320
+ set: import("elysia").Context["set"];
321
+ } | {
322
+ request: Request;
323
+ code: "NOT_FOUND";
324
+ error: Readonly<import("elysia").NotFoundError>;
325
+ set: import("elysia").Context["set"];
326
+ } | {
327
+ request: Request;
328
+ code: "PARSE";
329
+ error: Readonly<import("elysia").ParseError>;
330
+ set: import("elysia").Context["set"];
331
+ } | {
332
+ request: Request;
333
+ code: "INTERNAL_SERVER_ERROR";
334
+ error: Readonly<import("elysia").InternalServerError>;
335
+ set: import("elysia").Context["set"];
336
+ } | {
337
+ request: Request;
338
+ code: "INVALID_COOKIE_SIGNATURE";
339
+ error: Readonly<import("elysia").InvalidCookieSignature>;
340
+ set: import("elysia").Context["set"];
341
+ } | {
342
+ request: Request;
343
+ code: "INVALID_FILE_TYPE";
344
+ error: Readonly<import("elysia").InvalidFileType>;
345
+ set: import("elysia").Context["set"];
346
+ } | {
347
+ request: Request;
348
+ code: number;
349
+ error: Readonly<import("elysia").ElysiaCustomStatusResponse<number>>;
350
+ set: import("elysia").Context["set"];
351
+ })) => void;
352
+ };
353
+ };
354
+ parser: {};
355
+ response: {};
356
+ }, {}, {
357
+ derive: {};
358
+ resolve: {};
359
+ schema: {};
360
+ standaloneSchema: {};
361
+ response: {};
362
+ }, {
363
+ derive: {};
364
+ resolve: {};
365
+ schema: {};
366
+ standaloneSchema: {};
367
+ response: {};
368
+ }>;
369
+ export {};