typelab / utils / FunctionCallbackify
type FunctionCallbackify<T, ErrorType> = (...param) => void;Converts an Async Function type into a Callback-style Function.
| Type Parameter | Default type | Description |
|---|---|---|
|
‐ |
The |
|
|
|
|
‐ |
| Parameter | Type |
|---|---|
|
... |
[ |
void
A new Function type that accepts a callback for error handling and result.
// (a: string, callback: (error: unknown, result: string) => void) => void
type Callbackified = FunctionCallbackify<(a: string) => Promise<string>>;