diff --git a/components/input.d.ts b/components/input.d.ts index e035f8b34e..6feee0b88e 100644 --- a/components/input.d.ts +++ b/components/input.d.ts @@ -116,7 +116,7 @@ declare module '@salesforce/design-system-react/components/input' { /** * This callback exposes the input reference / DOM node to parent components. ` this.input = inputComponent} /> */ - inputRef?: (v: any) => any; + inputRef?: React.RefCallback; /** * Displays the value of the input statically. This follows the static input UX pattern. */ @@ -128,50 +128,53 @@ declare module '@salesforce/design-system-react/components/input' { /** * Triggered when focus is removed. */ - onBlur?: (v: any) => any; + onBlur?: React.FocusEventHandler; /** * This callback fires when the input changes. Passes in `event, { value }`. */ onChange?: ( - e: React.KeyboardEvent, - value: { value: any } + e: + | React.ChangeEvent + | React.KeyboardEvent + | React.MouseEvent, + value: { value: string; number?: number } ) => any; /** * This event fires when the input is clicked. */ - onClick?: (v: any) => any; + onClick?: React.MouseEventHandler; /** * Triggered when component is focused. */ - onFocus?: (v: any) => any; + onFocus?: React.FocusEventHandler; /** * Similar to `onchange`. Triggered when an element gets user input. */ - onInput?: (v: any) => any; + onInput?: React.FormEventHandler; /** * Triggered when a submittable `` element is invalid. */ - onInvalid?: (v: any) => any; + onInvalid?: React.FormEventHandler; /** * Triggered when a key is pressed down */ - onKeyDown?: (v: any) => any; + onKeyDown?: React.KeyboardEventHandler; /** * Triggered when a key is pressed and released */ - onKeyPress?: (v: any) => any; + onKeyPress?: React.KeyboardEventHandler; /** * Triggered when a key is released */ - onKeyUp?: (v: any) => any; + onKeyUp?: React.KeyboardEventHandler; /** * Triggered after some text has been selected in an element. */ - onSelect?: (v: any) => any; + onSelect?: React.ReactEventHandler; /** * Fires when a form is submitted. */ - onSubmit?: (v: any) => any; + onSubmit?: React.ReactEventHandler; /** * Text that will appear in an empty input. */ diff --git a/components/input/private/inner-input.d.ts b/components/input/private/inner-input.d.ts index 9128b670aa..d9eb2b83e5 100644 --- a/components/input/private/inner-input.d.ts +++ b/components/input/private/inner-input.d.ts @@ -81,7 +81,7 @@ declare module '@salesforce/design-system-react/components/input/private/inner-i /** * This callback exposes the input reference / DOM node to parent components. ` this.input = inputComponent} /> */ - inputRef?: (v: any) => any; + inputRef?: React.LegacyRef; /** * Displays the value of the input statically. This follows the static input UX pattern. */ @@ -90,23 +90,23 @@ declare module '@salesforce/design-system-react/components/input/private/inner-i * This label appears above the input. */ label?: string; - onBlur?: (v: any) => any; + onBlur?: React.FocusEventHandler; /** * This callback fires when the input changes. The synthetic React event will be the first parameter to the callback. You will probably want to reference `event.target.value` in your callback. No custom data object is provided. */ - onChange?: (v: any) => any; + onChange?: React.ChangeEventHandler; /** * This event fires when the input is clicked. */ - onClick?: (v: any) => any; - onFocus?: (v: any) => any; - onInput?: (v: any) => any; - onInvalid?: (v: any) => any; - onKeyDown?: (v: any) => any; - onKeyPress?: (v: any) => any; - onKeyUp?: (v: any) => any; - onSelect?: (v: any) => any; - onSubmit?: (v: any) => any; + onClick?: React.MouseEventHandler; + onFocus?: React.FocusEventHandler; + onInput?: React.FormEventHandler; + onInvalid?: React.FormEventHandler; + onKeyDown?: React.KeyboardEventHandler; + onKeyPress?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onSelect?: React.ReactEventHandler; + onSubmit?: React.ReactEventHandler; /** * Text that will appear in an empty input. */