diff --git a/src/index.d.ts b/src/index.d.ts index 3d5121f..7ae7e4b 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -12,7 +12,7 @@ export type EditorKey = 'visual' | 'content' | 'data'; export type SortOrder = 'ascending' | 'descending' | 'asc' | 'desc'; // TODO: use SnippetConfig from @cloudcannon/scrap-booker when ParserConfig issue resolved. -interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable { +export interface SnippetConfig extends ReducedCascade, Previewable, PickerPreviewable { /** * Name of the snippet. */ @@ -184,12 +184,12 @@ interface ImageResizeable { * A number suffixed with "x" (relative size) or "w" (fixed width) for setting the dimensions of * the image (e.g. 2x, 3x, 100w, 360w). */ - size: 'string'; + size: string; /** * A reference to another input that is given the path to this additional image file. */ - target?: 'string'; - }; + target?: string; + }[]; } export interface Editables { @@ -466,10 +466,7 @@ export interface BaseInputOptions { } export interface BaseInput { - /** - * Controls the type of input, changing how it is displayed and interacted with. - */ - type?: InputType; + type?: InputType | undefined | null; /** * Changes the subtext below the _Label_. Has no default. Supports a limited set of Markdown: * links, bold, italic, subscript, superscript, and inline code elements are allowed. @@ -670,6 +667,11 @@ export interface FileInputOptions extends BaseInputOptions, WithReducedPaths { * Restricts which file types are available to select or upload to this input. */ accepts_mime_types?: MimeType[] | '*'; + /** + * If you have one or more DAMs connected to your site, you can use this key to list which asset + * sources can be uploaded to and selected from. + */ + allowed_sources?: string[]; } export interface FileInput extends BaseInput { @@ -737,6 +739,14 @@ export interface MultichoiceInput extends BaseInput { type: 'multichoice'; } +export interface ObjectInputGroup { + heading?: string; + comment?: string; + collapsed?: boolean; + inputs?: string[]; + documentation?: Documentation; +} + export interface ObjectInputOptions extends BaseInputOptions { /** * Changes the appearance and behavior of the input. @@ -776,6 +786,21 @@ export interface ObjectInputOptions extends BaseInputOptions { * itself. */ structures?: string | Structure; + + /** + * Allows you to group the inputs inside this object together without changing the data structure. + */ + groups?: ObjectInputGroup[]; + + /** + * Controls which order input groups and ungrouped inputs appear in. + */ + place_groups_below?: boolean; + + /** + * Controls whether or not labels on mutable object entries are formatted. + */ + allow_label_formatting?: boolean; } export interface ObjectInput extends BaseInput { @@ -800,8 +825,13 @@ export interface ArrayInput extends BaseInput { type: 'array'; } +export interface UnknownInput extends BaseInput { + type?: undefined | null; +} + export type Input = | BaseInput + | UnknownInput | TextInput | CodeInput | ColorInput @@ -852,6 +882,10 @@ export interface ReducedPaths { * @default '' */ dam_static?: string; + /** + * When set to true, CloudCannon will reference files relative to the path of the file they were uploaded to. + */ + uploads_use_relative_path?: boolean; } export interface Paths extends ReducedPaths {