diff --git a/types/index.d.ts b/types/index.d.ts index 4ce68350..3d318103 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -6,12 +6,12 @@ declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs -declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: LocalePresetType, strict?: boolean): dayjs.Dayjs +declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs declare namespace dayjs { export type ConfigType = string | number | Date | Dayjs - export type OptionType = { locale?: LocalePresetType, format?: string, utc?: boolean } | string | string[] + export type OptionType = { locale?: string, format?: string, utc?: boolean } | string | string[] type UnitTypeShort = 'd' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms' export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date' | UnitTypeShort; @@ -96,16 +96,16 @@ declare namespace dayjs { isAfter(date: ConfigType, unit?: OpUnitType): boolean - locale(): LocalePresetType + locale(): string - locale(preset: LocalePresetType | ILocale, object?: Partial): Dayjs + locale(preset: string | ILocale, object?: Partial): Dayjs } export type PluginFunc = (option: T, c: typeof Dayjs, d: typeof dayjs) => void export function extend(plugin: PluginFunc, option?: T): Dayjs - export function locale(preset?: LocalePresetType | ILocale, object?: Partial, isLocal?: boolean): string + export function locale(preset?: string | ILocale, object?: Partial, isLocal?: boolean): string export function isDayjs(d: any): d is Dayjs diff --git a/types/locale/types.d.ts b/types/locale/types.d.ts index 072c180d..2c24a645 100644 --- a/types/locale/types.d.ts +++ b/types/locale/types.d.ts @@ -31,140 +31,3 @@ declare interface ILocale { yy: string }> } - -declare type LocalePresetType = - | 'af' - | 'ar-dz' - | 'ar-kw' - | 'ar-ly' - | 'ar-ma' - | 'ar-sa' - | 'ar-tn' - | 'ar' - | 'az' - | 'be' - | 'bg' - | 'bi' - | 'bm' - | 'bn' - | 'bo' - | 'br' - | 'bs' - | 'ca' - | 'cs' - | 'cv' - | 'cy' - | 'da' - | 'de-at' - | 'de-ch' - | 'de' - | 'dv' - | 'el' - | 'en-SG' - | 'en-au' - | 'en-ca' - | 'en-gb' - | 'en-ie' - | 'en-il' - | 'en-in' - | 'en-nz' - | 'en-tt' - | 'en' - | 'eo' - | 'es-do' - | 'es-us' - | 'es' - | 'et' - | 'eu' - | 'fa' - | 'fi' - | 'fo' - | 'fr-ca' - | 'fr-ch' - | 'fr' - | 'fy' - | 'ga' - | 'gd' - | 'gl' - | 'gom-latn' - | 'gu' - | 'he' - | 'hi' - | 'hr' - | 'hu' - | 'hy-am' - | 'id' - | 'is' - | 'it-ch' - | 'it' - | 'ja' - | 'jv' - | 'ka' - | 'kk' - | 'km' - | 'kn' - | 'ko' - | 'ku' - | 'ky' - | 'lb' - | 'lo' - | 'lt' - | 'lv' - | 'me' - | 'mi' - | 'mk' - | 'ml' - | 'mn' - | 'mr' - | 'ms-my' - | 'ms' - | 'mt' - | 'my' - | 'nb' - | 'ne' - | 'nl-be' - | 'nl' - | 'nn' - | 'oc-lnc' - | 'pa-in' - | 'pl' - | 'pt-br' - | 'pt' - | 'ro' - | 'ru' - | 'rw' - | 'sd' - | 'se' - | 'si' - | 'sk' - | 'sl' - | 'sq' - | 'sr-cyrl' - | 'sr' - | 'ss' - | 'sv' - | 'sw' - | 'ta' - | 'te' - | 'tet' - | 'tg' - | 'th' - | 'tk' - | 'tl-ph' - | 'tlh' - | 'tr' - | 'tzl' - | 'tzm-latn' - | 'tzm' - | 'ug-cn' - | 'uk' - | 'ur' - | 'uz-latn' - | 'uz' - | 'vi' - | 'x-pseudo' - | 'yo' - | 'zh-cn' - | 'zh-hk' - | 'zh-tw' - | 'zh'