forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fromnow.d.ts
28 lines (26 loc) · 868 Bytes
/
fromnow.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
// Type definitions for fromnow v2.0.0
// Project: https://github.com/lukeed/fromNow
// Definitions by: Martin Bukovics <https://github.com/marinewater>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace FromNow {
interface FromNowOpts {
maxChunks?: number,
useAgo?: boolean,
useAnd?: boolean
}
export interface FromNowStatic {
/**
* Get readable time differences from now vs past or future dates.
* @param {string|Date} date
* @param {object} [opts]
* @param {number} [opts.maxChucks=10]
* @param {boolean} [opts.useAgo=false]
* @param {boolean} [opts.useAnd=false]
*/
(date: string|Date, opts?: FromNowOpts): string
}
}
declare module 'fromnow' {
var FromNow: FromNow.FromNowStatic;
export = FromNow;
}