import type { UIStoreType, UIStoreUpdaterFn } from '@ui-schema/react/UIStore'; import type { SomeSchema } from '@ui-schema/ui-schema/CommonTypings'; import type { StoreKeys } from '@ui-schema/ui-schema/ValueStore'; import type { Map } from 'immutable'; export interface UIStoreUpdaterData { value?: any; internal?: any; /** * The validity for this node, for backwards compatible either a boolean or an object. * @todo simplify structure in a future release, after the store and validity part is no longer using immutable */ valid?: boolean | { valid?: boolean; errors?: any; } | Map; meta?: any; } export type UIStoreActionScoped = { /** * @todo move into the actions which support this, e.g. all `list-*` reducers rely on `internals` */ scopes: (keyof D)[]; }; export interface UIStoreAction { storeKeys: StoreKeys; type: string; schema?: SomeSchema; required?: boolean; /** * @deprecated use normal react flow and effects instead */ effect?: (newData: D, newStore: S) => void; } export interface UIStoreActionListItemAddWithValue extends UIStoreAction { type: 'list-item-add'; itemValue: any; } export interface UIStoreActionListItemAddWithSchema extends UIStoreAction { type: 'list-item-add'; schema: SomeSchema; } export type UIStoreActionListItemAdd = UIStoreActionListItemAddWithValue | UIStoreActionListItemAddWithSchema; export interface UIStoreActionListItemDelete extends UIStoreAction { type: 'list-item-delete'; index: number; } export interface UIStoreActionListItemMove extends UIStoreAction { type: 'list-item-move'; fromIndex: number; toIndex: number; } export interface UIStoreActionUpdate extends UIStoreActionScoped, UIStoreAction { type: 'update'; updater: UIStoreUpdaterFn; } export interface UIStoreActionSet extends UIStoreActionScoped, UIStoreAction { type: 'set'; data: D; } export interface UIStoreActionDelete extends Partial>, UIStoreAction { type: 'delete'; } export type UIStoreActions = UIStoreActionListItemAdd | UIStoreActionListItemDelete | UIStoreActionListItemMove | UIStoreActionUpdate | UIStoreActionSet | UIStoreActionDelete; export declare function isAffectingValue | (Omit & UIStoreActionScoped)>(action: S): boolean;