shelving
Version:
Toolkit for using data in JavaScript.
14 lines (13 loc) • 702 B
TypeScript
import type { Schema } from "../../schema/Schema.js";
import type { Data } from "../../util/data.js";
import type { AnyCaller } from "../../util/function.js";
import type { FormStore } from "./FormStore.js";
import { type SchemaInputProps } from "./SchemaInput.js";
/** Context for current form. */
export declare const FormContext: import("react").Context<FormStore<Data> | undefined>;
/** Use the current form context. */
export declare function requireForm<T extends Data = Data>(caller?: AnyCaller): FormStore<T>;
/** Use the props for a field of a form. */
export declare function useField<T, I = never>(name: string, form?: FormStore<{
[name: string]: T;
}>): SchemaInputProps<Schema<T>, I>;