Skip to content

Commit

Permalink
fix: make field and fields optional for widget='list'
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasandresen committed Mar 15, 2024
1 parent 554ff85 commit 4ad9cc1
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions packages/decap-cms-core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,22 +409,24 @@ declare module 'decap-cms-core' {
config: CmsConfig;
}

export type EditorComponentField = {
name: string;
label: string;
} & {
widget: Omit<string, 'list'>;
} | {
widget: 'list';
/**
* Used if widget === "list" to create a flat array
*/
field: EditorComponentField;
/**
* Used if widget === "list" to create an array of objects
*/
fields: EditorComponentField[];
}
export type EditorComponentField =
| ({
name: string;
label: string;
} & {
widget: Omit<string, 'list'>;
})
| {
widget: 'list';
/**
* Used if widget === "list" to create a flat array
*/
field?: EditorComponentField;
/**
* Used if widget === "list" to create an array of objects
*/
fields?: EditorComponentField[];
};

export interface EditorComponentOptions {
id: string;
Expand Down

0 comments on commit 4ad9cc1

Please sign in to comment.