Module: @ts-rest/express
Classes​
Interfaces​
Type Aliases​
AppRouteImplementation​
Ƭ AppRouteImplementation<T
>: T
extends AppRouteMutation
? AppRouteMutationImplementation
<T
> : T
extends AppRouteQuery
? AppRouteQueryImplementation
<T
> : never
Type parameters​
Name | Type |
---|---|
T | extends AppRoute |
Defined in​
libs/ts-rest/express/src/lib/types.ts:34
TsRestExpressOptions​
Ƭ TsRestExpressOptions<T
>: Object
Type parameters​
Name | Type |
---|---|
T | extends AppRouter |
Type declaration​
Name | Type |
---|---|
globalMiddleware? | TsRestRequestHandler <FlattenAppRouter <T >>[] |
jsonQuery? | boolean |
logInitialization? | boolean |
requestValidationErrorHandler? | "default" | "combined" | (err : RequestValidationError , req : TsRestRequest <FlattenAppRouter <T >>, res : Response , next : NextFunction ) => void |
responseValidation? | boolean |
Defined in​
libs/ts-rest/express/src/lib/types.ts:90
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​
Name | Type |
---|---|
T | extends AppRouter | AppRoute |
F | extends FlattenAppRouter <T > = FlattenAppRouter <T > |
S | extends 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​
Name | Type |
---|---|
T | extends AppRouter | AppRoute |
Type declaration​
â–¸ (req
, res
, next
): void
Parameters​
Name | Type |
---|---|
req | TsRestRequest <T > |
res | Response |
next | NextFunction |
Returns​
void
Defined in​
libs/ts-rest/express/src/lib/types.ts:57
Functions​
createExpressEndpoints​
â–¸ createExpressEndpoints<TRouter
>(schema
, router
, app
, options?
): void
Type parameters​
Name | Type |
---|---|
TRouter | extends AppRouter |
Parameters​
Name | Type |
---|---|
schema | TRouter |
router | RecursiveRouterObj <TRouter > |
app | IRouter |
options | TsRestExpressOptions <TRouter > |
Returns​
void
Defined in​
libs/ts-rest/express/src/lib/ts-rest-express.ts:273
initServer​
â–¸ initServer(): Object
Returns​
Object
Name | Type |
---|---|
route | <T>(route : T , args : AppRouteImplementationOrOptions <T >) => AppRouteImplementationOrOptions <T > |
router | <T>(router : T , args : RecursiveRouterObj <T >) => RecursiveRouterObj <T > |
Defined in​
libs/ts-rest/express/src/lib/ts-rest-express.ts:30