🤖 Merge PR #58653 feat: add types for comma-number@2.1 by @coreyar

* feat: add types for comma-number@2.1

* Update types/comma-number/tsconfig.json

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>

* Update types/comma-number/comma-number-tests.ts

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>

Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>
This commit is contained in:
Corey Rice
2022-02-21 16:05:05 -03:00
committed by GitHub
parent 207f8177bf
commit 976163796c
4 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import commaNumber = require('comma-number');
commaNumber('100');
commaNumber('100', '.');
commaNumber(100);
commaNumber(100, ',');
commaNumber.bindWith(',', '.');

16
types/comma-number/index.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// Type definitions for comma-number 2.1
// Project: https://github.com/elidoran/comma-number
// Definitions by: Corey Rice <https://github.com/coreyar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function commaNumber(
inputNumber: number | string,
optionalSeparator?: string,
optionalDecimalChar?: string,
): string;
declare namespace commaNumber {
function bindWith(separator: string, decimalChar: string): (num: number | string) => string;
}
export = commaNumber;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"comma-number-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "@definitelytyped/dtslint/dt.json" }