import * as React from 'react'; import type { List, Map, MapOf } from 'immutable'; import type { onChangeHandler, UIStoreType } from './UIStore.js'; import { UIStoreActionsContext, UIStoreActions } from '@ui-schema/react/UIStoreActions'; export interface UIStoreContext { store: UIStoreType | undefined; showValidity?: boolean; } /** * @deprecated will be removed in a future version */ export declare const UIConfigProvider: React.ComponentType>; export declare function UIStoreProvider({ children, showValidity, onChange, store, ...props }: React.PropsWithChildren & UIStoreActionsContext & C>): React.ReactElement; export declare const useUIStore: () => UIStoreContext; /** * @deprecated will be removed in a future version */ export declare function useUIConfig(): U; export interface WithOnChange { onChange: onChangeHandler; } /** * @todo normalize with `WithValue` once finalized stricter widget/plugin props overall */ export interface WithValuePlain { value: unknown; internalValue: unknown; } /** * @deprecated use `WithValuePlain` + `WithOnChange` instead, which is also included in `WidgetProps` now */ export interface WithValue { /** * @todo switch to `unknown` */ value: any | undefined; /** * @todo switch to `unknown` */ internalValue: any | undefined; showValidity?: UIStoreContext['showValidity']; onChange: onChangeHandler; } /** * @todo remove this typing, `WithValue` should be used with type guards * @deprecated use `WithValuePlain` instead */ export interface WithScalarValue { value: string | number | boolean | undefined | null; internalValue: any; showValidity?: UIStoreContext['showValidity']; onChange: onChangeHandler; } export type Validity = MapOf<{ valid?: boolean; children?: ValidityChildren; errors?: unknown; }>; /** * @todo make stricter, with immutable leads to `error TS2615: Type of property 'children' circularly references itself in mapped type` */ type ValidityChildren = Map | List; /** * @deprecated will be removed in a future version */ export interface WithValidity { validity: Validity | undefined; onChange: onChangeHandler; showValidity?: UIStoreContext['showValidity']; } export {};