Workery / types
Module: types
Table of contents
Interfaces
Type Aliases
- HTTPMethod
- HTTPMethodLower
- ResponseClass
- Next
- Later
- Preprocessor
- ZodBodyable
- RouteParameterLocation
- PathParameter
- QueryParameter
- HeaderParameter
- CookieParameter
- BodyParameter
- DependsParameter
- RouteParameters
- TypeOf
- ArgsOf
- InitOf
- ExceptionHandler
- RouteHandler
- DependencyHandler
- MiddlewareHandler
- UnboundRoute
Type Aliases
HTTPMethod
Ƭ HTTPMethod: "GET"
| "POST"
| "PUT"
| "PATCH"
| "DELETE"
| "HEAD"
| "OPTIONS"
| "TRACE"
Defined in
HTTPMethodLower
Ƭ HTTPMethodLower: "get"
| "post"
| "put"
| "patch"
| "delete"
| "head"
| "options"
| "trace"
Defined in
ResponseClass
Ƭ ResponseClass: (body
: any
, init?
: ResponseInit
) => Response
Type declaration
• (body
, init?
): Response
Parameters
Name | Type |
---|---|
body | any |
init? | ResponseInit |
Returns
Response
Defined in
Next
Ƭ Next: () => Promise
<Response
>
Type declaration
▸ (): Promise
<Response
>
Returns
Promise
<Response
>
Defined in
Later
Ƭ Later: (fn
: (res
: Response
) => void
) => void
Type declaration
▸ (fn
): void
Parameters
Name | Type |
---|---|
fn | (res : Response ) => void |
Returns
void
Defined in
Preprocessor
Ƭ Preprocessor: <Out, In>(value
: In
) => Out
| In
Type declaration
▸ <Out
, In
>(value
): Out
| In
Type parameters
Name | Type |
---|---|
Out | any |
In | any |
Parameters
Name | Type |
---|---|
value | In |
Returns
Out
| In
Defined in
ZodBodyable
Ƭ ZodBodyable: z.ZodType
| typeof String
| typeof Blob
| typeof ReadableStream
Defined in
RouteParameterLocation
Ƭ RouteParameterLocation: "path"
| "query"
| "header"
| "cookie"
| "body"
| "$depends"
Defined in
PathParameter
Ƭ PathParameter<S
>: RouteParameter
<S
> & { location
: "path"
; schema
: S
}
Type parameters
Name | Type |
---|---|
S | extends z.ZodType |
Defined in
QueryParameter
Ƭ QueryParameter<S
>: RouteParameter
<S
> & { location
: "query"
; schema
: S
}
Type parameters
Name | Type |
---|---|
S | extends z.ZodType |
Defined in
HeaderParameter
Ƭ HeaderParameter<S
>: RouteParameter
<S
> & { location
: "header"
; schema
: S
}
Type parameters
Name | Type |
---|---|
S | extends z.ZodType |
Defined in
CookieParameter
Ƭ CookieParameter<S
>: RouteParameter
<S
> & { location
: "cookie"
; schema
: S
}
Type parameters
Name | Type |
---|---|
S | extends z.ZodType |
Defined in
BodyParameter
Ƭ BodyParameter<S
>: RouteParameter
<S
> & { location
: "body"
; schema
: S
; options
: { mediaType
: string
} }
Type parameters
Name | Type |
---|---|
S | extends z.ZodType |
Defined in
DependsParameter
Ƭ DependsParameter<S
>: RouteParameter
<S
> & { location
: "$depends"
; dependency
: Dependency
<any
, RouteParameters
, any
> }
Type parameters
Name | Type |
---|---|
S | extends z.ZodType |
Defined in
RouteParameters
Ƭ RouteParameters: { [k: string]
: RouteParameter
<z.ZodType
>; } & { req?
: never
}
Defined in
TypeOf
Ƭ TypeOf<T
>: T
extends RouteParameter
<infer S> ? z.TypeOf
<S
> : T
extends z.ZodType
? z.TypeOf
<T
> : T
extends Dependency
<infer R, any
, any
> ? R
: unknown
Type parameters
Name |
---|
T |
Defined in
ArgsOf
Ƭ ArgsOf<Ps
, E
>: { req
: Request
; env
: E
; ctx
: ExecutionContext
} & { [K in keyof Ps]: TypeOf<Ps[K]> }
Type parameters
Name | Type |
---|---|
Ps | extends RouteParameters |
E | unknown |
Defined in
InitOf
Ƭ InitOf<C
>: C
extends (init
: infer I) => InstanceType
<C
> ? I
: never
Type parameters
Name | Type |
---|---|
C | extends (...args : any ) => any |
Defined in
ExceptionHandler
Ƭ ExceptionHandler<E
>: (args
: ArgsOf
<{}, E
>, e
: any
) => Promise
<Response
> | (args
: ArgsOf
<{}, E
>, e
: any
) => Response
Type parameters
Name | Type |
---|---|
E | unknown |
Defined in
RouteHandler
Ƭ RouteHandler<R
, Ps
, E
>: (args
: ArgsOf
<Ps
, E
>) => Promise
<R
> | (args
: ArgsOf
<Ps
, E
>) => R
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
E | unknown |
Defined in
DependencyHandler
Ƭ DependencyHandler<R
, Ps
, E
>: (args
: ArgsOf
<Ps
, E
>, later
: Later
) => Promise
<R
> | (args
: ArgsOf
<Ps
, E
>, later
: Later
) => R
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
E | unknown |
Defined in
MiddlewareHandler
Ƭ MiddlewareHandler<E
>: (args
: ArgsOf
<{}, E
>, next
: Next
) => Promise
<Response
> | (args
: ArgsOf
<{}, E
>, next
: Next
) => Response
Type parameters
Name | Type |
---|---|
E | unknown |
Defined in
UnboundRoute
Ƭ UnboundRoute<R
, Ps
, E
>: Omit
<InitOf
<typeof Route
>, "method"
| "path"
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
E | E |