diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..6d1b2e2 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,15 @@ +import { Decorator, FormState } from 'final-form' + +type FocusableInput = { + name: string, + focus: () => void, +} + +type GetInputs = () => FocusableInput[] +type FindInput = (inputs: FocusableInput[], errors: FormState['errors']) => FocusableInput[] + +declare const createDecorator: (getInputs?: GetInputs, findInput?: FindInput) => Decorator +declare const getFormInputs: (name: string) => GetInputs + +export default createDecorator +export { getFormInputs }