1 |
|
2 |
|
3 |
|
4 |
|
5 | export interface Callback<T> {
|
6 | (error: Error, result?: never): void;
|
7 | (error: null, result: T): void;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export interface ErrorCallback {
|
14 | (error: Error | null): void;
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export type Nullable<T> = T | null | undefined;
|
21 |
|
22 | export declare const objectToString: (obj: unknown) => string;
|
23 |
|
24 | export declare const safeToString: (val: unknown) => string;
|
25 |
|
26 | export interface PromiseCallback<T> {
|
27 | promise: Promise<T>;
|
28 | callback: Callback<T>;
|
29 | resolve: (value: T) => Promise<T>;
|
30 | reject: (error: Error) => Promise<T>;
|
31 | }
|
32 |
|
33 | export declare function createPromiseCallback<T>(cb?: Callback<T>): PromiseCallback<T>;
|
34 | export declare function inOperator<K extends string, T extends object>(k: K, o: T): o is T & Record<K, unknown>;
|