import {type Keyable, type SortType} from '@myparcel-pdk/common'; import {type InteractiveElementInstance} from '@myparcel/vue-form-builder'; import {type AdminIcon} from '../data'; import {type Translatable, type Translation} from './language.types'; export type GlobalFieldProps = { description?: Translation; subtext?: Translation; value?: unknown; }; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type ElementInstance = InteractiveElementInstance< Type, Props & GlobalFieldProps & Record >; export type OptionsProp = { options?: SelectOption[]; sort?: SortType; }; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type PdkElementProps = { element: ElementInstance; modelValue: ModelValue; }; export type PdkElementEmits = ( event: 'update:modelValue', value: ModelValue, ) => void; export type RadioGroupOption = SelectOption & { image?: string; icon?: AdminIcon; }; interface BaseSelectOption { disabled?: boolean; icon?: string | AdminIcon; image?: string; description?: Translatable; value: Value; } export interface SelectOptionWithLabel< Value extends SelectOptionValue = SelectOptionValue, T extends Translation = Translation, > extends BaseSelectOption { label: T; } export interface SelectOptionWithPlainLabel< Value extends SelectOptionValue = SelectOptionValue, T extends Translation = Translation, > extends BaseSelectOption { plainLabel: T; } export type SelectOptionValue = Keyable | boolean; export type SelectOption = | SelectOptionWithLabel | SelectOptionWithPlainLabel;