UNPKG

@zextras/carbonio-shell-ui

Version:

The Zextras Carbonio web client

41 lines (40 loc) 1.41 kB
import type { ComponentType } from 'react'; import type { Action, ActionFactory } from '../../types/integrations'; import type { AnyFunction } from '../../utils/typeUtils'; type Component<TProps extends Record<string, unknown> = Record<string, unknown>> = ComponentType<TProps>; export type IntegrationsState = { actions: { [type: string]: { [id: string]: ActionFactory<unknown>; }; }; components: { [id: string]: { app: string; Item: Component; }; }; functions: { [id: string]: AnyFunction; }; }; export type IntegrationActions = { removeActions: (...ids: Array<string>) => void; registerActions: <TAction extends Action = Action>(...items: Array<{ id: string; action: ActionFactory<unknown, TAction>; type: string; }>) => void; removeComponents: (...ids: Array<string>) => void; registerComponents: (app: string) => <TProps extends Record<string, unknown>>(...items: Array<{ id: string; component: Component<TProps>; }>) => void; removeFunctions: (...ids: Array<string>) => void; registerFunctions: (...items: Array<{ id: string; fn: AnyFunction; }>) => void; }; export declare const useIntegrationsStore: import("zustand").UseBoundStore<import("zustand").StoreApi<IntegrationsState & IntegrationActions>>; export {};