Add types for number-to-words (#16162)

Add an optional extended description…
This commit is contained in:
Frederick Fogerty
2017-04-28 05:04:15 +12:00
committed by Sheetal Nandi
parent fc63d5f5cc
commit 7b2edf2aac
4 changed files with 47 additions and 0 deletions

17
types/number-to-words/index.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
// Type definitions for number-to-words 1.2
// Project: https://github.com/marlun78/number-to-words
// Definitions by: Frederick Fogerty <https://github.com/frederickfogerty>
// 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;

View File

@@ -0,0 +1,7 @@
import * as converter from 'number-to-words';
converter.toOrdinal(21);
converter.toWords(13);
converter.toWordsOrdinal(21);

View File

@@ -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"
]
}

View File

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