@tdb/util
Version:
Shared helpers and utilities.
48 lines (47 loc) • 1.29 kB
TypeScript
export declare type RouteMethod = 'GET' | 'PUT' | 'POST' | 'DELETE' | 'PATCH';
export declare type RouteOptions = {
method?: RouteMethod;
schema?: IRouteSchemaTypes;
title?: IRoute['title'];
docs?: IRoute['docs'];
description?: IRoute['description'];
meta?: IRoute['meta'];
caseSensitive?: boolean;
strict?: boolean;
end?: boolean;
start?: boolean;
delimiter?: string;
endsWith?: string[];
delimiters?: string[];
};
export declare type IRoute = {
path: string;
method: RouteMethod;
tokens: Array<string | IRouteToken>;
schema: IRouteSchemaTypes;
title?: string;
description?: string;
docs?: string;
meta?: IRouteMeta;
};
export declare type IRouteMeta = {
[key: string]: string | number | boolean | null | undefined;
};
export declare type IRouteToken = {
name: string | number;
prefix: string;
delimiter: string;
optional: boolean;
repeat: boolean;
partial: boolean;
};
export declare type IRouteSchemaTypes = {
params?: string;
query?: string;
data?: string;
response?: string;
};
export declare type RouteParams = {
[key: string]: string | number | boolean;
};
export declare type RouteQuery = Record<string, string | string[] | number | boolean | undefined>;