/// import type { SvelteComponentTyped } from "svelte"; import type { AutocompleteFieldProps } from "./autocomplete-field.svelte"; export type Option = import("./autocomplete-option.svelte").Option; export interface AutocompleteProps extends AutocompleteFieldProps { /** * @default null */ class?: string | false | null; /** * The current selection as an array of `Option` objects. * Can be used to set the selection programmatically. * @default [] */ selection?: Option[]; /** * The minimum length the search query must be to call `getOptions`. * @default 3 */ minSearchLength?: number; /** * The maximum amount of options than can be selected. * @default undefined */ maxOptions?: number; /** * The current value of the text field. Can be used to control the query programmatically. * @default '' */ searchQuery?: string; /** * Whether to disable the field. * @default false */ disabled?: boolean; } export default class Autocomplete extends SvelteComponentTyped< AutocompleteProps, { change: CustomEvent<{ value: Option[] }> }, { ["load-more-options-message"]: {}; ["loading-message"]: {}; ["loading-options"]: {}; ["more-options"]: { loadMoreOptions: ( click?: CustomEvent<{ nativeEvent: MouseEvent }> ) => void; }; ["not-enough-input"]: {}; ["too-many-options"]: {}; } > {}