fix(typings): add types for boolean and color widgets (#4663)

Co-authored-by: Aleksandr Sapronov <aleksandr.sapronov@dsr-corporation.com>
This commit is contained in:
ScRiB2 2020-11-30 19:53:15 +03:00 committed by GitHub
parent 74d5569bd3
commit 8772664952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,11 @@ declare module 'netlify-cms-core' {
i18n?: boolean | 'translate' | 'duplicate'; i18n?: boolean | 'translate' | 'duplicate';
} }
export interface CmsFieldBoolean {
widget: 'boolean';
default?: boolean;
}
export interface CmsFieldCode { export interface CmsFieldCode {
widget: 'code'; widget: 'code';
default?: any; default?: any;
@ -75,6 +80,14 @@ declare module 'netlify-cms-core' {
output_code_only?: boolean; output_code_only?: boolean;
} }
export interface CmsFieldColor {
widget: 'color';
default?: string;
allowInput?: boolean;
enableAlpha?: boolean;
}
export interface CmsFieldDateTime { export interface CmsFieldDateTime {
widget: 'datetime'; widget: 'datetime';
default?: string; default?: string;
@ -225,7 +238,9 @@ declare module 'netlify-cms-core' {
export type CmsField = CmsFieldBase & export type CmsField = CmsFieldBase &
( (
| CmsFieldBoolean
| CmsFieldCode | CmsFieldCode
| CmsFieldColor
| CmsFieldDateTime | CmsFieldDateTime
| CmsFieldFileOrImage | CmsFieldFileOrImage
| CmsFieldList | CmsFieldList