import type { BehaviorSubject } from 'rxjs'; import type { AbsoluteLayoutItem, LayoutDefinitionItem, LayoutId, StructureItem, StructureItemType } from './DashboardJSON'; import type { PresetComponent } from './Preset'; import type { SearchControlAction } from './Search'; import type { EmittableEvent, TelemetryMetadata, TelemetryAPI } from './Telemetry'; import type { VizContract } from './Visualizations'; import type { UserMessageFn } from './UserMessage'; export type { BehaviorSubject }; export interface GlobalInputsApi { getInputsDomElement: () => HTMLDivElement | null; } interface GetDOMElement { getDomElement: () => HTMLDivElement | null; [x: string]: unknown; } export type VisualizationApi = GetDOMElement | (HTMLDivElement & GetDOMElement); export interface ActionsApi { refresh: (options?: { checkRiskyCommand?: boolean; }) => Promise; control: (action: SearchControlAction) => Promise; } export interface ToolbarApi { toggle?: () => void; expand?: () => void; collapse?: () => void; } type LayoutApiMethodArgs = { metadata?: TelemetryMetadata; }; /** @template {string} [TItemType=StructureItemType] Allowed values for the optional `type` property */ export type AddLayoutItem = { itemId: string; initContract?: VizContract; type?: TItemType; config?: PresetComponent['config']; }; /** @template {string} [TItemType=StructureItemType] Allowed values for the optional `type` property */ export type AddLayoutItemsArgs = LayoutApiMethodArgs & { items: AddLayoutItem[]; clipboardItems?: AbsoluteLayoutItem[]; }; export type CloneLayoutItemsArgs = LayoutApiMethodArgs & { from: string[]; to: string[]; [key: string]: unknown; }; export type RemoveLayoutItemsArgs = LayoutApiMethodArgs & { itemIds: string[]; }; /** * @template {any} [TLayoutStructure=unknown] The type which represents the layout structure to be handled * @template {string} [TItemType=string] Allowed values for the optional `type` property * @template {object} [TOptions=object] The type of the layout `options` property */ export interface LayoutApi> { readonly layoutId: string; readonly offsetSize: number; getLayoutItems(): StructureItem[]; addLayoutItems(arg0: AddLayoutItemsArgs): TLayoutStructure; cloneLayoutItems(arg0: CloneLayoutItemsArgs): TLayoutStructure; attemptCloneLayoutItems(arg0: CloneLayoutItemsArgs): TLayoutStructure | null; removeLayoutItems(arg0: RemoveLayoutItemsArgs): TLayoutStructure; snapshot(arg0?: LayoutApiMethodArgs): TOptions; emitTelemetry(payload: EmittableEvent): boolean; getLayoutItemOrder?(): string[]; [key: string]: unknown; } export interface LayoutApiConstructorArgs { layoutId: LayoutId; telemetry?: TelemetryAPI; getDefinition: () => LayoutDefinitionItem; userMessage: UserMessageFn; [x: string]: unknown; } /** * @template {any} [TLayoutStructure=unknown] The type which represents the layout structure to be handled * @template {string} [TItemType=string] Allowed values for the optional `type` property * @template {object} [TOptions=object] The type of the layout `options` property */ export type ConstructableLayoutApi> = new (arg0: LayoutApiConstructorArgs) => LayoutApi; export interface IApiRegistry { teardown(): void; cleanup(): void; getLayoutApi(layoutId: string): LayoutApi | null; getAllLayoutApis(): Record; registerLayoutApi({ layoutId, layoutApi, }: { layoutId: string; layoutApi: LayoutApi; }): void; removeLayoutApi(layoutId: string): void; removeAllLayoutApis(): void; getGlobalInputsApi(): GlobalInputsApi | null | undefined; registerGlobalInputsApi(api: GlobalInputsApi): void; removeGlobalInputsApi(): void; getVisualizationApi(id: string): VisualizationApi | undefined; registerVisualizationApi(id: string, api: VisualizationApi): void; removeVisualizationApi(id: string): void; getVisualizationActionsApi(id: string): ActionsApi | null | undefined; registerVisualizationActionsApi(id: string, api: ActionsApi): void; removeVisualizationActionsApi(id: string): void; getInputApi(id: string): HTMLDivElement | undefined; registerInputApi(id: string, api: HTMLDivElement): void; removeInputApi(id: string): void; getInputActionsApi(id: string): ActionsApi | null | undefined; registerInputActionsApi(id: string, api: ActionsApi): void; removeInputActionsApi(id: string): void; getToolbarApi(): ToolbarApi | null; registerToolbarApi(api: ToolbarApi): void; removeToolbarApi(): void; } //# sourceMappingURL=ApiRegistry.d.ts.map