Skip to content

Commit ee5a4ec

Browse files
authored
fix: update localeData plugin type (#1116)
1 parent c0200e4 commit ee5a4ec

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

types/plugin/localeData.d.ts

+31-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,37 @@ declare const plugin: PluginFunc
44
export = plugin
55

66
declare module 'dayjs' {
7+
type WeekdayNames = [string, string, string, string, string, string, string];
8+
type MonthNames = [string, string, string, string, string, string, string, string, string, string, string, string];
9+
10+
interface InstanceLocaleDataReturn {
11+
firstDayOfWeek(): number;
12+
weekdays(instance?: Dayjs): WeekdayNames;
13+
weekdaysShort(instance?: Dayjs): WeekdayNames;
14+
weekdaysMin(instance?: Dayjs): WeekdayNames;
15+
months(instance?: Dayjs): MonthNames;
16+
monthsShort(instance?: Dayjs): MonthNames;
17+
longDateFormat(format: string): string;
18+
}
19+
20+
interface GlobalLocaleDataReturn {
21+
firstDayOfWeek(): number;
22+
weekdays(): WeekdayNames;
23+
weekdaysShort(): WeekdayNames;
24+
weekdaysMin(): WeekdayNames;
25+
months(): MonthNames;
26+
monthsShort(): MonthNames;
27+
longDateFormat(format: string): string;
28+
}
29+
730
interface Dayjs {
8-
localeData(): any
31+
localeData(): InstanceLocaleDataReturn;
932
}
33+
34+
export function weekdays(localOrder?: boolean): WeekdayNames;
35+
export function weekdaysShort(localOrder?: boolean): WeekdayNames;
36+
export function weekdaysMin(localOrder?: boolean): WeekdayNames;
37+
export function monthsShort(): MonthNames;
38+
export function months(): MonthNames;
39+
export function localeData(): GlobalLocaleDataReturn;
1040
}

0 commit comments

Comments
 (0)