From 464366068227cf807417257366b939739e3dc617 Mon Sep 17 00:00:00 2001 From: alirni Date: Mon, 9 Dec 2024 13:23:39 +0330 Subject: [PATCH] fix: $form type error when using form fields --- packages/forms/src/form/Form.d.ts | 44 ++++++++++++++++--------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/packages/forms/src/form/Form.d.ts b/packages/forms/src/form/Form.d.ts index b975e56e7..b95bc89b5 100644 --- a/packages/forms/src/form/Form.d.ts +++ b/packages/forms/src/form/Form.d.ts @@ -213,27 +213,29 @@ export interface FormSlots { * Default content slot. * @param {Object} scope - default slot's params. */ - default: (scope: { - /** - * Registers a form field for validation and tracking. - * @param field - The name of the form field to register. - * @param options - Configuration options for the field, such as validation rules. - * @returns - Returns an object or value representing the registered field. - */ - register: (field: string, options: any) => any; - /** - * Resets the entire form state, clearing values and validation statuses. - */ - reset: () => void; - /** - * Indicates whether the form is valid, returning `true` if all fields pass validation. - */ - valid: boolean; - /** - * Stores the state of each form field, with the field name as the key and its state as the value. - */ - states: Record; - }) => VNode[]; + default: ( + scope: { + /** + * Registers a form field for validation and tracking. + * @param field - The name of the form field to register. + * @param options - Configuration options for the field, such as validation rules. + * @returns - Returns an object or value representing the registered field. + */ + register: (field: string, options: any) => any; + /** + * Resets the entire form state, clearing values and validation statuses. + */ + reset: () => void; + /** + * Indicates whether the form is valid, returning `true` if all fields pass validation. + */ + valid: boolean; + + /** + * Index signature for dynamically added form fields. + */ + } & Record + ) => VNode[]; } /**