import type { Component, Snippet } from 'svelte'; import type { ValidationContext, ValidationResult } from '../../utils/validation'; export type DropdownSelectorValidator = (context: ValidationContext) => ValidationResult; export type BaseProps = { /** Generated internally for the label association and Sitevision setup. */ id?: never; /** Field label, a string or Svelte snippet. */ label: string | Snippet; /** Description shown below the field, a string or Svelte snippet. */ description?: string | Snippet; /** Configuration key and HTML name attribute. */ name?: string; /** Set the field as required. */ required?: boolean; /** Disables the field. */ disabled?: boolean; /** Selected node ID. */ value?: string; /** Shows or hides the selector without destroying it. */ show?: boolean; /** CSS class added to the form-group wrapper. */ class?: string; /** Content rendered after the selector and validation message. */ children?: Snippet; /** Called on a selection change. */ onChange?: (value: string, event: Event) => void | Promise; /** Custom validator. */ validate?: DropdownSelectorValidator; }; /** Public props for the Sitevision DropdownSelector component. */ export type Props = BaseProps & { /** Sitevision component. */ component: 'metadata' | 'template' | 'oauth2-configuration' | 'virtual-group' | 'search-index' | 'font' | 'color' | 'llm-configuration' | 'target-audience' | (string & {}); /** Restricts selectable node types. */ types?: string | string[]; }; /** * Generic wrapper for Sitevision [select components](https://developer.sitevision.se/docs/webapps/configuration/sitevision-components) used for selecting nodes. * See [Readme](https://docs.soleil.se/packages/config-svelte/components/base/dropdownselector/). */ declare const DropdownSelector: Component; export default DropdownSelector;