diff --git a/types/number-to-words/index.d.ts b/types/number-to-words/index.d.ts new file mode 100644 index 0000000000..1d1caeb398 --- /dev/null +++ b/types/number-to-words/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for number-to-words 1.2 +// Project: https://github.com/marlun78/number-to-words +// Definitions by: Frederick Fogerty +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Converts an integer into a string with an ordinal postfix. If number is decimal, the decimals will be removed. + */ +export function toOrdinal(number: number): string; +/** + * Converts an integer into words. If number is decimal, the decimals will be removed. + */ +export function toWords(number: number): string; +/** + * Converts a number into ordinal words. If number is decimal, the decimals will be removed. + */ +export function toWordsOrdinal(number: number): string; diff --git a/types/number-to-words/number-to-words-tests.ts b/types/number-to-words/number-to-words-tests.ts new file mode 100644 index 0000000000..1c45936a78 --- /dev/null +++ b/types/number-to-words/number-to-words-tests.ts @@ -0,0 +1,7 @@ +import * as converter from 'number-to-words'; + +converter.toOrdinal(21); + +converter.toWords(13); + +converter.toWordsOrdinal(21); diff --git a/types/number-to-words/tsconfig.json b/types/number-to-words/tsconfig.json new file mode 100644 index 0000000000..c7d9661c4d --- /dev/null +++ b/types/number-to-words/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "number-to-words-tests.ts" + ] +} diff --git a/types/number-to-words/tslint.json b/types/number-to-words/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/number-to-words/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }