mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 20:02:05 +08:00
Add types for number-to-words (#16162)
Add an optional extended description…
This commit is contained in:
committed by
Sheetal Nandi
parent
fc63d5f5cc
commit
7b2edf2aac
17
types/number-to-words/index.d.ts
vendored
Normal file
17
types/number-to-words/index.d.ts
vendored
Normal 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;
|
||||
7
types/number-to-words/number-to-words-tests.ts
Normal file
7
types/number-to-words/number-to-words-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as converter from 'number-to-words';
|
||||
|
||||
converter.toOrdinal(21);
|
||||
|
||||
converter.toWords(13);
|
||||
|
||||
converter.toWordsOrdinal(21);
|
||||
22
types/number-to-words/tsconfig.json
Normal file
22
types/number-to-words/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/number-to-words/tslint.json
Normal file
1
types/number-to-words/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user