Reference
rouzer
export * from 'alien-middleware';
Functions
$error
Create a compile-time-only marker for a declared error response type.
export function $error<T>(): UncheckedError<T>;
export namespace $error {
var symbol: symbol;
}
Remarks
$error<T>() marks a non-success response branch in a status-keyed
response map. It is a type contract, not a runtime validator. On the server,
handlers use ctx.error(status, body) to return declared errors. On the
client, declared error responses resolve as [error, null, status] tuple
entries instead of rejecting the promise.
Examples
import { $type, $error } from 'rouzer'
import * as http from 'rouzer/http'
const getUser = http.get('users/:id', {
response: {
200: $type<User>(),
404: $error<{ code: string; message: string }>(),
},
})
$type
Create a compile-time-only marker for an action's JSON response payload type.
export function $type<T>(): Unchecked<T>;
export namespace $type {
var symbol: symbol;
}
Remarks
$type<T>() does not validate handler return values at the server
boundary. It lets Rouzer type server handler return values and client action
functions for HTTP actions whose responses are expected to be JSON. Use it
directly as response for one JSON success shape, or as a success entry in a
status-keyed response map. Validate response data where it enters your server
or client code when runtime integrity is required.
Examples
import { $type } from 'rouzer'
import * as http from 'rouzer/http'
const hello = http.get('hello/:name', {
response: $type<{ message: string }>(),
})
createClient
Create a typed fetch client for an HTTP route tree.
export function createClient<TRoutes extends HttpRouteTree = Record<string, never>>(config: {
baseURL: string;
headers?: Record<string, string>;
routes: TRoutes;
plugins?: readonly ClientResponsePlugin[];
onJsonError?: (response: Response) => Promisable<unknown>;
fetch?: typeof globalThis.fetch;
clientHook?: RouzerClientHook;
}): ClientTree<TRoutes, ""> & {
clientConfig: {
baseURL: string;
headers?: Record<string, string>;
routes: TRoutes;
plugins?: readonly ClientResponsePlugin[];
onJsonError?: (response: Response) => Promisable<unknown>;
fetch?: typeof globalThis.fetch;
clientHook?: RouzerClientHook;
};
};
Remarks
The returned client mirrors the resource tree and attaches direct
action functions such as client.users.list(...).
Properties
baseURLAbsolute base URL used for generated request URLs.Remarks
A trailing slash is added when missing. In browsers, derive a relative API path with
new URL('/api/', window.location.origin).href.headersDefault headers sent with every request.Remarks
Per-request headers are merged on top of these values. Undefined per-request headers are removed before
fetch.routesHTTP route tree to attach as direct client action functions.Examples
const client = createClient({ baseURL: 'https://example.com/api/', routes }) await client.users.list({ page: 1 })pluginsResponse codec plugins used by generated action functions.onJsonErrorCustom handler for non-2xx responses from generated client action functions.Remarks
When provided, the return value is returned from the client action as-is; Rouzer does not automatically parse a
Responsereturned by this hook.fetchCustomfetchimplementation to use for requests.clientHookBest-effort lifecycle observer for generated client action calls.Remarks
Hook errors are swallowed and never change request behavior.
baseURLAbsolute base URL used for generated request URLs.Remarks
A trailing slash is added when missing. In browsers, derive a relative API path with
new URL('/api/', window.location.origin).href.headersDefault headers sent with every request.Remarks
Per-request headers are merged on top of these values. Undefined per-request headers are removed before
fetch.routesHTTP route tree to attach as direct client action functions.Examples
const client = createClient({ baseURL: 'https://example.com/api/', routes }) await client.users.list({ page: 1 })pluginsResponse codec plugins used by generated action functions.onJsonErrorCustom handler for non-2xx responses from generated client action functions.Remarks
When provided, the return value is returned from the client action as-is; Rouzer does not automatically parse a
Responsereturned by this hook.fetchCustomfetchimplementation to use for requests.clientHookBest-effort lifecycle observer for generated client action calls.Remarks
Hook errors are swallowed and never change request behavior.
createResponsePluginMap
Create a plugin lookup map and reject duplicate plugin ids.
export function createResponsePluginMap<TPlugin extends {
readonly id: string;
}>(plugins?: readonly TPlugin[], label?: string): Map<string, TPlugin>;
š createResponsePluginMap on GitHub
createResponsePluginMarker
Create a response marker for a response plugin.
export function createResponsePluginMarker<TClient, TRouter = TClient, const TId extends string = string>(id: TId): ResponsePluginMarker<TClient, TRouter, TId>;
š createResponsePluginMarker on GitHub
createRouter
Create a Rouzer router that can be mounted as a fetch-compatible handler.
export function createRouter<TEnv extends object = {}, TProperties extends object = {}, TRuntime = unknown>(config?: RouterConfig): Router<MiddlewareTypes<TEnv, TProperties, TRuntime>>;
Parameters
config: Optional router configuration for base path, debug behavior, response plugins, and CORS origin restrictions.
Returns
A fetch-compatible handler with .use(...) methods for middleware
and route registration.
getResponsePluginMarkerId
Get the response plugin id from a plugin marker, if present.
export function getResponsePluginMarkerId(value: unknown): string | undefined;
š getResponsePluginMarkerId on GitHub
isResponsePluginMarker
Return true when a route response marker is handled by a response plugin.
export function isResponsePluginMarker(value: unknown): value is ResponsePluginMarker<unknown, unknown>;
š isResponsePluginMarker on GitHub
metadata
Attach runtime metadata to a route declaration.
export function metadata(value: RouteMetadata): object;
Types
BodyInput
type BodyInput<T> = T extends MutationRouteSchema ? T extends {
body: infer TBody;
} ? TBody extends RawBodySchema ? unknown : z.infer<TBody> : unknown : unknown;
ClientResponsePlugin
Client-side response plugin used by createClient({ plugins }).
export type ClientResponsePlugin = {
readonly id: string;
decode(response: Response, context: {
marker: ResponsePluginMarker<any, any>;
request: ClientResponsePluginRequest;
}): Promisable<unknown>;
};
Properties
idStable response codec id matched against route response markers.decodeDecode a successfulResponseinto the client action result.
š ClientResponsePlugin on GitHub
ClientResponsePluginRequest
Request metadata passed to client response plugins.
export type ClientResponsePluginRequest = {
schema: RouteSchema;
path: RoutePattern;
method: string;
input?: unknown;
options?: RouteOptions;
};
š ClientResponsePluginRequest on GitHub
ClientTree
Client object shape produced from an HTTP route tree.
export type ClientTree<T extends HttpRouteTree, TPrefix extends string = ''> = {
[K in keyof T]: T[K] extends HttpResource<infer P, infer C> ? ClientTree<C, Join<TPrefix, P>> : T[K] extends HttpAction<infer P, infer S, any> ? RouteFunction<S, Join<TPrefix, P>> : never;
};
HeaderInput
type HeaderInput<T> = T extends {
headers: infer THeaders;
} ? Partial<z.infer<THeaders>> : Record<string, string | undefined>;
InferActionHandler
export type InferActionHandler<TMiddleware extends AnyMiddlewareChain, TAction extends HttpAction, TPath extends string> = TAction['schema'] extends {
response: infer R extends RouteResponseMap;
} ? TAction['method'] extends 'GET' ? RouteRequestHandler<TMiddleware, {
path: TAction['schema'] extends {
path: any;
} ? z.infer<TAction['schema']['path']> : MatchParams<TPath>;
query: TAction['schema'] extends {
query: any;
} ? z.infer<TAction['schema']['query']> : undefined;
headers: TAction['schema'] extends {
headers: any;
} ? z.infer<TAction['schema']['headers']> : undefined;
}, InferRouteHandlerResult<Extract<TAction['schema'], RouteSchema>>, InferResponseMapErrors<R>, InferResponseMapSuccesses<R>> : RouteRequestHandler<TMiddleware, {
path: TAction['schema'] extends {
path: any;
} ? z.infer<TAction['schema']['path']> : MatchParams<TPath>;
body: InferHandlerBody<TAction['schema']>;
headers: TAction['schema'] extends {
headers: any;
} ? z.infer<TAction['schema']['headers']> : undefined;
}, InferRouteHandlerResult<Extract<TAction['schema'], RouteSchema>>, InferResponseMapErrors<R>, InferResponseMapSuccesses<R>> : TAction['method'] extends 'GET' ? RouteRequestHandler<TMiddleware, {
path: TAction['schema'] extends {
path: any;
} ? z.infer<TAction['schema']['path']> : MatchParams<TPath>;
query: TAction['schema'] extends {
query: any;
} ? z.infer<TAction['schema']['query']> : undefined;
headers: TAction['schema'] extends {
headers: any;
} ? z.infer<TAction['schema']['headers']> : undefined;
}, InferRouteHandlerResult<Extract<TAction['schema'], RouteSchema>>> : RouteRequestHandler<TMiddleware, {
path: TAction['schema'] extends {
path: any;
} ? z.infer<TAction['schema']['path']> : MatchParams<TPath>;
body: InferHandlerBody<TAction['schema']>;
headers: TAction['schema'] extends {
headers: any;
} ? z.infer<TAction['schema']['headers']> : undefined;
}, InferRouteHandlerResult<Extract<TAction['schema'], RouteSchema>>>;
š InferActionHandler on GitHub
InferHandlerBody
type InferHandlerBody<T> = T extends {
body: infer TBody;
} ? TBody extends RawBodySchema ? undefined : z.infer<TBody> : undefined;
š InferHandlerBody on GitHub
InferResponseMapClient
Helper: given a status-keyed response map, produce the discriminated tuple union for the client.
Each entry becomes:
$type<T>()ā[null, T, Status]$error<T>()ā[T, null, Status]
type InferResponseMapClient<T extends RouteResponseMap> = {
[K in keyof T & number]: T[K] extends UncheckedError<infer TError> ? [TError, null, K] : T[K] extends Unchecked<infer TSuccess> ? [null, TSuccess, K] : T[K] extends ResponsePluginMarker<infer TClient, any> ? [null, TClient, K] : never;
}[keyof T & number];
š InferResponseMapClient on GitHub
InferResponseMapErrors
Helper: given a status-keyed response map, extract error entries as a union
of [status, body] pairs for typing ctx.error(status, body).
export type InferResponseMapErrors<T extends RouteResponseMap> = {
[K in keyof T & number]: T[K] extends UncheckedError<infer TError> ? [K, TError] : never;
}[keyof T & number];
š InferResponseMapErrors on GitHub
InferResponseMapHandlerResult
Helper: given a status-keyed response map, produce the union of handler result types (success values the handler can return directly).
type InferResponseMapHandlerResult<T extends RouteResponseMap> = {
[K in keyof T & number]: T[K] extends Unchecked<infer TSuccess> ? TSuccess : T[K] extends ResponsePluginMarker<any, infer TRouter> ? TRouter : never;
}[keyof T & number];
š InferResponseMapHandlerResult on GitHub
InferResponseMapSuccesses
Extract success entries as a union of [status, body] pairs.
export type InferResponseMapSuccesses<T extends RouteResponseMap> = {
[K in keyof T & number]: T[K] extends Unchecked<infer TSuccess> ? [K, TSuccess] : T[K] extends ResponsePluginMarker<any, infer TRouter> ? [K, TRouter] : never;
}[keyof T & number];
š InferResponseMapSuccesses on GitHub
InferRouteBody
Infer the request body type from an action schema.
export type InferRouteBody<T> = T extends RouteSchema ? InferRouteSchemaBody<T> : never;
Remarks
HTTP action schemas can be inspected with
InferRouteBody<typeof action.schema>. Schemas without a body schema infer
unknown.
InferRouteHandlerResult
Infer the non-Response handler result type from an action schema.
export type InferRouteHandlerResult<T extends RouteSchema> = T extends {
response: infer R;
} ? R extends ResponsePluginMarker<any, infer TRouter> ? TRouter : R extends Unchecked<infer TResponse> ? TResponse : R extends RouteResponseMap ? InferResponseMapHandlerResult<R> : void : void;
Remarks
For status-keyed response maps, this includes only success result
values. Declared error responses are returned with ctx.error(status, body).
š InferRouteHandlerResult on GitHub
InferRouteResponse
Infer the generated client action result type from an action schema.
export type InferRouteResponse<T extends RouteSchema> = T extends {
response: infer R;
} ? R extends ResponsePluginMarker<infer TClient, any> ? TClient : R extends Unchecked<infer TResponse> ? TResponse : R extends RouteResponseMap ? InferResponseMapClient<R> : void : void;
Remarks
Direct JSON markers infer their payload type, plugin markers infer
their client result type, and status-keyed response maps infer a tuple union
of [null, value, status] success entries and [error, null, status] error
entries.
š InferRouteResponse on GitHub
InferRouteSchemaBody
type InferRouteSchemaBody<TSchema> = TSchema extends MutationRouteSchema ? TSchema extends {
body: infer TBody;
} ? z.infer<TBody> : unknown : never;
š InferRouteSchemaBody on GitHub
Join
type Join<A extends string, B extends string> = A extends '' ? B : B extends '' ? A : `${A}/${B}`;
MutationRouteSchema
Schema shape for mutation route methods.
export type MutationRouteSchema = {
path?: z.ZodObject<any>;
query?: never;
body?: z.ZodObject<any> | RawBodySchema;
headers?: z.ZodObject<any>;
response?: RouteResponseSchema;
};
Properties
pathOptional Zod object used to validate path params.queryMutation routes do not accept query schemas.bodyOptional Zod schema used to validate the JSON request body, or raw body marker.headersOptional Zod object used to validate request headers.responseOptional compile-time-only JSON or plugin response type marker.
š MutationRouteSchema on GitHub
PathInput
type PathInput<T, P extends string> = T extends {
path: infer TPath;
} ? z.infer<TPath> : MatchParams<P>;
QueryInput
type QueryInput<T> = T extends QueryRouteSchema & {
query: infer TQuery;
} ? z.infer<TQuery> : unknown;
QueryRouteSchema
Schema shape for GET route methods.
export type QueryRouteSchema = {
path?: z.ZodObject<any>;
query?: z.ZodObject<any>;
body?: never;
headers?: z.ZodObject<any>;
response?: RouteResponseSchema;
};
Properties
pathOptional Zod object used to validate path params.queryOptional Zod object used to validate URL query params.bodyGETroutes do not accept request bodies.headersOptional Zod object used to validate request headers.responseOptional compile-time-only JSON or plugin response type marker.
š QueryRouteSchema on GitHub
RawBodySchema
Marker for request bodies passed through to fetch without JSON encoding.
export type RawBodySchema = {
readonly __rawBody__: unique symbol;
};
RequestContext
type RequestContext<TMiddleware extends AnyMiddlewareChain> = MiddlewareContext<TMiddleware>;
ResponsePluginMarker
Compile-time response marker handled by a client/router response plugin pair.
export type ResponsePluginMarker<TClient, TRouter = TClient, TId extends string = string> = Record<number, unknown> & {
readonly [responsePluginMarker]: {
readonly id: TId;
readonly client: TClient;
readonly router: TRouter;
};
};
Remarks
TClient is the value returned by generated client action
functions. TRouter is the non-Response value accepted from route handlers.
Plugin markers may be used directly as an action response or as success
entries in a status-keyed response map.
š ResponsePluginMarker on GitHub
ResponsePluginMarker
Compile-time response marker handled by a client/router response plugin pair.
export type ResponsePluginMarker<TClient, TRouter = TClient, TId extends string = string> = Record<number, unknown> & {
readonly [responsePluginMarker]: {
readonly id: TId;
readonly client: TClient;
readonly router: TRouter;
};
};
Remarks
TClient is the value returned by generated client action
functions. TRouter is the non-Response value accepted from route handlers.
Plugin markers may be used directly as an action response or as success
entries in a status-keyed response map.
š ResponsePluginMarker on GitHub
RouteBodyOption
type RouteBodyOption<T> = T extends {
body: RawBodySchema;
} ? {
body: BodyInit | null;
} : {};
š RouteBodyOption on GitHub
RouteErrorResponse
Error response returned by ctx.error(status, body) in route handlers.
export type RouteErrorResponse = Response & {
__routeError__: true;
};
Remarks
This is an opaque branded type returned by the error helper. Route handlers may return it to signal a declared error response.
š RouteErrorResponse on GitHub
RouteFetchOptions
Fetch options accepted by a generated client action.
export type RouteFetchOptions<T extends RouteSchema = any> = Omit<RequestInit, 'method' | 'body' | 'headers'> & {
headers?: HeaderInput<T>;
};
Remarks
headers remains optional because required route headers may be
supplied by createClient({ headers }) defaults. Raw-body routes with path or
query input accept body here; raw-body routes without input accept the body
as the first client action argument and these options as the second.
Properties
headersHeaders for this request. Undefined values are removed beforefetch.
š RouteFetchOptions on GitHub
RouteFunction
Client action function attached for each HTTP action leaf.
export type RouteFunction<T extends RouteSchema, P extends string> = T extends {
body: RawBodySchema;
} ? RouteInput<T, P> extends infer TInput ? {} extends TInput ? (body: BodyInit | null, options?: RouteFetchOptions<T>) => Promise<T extends {
response: any;
} ? InferRouteResponse<T> : Response> : (input: TInput, options: RouteOptions<T>) => Promise<T extends {
response: any;
} ? InferRouteResponse<T> : Response> : never : (...p: RouteInput<T, P> extends infer TInput ? {} extends TInput ? [input?: TInput, options?: RouteOptions<T>] : [input: TInput, options?: RouteOptions<T>] : never) => Promise<T extends {
response: any;
} ? InferRouteResponse<T> : Response>;
Remarks
Actions whose schema has response: $type<T>() return parsed JSON
as T. Actions whose schema has a status-keyed response map return a tuple
union of [null, value, status] success entries and [error, null, status]
error entries. Actions whose schema has a plugin response marker return the
plugin's client result type. Actions without a response marker return the raw
Response. Raw-body actions with no path or query input accept
(body, options); raw-body actions with route input accept
(input, { body, ...options }).
RouteInput
Semantic input accepted by a generated client action function.
export type RouteInput<T extends RouteSchema = any, P extends string = string> = [T] extends [Any] ? any : PathInput<T, P> & QueryInput<T> & BodyInput<T>;
Remarks
Path params, query params, and JSON body fields are flattened into a single object. Avoid declaring duplicate keys across path/query/body schemas, since a flat input cannot distinguish their source.
RouteMetadata
Runtime metadata attached to Rouzer route nodes.
export type RouteMetadata = {
summary?: string;
description?: string;
};
Properties
summaryShort label for generated indexes, clients, CLIs, or docs.descriptionHuman-readable route description for generated tooling.
RouteOptions
export type RouteOptions<T extends RouteSchema = any> = RouteFetchOptions<T> & RouteBodyOption<T>;
Router
Fetch-compatible Rouzer handler with chainable middleware and route registration.
export interface Router<T extends MiddlewareTypes = any> extends RequestHandler<T>, MiddlewareChain<T> {
use<const TMiddleware extends ExtractMiddleware<this>>(middleware: TMiddleware | null): Router<ApplyMiddleware<this, TMiddleware>>;
use<TRoutes extends HttpRouteTree>(routes: TRoutes, handlers: RouteRequestHandlerMap<TRoutes, this>): Router<T>;
}
Properties
useClone this router and add the given middleware to the end of the chain.Returns
a new
Routerinstance.useClone this router and add the given HTTP route tree and handlers to the chain.Remarks
The handler object mirrors the resource tree. Resource nodes are nested objects, and action nodes are direct handler functions.
Returns
a new
Routerinstance.
RouterConfig
Configuration for createRouter.
export type RouterConfig = {
basePath?: string;
debug?: boolean;
plugins?: readonly RouterResponsePlugin[];
cors?: {
allowOrigins?: string[];
};
};
Properties
basePathBase path to prepend to all route patterns.Remarks
Leading and trailing slashes are normalized so
api,/api, andapi/all mount routes under/api/.Examples
createRouter({ basePath: 'api/' })debugEnable debug behavior for local development.Remarks
Debug mode adds an
X-Route-Nameresponse header for matched routes, includes specific Zod error messages in400validation responses, and logs missing route handlers to the console.pluginsResponse codec plugins used for route handler results.corsCORS configuration for requests with anOriginheader.allowOriginsAllowed origins for CORS requests.Remarks
Origins may contain wildcards for protocol and subdomain. The protocol is optional and defaults to
https. Requests with anOriginheader outside this list receive403.Examples
allowOrigins: ['example.net', 'https://*.example.com', '*://localhost:3000']
RouteRequestHandler
export type RouteRequestHandler<TMiddleware extends AnyMiddlewareChain, TArgs extends object, TResult, TErrors = never, TSuccesses = never> = (context: RequestContext<TMiddleware> & TArgs & ([TErrors] extends [never] ? {} : {
error: <TEntry extends TErrors>(...args: TEntry extends [infer S extends number, infer B] ? [status: S, body: B] : never) => RouteErrorResponse;
}) & ([TSuccesses] extends [never] ? {} : {
success: <TEntry extends TSuccesses>(...args: TEntry extends [infer S extends number, infer B] ? [status: S, body: B] : never) => RouteSuccessResponse;
})) => Promisable<TResult | Response>;
Properties
errorReturn a declared error response.Remarks
Only statuses declared with
$error<T>()in the response map are accepted.successReturn a declared success response with an explicit status.Remarks
Useful when a response map declares multiple 2xx statuses.
š RouteRequestHandler on GitHub
RouteRequestHandlerMap
Handler map shape required by createRouter().use(routes, handlers).
export type RouteRequestHandlerMap<TRoutes extends HttpRouteTree = HttpRouteTree, TMiddleware extends AnyMiddlewareChain = never, TPrefix extends string = ''> = {
[K in keyof TRoutes]: TRoutes[K] extends HttpResource<infer P, infer C> ? RouteRequestHandlerMap<C, TMiddleware, Join<TPrefix, P>> : TRoutes[K] extends HttpAction<infer P, any, any> ? InferActionHandler<TMiddleware, TRoutes[K], Join<TPrefix, P>> : never;
};
Remarks
The handler object mirrors the HTTP route tree. Resource nodes become nested handler objects, while action nodes become direct handler functions. Handler context is inferred from middleware plus accumulated path params, query/body schemas, and header schemas.
š RouteRequestHandlerMap on GitHub
RouteResponse
Response whose .json() method resolves to a known payload type.
export type RouteResponse<TResult = any> = Response & {
json(): Promise<TResult>;
};
RouteResponseMap
Status-keyed response map for declaring multiple response types.
export type RouteResponseMap = {
[status: number]: RouteResponseMarker;
};
Remarks
Numeric keys are HTTP status codes. Use $type<T>() or a response
plugin marker for success responses and $error<T>() for declared error
JSON responses.
š RouteResponseMap on GitHub
RouteResponseMarker
Single response marker accepted by status-keyed response maps.
export type RouteResponseMarker = Unchecked<any> | UncheckedError<any> | ResponsePluginMarker<any, any>;
š RouteResponseMarker on GitHub
RouteResponseSchema
Response marker accepted by HTTP action schemas.
export type RouteResponseSchema = Unchecked<any> | ResponsePluginMarker<any, any> | RouteResponseMap;
š RouteResponseSchema on GitHub
RouterResponsePlugin
Router-side response plugin used by createRouter({ plugins }).
export type RouterResponsePlugin = {
readonly id: string;
encode(value: unknown, context: {
marker: ResponsePluginMarker<any, any>;
request: Request;
}): Promisable<Response>;
};
Properties
idStable response codec id matched against route response markers.encodeEncode a handler result into the HTTP response.
š RouterResponsePlugin on GitHub
RouteSchema
Any HTTP action schema Rouzer can execute.
export type RouteSchema = QueryRouteSchema | MutationRouteSchema;
RouteSuccessResponse
Response returned by ctx.success(status, body) in route handlers.
export type RouteSuccessResponse = Response & {
__routeSuccess__: true;
};
š RouteSuccessResponse on GitHub
RouzerClient
Client type inferred from an HTTP route tree passed to createClient.
export type RouzerClient<TRoutes extends HttpRouteTree = Record<string, never>> = ReturnType<typeof createClient<TRoutes>>;
RouzerClientHook
Best-effort observer for generated client action lifecycles.
export type RouzerClientHook = (event: RouzerClientHookEvent) => void;
š RouzerClientHook on GitHub
RouzerClientHookEvent
Lifecycle event emitted by generated client action functions.
export type RouzerClientHookEvent = {
type: 'request.start';
opId: string;
routeName: string;
method: string;
pathPattern: string;
payload: unknown;
} | {
type: 'request.success';
opId: string;
routeName: string;
method: string;
pathPattern: string;
payload: unknown;
response: unknown;
status?: number;
durationMs: number;
} | {
type: 'request.error';
opId: string;
routeName: string;
method: string;
pathPattern: string;
payload: unknown;
error: unknown;
status?: number;
durationMs: number;
};
š RouzerClientHookEvent on GitHub
Unchecked
Compile-time-only marker used by $type<T>() to carry an unchecked response
type through route declarations.
export type Unchecked<T> = Record<number, unknown> & {
__unchecked__: T;
};
Remarks
Consumers usually use $type<T>() instead of constructing this type
directly.
UncheckedError
Compile-time-only marker used by $error<T>() to carry a declared error
response type through route declarations.
export type UncheckedError<T> = {
__uncheckedError__: T;
};
Remarks
Consumers usually use $error<T>() instead of constructing this
type directly.
import type { RoutePattern } from '@remix-run/route-pattern';
Constants
responsePluginMarker
Runtime key carried by response plugin markers.
export const responsePluginMarker: unique symbol;
š responsePluginMarker on GitHub
responsePluginMarker
Runtime key carried by response plugin markers.
export const responsePluginMarker: unique symbol;
š responsePluginMarker on GitHub
import { ApplyMiddleware, chain, ExtractMiddleware, MiddlewareChain, MiddlewareTypes, RequestHandler } from 'alien-middleware';
import type { MatchParams } from '@remix-run/route-pattern/match';
Classes
Any
class Any {
private isAny;
}
import type { MatchParams } from '@remix-run/route-pattern/match';
import type { AnyMiddlewareChain, MiddlewareContext } from 'alien-middleware';
import type { AnyMiddlewareChain } from 'alien-middleware';