@sanity/form-builder
Version:
Sanity form builder
41 lines • 1.35 kB
TypeScript
import React from 'react';
import { Marker, Path, Schema, SchemaType } from '@sanity/types';
import { FormFieldPresence } from '@sanity/base/presence';
import { FormBuilderInput } from '../FormBuilderInput';
declare type PatchChannel = {
subscribe: () => () => {};
receivePatches: (patches: any[]) => void;
};
declare type Props = {
value: any | null;
schema: Schema;
type: SchemaType;
markers: Marker[];
patchChannel: PatchChannel;
compareValue: any;
onFocus: (path: Path) => void;
readOnly: boolean;
onChange: (patches: any[]) => void;
filterField: (field: any) => boolean;
onBlur: () => void;
autoFocus: boolean;
focusPath: Path;
presence: FormFieldPresence[];
changesOpen: boolean;
};
export default class SanityFormBuilder extends React.Component<Props> {
static createPatchChannel: () => {
receiveEvent: (event: any) => void;
onPatch: (subscriber: import("nano-pubsub").Subscriber<{
snapshot: any;
patches: import("../patch/types").Patch[];
}>) => () => void;
};
_input: FormBuilderInput | null;
setInput: (input: FormBuilderInput | null) => void;
componentDidMount(): void;
handleChange: (patchEvent: any) => void;
render(): React.JSX.Element;
}
export {};
//# sourceMappingURL=SanityFormBuilder.d.ts.map