From 7c5fa82175481172f393ba993175da683fdbb308 Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Sat, 9 Mar 2024 16:08:53 -0800 Subject: [PATCH] export observability startdeps Signed-off-by: Shenoy Pratik --- public/index.ts | 2 ++ public/plugin.tsx | 7 +++++-- public/types.ts | 14 +++++++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/public/index.ts b/public/index.ts index 919af71b2..8738c505b 100644 --- a/public/index.ts +++ b/public/index.ts @@ -13,3 +13,5 @@ export { ObservabilityPlugin as Plugin }; export const plugin = (initializerContext: PluginInitializerContext) => new ObservabilityPlugin(initializerContext); + +export { ObservabilityStart } from './types'; diff --git a/public/plugin.tsx b/public/plugin.tsx index eff8dddc8..8d4bfdea0 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -48,6 +48,7 @@ import { observabilityTracesTitle, } from '../common/constants/shared'; import { QueryManager } from '../common/query_manager'; +import { AssociatedObject } from '../common/types/data_connections'; import { VISUALIZATION_SAVED_OBJECT } from '../common/types/observability_saved_object_attributes'; import { setOSDHttp, @@ -102,12 +103,14 @@ interface PublicConfig { export const [ getRenderAccelerationDetailsFlyout, setRenderAccelerationDetailsFlyout, -] = createGetterSetter('renderAccelerationDetailsFlyout'); +] = createGetterSetter<(acceleration: any) => void>('renderAccelerationDetailsFlyout'); export const [ getRenderAssociatedObjectsDetailsFlyout, setRenderAssociatedObjectsDetailsFlyout, -] = createGetterSetter('renderAssociatedObjectsDetailsFlyout'); +] = createGetterSetter<({ tableDetail }: { tableDetail: AssociatedObject }) => void>( + 'renderAssociatedObjectsDetailsFlyout' +); export const [ getRenderCreateAccelerationFlyout, diff --git a/public/types.ts b/public/types.ts index 4d5fbd832..704e967f8 100644 --- a/public/types.ts +++ b/public/types.ts @@ -11,6 +11,7 @@ import { ManagementOverViewPluginSetup } from '../../../src/plugins/management_o import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; import { UiActionsStart } from '../../../src/plugins/ui_actions/public'; import { VisualizationsSetup } from '../../../src/plugins/visualizations/public'; +import { AssociatedObject } from '../common/types/data_connections'; import { AssistantSetup } from './types'; export interface AppPluginStartDependencies { @@ -33,8 +34,15 @@ export interface SetupDependencies { // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ObservabilitySetup {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ObservabilityStart {} +export interface ObservabilityStart { + renderAccelerationDetailsFlyout: (acceleration: any) => void; + renderAssociatedObjectsDetailsFlyout: ({ + tableDetail, + }: { + tableDetail: AssociatedObject; + }) => void; + renderCreateAccelerationFlyout: (selectedDatasource: string) => void; +} /** * Introduce a compile dependency on dashboards-assistant @@ -42,4 +50,4 @@ export interface ObservabilityStart {} * It will gives an type error when dashboards-assistant is not installed so add a ts-ignore to suppress the error. */ // @ts-ignore -export type { AssistantSetup, RenderProps, IMessage } from '../../dashboards-assistant/public'; +export type { AssistantSetup, IMessage, RenderProps } from '../../dashboards-assistant/public';