From c3b71e7ad6c1600b68ec74c1be200ed46f3334e4 Mon Sep 17 00:00:00 2001 From: Ross Phillips <12723297+rphillips-cc@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:21:53 +1200 Subject: [PATCH] Add new options for select previews, fix existing object/array --- src/configuration.d.ts | 43 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/src/configuration.d.ts b/src/configuration.d.ts index 085ed5d..e2dcab2 100644 --- a/src/configuration.d.ts +++ b/src/configuration.d.ts @@ -787,7 +787,10 @@ export interface ImageInput extends BaseInput { type: 'image'; } -export interface SelectInputOptions extends BaseInputOptions { +export interface SelectInputOptions + extends BaseInputOptions, + Previewable, + PickerPreviewable { /** * Allows new text values to be created at edit time. * @@ -812,6 +815,14 @@ export interface SelectInputOptions extends BaseInput * instead for objects, and the value itself is used for primitive types. */ value_key?: string; + /** + * Controls how selected items are rendered. + */ + view?: 'card' | 'text' | 'gallery' | 'gallery-left'; + /** + * Controls how selectable options are rendered. + */ + picker_view?: 'card' | 'text' | 'gallery' | 'gallery-left'; } export interface SelectInput extends BaseInput { @@ -825,12 +836,7 @@ export interface MultiselectInput extends BaseInput { } export interface ChoiceInputOptions - extends Omit, 'allow_create'> { - /** - * The preview definition for changing the way selected and available options are displayed. - */ - preview?: SelectPreview; -} + extends Omit, 'allow_create'> {} export interface ChoiceInput extends BaseInput { type: 'choice'; @@ -850,7 +856,7 @@ export interface ObjectInputGroup { documentation?: Documentation; } -export interface ObjectInputOptions extends BaseInputOptions { +export interface ObjectInputOptions extends BaseInputOptions, Previewable { /** * Changes the appearance and behavior of the input. */ @@ -877,12 +883,6 @@ export interface ObjectInputOptions extends BaseInputOptions { */ structures?: string | Structure; }; - /** - * The preview definition for changing the way data within an object input is previewed before - * being expanded. If the input has `structures`, the preview from the structure value is used - * instead. - */ - preview?: ObjectPreview; /** * Provides data formats for value of this object. When choosing an item, team members are * prompted to choose from a number of values you have defined. `structures` applies to the object @@ -911,12 +911,6 @@ export interface ObjectInput extends BaseInput { } export interface ArrayInputOptions extends BaseInputOptions { - /** - * The preview definition for changing the way data within an array input's items are previewed - * before being expanded. If the input has structures, the preview from the structure value is - * used instead. - */ - preview?: ObjectPreview; /** * Provides data formats for value of this object. When choosing an item, team members are * prompted to choose from a number of values you have defined. @@ -1055,6 +1049,7 @@ export interface PreviewGallery extends TextPreviewable, ImagePreviewable, IconPreviewable, + IconColorPreviewable, IconColorPreviewable { /** * Controls how the gallery image is positioned within the gallery. @@ -1068,14 +1063,6 @@ export interface PreviewMetadata IconPreviewable, IconColorPreviewable {} -export interface ObjectPreview - extends TextPreviewable, - ImagePreviewable, - IconPreviewable, - SubtextPreviewable {} - -export interface SelectPreview extends TextPreviewable, IconPreviewable {} - export interface Preview extends TextPreviewable, ImagePreviewable,