import { type Data, type Device, type RichTextValue as RichTextControlValue } from '@makeswift/controls'; import { type Descriptor, type PropDef, type OptionsType, CheckboxDescriptor as CheckboxControl, CheckboxPropControllerData, DateDescriptor as DateControl, DatePropControllerData, ImageDescriptor as ImageControl, ImageData as ImageControlValue, GapData, GapX, GapYDescriptor, GapYPropControllerData, LinkData, LinkDescriptor as LinkControl, LinkPropControllerData, NumberDescriptor, NumberOptions, NumberPropControllerData, ResponsiveColorDescriptor, ResponsiveColorPropControllerData, ResponsiveIconRadioGroup, ResponsiveLengthDescriptor, ResponsiveLengthOptions, ResponsiveLengthPropControllerData, ResponsiveNumber, ResponsiveSelect, Types as PropControllerTypes, TextStyleDescriptor as TextStyleControl, TextStylePropControllerData, TextInputDescriptor as TextInputControl } from '@makeswift/prop-controllers'; import { type DeserializedFunction, type SerializedFunction } from '../controls/serialization/message-port/function-serialization'; import { PanelDescriptorType as PanelControlType } from './descriptors'; import { DELETED_PROP_CONTROLLER_TYPES, ListDescriptor as ListControl, ListOptions as ListControlConfig, ListValue as ListControlValue, ShapeDescriptor as ShapeControl, ShapeValue as ShapeControlValue, TypeaheadDescriptor as TypeaheadControl, TypeaheadOptions as TypeaheadControlConfig, TypeaheadValue as TypeaheadControlValue, RichTextDescriptor as RichTextControl } from './deleted'; import { type LegacyDescriptor } from './descriptors'; type SerializedShapeControlConfig> = { type: T; preset?: { [K in keyof T]?: SerializedPanelControlValueType; }; }; type SerializedShapeControl<_T extends Record, U extends Record> = { type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape; options: SerializedShapeControlConfig; }; type DeserializedShapeControlConfig> = { type: T; preset?: { [K in keyof T]?: DeserializedPanelControlValueType; }; }; type DeserializedShapeControl<_T extends Record, U extends Record> = { type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape; options: DeserializedShapeControlConfig; }; type SerializedListControlConfig = { type: SerializedPanelControl; label?: string; getItemLabel?: SerializedFunction['getItemLabel'], undefined>>; preset?: ListControlValue; defaultValue?: ListControlValue; }; export type SerializedListControl = { type: typeof DELETED_PROP_CONTROLLER_TYPES.List; options: SerializedListControlConfig ? U : never>; }; type DeserializedListControlConfig = { type: DeserializedPanelControl; label?: string; getItemLabel?: DeserializedFunction['getItemLabel'], undefined>>; preset?: ListControlValue; defaultValue?: ListControlValue; }; type DeserializedListControl = { type: typeof DELETED_PROP_CONTROLLER_TYPES.List; options: DeserializedListControlConfig ? U : never>; }; type SerializedTypeaheadControlConfig = { getItems: SerializedFunction['getItems']>; label?: string; preset?: TypeaheadControlValue; defaultValue?: TypeaheadControlValue; }; export type SerializedTypeaheadControl = { type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead; options: SerializedTypeaheadControlConfig; }; type DeserializedTypeaheadControlConfig = { getItems: DeserializedFunction['getItems']>; label?: string; preset?: TypeaheadControlValue; defaultValue?: TypeaheadControlValue; }; type DeserializedTypeaheadControl = { type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead; options: DeserializedTypeaheadControlConfig; }; type SerializedConfig = T | SerializedFunction<(props: Record, deviceMode: Device) => T>; export type DeserializedConfig = T | DeserializedFunction<(props: Record, deviceMode: Device) => T>; type SerializedControlDef

= Descriptor

& { options: SerializedConfig>; }; export type DeserializedControlDef

= Descriptor

