mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add type definition of the module format-number (#34101)
* Add type definition of the module format-number Add type definition of the module format-number Amend Amend * Add README.md * Remove unnecessary files Trigger github devops Add line at the end of the file * Remove unnecessary line
This commit is contained in:
parent
82ab88b4fd
commit
1c24ca23fc
5
types/format-number/format-number-tests.ts
Normal file
5
types/format-number/format-number-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import createFormatNumber from "format-number";
|
||||
|
||||
createFormatNumber({ round: 2 }); // $ExpectType (number: number, overrideOptions?: { noUnits: boolean; noSeparator: boolean; } | undefined) => string
|
||||
|
||||
createFormatNumber({ round: 2 })(12); // $ExpectType string
|
||||
30
types/format-number/index.d.ts
vendored
Normal file
30
types/format-number/index.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Type definitions for format-number 2.0
|
||||
// Project: https://github.com/componitable/format-number
|
||||
// Definitions by: Fedai Kaya <https://github.com/codelovesme>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default function(options?: {
|
||||
negativeType?: "right" | "left" | "brackets" | null;
|
||||
negativeLeftSymbol?: string;
|
||||
negative?: "R" | null;
|
||||
negativeRightSymbol?: string;
|
||||
negativeLeftOut?: boolean;
|
||||
negativeOut?: boolean;
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
integerSeparator?: string;
|
||||
separator?: string;
|
||||
decimalsSeparator?: string;
|
||||
decimal?: string;
|
||||
padLeft?: number;
|
||||
padRight?: number;
|
||||
round?: number;
|
||||
truncate?: number;
|
||||
allowedSeparators?: string[];
|
||||
}): (
|
||||
number: number,
|
||||
overrideOptions?: {
|
||||
noUnits: boolean;
|
||||
noSeparator: boolean;
|
||||
}
|
||||
) => string;
|
||||
16
types/format-number/tsconfig.json
Normal file
16
types/format-number/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "format-number-tests.ts"]
|
||||
}
|
||||
1
types/format-number/tslint.json
Normal file
1
types/format-number/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user