UNPKG

@dreamkit/solid

Version:

DreamKit tools for Solid.

26 lines 1.37 kB
import type { ControlledValue } from "../primitives/createControlledValue.js"; export type InputType = "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "month" | "number" | "password" | "radio" | "range" | "search" | "tel" | "text" | "time" | "url" | "week"; export type InputControlTypes = { number: number | null; file: File | null; checkbox: boolean; }; export type InputValue<T extends InputType> = T extends keyof InputControlTypes ? InputControlTypes[T] : string; export declare class InputControl<T extends InputType> { readonly type: T; readonly input: HTMLInputElement; readonly controlled: ControlledValue<InputValue<T>>; readonly onChange?: ((value: InputValue<T>) => void) | undefined; lastSelectionStart: number | undefined; valueEvent: boolean; constructor(type: T, input: HTMLInputElement, controlled: ControlledValue<InputValue<T>>, onChange?: ((value: InputValue<T>) => void) | undefined); hasControlledValueAttr(): boolean; hasSelectionRange(): boolean; getValue(): InputValue<T>; setValue(value: InputValue<T>, onlyIfDifferent?: boolean): void; processBlurEvent(): void; processInputEvent(): InputValue<T>; tryProcessValueEvent(nextValue: InputValue<T>): void; processValueEvent(nextValue: InputValue<T>): void; } //# sourceMappingURL=dom.d.ts.map