vue-dadata
Version:
Vue component for hinting addresses using dadata.ru
28 lines (27 loc) • 1.13 kB
TypeScript
import { Ref } from 'vue';
import { BoundsType, KeyEvent, LocationOptions, Suggestion } from './types';
declare const useSuggestions: (props: {
modelValue: string;
suggestion: Suggestion | undefined;
token: string;
url?: string;
disabled?: boolean;
debounceWait?: number | string;
toBound?: BoundsType;
fromBound?: BoundsType;
locationOptions?: LocationOptions;
autocomplete: boolean;
}, emit: (event: "update:modelValue" | "update:suggestion" | "handleError", ...args: any[]) => void) => {
queryProxy: import('vue').WritableComputedRef<string, string>;
suggestionProxy: import('vue').WritableComputedRef<Suggestion | undefined, Suggestion | undefined>;
inputFocused: Ref<boolean, boolean>;
suggestionsVisible: Ref<boolean, boolean>;
suggestionIndex: Ref<number, number>;
suggestionList: Ref<Suggestion[], Suggestion[]>;
onInputChange: () => void;
onKeyPress: (keyboardEvent: KeyboardEvent, keyEvent: KeyEvent) => void;
onInputFocus: () => void;
onInputBlur: () => void;
onSuggestionClick: (index: number) => void;
};
export default useSuggestions;