synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
29 lines • 1.69 kB
TypeScript
import RJSF from '@rjsf/core';
import { JSONSchema7 } from 'json-schema';
import { RefObject } from 'react';
export type SchemaDrivenAnnotationEditorProps = {
/** The entity whose annotations should be edited with the form */
entityId?: string;
/** If no entity ID is supplied, the schema to use for the form */
schemaId?: string;
/** May be used to directly provide a JSON Schema to use for the form */
validationSchema?: JSONSchema7;
/** Optionally supply a ref to the form to handle submission externally with `formRef.current.submit()`. */
formRef?: RefObject<RJSF | null>;
/** Provide live input validation. This can cause performance degradation. By default, liveValidate will be true if an entity with a schema and existing annotations is being edited */
liveValidate?: boolean;
/** Invoked after a successful form submission */
onSuccess?: () => void;
/** If defined and formRef is not supplied, shows a 'Cancel' button and runs this effect on click */
onCancel?: () => void;
/** Passes new form data upon each change to the form */
onChange?: (annotations: Record<string, unknown>) => void;
/** If true, the editor will not render its own submit UI. */
hideActions?: boolean;
};
/**
* Renders a form for editing an entity's annotations. The component also supports supplying just a schema ID,
* but work to support annotation flows without an entity (i.e. before creating entities) is not yet complete.
*/
export declare function SchemaDrivenAnnotationEditor(props: SchemaDrivenAnnotationEditorProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=SchemaDrivenAnnotationEditor.d.ts.map