Skip to content

Commit

Permalink
fix: Rollback LocalePresetType to string (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyoshikawa committed Jul 29, 2020
1 parent 73813ab commit b342bd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 142 deletions.
10 changes: 5 additions & 5 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -96,16 +96,16 @@ declare namespace dayjs {

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

locale(): LocalePresetType
locale(): string

locale(preset: LocalePresetType | ILocale, object?: Partial<ILocale>): Dayjs
locale(preset: string | ILocale, object?: Partial<ILocale>): Dayjs
}

export type PluginFunc<T = unknown> = (option: T, c: typeof Dayjs, d: typeof dayjs) => void

export function extend<T = unknown>(plugin: PluginFunc<T>, option?: T): Dayjs

export function locale(preset?: LocalePresetType | ILocale, object?: Partial<ILocale>, isLocal?: boolean): string
export function locale(preset?: string | ILocale, object?: Partial<ILocale>, isLocal?: boolean): string

export function isDayjs(d: any): d is Dayjs

Expand Down
137 changes: 0 additions & 137 deletions types/locale/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit b342bd3

Please sign in to comment.