-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
60 lines (51 loc) · 1.25 KB
/
types.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
declare module '@eartharoid/dtf' {
interface PlaceholderMap {
[placeholder: string]: (date: Date, locale?: string) => string
}
class DTF {
public locale: string;
private ordinals: Intl.PluralRules;
private placeholders: PlaceholderMap;
/**
* Create a new DTF instance
* @param {string} locale - The locale to use for this DTF instance
*/
constructor(locale?: string)
/**
* Fill a timestamp
* @param {string} format - The timestamp format
* @param {Date} [date] - Optional Date object
* @param {Boolean} [utc] - Use UTC time?
* @returns {string}
*/
public fill(
format?: string,
date?: Date,
utc?: boolean
): string
/**
* Get AM/PM
* @param {Date} [date] - Optional Date object
* @param {Boolean} [utc] - Use UTC time?
* @returns {string} "AM" or "PM"
*/
public AMPM(
date?: Date,
utc?: boolean
): string
/**
* Append an ordinal suffix to a number
* @param {number} number - The number
* @returns {string}
*/
public suffix(number: number): string
/**
* Convert a 24 hour number to 12 hour
* @param {number} h - The hour number
* @returns {number}
*/
public convert24To12(h: number): number
private offsetUTC(date: Date): Date
}
export default DTF;
}