Skip to content

Commit

Permalink
fix: Correct typescript definition add
Browse files Browse the repository at this point in the history
fix #531
  • Loading branch information
iamkun committed Mar 12, 2019
1 parent 6e29a4a commit 22a249c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 22a249c

Please sign in to comment.