diff --git a/src/Pincode.svelte.d.ts b/src/Pincode.svelte.d.ts index 9e0fc2d..9f84995 100644 --- a/src/Pincode.svelte.d.ts +++ b/src/Pincode.svelte.d.ts @@ -1,9 +1,11 @@ -/// -import { SvelteComponentTyped } from "svelte"; +import type { SvelteComponentTyped } from "svelte"; +import type { SvelteHTMLElements } from "svelte/elements"; export type Code = string[]; -export interface PincodeProps extends svelte.JSX.HTMLAttributes { +type RestProps = SvelteHTMLElements["div"]; + +export interface PincodeProps extends RestProps { /** * @default [] */ @@ -29,6 +31,8 @@ export interface PincodeProps extends svelte.JSX.HTMLAttributes { - focusFirstInput?: () => void; - focusNextEmptyInput?: () => void; - focusLastInput?: () => void; + focusFirstInput: () => void; + + focusNextEmptyInput: () => void; + + focusLastInput: () => void; } diff --git a/src/PincodeInput.svelte.d.ts b/src/PincodeInput.svelte.d.ts index faa2628..02d270a 100644 --- a/src/PincodeInput.svelte.d.ts +++ b/src/PincodeInput.svelte.d.ts @@ -1,7 +1,9 @@ -/// -import { SvelteComponentTyped } from "svelte"; +import type { SvelteComponentTyped } from "svelte"; +import type { SvelteHTMLElements } from "svelte/elements"; -export interface PincodeInputProps extends svelte.JSX.HTMLAttributes { +type RestProps = SvelteHTMLElements["input"]; + +export interface PincodeInputProps extends RestProps { /** * @default "" */ @@ -16,10 +18,16 @@ export interface PincodeInputProps extends svelte.JSX.HTMLAttributes {} diff --git a/test/Pincode.test.svelte b/test/Pincode.test.svelte index d409b25..819d68e 100644 --- a/test/Pincode.test.svelte +++ b/test/Pincode.test.svelte @@ -17,9 +17,9 @@ $: error = complete && !success; onMount(() => { - ref.focusFirstInput?.(); - ref.focusNextEmptyInput?.(); - ref.focusLastInput?.(); + ref.focusFirstInput(); + ref.focusNextEmptyInput(); + ref.focusLastInput(); });