synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
33 lines • 1.68 kB
TypeScript
import { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
declare const propertyTypeArray: readonly ["String", "Integer", "Float", "Boolean", "Datetime"];
export type PropertyType = (typeof propertyTypeArray)[number];
export declare function guessPropertyType(list: Array<unknown>): PropertyType;
export declare function transformDataFromPropertyType(list: Array<any>, propertyType: PropertyType): boolean[] | (string | number)[];
/**
* Maps a Synapse Annotation PropertyType to a JSON Schema that captures the type and format.
* @param propertyType
*/
export declare function getSchemaForPropertyType(propertyType: PropertyType): {
type: string;
format: string;
} | {
type: string;
format?: undefined;
};
/**
* react-jsonschema-form SchemaField override for "additionalProperties" only. In Synapse these are "custom annotations".
* Modifies the data to provide full compatibility with Synapse annotations features.
*
* This component provides these enhancements to the SchemaField:
* - Supports selecting a type, and changing the input widget appropriately
* - Identifying the type on mount
* - Treat all field values as arrays
* - When the last array value is removed, remove the entire key from the form.
* @param props
* @returns
*/
export declare function AdditionalPropertiesSchemaField<T extends Array<unknown> = Array<unknown>, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldProps<T, S, F> & {
onDropPropertyClick: (key: string) => (event: any) => void;
}): import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=AdditionalPropertiesSchemaField.d.ts.map