forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
numbro.d.ts
49 lines (43 loc) · 1.06 KB
/
numbro.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Type definitions for Numbro.js
// Project: https://github.com/foretagsplatsen/numbro
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface NumbroLanguage {
delimiters: {
thousands: string;
decimal: string;
};
abbreviations: {
thousand: string;
million: string;
billion: string;
trillion: string;
};
ordinal(num: number): string;
currency: {
symbol: string;
};
}
interface Numbro {
(value?: any): Numbro;
version: string;
isNumbro: boolean;
language(key: string, values?: NumbroLanguage): Numbro;
zeroFormat(format: string): string;
clone(): Numbro;
format(inputString?: string): string;
formatCurrency(inputString?: string): string;
unformat(inputString: string): number;
value(): number;
valueOf(): number;
set (value: any): Numbro;
add(value: any): Numbro;
subtract(value: any): Numbro;
multiply(value: any): Numbro;
divide(value: any): Numbro;
difference(value: any): number;
}
declare var numbro: Numbro;
declare module "numbro" {
export = numbro;
}