import { RoutePattern } from '@remix-run/route-pattern'; import { type RouteMetadata } from './metadata.js'; import type { RawBodySchema, RouteSchema } from './types/schema.js'; /** HTTP methods supported by Rouzer action declarations. */ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * Callable endpoint leaf in an HTTP route tree. * * @remarks Actions declare one HTTP operation. Their property name becomes the * client/handler name, while their optional `path` contributes URL segments. */ export type HttpAction
= { /** Discriminator used internally when traversing route trees. */ kind: 'action'; /** Optional action-local path segment appended after parent resources. */ path?: RoutePattern
; /** HTTP method used when the client sends this action. */ method: M; /** Request validation and optional response type schema. */ schema: T; /** Optional runtime metadata for generated tooling. */ metadata?: RouteMetadata; }; /** * Path-scoped namespace in an HTTP route tree. * * @remarks Resources contribute URL path segments and contain child resources or * actions. They do not have handlers of their own. */ export type HttpResource
= { /** Discriminator used internally when traversing route trees. */ kind: 'resource'; /** Path segment contributed by this resource. */ path: RoutePattern
;
/** Child resources and actions exposed below this resource. */
children: TChildren;
/** Optional runtime metadata for generated tooling. */
metadata?: RouteMetadata;
};
/** Node type accepted inside an HTTP route tree. */
export type HttpNode = HttpAction | HttpResource;
/** Route tree accepted by HTTP clients and routers. */
export type HttpRouteTree = {
[key: string]: HttpNode;
};
type StringKeys >;
/** Declare a GET action, optionally with an action-local path segment. */
export declare function get ;
export declare function get ;
export declare function post ;
export declare function put ;
export declare function patch ;
declare function deleteAction