import * as solid_js from 'solid-js'; import { JSXElement, Component, Ref, ParentComponent } from 'solid-js'; type CreateSelectOption = any; type CreateSelectSingleValue = any; type CreateSelectValue = CreateSelectSingleValue | CreateSelectSingleValue[]; interface CreateSelectProps { options: CreateSelectOption[] | ((inputValue: string) => CreateSelectOption[]); initialValue?: CreateSelectValue; multiple?: boolean; disabled?: boolean; optionToValue?: (option: CreateSelectOption) => CreateSelectSingleValue; isOptionDisabled?: (option: CreateSelectOption) => boolean; onChange?: (value: CreateSelectValue) => void; onInput?: (inputValue: string) => void; } declare const createSelect: (props: CreateSelectProps) => { options: solid_js.Accessor; value: () => any; setValue: (value: CreateSelectValue) => any[]; hasValue: () => boolean; clearValue: () => never[]; inputValue: solid_js.Accessor; setInputValue: solid_js.Setter; hasInputValue: () => boolean; clearInputValue: () => ""; isOpen: solid_js.Accessor; setIsOpen: solid_js.Setter; toggleOpen: () => boolean; isActive: solid_js.Accessor; setIsActive: solid_js.Setter; readonly multiple: boolean; readonly disabled: boolean; pickOption: (option: CreateSelectOption) => void; isOptionFocused: (option: CreateSelectOption) => boolean; isOptionDisabled: (((option: CreateSelectOption) => boolean) | ((option: CreateSelectOption) => false)) & (((option: CreateSelectOption) => boolean) | ((option: CreateSelectOption) => false) | undefined); onFocusIn: () => true; onFocusOut: () => void; onMouseDown: (event: Event) => void; onClick: (event: Event) => void; onInput: (event: Event) => void; onKeyDown: (event: KeyboardEvent) => void; }; interface CreateOptionsOption { value: CreateSelectValue; label: JSXElement; text: string; disabled: boolean; } type CreateOptionsFilterableFunction = (inputValue: string, options: CreateOptionsOption[]) => CreateOptionsOption[]; type CreateOptionsCreateableFunction = (inputValue: string, exists: boolean, options: CreateOptionsOption[]) => CreateSelectValue | CreateSelectValue[]; type CreateOptionsFormatFunction = (value: CreateSelectValue, type: "value" | "label", meta: { highlight?: JSXElement; prefix?: string; }) => JSXElement; declare const defaultFormat: CreateOptionsFormatFunction; interface CreateOptionsConfig { key?: string; format?: CreateOptionsFormatFunction; filterable?: boolean | CreateOptionsFilterableFunction; createable?: boolean | CreateOptionsCreateableFunction; extractText?: (value: CreateSelectValue) => string; disable?: (value: CreateSelectValue) => boolean; } declare const createOptions: (values: CreateSelectValue[] | ((inputValue: string) => CreateSelectValue[]), userConfig?: CreateOptionsConfig) => { options: (inputValue: string) => CreateOptionsOption[]; optionToValue: (option: CreateOptionsOption) => any; isOptionDisabled: (option: CreateOptionsOption) => boolean; format: (item: CreateOptionsOption | CreateSelectValue, type: "option" | "value") => solid_js.JSX.Element; }; declare const createAsyncOptions: (fetcher: (inputValue: string) => Promise, timeout?: number) => { readonly options: unknown; readonly loading: boolean; onInput: solid_js.Setter; readonly: boolean; }; type FuzzySearchMatch = boolean; interface FuzzySearchResult { target: string; score: number; matches: FuzzySearchMatch[]; } type FuzzySortResult = (FuzzySearchResult & { item: any; index: number; })[]; declare const fuzzySearch: (value: string, target: string) => FuzzySearchResult; declare const fuzzyHighlight: (searchResult: FuzzySearchResult, highlighter?: (match: string) => solid_js.JSX.Element) => solid_js.JSX.Element; declare const fuzzySort: (value: string, items: any[], key?: string | ((item: any) => any)) => FuzzySortResult; interface CommonProps { format: (data: CreateSelectOption | CreateSelectValue, type: "option" | "value") => JSXElement | undefined; placeholder?: string; id?: string; name?: string; class?: string; autofocus?: boolean; readonly?: boolean; loading?: boolean; loadingPlaceholder?: string; emptyPlaceholder?: string; ref?: Ref; } type SelectProps = CreateSelectProps & Partial; declare const SelectContext: solid_js.Context<{ options: solid_js.Accessor; value: () => any; setValue: (value: CreateSelectValue) => any[]; hasValue: () => boolean; clearValue: () => never[]; inputValue: solid_js.Accessor; setInputValue: solid_js.Setter; hasInputValue: () => boolean; clearInputValue: () => ""; isOpen: solid_js.Accessor; setIsOpen: solid_js.Setter; toggleOpen: () => boolean; isActive: solid_js.Accessor; setIsActive: solid_js.Setter; readonly multiple: boolean; readonly disabled: boolean; pickOption: (option: CreateSelectOption) => void; isOptionFocused: (option: CreateSelectOption) => boolean; isOptionDisabled: (((option: CreateSelectOption) => boolean) | ((option: CreateSelectOption) => false)) & (((option: CreateSelectOption) => boolean) | ((option: CreateSelectOption) => false) | undefined); onFocusIn: () => true; onFocusOut: () => void; onMouseDown: (event: Event) => void; onClick: (event: Event) => void; onInput: (event: Event) => void; onKeyDown: (event: KeyboardEvent) => void; } | undefined>; declare const useSelect: () => { options: solid_js.Accessor; value: () => any; setValue: (value: CreateSelectValue) => any[]; hasValue: () => boolean; clearValue: () => never[]; inputValue: solid_js.Accessor; setInputValue: solid_js.Setter; hasInputValue: () => boolean; clearInputValue: () => ""; isOpen: solid_js.Accessor; setIsOpen: solid_js.Setter; toggleOpen: () => boolean; isActive: solid_js.Accessor; setIsActive: solid_js.Setter; readonly multiple: boolean; readonly disabled: boolean; pickOption: (option: CreateSelectOption) => void; isOptionFocused: (option: CreateSelectOption) => boolean; isOptionDisabled: (((option: CreateSelectOption) => boolean) | ((option: CreateSelectOption) => false)) & (((option: CreateSelectOption) => boolean) | ((option: CreateSelectOption) => false) | undefined); onFocusIn: () => true; onFocusOut: () => void; onMouseDown: (event: Event) => void; onClick: (event: Event) => void; onInput: (event: Event) => void; onKeyDown: (event: KeyboardEvent) => void; }; declare const Select: Component; type ContainerProps = Pick; declare const Container: ParentComponent; type ControlProps = Omit; declare const Control: Component; type PlaceholderProps = Pick; declare const Placeholder: ParentComponent; declare const SingleValue: ParentComponent<{}>; declare const MultiValue: ParentComponent<{ onRemove: () => void; }>; type InputProps = Pick; declare const Input: Component; type ListProps = Pick; declare const List: Component; type OptionProps = { option: CreateSelectOption; }; declare const Option: ParentComponent; export { Container, Control, type CreateOptionsCreateableFunction, type CreateOptionsFilterableFunction, type CreateOptionsFormatFunction, type CreateOptionsOption, type CreateSelectOption, type CreateSelectValue, type FuzzySearchResult, type FuzzySortResult, Input, List, MultiValue, Option, Placeholder, Select, SelectContext, SingleValue, createAsyncOptions, createOptions, createSelect, defaultFormat, fuzzyHighlight, fuzzySearch, fuzzySort, useSelect };