import { StudioLayouts } from '.'; import type { StudioLayoutBasePropsConfig } from './StudioBaseSchema'; /** * Configuration for the data picker layout in Studio. * This interface defines the properties available for configuring a data value picker component * within the Studio environment. It allows for specifying the component type, * callbacks for value changes and confirmation, and providing initial or additional data. */ export interface StudioLayoutDataValuePickerConfig extends StudioLayoutBasePropsConfig { /** * Type of the layout component. * This property strictly defines the component as a data value picker panel. */ type: `${StudioLayouts.panelDataValuePicker}`; /** * Callback function to be called when the picker's internal value has changed. * This is typically triggered as the user interacts with the picker, providing real-time updates. * The function receives an object containing the new resolved value. * @example * ```typescript * ({ value }) => console.log('new value', value); * ``` */ onChange?: '__fn__'; /** * Callback function to be called when the picker selection is confirmed by the user. * This signifies a final selection or acceptance of the currently resolved value. * The function receives an object containing the confirmed resolved value. * @example * ```typescript * ({ value }) => console.log('confirmed value', value); * ``` */ onConfirm?: '__fn__'; /** * The initial or current value for the data value picker. * This can be a `DataResolverProps` object defining a variable or a condition, * or a primitive value. * This prop is used to pre-populate the picker with an existing selection or state. */ value?: object; /** * Additional data sources or context that can be used by the data value picker. * This property allows for extending the available data paths. */ additionalSources?: object; }