@variantjs/vue
Version:
Vue VariantJS: Fully configurable Vue 3 components styled with TailwindCSS
19 lines (18 loc) • 1.25 kB
TypeScript
import { InputOptions, NormalizedOption, NormalizedOptions } from '@variantjs/core';
import { Ref, ComputedRef } from 'vue';
import { FetchOptionsFn, MinimumInputLengthTextProp, PreFetchOptionsFn } from '../types';
export default function useFetchsOptions(localValue: Ref<any>, options: Ref<InputOptions | undefined>, textAttribute: Ref<string | undefined>, valueAttribute: Ref<string | undefined>, normalize: Ref<boolean>, searchQuery: Ref<string | undefined>, fetchFn: Ref<FetchOptionsFn | undefined>, prefetchFn: Ref<boolean | PreFetchOptionsFn>, fetchDelay: Ref<number | undefined>, fetchMinimumInputLength: Ref<number | undefined>, fetchMinimumInputLengthText: Ref<MinimumInputLengthTextProp>): {
normalizedOptions: ComputedRef<NormalizedOptions>;
flattenedOptions: ComputedRef<NormalizedOption[]>;
fetchsOptions: ComputedRef<boolean>;
needsMoreCharsToFetch: ComputedRef<boolean>;
needsMoreCharsMessage: ComputedRef<string>;
fetchingOptions: Ref<boolean>;
fetchingMoreOptions: Ref<boolean>;
fetchedOptionsHaveMorePages: Ref<boolean>;
optionsWereFetched: Ref<boolean>;
fetchOptions: () => void;
prefetchOptions: () => void;
fetchMoreOptions: () => void;
fetchOptionsCancel: () => void;
};