Skip to content

Commit

Permalink
Merge pull request #471 from jaredhan418/master
Browse files Browse the repository at this point in the history
add more function types define.
  • Loading branch information
joepuzzo authored Apr 9, 2024
2 parents 8e2c39e + a040b08 commit 0022dd2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
export type FormState = {
pristine: boolean;
dirty: boolean;
disabled: boolean;
submitted: boolean;
valid: boolean;
invalid: boolean;
Expand Down Expand Up @@ -138,6 +139,7 @@ export type ArrayFieldApi = {
reset: () => void;
swap: (a: number, b: number) => void;
addWithInitialValue: (value: any) => void;
clear: () => void;
};

export type ArrayFieldItemApi = {
Expand Down Expand Up @@ -197,6 +199,7 @@ export type InformedProps<UserProps> = {
ajvErrors?: any;
onlyValidateSchema?: boolean;
components?: any;
adapter?: Record<string | number | symbol, React.FC>;
errorMessage?: Record<string, unknown>;
focusOnInvalid?: boolean;
resetOnlyOnscreen?: boolean;
Expand Down Expand Up @@ -395,12 +398,25 @@ export function useConditional(params: {
native: boolean;
}): unknown;

export function useArrayFieldApi(): ArrayFieldApi;

export function useArrayFieldItemApi(): ArrayFieldItemApi;

export function FormStateAccessor({
children
}: {
children: (formState: FormState) => JSX.Element;
}): JSX.Element;

declare function FormFields({
schema,
onlyValidateSchema
}: {
/** Json Schema */
schema: any,
onlyValidateSchema: boolean
}): JSX.Element[];

declare function ArrayField({
children,
name,
Expand Down

0 comments on commit 0022dd2

Please sign in to comment.