Skip to content

Commit

Permalink
chore: Update index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun committed Feb 23, 2019
1 parent e72f71e commit bc4383e
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
export = dayjs;
declare function dayjs (date?: dayjs.DateType, option?: dayjs.OptionType): dayjs.Dayjs
declare function dayjs (date?: dayjs.ConfigType, option?: dayjs.OptionType): dayjs.Dayjs

declare namespace dayjs {
export type DateType = string | number | Date | Dayjs

/** @deprecated Renamed to DateType. */
export type ConfigType = DateType
export type ConfigType = string | number | Date | Dayjs

export type OptionType = { locale?: string, format?: string } | string

Expand All @@ -26,7 +23,7 @@ declare namespace dayjs {
}

class Dayjs {
constructor (date?: DateType)
constructor (config?: ConfigType)

clone(): Dayjs

Expand Down Expand Up @@ -60,7 +57,7 @@ declare namespace dayjs {

format(template?: string): string

diff(date: DateType, unit: OpUnitType, float?: boolean): number
diff(date: ConfigType, unit: OpUnitType, float?: boolean): number

valueOf(): number

Expand All @@ -80,11 +77,11 @@ declare namespace dayjs {

toString(): string

isBefore(date: DateType, unit?: OpUnitType): boolean
isBefore(date: ConfigType, unit?: OpUnitType): boolean

isSame(date: DateType, unit?: OpUnitType): boolean
isSame(date: ConfigType, unit?: OpUnitType): boolean

isAfter(date: DateType, unit?: OpUnitType): boolean
isAfter(date: ConfigType, unit?: OpUnitType): boolean

isLeapYear(): boolean

Expand Down

0 comments on commit bc4383e

Please sign in to comment.