1 | type NumericAscii = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0";
|
2 | type NonNumericAscii<S> = S extends `${NumericAscii}` ? never : any;
|
3 |
|
4 | type IsNumericString<S extends string> = S extends `${number}` ? any : never;
|
5 |
|
6 | type IsNonNumericString<S extends string> = S extends `${NonNumericAscii<S>}${infer _}` ? any : never;
|
7 |
|
8 | export = status;
|
9 |
|
10 | declare const status: status;
|
11 |
|
12 | interface status {
|
13 | (code: number): string;
|
14 | <S extends string>(code: S): status.Result<S>;
|
15 |
|
16 | codes: number[];
|
17 | code: { [msg: string]: number | undefined };
|
18 | empty: { [code: number]: boolean | undefined };
|
19 | message: { [code: number]: string | undefined };
|
20 | redirect: { [code: number]: boolean | undefined };
|
21 | retry: { [code: number]: boolean | undefined };
|
22 | }
|
23 |
|
24 | declare namespace status {
|
25 | type Result<S extends string> = S extends IsNumericString<S> ? string
|
26 | : S extends IsNonNumericString<S> ? number
|
27 | : string | number;
|
28 | }
|