Skip to content

Commit

Permalink
Merge pull request #6941 from alirni/master
Browse files Browse the repository at this point in the history
Fix $form type error
  • Loading branch information
tugcekucukoglu authored Dec 10, 2024
2 parents 77fe1dc + 4643660 commit 7d4f295
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions packages/forms/src/form/Form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, FormFieldState>;
}) => 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<string, FormFieldState>
) => VNode[];
}

/**
Expand Down

0 comments on commit 7d4f295

Please sign in to comment.