import { Field, FieldOptions } from './Field.ts'; import { RegisterFormFiled, VueComponent } from './types.ts'; import { AxiosInstance } from 'axios'; import { BaseAdapter } from '../../../common/adapters'; export interface HttpEndPoints { fetchUrl: string; searchQueryParam?: string; nextPageQueryParam?: string; pageSizeParam?: string; adapter?: BaseAdapter; } interface SelectFieldOptionBase extends FieldOptions { multiple?: boolean; creatable?: boolean; placeholder?: string; itemSlot?: VueComponent; placeHolderSlot?: VueComponent; searchable?: boolean; onSearch?: (searchString: string) => Array | null>; onScrollEnd?: () => void; onSelect?: (selectedItem: any) => void; onCreate?: (value: string) => Promise>; dropdownHeight?: string; httpEndPoints?: HttpEndPoints; httpService?: AxiosInstance; mapResult?: (value: any) => Record; } export type ValueType = Record | number | string | null; export type OptionType = number | null | string | Record; interface PrimitiveSelectFieldOption extends SelectFieldOptionBase { options?: OptionType[]; valueKey?: never; labelKey?: never; value?: ValueType | ValueType[]; } interface ObjectSelectFieldOption extends SelectFieldOptionBase { options?: OptionType[]; valueKey: string; labelKey: string; value?: ValueType | ValueType[]; } type SelectFieldOption = PrimitiveSelectFieldOption | ObjectSelectFieldOption; export declare class SelectField extends Field implements RegisterFormFiled { component: VueComponent; type: string; multiple: boolean; creatable: boolean; placeholder: string; slot: VueComponent; placeholderSlot: VueComponent; options?: OptionType[]; valueKey: string; labelKey: string; dropdownHeight: string; searchable: boolean; onSearch?: (searchString: string) => Array | null>; onScrollEnd?: () => void; onSelect?: (selectedItem: any) => void; onCreate?: (value: string) => Promise>; value?: ValueType | ValueType[]; httpEndPoints: HttpEndPoints; httpService?: AxiosInstance; mapResult: (value: any) => Record; constructor(options: SelectFieldOption); } export {};