Skip to content

Commit

Permalink
fix: update localeData plugin type (#1116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mocha-- authored Oct 14, 2020
1 parent c0200e4 commit ee5a4ec
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion types/plugin/localeData.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,37 @@ declare const plugin: PluginFunc
export = plugin

declare module 'dayjs' {
type WeekdayNames = [string, string, string, string, string, string, string];
type MonthNames = [string, string, string, string, string, string, string, string, string, string, string, string];

interface InstanceLocaleDataReturn {
firstDayOfWeek(): number;
weekdays(instance?: Dayjs): WeekdayNames;
weekdaysShort(instance?: Dayjs): WeekdayNames;
weekdaysMin(instance?: Dayjs): WeekdayNames;
months(instance?: Dayjs): MonthNames;
monthsShort(instance?: Dayjs): MonthNames;
longDateFormat(format: string): string;
}

interface GlobalLocaleDataReturn {
firstDayOfWeek(): number;
weekdays(): WeekdayNames;
weekdaysShort(): WeekdayNames;
weekdaysMin(): WeekdayNames;
months(): MonthNames;
monthsShort(): MonthNames;
longDateFormat(format: string): string;
}

interface Dayjs {
localeData(): any
localeData(): InstanceLocaleDataReturn;
}

export function weekdays(localOrder?: boolean): WeekdayNames;
export function weekdaysShort(localOrder?: boolean): WeekdayNames;
export function weekdaysMin(localOrder?: boolean): WeekdayNames;
export function monthsShort(): MonthNames;
export function months(): MonthNames;
export function localeData(): GlobalLocaleDataReturn;
}

0 comments on commit ee5a4ec

Please sign in to comment.