diff --git a/x-pack/plugins/observability/public/data_handler.ts b/x-pack/plugins/observability/public/data_handler.ts index 382812903fd8eb..8f80f79b2e829a 100644 --- a/x-pack/plugins/observability/public/data_handler.ts +++ b/x-pack/plugins/observability/public/data_handler.ts @@ -4,9 +4,23 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FetchData, HasData, ObservabilityFetchDataResponse } from './typings/data_handler'; +import { ObservabilityFetchDataResponse, FetchDataResponse } from './typings/fetch_data_response'; import { ObservabilityApp } from '../typings/common'; +interface FetchDataParams { + // The start timestamp in milliseconds of the queried time interval + startTime: string; + // The end timestamp in milliseconds of the queried time interval + endTime: string; + // The aggregation bucket size in milliseconds if applicable to the data source + bucketSize: string; +} + +export type FetchData = ( + fetchDataParams: FetchDataParams +) => Promise; +export type HasData = () => Promise; + interface DataHandler { fetchData: FetchData; hasData: HasData; diff --git a/x-pack/plugins/observability/public/typings/data_handler/index.d.ts b/x-pack/plugins/observability/public/typings/fetch_data_response/index.d.ts similarity index 76% rename from x-pack/plugins/observability/public/typings/data_handler/index.d.ts rename to x-pack/plugins/observability/public/typings/fetch_data_response/index.d.ts index b4e85ed21eefa7..30ecb24a58a5a5 100644 --- a/x-pack/plugins/observability/public/typings/data_handler/index.d.ts +++ b/x-pack/plugins/observability/public/typings/fetch_data_response/index.d.ts @@ -31,7 +31,7 @@ interface Series { color?: string; } -interface FetchDataResponse { +export interface FetchDataResponse { title: string; appLink: string; } @@ -84,17 +84,3 @@ export interface ObservabilityFetchDataResponse { infra_logs: LogsFetchDataResponse; uptime: UptimeFetchDataResponse; } - -interface FetchDataParams { - // The start timestamp in milliseconds of the queried time interval - startTime: string; - // The end timestamp in milliseconds of the queried time interval - endTime: string; - // The aggregation bucket size in milliseconds if applicable to the data source - bucketSize: string; -} - -export type FetchData = ( - fetchDataParams: FetchDataParams -) => Promise; -type HasData = () => Promise;