import { RuleExpression } from 'vee-validate'; import { Ref, ToRefs } from 'vue'; import { MaybeNullOrUndefined, Nullable } from '../../../../shared/dist/esm/index'; import { LabelPosition } from './input'; export type InputColor = 'page' | 'foundation' | 'transparent' | 'fully-transparent'; /** * Common setup for text input & textarea fields */ export declare function useTextInputCore(params: { props: ToRefs<{ name: string; help?: string; label?: string; showLabel?: boolean; rules?: RuleExpression; validateOnMount?: boolean; validateOnValueUpdate?: boolean; modelValue?: V; autoFocus?: boolean; showClear?: boolean; useLabelInErrors?: boolean; customErrorMessage?: string; hideErrorMessage?: boolean; color?: InputColor; labelPosition?: LabelPosition; customHelpClass?: string; }>; emit: { (e: 'change', val: { event?: Event; value: V; }): void; (e: 'clear'): void; }; inputEl: Ref>; options?: Partial<{ customClear: () => void; }>; }): { coreInputClasses: import('vue').ComputedRef; coreClasses: import('vue').ComputedRef; title: import('vue').ComputedRef; value: Ref; helpTipId: import('vue').ComputedRef; helpTipClasses: import('vue').ComputedRef; helpTip: import('vue').ComputedRef; hideHelpTip: import('vue').ComputedRef; errorMessage: import('vue').ComputedRef; clear: () => void; focus: () => void; labelClasses: import('vue').ComputedRef; shouldShowClear: import('vue').ComputedRef; hasError: import('vue').ComputedRef; }; type FormInputChangeEvent = { event?: Event; value: string; }; /** * Attach returned on and bind using v-on and v-bind, and then you can use the returned `value` * ref to get the input's value while ensuring normal input events are debounced and only change/clear * events cause the value to propagate immediately * * Very useful for search inputs and other kind of auto-submitting inputs! */ export declare function useDebouncedTextInput(params?: { /** * For how long should basic input events be debounced. * Default: 1000 (ms) */ debouncedBy?: number; /** * If enabled, value will only change on submit/enter, and just typing in values will never * register. * Default: false */ disableDebouncedInput?: boolean; /** * Optionally pass in the model ref that should be used as the source of truth */ model?: Ref>; /** * Set to true if you're tracking changes on a basic HTML input element. This will change the events * being used (e.g. input instead of update:modelValue) * * Default: false */ isBasicHtmlInput?: boolean; /** * Set to false if you don't want the change event to be emitted on Enter key press. * Setting only works for basic html inputs currently! * * Default: Default behavior (true for input, false for textarea) */ submitOnEnter?: boolean; /** * Set to true if you want to see debug output for how events fire and are handled */ debug?: boolean | ((...logArgs: unknown[]) => void); /** * Callback function that gets called when a new value is actually written to the model */ onWrite?: (val: string) => void; }): { on: { [x: string]: ((val: string | InputEvent) => void) | ((e: KeyboardEvent) => void); clear: () => void; change: (val: FormInputChangeEvent | Event) => void; keydown: (e: KeyboardEvent) => void; }; bind: import('vue').ComputedRef<{ modelValue: string; }>; value: Ref, MaybeNullOrUndefined>; /** * Force sync internal state from the source of truth */ syncFromValue: () => void; }; export {};