Skip to content

Commit 22a249c

Browse files
committed
fix: Correct typescript definition add
fix #531
1 parent 6e29a4a commit 22a249c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

types/index.d.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ declare namespace dayjs {
77
export type OptionType = { locale?: string, format?: string, utc?: boolean } | string
88

99
type UnitTypeShort = 'd' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms'
10-
export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'quarter' | 'year' | 'date' | UnitTypeShort;
10+
export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date' | UnitTypeShort;
1111

12-
type OpUnitTypeShort = 'w'
13-
export type OpUnitType = UnitType | "week" | OpUnitTypeShort;
12+
export type OpUnitType = UnitType | "week" | 'w';
1413

1514
class Dayjs {
1615
constructor (config?: ConfigType)
@@ -63,7 +62,7 @@ declare namespace dayjs {
6362

6463
format(template?: string): string
6564

66-
diff(date: ConfigType, unit: OpUnitType, float?: boolean): number
65+
diff(date: ConfigType, unit: OpUnitType | 'quarter', float?: boolean): number
6766

6867
valueOf(): number
6968

0 commit comments

Comments
 (0)