forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pluralize.d.ts
65 lines (57 loc) · 1.41 KB
/
pluralize.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Type definitions for pluralize
// Project: https://www.npmjs.com/package/pluralize
// Definitions by: Syu Kato <https://github.com/ukyo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface PluralizeStatic {
/**
* Pluralize or singularize a word based on the passed in count.
*
* @param word
* @param count
* @param inclusive
*/
(word: string, count?: number, inclusive?: boolean): string;
/**
* Pluralize a word based.
*
* @param word
*/
plural(word: string): string;
/**
* Singularize a word based.
*
* @param word
*/
singular(word: string): string;
/**
* Add a pluralization rule to the collection.
*
* @param rule
* @param replacement
*/
addPluralRule(rule: string|RegExp, replacemant: string): void;
/**
* Add a singularization rule to the collection.
*
* @param rule
* @param replacement
*/
addSingularRule(rule: string|RegExp, replacemant: string): void;
/**
* Add an irregular word definition.
*
* @param single
* @param plural
*/
addIrregularRule(single: string, plural: string): void;
/**
* Add an uncountable word rule.
*
* @param word
*/
addUncountableRule(word: string|RegExp): void;
}
declare module "pluralize" {
export = pluralize;
}
declare var pluralize: PluralizeStatic;