autocomplete.d.ts 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import type { ExtractPropTypes } from 'vue';
  2. import type Autocomplete from './autocomplete.vue';
  3. import type { Placement } from 'element-plus/es/components/popper';
  4. import type { Awaitable } from 'element-plus/es/utils';
  5. export type AutocompleteData = Record<string, any>[];
  6. export type AutocompleteFetchSuggestionsCallback = (data: AutocompleteData) => void;
  7. export type AutocompleteFetchSuggestions = ((queryString: string, cb: AutocompleteFetchSuggestionsCallback) => Awaitable<AutocompleteData> | void) | AutocompleteData;
  8. export declare const autocompleteProps: {
  9. readonly ariaLabel: StringConstructor;
  10. readonly valueKey: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "value", boolean>;
  11. readonly modelValue: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
  12. readonly debounce: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
  13. readonly placement: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "top" | "bottom" | "left" | "right" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement) | ((new (...args: any[]) => "top" | "bottom" | "left" | "right" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement))[], "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end", unknown, "bottom-start", boolean>;
  14. readonly fetchSuggestions: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => AutocompleteData | ((queryString: string, cb: AutocompleteFetchSuggestionsCallback) => Awaitable<AutocompleteData> | void)) | (() => AutocompleteFetchSuggestions) | ((new (...args: any[]) => AutocompleteData | ((queryString: string, cb: AutocompleteFetchSuggestionsCallback) => Awaitable<AutocompleteData> | void)) | (() => AutocompleteFetchSuggestions))[], unknown, unknown, () => void, boolean>;
  15. readonly popperClass: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
  16. readonly triggerOnFocus: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
  17. readonly selectWhenUnmatched: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
  18. readonly hideLoading: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
  19. readonly teleported: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
  20. readonly highlightFirstItem: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
  21. readonly fitInputWidth: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
  22. readonly clearable: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
  23. readonly disabled: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
  24. readonly name: StringConstructor;
  25. };
  26. export type AutocompleteProps = ExtractPropTypes<typeof autocompleteProps>;
  27. export declare const autocompleteEmits: {
  28. "update:modelValue": (value: string) => boolean;
  29. input: (value: string) => boolean;
  30. change: (value: string) => boolean;
  31. focus: (evt: FocusEvent) => boolean;
  32. blur: (evt: FocusEvent) => boolean;
  33. clear: () => boolean;
  34. select: (item: Record<string, any>) => boolean;
  35. };
  36. export type AutocompleteEmits = typeof autocompleteEmits;
  37. export type AutocompleteInstance = InstanceType<typeof Autocomplete> & unknown;