diff --git a/package.json b/package.json
index 769e2bd9f84..77aa4d4c5f9 100644
--- a/package.json
+++ b/package.json
@@ -143,5 +143,8 @@
"engines": {
"node": ">=12.22.0"
},
- "packageManager": "pnpm@7.18.0"
+ "packageManager": "pnpm@7.18.0",
+ "dependencies": {
+ "@hookform/core": "0.0.2"
+ }
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7e4bcea089e..265485c0137 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1,6 +1,7 @@
lockfileVersion: 5.4
specifiers:
+ '@hookform/core': 0.0.2
'@microsoft/api-extractor': ^7.33.7
'@rollup/plugin-commonjs': ^22.0.2
'@rollup/plugin-node-resolve': ^14.1.0
@@ -43,6 +44,9 @@ specifiers:
tsd: ^0.25.0
typescript: ^4.9.4
+dependencies:
+ '@hookform/core': 0.0.2
+
devDependencies:
'@microsoft/api-extractor': 7.33.7
'@rollup/plugin-commonjs': 22.0.2_rollup@2.79.1
@@ -496,6 +500,10 @@ packages:
- supports-color
dev: true
+ /@hookform/core/0.0.2:
+ resolution: {integrity: sha512-MZlFb5J1tA0a1mdTNYehJ4BdVY0ny0cwiyyKg+JHfSWUTdPUwiDDMg4RAt+khRlBWCzfVrvorjbeGgGRSQdkeQ==}
+ dev: false
+
/@humanwhocodes/config-array/0.11.8:
resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==}
engines: {node: '>=10.10.0'}
@@ -2316,6 +2324,7 @@ packages:
/commander/9.5.0:
resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
engines: {node: ^12.20.0 || >=14}
+ requiresBuild: true
dev: true
optional: true
diff --git a/reports/api-extractor.md b/reports/api-extractor.md
index 6a9900b60cd..33a2676bfef 100644
--- a/reports/api-extractor.md
+++ b/reports/api-extractor.md
@@ -6,710 +6,447 @@
///
+import { appendErrors } from '@hookform/core';
+import { ArrayKey } from '@hookform/core';
+import { ArrayPath } from '@hookform/core';
+import { AsKey } from '@hookform/core';
+import { AsPathTuple } from '@hookform/core';
+import { BatchFieldArrayUpdate } from '@hookform/core';
+import { BrowserNativeObject } from '@hookform/core';
+import { ChangeHandler } from '@hookform/core';
+import { CheckKeyConstraint } from '@hookform/core';
+import { ContainsIndexable } from '@hookform/core';
+import { Control } from '@hookform/core';
+import { ControllerFieldState } from '@hookform/core';
+import { ControllerProps } from '@hookform/core';
+import { ControllerRenderProps } from '@hookform/core';
+import { CriteriaMode } from '@hookform/core';
+import { CustomElement } from '@hookform/core';
+import { DeepMap } from '@hookform/core';
+import { DeepPartial } from '@hookform/core';
+import { DeepPartialSkipArrayKey } from '@hookform/core';
+import { DeepRequired } from '@hookform/core';
+import { DefaultValues } from '@hookform/core';
+import { DelayCallback } from '@hookform/core';
+import { EmptyObject } from '@hookform/core';
+import { ErrorOption } from '@hookform/core';
+import { EvaluateKey } from '@hookform/core';
+import { EvaluatePath } from '@hookform/core';
+import { EventType } from '@hookform/core';
+import { Field } from '@hookform/core';
+import { FieldArray } from '@hookform/core';
+import { FieldArrayMethodProps } from '@hookform/core';
+import { FieldArrayPath } from '@hookform/core';
+import { FieldArrayPathValue } from '@hookform/core';
+import { FieldArrayWithId } from '@hookform/core';
+import { FieldElement } from '@hookform/core';
+import { FieldError } from '@hookform/core';
+import { FieldErrors } from '@hookform/core';
+import { FieldErrorsImpl } from '@hookform/core';
+import { FieldName } from '@hookform/core';
+import { FieldNamesMarkedBoolean } from '@hookform/core';
+import { FieldPath } from '@hookform/core';
+import { FieldPathByValue } from '@hookform/core';
+import { FieldPathValue } from '@hookform/core';
+import { FieldPathValues } from '@hookform/core';
+import { FieldRefs } from '@hookform/core';
+import { FieldValue } from '@hookform/core';
+import { FieldValues } from '@hookform/core';
+import { FormProviderProps } from '@hookform/core';
+import { FormState } from '@hookform/core';
+import { FormStateProxy } from '@hookform/core';
+import { FormStateSubjectRef } from '@hookform/core';
+import { get } from '@hookform/core';
+import { GetIsDirty } from '@hookform/core';
+import { GlobalError } from '@hookform/core';
+import { HasKey } from '@hookform/core';
+import { HasPath } from '@hookform/core';
+import { InternalFieldErrors } from '@hookform/core';
+import { InternalFieldName } from '@hookform/core';
+import { InternalNameSet } from '@hookform/core';
+import { IsAny } from '@hookform/core';
+import { IsEqual } from '@hookform/core';
+import { IsFlatObject } from '@hookform/core';
+import { IsNever } from '@hookform/core';
+import { IsTuple } from '@hookform/core';
+import { JoinPathTuple } from '@hookform/core';
import { JSXElementConstructor } from 'react';
-import { default as React_2 } from 'react';
+import { KeepStateOptions } from '@hookform/core';
+import { Key } from '@hookform/core';
+import { Keys } from '@hookform/core';
+import { LiteralUnion } from '@hookform/core';
+import { Merge } from '@hookform/core';
+import { Message } from '@hookform/core';
+import { Mode } from '@hookform/core';
+import { MultipleFieldErrors } from '@hookform/core';
+import { Names } from '@hookform/core';
+import { NativeFieldValue } from '@hookform/core';
+import { NestedValue } from '@hookform/core';
+import { NonUndefined } from '@hookform/core';
+import { Noop } from '@hookform/core';
+import { NumericKeys } from '@hookform/core';
+import { ObjectKeys } from '@hookform/core';
+import { Path } from '@hookform/core';
+import { PathString } from '@hookform/core';
+import { PathTuple } from '@hookform/core';
+import { PathValue } from '@hookform/core';
+import { Primitive } from '@hookform/core';
import { ReactElement } from 'react';
-
-// @public (undocumented)
-export const appendErrors: (name: InternalFieldName, validateAllFieldCriteria: boolean, errors: InternalFieldErrors, type: string, message: ValidateResult) => {};
-
-// Warning: (ae-forgotten-export) The symbol "ArrayPathInternal" needs to be exported by the entry point index.d.ts
-//
-// @public
-export type ArrayPath = T extends any ? ArrayPathInternal : never;
-
-// @public (undocumented)
-export type BatchFieldArrayUpdate = = FieldArrayPath>(name: InternalFieldName, updatedFieldArrayValues?: Partial>[], method?: T, args?: Partial<{
- argA: unknown;
- argB: unknown;
-}>, shouldSetValue?: boolean, shouldUpdateFieldsAndErrors?: boolean) => void;
-
-// Warning: (ae-forgotten-export) The symbol "FileList_2" needs to be exported by the entry point index.d.ts
-// Warning: (ae-forgotten-export) The symbol "File_2" needs to be exported by the entry point index.d.ts
-//
-// @public (undocumented)
-export type BrowserNativeObject = Date | FileList_2 | File_2;
-
-// @public (undocumented)
-export type ChangeHandler = (event: {
- target: any;
- type?: any;
-}) => Promise;
-
-// @public (undocumented)
-export type Control = {
- _subjects: Subjects;
- _removeUnmounted: Noop;
- _focusError: Noop;
- _names: Names;
- _stateFlags: {
- mount: boolean;
- action: boolean;
- watch: boolean;
- };
- _reset: UseFormReset;
- _options: UseFormProps;
- _getDirty: GetIsDirty;
- _formState: FormState;
- _updateValid: (shouldUpdateValid?: boolean) => void;
- _updateFormState: (formState: Partial>) => void;
- _fields: FieldRefs;
- _formValues: FieldValues;
- _proxyFormState: ReadFormState;
- _defaultValues: Partial>;
- _getWatch: WatchInternal;
- _updateFieldArray: BatchFieldArrayUpdate;
- _getFieldArray: (name: InternalFieldName) => Partial[];
- _executeSchema: (names: InternalFieldName[]) => Promise<{
- errors: FieldErrors;
- }>;
- register: UseFormRegister;
- unregister: UseFormUnregister;
- getFieldState: UseFormGetFieldState;
-};
+import { ReadFormState } from '@hookform/core';
+import { Ref } from '@hookform/core';
+import { RefCallBack } from '@hookform/core';
+import { RegisterOptions } from '@hookform/core';
+import { Resolver } from '@hookform/core';
+import { ResolverError } from '@hookform/core';
+import { ResolverOptions } from '@hookform/core';
+import { ResolverResult } from '@hookform/core';
+import { ResolverSuccess } from '@hookform/core';
+import { set } from '@hookform/core';
+import { SetFieldValue } from '@hookform/core';
+import { SetFocusOptions } from '@hookform/core';
+import { SetValueConfig } from '@hookform/core';
+import { SplitPathString } from '@hookform/core';
+import { Subjects } from '@hookform/core';
+import { SubmitErrorHandler } from '@hookform/core';
+import { SubmitHandler } from '@hookform/core';
+import { ToKey } from '@hookform/core';
+import { Traversable } from '@hookform/core';
+import { TriggerConfig } from '@hookform/core';
+import { TupleKeys } from '@hookform/core';
+import { UnionToIntersection } from '@hookform/core';
+import { UseControllerProps } from '@hookform/core';
+import { UseControllerReturn } from '@hookform/core';
+import { UseFieldArrayAppend } from '@hookform/core';
+import { UseFieldArrayInsert } from '@hookform/core';
+import { UseFieldArrayMove } from '@hookform/core';
+import { UseFieldArrayPrepend } from '@hookform/core';
+import { UseFieldArrayProps } from '@hookform/core';
+import { UseFieldArrayRemove } from '@hookform/core';
+import { UseFieldArrayReplace } from '@hookform/core';
+import { UseFieldArrayReturn } from '@hookform/core';
+import { UseFieldArraySwap } from '@hookform/core';
+import { UseFieldArrayUpdate } from '@hookform/core';
+import { UseFormClearErrors } from '@hookform/core';
+import { UseFormGetFieldState } from '@hookform/core';
+import { UseFormGetValues } from '@hookform/core';
+import { UseFormHandleSubmit } from '@hookform/core';
+import { UseFormProps } from '@hookform/core';
+import { UseFormRegister } from '@hookform/core';
+import { UseFormRegisterReturn } from '@hookform/core';
+import { UseFormReset } from '@hookform/core';
+import { UseFormResetField } from '@hookform/core';
+import { UseFormReturn } from '@hookform/core';
+import { UseFormSetError } from '@hookform/core';
+import { UseFormSetFocus } from '@hookform/core';
+import { UseFormSetValue } from '@hookform/core';
+import { UseFormStateProps } from '@hookform/core';
+import { UseFormStateReturn } from '@hookform/core';
+import { UseFormTrigger } from '@hookform/core';
+import { UseFormUnregister } from '@hookform/core';
+import { UseFormWatch } from '@hookform/core';
+import { UseWatchProps } from '@hookform/core';
+import { Validate } from '@hookform/core';
+import { ValidateResult } from '@hookform/core';
+import { ValidationMode } from '@hookform/core';
+import { ValidationRule } from '@hookform/core';
+import { ValidationValue } from '@hookform/core';
+import { ValidationValueMessage } from '@hookform/core';
+import { ValidPathPrefix } from '@hookform/core';
+import { WatchInternal } from '@hookform/core';
+import { WatchObserver } from '@hookform/core';
+
+export { appendErrors }
+
+export { ArrayKey }
+
+export { ArrayPath }
+
+export { AsKey }
+
+export { AsPathTuple }
+
+export { BatchFieldArrayUpdate }
+
+export { BrowserNativeObject }
+
+export { ChangeHandler }
+
+export { CheckKeyConstraint }
+
+export { ContainsIndexable }
+
+export { Control }
// @public
export const Controller: = Path>(props: ControllerProps) => ReactElement>;
-// @public (undocumented)
-export type ControllerFieldState = {
- invalid: boolean;
- isTouched: boolean;
- isDirty: boolean;
- error?: FieldError;
-};
+export { ControllerFieldState }
-// @public
-export type ControllerProps = FieldPath> = {
- render: ({ field, fieldState, formState, }: {
- field: ControllerRenderProps;
- fieldState: ControllerFieldState;
- formState: UseFormStateReturn;
- }) => React_2.ReactElement;
-} & UseControllerProps;
-
-// @public (undocumented)
-export type ControllerRenderProps = FieldPath> = {
- onChange: (...event: any[]) => void;
- onBlur: Noop;
- value: FieldPathValue;
- name: TName;
- ref: RefCallBack;
-};
-
-// @public (undocumented)
-export type CriteriaMode = 'firstError' | 'all';
-
-// @public (undocumented)
-export type CustomElement = {
- name: FieldName;
- type?: string;
- value?: any;
- disabled?: boolean;
- checked?: boolean;
- options?: HTMLOptionsCollection;
- files?: FileList | null;
- focus?: Noop;
-};
-
-// @public (undocumented)
-export type DeepMap = IsAny extends true ? any : T extends BrowserNativeObject | NestedValue ? TValue : T extends object ? {
- [K in keyof T]: DeepMap, TValue>;
-} : TValue;
-
-// @public (undocumented)
-export type DeepPartial = T extends BrowserNativeObject | NestedValue ? T : {
- [K in keyof T]?: DeepPartial;
-};
-
-// @public (undocumented)
-export type DeepPartialSkipArrayKey = T extends BrowserNativeObject | NestedValue ? T : T extends ReadonlyArray ? {
- [K in keyof T]: DeepPartialSkipArrayKey;
-} : {
- [K in keyof T]?: DeepPartialSkipArrayKey;
-};
-
-// @public (undocumented)
-export type DeepRequired = T extends BrowserNativeObject | Blob ? T : {
- [K in keyof T]-?: NonNullable>;
-};
-
-// @public (undocumented)
-export type DefaultValues = DeepPartial;
-
-// @public (undocumented)
-export type DelayCallback = (wait: number) => void;
-
-// @public (undocumented)
-export type EmptyObject = {
- [K in string | number]: never;
-};
-
-// @public (undocumented)
-export type ErrorOption = {
- message?: Message;
- type?: LiteralUnion;
- types?: MultipleFieldErrors;
-};
-
-// @public (undocumented)
-export type EventType = 'focus' | 'blur' | 'change' | 'changeText' | 'valueChange' | 'contentSizeChange' | 'endEditing' | 'keyPress' | 'submitEditing' | 'layout' | 'selectionChange' | 'longPress' | 'press' | 'pressIn' | 'pressOut' | 'momentumScrollBegin' | 'momentumScrollEnd' | 'scroll' | 'scrollBeginDrag' | 'scrollEndDrag' | 'load' | 'error' | 'progress' | 'custom';
-
-// @public (undocumented)
-export type Field = {
- _f: {
- ref: Ref;
- name: InternalFieldName;
- refs?: HTMLInputElement[];
- mount?: boolean;
- } & RegisterOptions;
-};
-
-// @public (undocumented)
-export type FieldArray = FieldArrayPath> = FieldArrayPathValue extends ReadonlyArray | null | undefined ? U : never;
+export { ControllerProps }
-// @public
-export type FieldArrayMethodProps = {
- shouldFocus?: boolean;
- focusIndex?: number;
- focusName?: string;
-};
+export { ControllerRenderProps }
-// @public
-export type FieldArrayPath = ArrayPath;
+export { CriteriaMode }
-// @public
-export type FieldArrayPathValue> = PathValue;
+export { CustomElement }
-// @public
-export type FieldArrayWithId = FieldArrayPath, TKeyName extends string = 'id'> = FieldArray & Record;
+export { DeepMap }
-// @public (undocumented)
-export type FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | CustomElement;
+export { DeepPartial }
-// @public (undocumented)
-export type FieldError = {
- type: LiteralUnion;
- root?: FieldError;
- ref?: Ref;
- types?: MultipleFieldErrors;
- message?: Message;
-};
+export { DeepPartialSkipArrayKey }
-// @public (undocumented)
-export type FieldErrors = Partial ? any : FieldErrorsImpl>> & {
- root?: Record & GlobalError;
-};
+export { DeepRequired }
-// @public (undocumented)
-export type FieldErrorsImpl = {
- [K in keyof T]?: T[K] extends BrowserNativeObject | Blob ? FieldError : K extends 'root' | `root.${string}` ? GlobalError : T[K] extends object ? Merge> : FieldError;
-};
+export { DefaultValues }
-// @public (undocumented)
-export type FieldName = IsFlatObject extends true ? Extract : string;
+export { DelayCallback }
-// @public (undocumented)
-export type FieldNamesMarkedBoolean = DeepMap, boolean>;
+export { EmptyObject }
-// @public
-export type FieldPath = Path;
+export { ErrorOption }
-// @public
-export type FieldPathByValue = {
- [Key in FieldPath]: FieldPathValue extends TValue ? Key : never;
-}[FieldPath];
+export { EvaluateKey }
-// @public
-export type FieldPathValue> = PathValue;
+export { EvaluatePath }
-// @public
-export type FieldPathValues[] | readonly FieldPath[]> = {} & {
- [K in keyof TPath]: FieldPathValue>;
-};
+export { EventType }
+
+export { Field }
+
+export { FieldArray }
+
+export { FieldArrayMethodProps }
+
+export { FieldArrayPath }
-// @public (undocumented)
-export type FieldRefs = Partial>;
+export { FieldArrayPathValue }
-// @public (undocumented)
-export type FieldValue = TFieldValues[InternalFieldName];
+export { FieldArrayWithId }
-// @public (undocumented)
-export type FieldValues = Record;
+export { FieldElement }
+
+export { FieldError }
+
+export { FieldErrors }
+
+export { FieldErrorsImpl }
+
+export { FieldName }
+
+export { FieldNamesMarkedBoolean }
+
+export { FieldPath }
+
+export { FieldPathByValue }
+
+export { FieldPathValue }
+
+export { FieldPathValues }
+
+export { FieldRefs }
+
+export { FieldValue }
+
+export { FieldValues }
// @public
export const FormProvider: (props: FormProviderProps) => JSX.Element;
-// @public (undocumented)
-export type FormProviderProps = {
- children: React_2.ReactNode | React_2.ReactNode[];
-} & UseFormReturn;
-
-// @public (undocumented)
-export type FormState = {
- isDirty: boolean;
- isLoading: boolean;
- isSubmitted: boolean;
- isSubmitSuccessful: boolean;
- isSubmitting: boolean;
- isValidating: boolean;
- isValid: boolean;
- submitCount: number;
- defaultValues?: undefined | Readonly>;
- dirtyFields: Partial>>;
- touchedFields: Partial>>;
- errors: FieldErrors;
-};
-
-// @public (undocumented)
-export type FormStateProxy = {
- isDirty: boolean;
- isValidating: boolean;
- dirtyFields: FieldNamesMarkedBoolean;
- touchedFields: FieldNamesMarkedBoolean;
- errors: boolean;
- isValid: boolean;
-};
-
-// Warning: (ae-forgotten-export) The symbol "Subject" needs to be exported by the entry point index.d.ts
-//
-// @public (undocumented)
-export type FormStateSubjectRef = Subject> & {
- name?: InternalFieldName;
-}>;
-
-// @public (undocumented)
-export const get: (obj: T, path: string, defaultValue?: unknown) => any;
-
-// @public (undocumented)
-export type GetIsDirty = (name?: TName, data?: TData) => boolean;
-
-// @public (undocumented)
-export type GlobalError = Partial<{
- type: string | number;
- message: string;
-}>;
-
-// @public (undocumented)
-export type InternalFieldErrors = Partial>;
-
-// @public (undocumented)
-export type InternalFieldName = string;
-
-// @public (undocumented)
-export type InternalNameSet = Set;
+export { FormProviderProps }
-// @public
-export type IsAny = 0 extends 1 & T ? true : false;
+export { FormState }
-// @public
-export type IsEqual = T1 extends T2 ? (() => G extends T1 ? 1 : 2) extends () => G extends T2 ? 1 : 2 ? true : false : false;
+export { FormStateProxy }
-// @public (undocumented)
-export type IsFlatObject = Extract, any[] | object> extends never ? true : false;
+export { FormStateSubjectRef }
-// @public
-export type IsNever = [T] extends [never] ? true : false;
-
-// @public (undocumented)
-export type KeepStateOptions = Partial<{
- keepDirtyValues: boolean;
- keepErrors: boolean;
- keepDirty: boolean;
- keepValues: boolean;
- keepDefaultValues: boolean;
- keepIsSubmitted: boolean;
- keepTouched: boolean;
- keepIsValid: boolean;
- keepSubmitCount: boolean;
-}>;
-
-// @public (undocumented)
-export type LiteralUnion = T | (U & {
- _?: never;
-});
-
-// @public (undocumented)
-export type Merge = {
- [K in keyof A | keyof B]?: K extends keyof A & keyof B ? [A[K], B[K]] extends [object, object] ? Merge : A[K] | B[K] : K extends keyof A ? A[K] : K extends keyof B ? B[K] : never;
-};
-
-// @public (undocumented)
-export type Message = string;
-
-// @public (undocumented)
-export type Mode = keyof ValidationMode;
-
-// @public (undocumented)
-export type MultipleFieldErrors = {
- [K in keyof RegisterOptions]?: ValidateResult;
-} & {
- [key: string]: ValidateResult;
-};
-
-// @public (undocumented)
-export type Names = {
- mount: InternalNameSet;
- unMount: InternalNameSet;
- array: InternalNameSet;
- watch: InternalNameSet;
- focus?: InternalFieldName;
- watchAll?: boolean;
-};
-
-// @public (undocumented)
-export type NativeFieldValue = string | number | boolean | null | undefined | unknown[];
-
-// @public @deprecated (undocumented)
-export type NestedValue = {
- [$NestedValue]: never;
-} & TValue;
-
-// @public (undocumented)
-export type NonUndefined = T extends undefined ? never : T;
-
-// @public (undocumented)
-export type Noop = () => void;
-
-// Warning: (ae-forgotten-export) The symbol "PathInternal" needs to be exported by the entry point index.d.ts
-//
-// @public
-export type Path = T extends any ? PathInternal : never;
+export { get }
-// @public
-export type PathString = string;
+export { GetIsDirty }
-// Warning: (ae-forgotten-export) The symbol "ArrayKey" needs to be exported by the entry point index.d.ts
-//
-// @public
-export type PathValue | ArrayPath> = T extends any ? P extends `${infer K}.${infer R}` ? K extends keyof T ? R extends Path ? PathValue : never : K extends `${ArrayKey}` ? T extends ReadonlyArray ? PathValue> : never : never : P extends keyof T ? T[P] : P extends `${ArrayKey}` ? T extends ReadonlyArray ? V : never : never : never;
-
-// @public (undocumented)
-export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
-
-// @public (undocumented)
-export type ReadFormState = {
- [K in keyof FormStateProxy]: boolean | 'all';
-};
-
-// @public (undocumented)
-export type Ref = FieldElement;
-
-// @public (undocumented)
-export type RefCallBack = (instance: any) => void;
-
-// @public (undocumented)
-export type RegisterOptions = FieldPath> = Partial<{
- required: Message | ValidationRule;
- min: ValidationRule;
- max: ValidationRule;
- maxLength: ValidationRule;
- minLength: ValidationRule;
- validate: Validate, TFieldValues> | Record, TFieldValues>>;
- value: FieldPathValue;
- setValueAs: (value: any) => any;
- shouldUnregister?: boolean;
- onChange?: (event: any) => void;
- onBlur?: (event: any) => void;
- disabled: boolean;
- deps: InternalFieldName | InternalFieldName[];
-}> & ({
- pattern?: ValidationRule;
- valueAsNumber?: false;
- valueAsDate?: false;
-} | {
- pattern?: undefined;
- valueAsNumber?: false;
- valueAsDate?: true;
-} | {
- pattern?: undefined;
- valueAsNumber?: true;
- valueAsDate?: false;
-});
-
-// @public (undocumented)
-export type Resolver = (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise> | ResolverResult;
-
-// @public (undocumented)
-export type ResolverError = {
- values: {};
- errors: FieldErrors;
-};
-
-// @public (undocumented)
-export interface ResolverOptions {
- // (undocumented)
- criteriaMode?: CriteriaMode;
- // (undocumented)
- fields: Record;
- // (undocumented)
- names?: FieldName[];
- // (undocumented)
- shouldUseNativeValidation: boolean | undefined;
-}
-
-// @public (undocumented)
-export type ResolverResult = ResolverSuccess | ResolverError;
-
-// @public (undocumented)
-export type ResolverSuccess = {
- values: TFieldValues;
- errors: {};
-};
-
-// @public (undocumented)
-export function set(object: FieldValues, path: string, value?: unknown): FieldValues;
-
-// @public (undocumented)
-export type SetFieldValue = FieldValue;
-
-// @public (undocumented)
-export type SetFocusOptions = Partial<{
- shouldSelect: boolean;
-}>;
-
-// @public (undocumented)
-export type SetValueConfig = Partial<{
- shouldValidate: boolean;
- shouldDirty: boolean;
- shouldTouch: boolean;
-}>;
-
-// @public (undocumented)
-export type Subjects = {
- watch: Subject<{
- name?: InternalFieldName;
- type?: EventType;
- values?: FieldValues;
- }>;
- array: Subject<{
- name?: InternalFieldName;
- values?: FieldValues;
- }>;
- state: FormStateSubjectRef;
-};
-
-// @public (undocumented)
-export type SubmitErrorHandler = (errors: FieldErrors, event?: React_2.BaseSyntheticEvent) => any | Promise;
-
-// @public (undocumented)
-export type SubmitHandler = (data: TFieldValues, event?: React_2.BaseSyntheticEvent) => any | Promise;
-
-// @public (undocumented)
-export type TriggerConfig = Partial<{
- shouldFocus: boolean;
-}>;
-
-// @public @deprecated (undocumented)
-export type UnpackNestedValue = T extends NestedValue ? U : T extends Date | FileList | File | Blob ? T : T extends object ? {
- [K in keyof T]: UnpackNestedValue;
-} : T;
+export { GlobalError }
+
+export { HasKey }
+
+export { HasPath }
+
+export { InternalFieldErrors }
+
+export { InternalFieldName }
+
+export { InternalNameSet }
+
+export { IsAny }
+
+export { IsEqual }
+
+export { IsFlatObject }
+
+export { IsNever }
+
+export { IsTuple }
+
+export { JoinPathTuple }
+
+export { KeepStateOptions }
+
+export { Key }
+
+export { Keys }
+
+export { LiteralUnion }
+
+export { Merge }
+
+export { Message }
+
+export { Mode }
+
+export { MultipleFieldErrors }
+
+export { Names }
+
+export { NativeFieldValue }
+
+export { NestedValue }
+
+export { NonUndefined }
+
+export { Noop }
+
+export { NumericKeys }
+
+export { ObjectKeys }
+
+export { Path }
+
+export { PathString }
+
+export { PathTuple }
+
+export { PathValue }
+
+export { Primitive }
+
+export { ReadFormState }
+
+export { Ref }
+
+export { RefCallBack }
+
+export { RegisterOptions }
+
+export { Resolver }
+
+export { ResolverError }
+
+export { ResolverOptions }
+
+export { ResolverResult }
+
+export { ResolverSuccess }
+
+export { set }
+
+export { SetFieldValue }
+
+export { SetFocusOptions }
+
+export { SetValueConfig }
+
+export { SplitPathString }
+
+export { Subjects }
+
+export { SubmitErrorHandler }
+
+export { SubmitHandler }
+
+export { ToKey }
+
+export { Traversable }
+
+export { TriggerConfig }
+
+export { TupleKeys }
+
+export { UnionToIntersection }
// @public
export function useController = FieldPath>(props: UseControllerProps): UseControllerReturn;
-// @public (undocumented)
-export type UseControllerProps = FieldPath> = {
- name: TName;
- rules?: Omit, 'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled'>;
- shouldUnregister?: boolean;
- defaultValue?: FieldPathValue;
- control?: Control;
-};
+export { UseControllerProps }
-// @public (undocumented)
-export type UseControllerReturn = FieldPath> = {
- field: ControllerRenderProps;
- formState: UseFormStateReturn;
- fieldState: ControllerFieldState;
-};
+export { UseControllerReturn }
// @public
export function useFieldArray = FieldArrayPath, TKeyName extends string = 'id'>(props: UseFieldArrayProps): UseFieldArrayReturn;
-// @public
-export type UseFieldArrayAppend = FieldArrayPath> = (value: FieldArray | FieldArray[], options?: FieldArrayMethodProps) => void;
+export { UseFieldArrayAppend }
-// @public
-export type UseFieldArrayInsert = FieldArrayPath> = (index: number, value: FieldArray | FieldArray[], options?: FieldArrayMethodProps) => void;
+export { UseFieldArrayInsert }
-// @public
-export type UseFieldArrayMove = (indexA: number, indexB: number) => void;
+export { UseFieldArrayMove }
-// @public
-export type UseFieldArrayPrepend = FieldArrayPath> = (value: FieldArray | FieldArray[], options?: FieldArrayMethodProps) => void;
+export { UseFieldArrayPrepend }
-// @public (undocumented)
-export type UseFieldArrayProps = FieldArrayPath, TKeyName extends string = 'id'> = {
- name: TFieldArrayName;
- keyName?: TKeyName;
- control?: Control;
- rules?: {
- validate?: Validate[], TFieldValues> | Record[], TFieldValues>>;
- } & Pick, 'maxLength' | 'minLength' | 'required'>;
- shouldUnregister?: boolean;
-};
+export { UseFieldArrayProps }
-// @public
-export type UseFieldArrayRemove = (index?: number | number[]) => void;
+export { UseFieldArrayRemove }
-// @public
-export type UseFieldArrayReplace = FieldArrayPath> = (value: FieldArray | FieldArray[]) => void;
-
-// @public (undocumented)
-export type UseFieldArrayReturn = FieldArrayPath, TKeyName extends string = 'id'> = {
- swap: UseFieldArraySwap;
- move: UseFieldArrayMove;
- prepend: UseFieldArrayPrepend;
- append: UseFieldArrayAppend;
- remove: UseFieldArrayRemove;
- insert: UseFieldArrayInsert;
- update: UseFieldArrayUpdate;
- replace: UseFieldArrayReplace;
- fields: FieldArrayWithId[];
-};
+export { UseFieldArrayReplace }
-// @public
-export type UseFieldArraySwap = (indexA: number, indexB: number) => void;
+export { UseFieldArrayReturn }
-// @public
-export type UseFieldArrayUpdate = FieldArrayPath> = (index: number, value: FieldArray) => void;
+export { UseFieldArraySwap }
+
+export { UseFieldArrayUpdate }
// @public
export function useForm(props?: UseFormProps): UseFormReturn;
-// @public
-export type UseFormClearErrors = (name?: FieldPath | FieldPath[] | readonly FieldPath[] | `root.${string}` | 'root') => void;
+export { UseFormClearErrors }
// @public
export const useFormContext: () => UseFormReturn;
-// @public
-export type UseFormGetFieldState = >(name: TFieldName, formState?: FormState) => {
- invalid: boolean;
- isDirty: boolean;
- isTouched: boolean;
- error?: FieldError;
-};
-
-// @public (undocumented)
-export type UseFormGetValues = {
- (): TFieldValues;
- >(name: TFieldName): FieldPathValue;
- []>(names: readonly [...TFieldNames]): [...FieldPathValues];
-};
+export { UseFormGetFieldState }
-// @public
-export type UseFormHandleSubmit = (onValid: SubmitHandler, onInvalid?: SubmitErrorHandler) => (e?: React_2.BaseSyntheticEvent) => Promise;
-
-// @public (undocumented)
-export type UseFormProps = Partial<{
- mode: Mode;
- reValidateMode: Exclude;
- defaultValues: DefaultValues | AsyncDefaultValues;
- values: TFieldValues;
- resetOptions: Parameters>[1];
- resolver: Resolver;
- context: TContext;
- shouldFocusError: boolean;
- shouldUnregister: boolean;
- shouldUseNativeValidation: boolean;
- criteriaMode: CriteriaMode;
- delayError: number;
-}>;
+export { UseFormGetValues }
-// @public
-export type UseFormRegister = = FieldPath>(name: TFieldName, options?: RegisterOptions) => UseFormRegisterReturn;
+export { UseFormHandleSubmit }
-// @public (undocumented)
-export type UseFormRegisterReturn = {
- onChange: ChangeHandler;
- onBlur: ChangeHandler;
- ref: RefCallBack;
- name: TFieldName;
- min?: string | number;
- max?: string | number;
- maxLength?: number;
- minLength?: number;
- pattern?: string;
- required?: boolean;
- disabled?: boolean;
-};
+export { UseFormProps }
-// Warning: (ae-forgotten-export) The symbol "ResetAction" needs to be exported by the entry point index.d.ts
-//
-// @public
-export type UseFormReset = (values?: DefaultValues | TFieldValues | ResetAction, keepStateOptions?: KeepStateOptions) => void;
+export { UseFormRegister }
-// @public
-export type UseFormResetField = = FieldPath>(name: TFieldName, options?: Partial<{
- keepDirty: boolean;
- keepTouched: boolean;
- keepError: boolean;
- defaultValue: any;
-}>) => void;
-
-// @public (undocumented)
-export type UseFormReturn = {
- watch: UseFormWatch;
- getValues: UseFormGetValues;
- getFieldState: UseFormGetFieldState;
- setError: UseFormSetError