From b1abdc40ee6c9d18ff46c311a114e0755677ea6f Mon Sep 17 00:00:00 2001 From: Jason Kwok <4410086+JasonHK@users.noreply.github.com> Date: Wed, 10 Mar 2021 14:29:36 +0800 Subject: [PATCH] fix: fix missing types for ArraySupport plugin (#1401) --- types/index.d.ts | 6 +++++- types/plugin/arraySupport.d.ts | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 22efc9ebe..d83c9dde3 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -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[] diff --git a/types/plugin/arraySupport.d.ts b/types/plugin/arraySupport.d.ts index 30ec75e5d..e4e44b2e6 100755 --- a/types/plugin/arraySupport.d.ts +++ b/types/plugin/arraySupport.d.ts @@ -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