-
What would you like to discuss?I have the following code in typescript: const client = got.extend({
...,
handlers: [someHandler],
}); and handler function: async function someHandler (options: ???, next: ???): Promise<???> {} How can i access types of Checklist
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
import { HandlerFunction } from 'got'; |
Beta Was this translation helpful? Give feedback.
-
If you were referring to the handler parameters types you can take a look at the definition of export declare type HandlerFunction = <T extends GotReturn>(options: NormalizedOptions, next: (options: NormalizedOptions) => T) => T | Promise<T>; |
Beta Was this translation helpful? Give feedback.
-
Thanks @Giotino. It seems that my typescript knowledge should be improved. I tried to access it like this: import got from 'got';
got.SomeType |
Beta Was this translation helpful? Give feedback.
HandlerFunction
type is exported by Got, you can use it like follows: