import { type PartialWithUndefined } from '@augment-vir/common'; import { type AttributeValues } from 'element-vir'; /** * Inputs shared between the multiple input elements. * * @category Internal */ export type SharedTextInputElementInputs = { value: string; } & PartialWithUndefined<{ /** Shown when no other text is present. Input restrictions do not apply to this property. */ placeholder: string; /** Set to true to trigger disabled styles and to block all user input. */ disabled: boolean; /** * Only letters in the given string or matches to the given RegExp will be allowed. * blockedInputs takes precedence over this input. * * For example: if allowedInputs is set to "abcd" and blockedInputs is set to "d", only "a", * "b", or "c" letters will be allowed. */ allowedInputs: string | RegExp; /** Any letters in the given string or matches to the given RegExp will be blocked. */ blockedInputs: string | RegExp; /** Disable all browser helps like spellchecking, autocomplete, etc. */ disableBrowserHelps: boolean; /** Set this to true to make the whole element size to only fit the input text. */ fitText: boolean; /** A set of attributes that will be applied to the inner native text element. */ attributePassthrough: AttributeValues; }>; /** * Inputs used to check if the current input element value is allowed. * * @category Internal */ export type IsAllowedInputs = { value: string | number; allowed: string | RegExp | undefined; blocked: string | RegExp | undefined; }; /** * Filters out blocked text from an input element's value. * * @category Internal */ export declare function filterTextInputValue(inputs: IsAllowedInputs): { filtered: string; blocked: string; }; /** * A function to be called when an input element's value changes. * * @category Internal */ export declare function textInputListener({ inputs, previousValue, event, elementConstructor, inputBlockedCallback, newValueCallback, }: { inputs: SharedTextInputElementInputs; /** The value of the input element before this listener fired. */ previousValue: string; event: Event; /** * The constructor for the underlying native element. Defaults to `HTMLInputElement`, but can be * set to `HTMLTextAreaElement` for textarea-based elements. */ elementConstructor?: typeof HTMLInputElement | typeof HTMLTextAreaElement | undefined; inputBlockedCallback: (blockedInput: string) => void; newValueCallback: (newValue: string) => void; }): void;