import { type ComponentType, type ReactNode } from 'react'; import { type MadeView, type UiClass, type UiContract, type ViewImpl } from '@playfast/reform'; import type { ArrayItem, ArrayPath, FieldBinding, FieldPath, PathValue, Values, VariantBody, VariantPath, VariantTag, VariantValue, View, AnyForm } from '@playfast/reform-forms'; export type FieldComponent = ComponentType<{ readonly field: FieldBinding; } & P>; export interface FieldHandle { as(component: FieldComponent): ReactNode; as

(component: FieldComponent, props: P): ReactNode; } export interface ArrayItemScope extends ScopeHelpers { readonly key: string; readonly index: number; readonly value: Item; readonly remove: () => void; readonly move: (to: number) => void; } export interface ArrayRenderArgs { readonly items: ReadonlyArray>; readonly append: (value?: Item) => void; readonly remove: (index: number) => void; readonly move: (from: number, to: number) => void; readonly swap: (a: number, b: number) => void; } type VariantCases = { readonly [Tag in VariantTag]: (scope: ScopeHelpers>) => ReactNode; }; export interface ScopeHelpers { readonly field:

>(path: P) => FieldHandle>; readonly array:

>(path: P, render: (args: ArrayRenderArgs>) => ReactNode) => ReactNode; readonly variant:

>(path: P, cases: VariantCases>) => ReactNode; } export interface RootHelpers extends ScopeHelpers> { readonly form: View; } type ContractWithForm = UiContract & { readonly props: { readonly form: View; }; }; export declare const make: , N extends string>(contract: UiClass, _form: F, render: (helpers: RootHelpers & { readonly props: C["props"]; }, slots: Parameters>[1], events: Parameters>[2]) => ReactNode) => MadeView; export declare const FormUi: { readonly make: typeof make; }; export {}; //# sourceMappingURL=index.d.ts.map