@abgov/react-components
Version:
Government of Alberta - UI components for React
16 lines (15 loc) • 803 B
TypeScript
import { AppState, GoabFieldsetItemValue, FieldValidator, PublicFormController } from '@abgov/ui-components-common';
declare function usePublicFormController<T>(type?: "details" | "list"): {
state: AppState<T> | AppState<T>[] | undefined;
init: (e: Event) => void;
initList: (e: Event) => void;
initState: (state?: string | AppState<T> | AppState<T>[], callback?: () => void) => void;
continueTo: (next: T | undefined) => void;
validate: (e: Event, field: string, validators: FieldValidator[]) => [boolean, GoabFieldsetItemValue];
getStateValue: (group: string, key: string) => string;
getStateList: () => Record<string, string>[];
complete: () => void;
completeSubform: () => void;
controller: PublicFormController<T>;
};
export { usePublicFormController };