Skip to content

Commit

Permalink
fix: fix missing types for ArraySupport plugin (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonHK authored Mar 10, 2021
1 parent 656127c commit b1abdc4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, stri
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
interface ConfigTypeMap {
default: string | number | Date | Dayjs
}

export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap]

export type OptionType = { locale?: string, format?: string, utc?: boolean } | string | string[]

Expand Down
6 changes: 6 additions & 0 deletions types/plugin/arraySupport.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { PluginFunc } from 'dayjs'

declare module 'dayjs' {
interface ConfigTypeMap {
arraySupport: [number?, number?, number?, number?, number?, number?, number?]
}
}

declare const plugin: PluginFunc
export = plugin

0 comments on commit b1abdc4

Please sign in to comment.