autocomplete.d.ts 1.5 KB

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