UNPKG

@ui-schema/react

Version:

Schema-driven UI generator for React using JSON Schema. Build powerful form and interface generators with headless components and hooks.

79 lines (78 loc) 2.3 kB
import { SomeSchema } from '@ui-schema/ui-schema/CommonTypings'; import * as React from 'react'; import { Map } from 'immutable'; /** * @deprecated will be removed in a future version */ export declare const PROGRESS_NONE = false; /** * @deprecated will be removed in a future version */ export declare const PROGRESS_START = "start"; /** * @deprecated will be removed in a future version */ export declare const PROGRESS_DONE = true; /** * @deprecated will be removed in a future version */ export declare const PROGRESS_ERROR = "error"; /** * @deprecated will be removed in a future version */ export type PROGRESS = false | 'start' | true | 'error'; /** * @deprecated will be removed in a future version */ export declare function useProgress(): [PROGRESS, React.Dispatch<React.SetStateAction<PROGRESS>>]; /** * @deprecated will be removed in a future version */ export interface UIApiContextType { schemas?: Map<string, SomeSchema>; loadSchema?: (url: string, versions?: string[]) => Promise<PROGRESS>; } /** * @deprecated will be removed in a future version */ export type loadSchemaUIApi = (refUrl: string, version?: string[]) => Promise<any>; /** * @deprecated will be removed in a future version */ export type schemaLocalCachePath = string; /** * @deprecated will be removed in a future version */ export declare const UIApiContext: React.Context<UIApiContextType>; /** * @deprecated will be removed in a future version */ export declare const useUIApi: () => UIApiContextType; /** * @deprecated will be removed in a future version */ export declare const schemaLocalCachePath: string; /** * @deprecated will be removed in a future version */ export interface UIApiActionSchemaLoaded { type: 'SCHEMA_LOADED'; id: string; value: any; noCache: boolean | undefined; } /** * @deprecated will be removed in a future version */ export declare const isLoaded: (schemas: UIApiContextType['schemas'], ref: string, version?: string) => boolean; /** * @deprecated will be removed in a future version */ export interface UIApiProviderProps { loadSchema: loadSchemaUIApi; noCache?: boolean; } /** * @deprecated will be removed in a future version */ export declare const UIApiProvider: React.FC<React.PropsWithChildren<UIApiProviderProps>>;