import { ContentType, KeyValueMap } from './entities'; interface AppStateEditorInterfaceItem { controls?: Array<{ fieldId: string; settings?: Record; }>; sidebar?: { position: number; settings?: Record; }; editors?: { position: number; settings?: Record; }; /** * @deprecated use `editors` instead */ editor?: boolean; } export interface AppState { EditorInterface: Record; } export type OnConfigureHandlerReturn = { parameters?: KeyValueMap | null; targetState?: AppState | null; } | false; export type OnConfigureHandler = () => OnConfigureHandlerReturn | Promise; export interface AppConfigAPI { /** Tells the web app that the app is loaded */ setReady: () => Promise; /** Returns true if an App is installed */ isInstalled: () => Promise; /** Returns current state of an App */ getCurrentState: () => Promise; /** Returns parameters of an App, null otherwise */ getParameters: () => Promise; /** Registers a handler to be called to produce parameters for an App */ onConfigure: (handler: OnConfigureHandler) => void; /** Registers a handler to be called once configuration was finished */ onConfigurationCompleted: (handler: (err: null | { message: string; }) => void) => void; } export {};