UNPKG

586 BTypeScriptView Raw
1import { PluginFunc, ConfigType } from 'dayjs'
2
3declare interface RelativeTimeThreshold {
4 l: string
5 r?: number
6 d?: string
7}
8
9declare interface RelativeTimeOptions {
10 rounding?: (num: number) => number
11 thresholds?: RelativeTimeThreshold[]
12}
13
14declare const plugin: PluginFunc<RelativeTimeOptions>
15export = plugin
16
17declare module 'dayjs' {
18 interface Dayjs {
19 fromNow(withoutSuffix?: boolean): string
20 from(compared: ConfigType, withoutSuffix?: boolean): string
21 toNow(withoutSuffix?: boolean): string
22 to(compared: ConfigType, withoutSuffix?: boolean): string
23 }
24}