From 22a249c349a61169b463558cc917168142723384 Mon Sep 17 00:00:00 2001 From: iamkun Date: Tue, 12 Mar 2019 19:01:01 +0800 Subject: [PATCH] fix: Correct typescript definition `add` fix #531 --- types/index.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index eee848e61..a04c66eaa 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -7,10 +7,9 @@ declare namespace dayjs { export type OptionType = { locale?: string, format?: string, utc?: boolean } | string type UnitTypeShort = 'd' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms' - export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'quarter' | 'year' | 'date' | UnitTypeShort; + export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date' | UnitTypeShort; - type OpUnitTypeShort = 'w' - export type OpUnitType = UnitType | "week" | OpUnitTypeShort; + export type OpUnitType = UnitType | "week" | 'w'; class Dayjs { constructor (config?: ConfigType) @@ -63,7 +62,7 @@ declare namespace dayjs { format(template?: string): string - diff(date: ConfigType, unit: OpUnitType, float?: boolean): number + diff(date: ConfigType, unit: OpUnitType | 'quarter', float?: boolean): number valueOf(): number