@types/statuses
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -6,9 +6,18 @@ // Type definitions for statuses 2.0 | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Minimum TypeScript Version: 4.7 | ||
type NumericAscii = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '0'; | ||
type NonNumericAscii<S> = S extends `${NumericAscii}` ? never : any; | ||
type IsNumericString<S extends string> = S extends `${number}` ? any : never; | ||
type IsNonNumericString<S extends string> = S extends `${NonNumericAscii<S>}${infer _}` ? any : never; | ||
export = status; | ||
declare const status: Status; | ||
declare const status: status; | ||
interface Status { | ||
(code_msg: number | string): number | string; | ||
interface status { | ||
(code: number): string; | ||
<S extends string>(code: S): status.Result<S>; | ||
@@ -22,1 +31,9 @@ codes: number[]; | ||
} | ||
declare namespace status { | ||
type Result<S extends string> = S extends IsNumericString<S> | ||
? string | ||
: S extends IsNonNumericString<S> | ||
? number | ||
: string | number; | ||
} |
{ | ||
"name": "@types/statuses", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "TypeScript definitions for statuses", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/statuses", | ||
"license": "MIT", | ||
@@ -27,4 +28,4 @@ "contributors": [ | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "882d17a6aaf5eb0415fb5dc845595485c11e9f1714f54dc2a71f8482456b07d7", | ||
"typeScriptVersion": "3.0" | ||
"typesPublisherContentHash": "41283cc345cff03ce063d54e2f7f471529aa1782c9ff19057d84d57412d05694", | ||
"typeScriptVersion": "4.7" | ||
} |
@@ -9,5 +9,46 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/statuses. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/statuses/index.d.ts) | ||
````ts | ||
// Type definitions for statuses 2.0 | ||
// Project: https://github.com/jshttp/statuses | ||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff> | ||
// BendingBender <https://github.com/BendingBender> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Minimum TypeScript Version: 4.7 | ||
type NumericAscii = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '0'; | ||
type NonNumericAscii<S> = S extends `${NumericAscii}` ? never : any; | ||
type IsNumericString<S extends string> = S extends `${number}` ? any : never; | ||
type IsNonNumericString<S extends string> = S extends `${NonNumericAscii<S>}${infer _}` ? any : never; | ||
export = status; | ||
declare const status: status; | ||
interface status { | ||
(code: number): string; | ||
<S extends string>(code: S): status.Result<S>; | ||
codes: number[]; | ||
code: { [msg: string]: number | undefined }; | ||
empty: { [code: number]: boolean | undefined }; | ||
message: { [code: number]: string | undefined }; | ||
redirect: { [code: number]: boolean | undefined }; | ||
retry: { [code: number]: boolean | undefined }; | ||
} | ||
declare namespace status { | ||
type Result<S extends string> = S extends IsNumericString<S> | ||
? string | ||
: S extends IsNonNumericString<S> | ||
? number | ||
: string | number; | ||
} | ||
```` | ||
### Additional Details | ||
* Last updated: Wed, 24 Jun 2020 06:29:45 GMT | ||
* Last updated: Thu, 12 Jan 2023 00:02:46 GMT | ||
* Dependencies: none | ||
@@ -14,0 +55,0 @@ * Global values: none |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5326
29
0
58