& { options: DeserializedConfig>; }; type GapYControlConfig = { preset?: GapYPropControllerData; label?: string; defaultValue?: GapData; min?: number; max?: number; step?: number; hidden?: boolean; }; type SerializedGapYControl<_T = GapYPropControllerData> = { type: typeof PropControllerTypes.GapY; options: SerializedConfig; }; type DeserializedGapYControl<_T = GapYPropControllerData> = { type: typeof PropControllerTypes.GapY; options: DeserializedConfig; }; type CheckboxControlConfig = { preset?: CheckboxPropControllerData; label: string; hidden?: boolean; }; type SerializedCheckboxControl<_T = CheckboxPropControllerData> = { type: typeof PropControllerTypes.Checkbox; options: SerializedConfig; }; type DeserializedCheckboxControl<_T = CheckboxPropControllerData> = { type: typeof PropControllerTypes.Checkbox; options: DeserializedConfig; }; type ResponsiveColorControlConfig = { label?: string; placeholder?: string; hidden?: boolean; }; type SerializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = { type: typeof PropControllerTypes.ResponsiveColor; options: SerializedConfig; }; type DeserializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = { type: typeof PropControllerTypes.ResponsiveColor; options: DeserializedConfig; }; type SerializedNumberControl<_T = NumberPropControllerData> = { type: typeof PropControllerTypes.Number; options: SerializedConfig; }; type DeserializedNumberControl<_T = NumberPropControllerData> = { type: typeof PropControllerTypes.Number; options: DeserializedConfig; }; type DateControlConfig = { preset?: DatePropControllerData; }; type SerializedDateControl<_T = DatePropControllerData> = { type: typeof PropControllerTypes.Date; options: SerializedConfig; }; type DeserializedDateControl<_T = DatePropControllerData> = { type: typeof PropControllerTypes.Date; options: DeserializedConfig; }; type LinkControlConfig = { preset?: LinkPropControllerData; label?: string; defaultValue?: LinkPropControllerData; options?: { value: LinkData['type']; label: string; }[]; hidden?: boolean; }; type SerializedLinkControl<_T = LinkPropControllerData> = { type: typeof PropControllerTypes.Link; options: SerializedConfig; }; type DeserializedLinkControl<_T = LinkPropControllerData> = { type: typeof PropControllerTypes.Link; options: DeserializedConfig; }; type TextInputControlConfig = { label?: string; placeholder?: string; hidden?: boolean; }; type TextInputControlValue = string; type SerializedTextInputControl<_T = TextInputControlValue> = { type: typeof PropControllerTypes.TextInput; options: SerializedConfig; }; type DeserializedTextInputControl<_T = TextInputControlValue> = { type: typeof PropControllerTypes.TextInput; options: DeserializedConfig; }; type SerializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = { type: typeof PropControllerTypes.ResponsiveLength; options: SerializedConfig; }; type DeserializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = { type: typeof PropControllerTypes.ResponsiveLength; options: DeserializedConfig; }; type SerializedTextStyleControl<_T = TextStylePropControllerData> = { type: typeof PropControllerTypes.TextStyle; options: SerializedConfig; }; type TextStyleControlConfig = { preset?: TextStylePropControllerData; label?: string; hidden?: boolean; }; type DeserializedTextStyleControl<_T = TextStylePropControllerData> = { type: typeof PropControllerTypes.TextStyle; options: DeserializedConfig; }; type ImageControlConfig = { label?: string; hidden?: boolean; }; type SerializedImageControl<_T = ImageControlValue> = { type: typeof PropControllerTypes.Image; options: SerializedConfig; }; type DeserializedImageControl<_T = ImageControlValue> = { type: typeof PropControllerTypes.Image; options: DeserializedConfig; }; type RichTextControlConfig = { preset?: RichTextControlValue; }; type SerializedRichTextControl<_T = RichTextControlValue> = { type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText; options: SerializedConfig; }; type DeserializedRichTextControl<_T = RichTextControlValue> = { type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText; options: DeserializedConfig; }; export type SerializedLegacyControl = Exclude, ListControl | ShapeControl | TypeaheadControl | Descriptor | GapYDescriptor | Descriptor | CheckboxControl | ResponsiveColorDescriptor | NumberDescriptor | Descriptor | Descriptor | ResponsiveLengthDescriptor | DateControl | LinkControl | TextInputControl | TextStyleControl | ImageControl | RichTextControl> | SerializedListControl | SerializedShapeControl | SerializedTypeaheadControl | SerializedControlDef | SerializedGapYControl | SerializedControlDef | SerializedCheckboxControl | SerializedResponsiveColorControl | SerializedNumberControl | SerializedControlDef | SerializedControlDef | SerializedResponsiveLengthControl | SerializedDateControl | SerializedLinkControl | SerializedTextInputControl | SerializedTextStyleControl | SerializedImageControl | SerializedRichTextControl; type SerializedPanelControl = Extract, { type: PanelControlType; }>; type SerializedPanelControlValueType = T extends SerializedPanelControl ? U : never; export type DeserializedLegacyControl = Exclude, ListControl | ShapeControl | TypeaheadControl | Descriptor | GapYDescriptor | Descriptor | CheckboxControl | ResponsiveColorDescriptor | NumberDescriptor | Descriptor | Descriptor | ResponsiveLengthDescriptor | DateControl | LinkControl | TextInputControl | TextStyleControl | ImageControl | RichTextControl> | DeserializedListControl | DeserializedShapeControl | DeserializedTypeaheadControl | DeserializedControlDef | DeserializedGapYControl | DeserializedControlDef | DeserializedCheckboxControl | DeserializedResponsiveColorControl | DeserializedNumberControl | DeserializedControlDef | DeserializedControlDef | DeserializedResponsiveLengthControl | DeserializedDateControl | DeserializedLinkControl | DeserializedTextInputControl | DeserializedTextStyleControl | DeserializedImageControl | DeserializedRichTextControl; export type DeserializedPanelControl = Extract, { type: PanelControlType; }>; type DeserializedPanelControlValueType = T extends DeserializedPanelControl ? U : never; export declare function serializeLegacyControl(control: LegacyDescriptor): [SerializedLegacyControl, Transferable[]]; export declare function deserializeLegacyControl(serializedControl: SerializedLegacyControl): DeserializedLegacyControl; export {}; //# sourceMappingURL=serialization.d.ts.map