autocomplete.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { ElementUIComponent } from './component'
  2. import { IconClickEventHandler } from './input'
  3. export interface FetchSuggestionsCallback {
  4. /**
  5. * Callback function used in fetch-suggestions function
  6. *
  7. * @param data Suggestions to use
  8. */
  9. (data: any[]): void
  10. }
  11. export interface FetchSuggestions {
  12. /**
  13. * The function passed into the fetch-suggestions property
  14. *
  15. * @param queryString Current value of the text input
  16. * @param callback Callback function used to indicate that suggestions have completely fetched
  17. */
  18. (queryString: string, callback: FetchSuggestionsCallback): void
  19. }
  20. /** Autocomplete Component */
  21. export declare class ElAutocomplete extends ElementUIComponent {
  22. /** The placeholder of Autocomplete */
  23. placeholder: string
  24. /** Whether Autocomplete is disabled */
  25. disabled: boolean
  26. /** Binding value */
  27. value: string
  28. /** Debounce delay when typing */
  29. debounce: number
  30. /** name for the inner native input */
  31. name: string
  32. /** whether to emit select event on enter when there is no autocomplete match */
  33. selectWhenUnmatched: boolean
  34. /** Component name of your customized suggestion list item */
  35. customItem: string
  36. /** A method to fetch input suggestions. When suggestions are ready, invoke callback(data:[]) to return them to Autocomplete */
  37. fetchSuggestions: FetchSuggestions
  38. /** Custom class name for autocomplete's dropdown */
  39. popperClass: string
  40. /** Whether show suggestions when input focus */
  41. triggerOnFocus: boolean
  42. }