Skip to main content

Module: @ts-rest/express

Classes

Interfaces

Type Aliases

AppRouteImplementation

Ƭ AppRouteImplementation<T>: T extends AppRouteMutation ? AppRouteMutationImplementation<T> : T extends AppRouteQuery ? AppRouteQueryImplementation<T> : never

Type parameters

NameType
Textends AppRoute

Defined in

libs/ts-rest/express/src/lib/types.ts:34


TsRestRequest

Ƭ TsRestRequest<T, F, S>: Request<"params" extends keyof S ? S["params"] : Express["request"][``"params"``], ServerInferResponseBody<F>, "body" extends keyof S ? S["body"] : Express["request"][``"body"``], "query" extends keyof S ? S["query"] : Express["request"][``"query"``]> & { headers: "headers" extends keyof S ? S["headers"] : Express["request"][``"headers"``] ; tsRestRoute: F }

Type parameters

NameType
Textends AppRouter | AppRoute
Fextends FlattenAppRouter<T> = FlattenAppRouter<T>
Sextends ServerInferRequest<F> = ServerInferRequest<F>

Defined in

libs/ts-rest/express/src/lib/types.ts:41


TsRestRequestHandler

Ƭ TsRestRequestHandler<T>: (req: TsRestRequest<T>, res: Response, next: NextFunction) => void

Type parameters

NameType
Textends AppRouter | AppRoute

Type declaration

▸ (req, res, next): void

Parameters
NameType
reqTsRestRequest<T>
resResponse
nextNextFunction
Returns

void

Defined in

libs/ts-rest/express/src/lib/types.ts:57

Functions

createExpressEndpoints

createExpressEndpoints<TRouter>(schema, router, app, options?): void

Type parameters

NameType
TRouterextends AppRouter

Parameters

NameType
schemaTRouter
routerRecursiveRouterObj<TRouter>
appIRouter
optionsTsRestExpressOptions<TRouter>

Returns

void

Defined in

libs/ts-rest/express/src/lib/ts-rest-express.ts:258


initServer

initServer(): Object

Returns

Object

NameType
router<T>(router: T, args: RecursiveRouterObj<T>) => RecursiveRouterObj<T>

Defined in

libs/ts-rest/express/src/lib/ts-rest-express.ts:28