forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.timeago.d.ts
62 lines (53 loc) · 1.44 KB
/
jquery.timeago.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
// Type definitions for jQuery.timeago.js 1.0.2
// Project: http://timeago.yarp.com/
// Definitions by: François Guillot <http://fguillot.developpez.com/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface TimeagoSetings {
refreshMillis?: number;
allowFuture?: boolean;
strings?: {
prefixAgo?: string;
prefixFromNow?: string;
suffixAgo?: string;
suffixFromNow?: string;
// Those can be string or Function
seconds?: any;
minute?: any;
minutes?: any;
hour?: any;
hours?: any;
day?: any;
days?: any;
month?: any;
months?: any;
year?: any;
years?: any;
wordSeparator?: string;
numbers?: any[];
};
}
interface TimeagoStatic {
(timestamp: Date): string;
(timestamp: number): string;
(timestamp: string): string;
(timestamp: Element): string;
(timestamp: JQuery): string;
settings: TimeagoSetings;
inWords(distanceMillis: Date): string;
inWords(distanceMillis: number): string;
parse(iso8601: string): Date;
datetime(element: Element): Date;
datetime(element: JQuery): Date;
isTime(element: Element): boolean;
isTime(element: JQuery): boolean;
}
interface Timeago {
(): JQuery;
}
interface JQueryStatic {
timeago: TimeagoStatic;
}
interface JQuery {
timeago: Timeago;
}