From 8772664952dc6cc4b3e340f65bfb61215e1ebaef Mon Sep 17 00:00:00 2001 From: ScRiB2 Date: Mon, 30 Nov 2020 19:53:15 +0300 Subject: [PATCH] fix(typings): add types for boolean and color widgets (#4663) Co-authored-by: Aleksandr Sapronov --- packages/netlify-cms-core/index.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/netlify-cms-core/index.d.ts b/packages/netlify-cms-core/index.d.ts index 3cc4152e..d8f677d6 100644 --- a/packages/netlify-cms-core/index.d.ts +++ b/packages/netlify-cms-core/index.d.ts @@ -65,6 +65,11 @@ declare module 'netlify-cms-core' { i18n?: boolean | 'translate' | 'duplicate'; } + export interface CmsFieldBoolean { + widget: 'boolean'; + default?: boolean; + } + export interface CmsFieldCode { widget: 'code'; default?: any; @@ -75,6 +80,14 @@ declare module 'netlify-cms-core' { output_code_only?: boolean; } + export interface CmsFieldColor { + widget: 'color'; + default?: string; + + allowInput?: boolean; + enableAlpha?: boolean; + } + export interface CmsFieldDateTime { widget: 'datetime'; default?: string; @@ -225,7 +238,9 @@ declare module 'netlify-cms-core' { export type CmsField = CmsFieldBase & ( + | CmsFieldBoolean | CmsFieldCode + | CmsFieldColor | CmsFieldDateTime | CmsFieldFileOrImage | CmsFieldList