@sanity/form-builder
Version:
Sanity form builder
46 lines • 1.7 kB
TypeScript
import PropTypes from 'prop-types';
import React from 'react';
import { Schema, SchemaType } from '@sanity/types';
import type { Patch } from './patch/types';
export interface PatchChannelOptions {
onPatch?: (patch: any) => void;
receivePatches?: (patches: any[]) => void;
}
interface Props {
schema: Schema;
value?: unknown;
children: any;
filterField?: any;
patchChannel?: PatchChannelOptions;
resolveInputComponent: (type: SchemaType) => React.ComponentType<any>;
resolvePreviewComponent: (type: SchemaType) => React.ComponentType<any>;
}
export default class FormBuilderContext extends React.Component<Props> {
static createPatchChannel: () => {
onPatch: (subscriber: import("nano-pubsub").Subscriber<{
snapshot: any;
patches: Patch[];
}>) => () => void;
receivePatches: (message: {
snapshot: any;
patches: Patch[];
}) => void;
};
static childContextTypes: {
getValuePath: PropTypes.Requireable<(...args: any[]) => any>;
onPatch: PropTypes.Requireable<(...args: any[]) => any>;
filterField: PropTypes.Requireable<(...args: any[]) => any>;
formBuilder: PropTypes.Requireable<PropTypes.InferProps<{
schema: PropTypes.Requireable<object>;
resolveInputComponent: PropTypes.Requireable<(...args: any[]) => any>;
document: PropTypes.Requireable<any>;
}>>;
};
getDocument: () => unknown;
resolveInputComponent: (arg: any) => any;
resolvePreviewComponent: (arg: any) => any;
getChildContext: () => any;
render(): any;
}
export {};
//# sourceMappingURL=FormBuilderContext.d.ts.map