UNPKG

test-jsonforms-react-spectrum-renderers

Version:

React Spectrum Renderer Set for JSONForms

60 lines (59 loc) 2.17 kB
import { ErrorObject } from 'ajv'; import { UISchemaElement } from '@jsonforms/core'; import { Dispatch } from './type'; export declare function getUIOptions(uischema: UISchemaElement, defaultLabel: string): UIOptions; export declare function AddButton(props: Pick<UIOptions, 'addButtonLabel' | 'addButtonLabelType'> & { onPress: () => void; }): JSX.Element; export declare function ArrayHeader(props: UIOptions & { add: () => void; labelText: string; allErrorsMessages: string[]; }): JSX.Element; export declare function ArrayFooter(props: UIOptions & { add: () => void; }): JSX.Element; interface UIOptions { addButtonPosition: 'top' | 'bottom'; addButtonLabel?: string; addButtonLabelType: 'tooltip' | 'inline'; } export declare function getChildError(e: ErrorObject[], path: string): string; export declare let indexOfFittingSchemaObject: any; interface UpdateAction { type: 'jsonforms/UPDATE'; path: string; updater(existingData?: any): any; } export declare const UPDATE_DATA: 'jsonforms/UPDATE'; interface DispatchPropsOfArrayControl { move?(path: string, from: number, to: number): () => void; } /** * Maps state to dispatch properties of an array control. * * @param dispatch the store's dispatch method * @returns {DispatchPropsOfArrayControl} dispatch props of an array control */ export declare const mapDispatchToArrayControlProps: (dispatch: Dispatch<UpdateAction>) => DispatchPropsOfArrayControl; export declare const moveFromTo: (data: any[], from: number, to: number) => void; export declare function swap(array: any[], moveIndex: number, toIndex: number): any[]; /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * clamp(-10, -5, 5) * // => -5 * * clamp(10, -5, 5) * // => 5 */ export declare function clamp(number: number, lower: number, upper: number): number; export {};