Skip to content

Commit

Permalink
expose types for cachemanager
Browse files Browse the repository at this point in the history
Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
  • Loading branch information
ps48 committed Mar 19, 2024
1 parent b594e00 commit f1aef4f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 7 additions & 0 deletions common/types/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { EuiComboBoxOptionOption } from '@elastic/eui';
import { DirectQueryLoadingStatus } from './explorer';

export type AccelerationStatus = 'ACTIVE' | 'INACTIVE';

Expand Down Expand Up @@ -233,3 +234,9 @@ export interface CreateAccelerationForm {
refreshIntervalOptions: RefreshIntervalType;
formErrors: FormErrorsType;
}

export interface LoadCachehookOutput {
loadStatus: DirectQueryLoadingStatus;
startLoading: (dataSourceName: string, databaseName?: string, tableName?: string) => void;
stopLoading: () => void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const PreviewSQLDefinition = ({
path: `#/${accelerationFormData.dataSource}`,
state: {
language: 'sql',
queryToRun: '',
queryToRun: accelerationQueryBuilder(accelerationFormData),
},
});
}
Expand Down
12 changes: 4 additions & 8 deletions public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +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 { DirectQueryLoadingStatus } from '../common/types/explorer';
import { AssociatedObject, LoadCachehookOutput } from '../common/types/data_connections';
import { CatalogCacheManager } from './framework/catalog_cache/cache_manager';
import { AssistantSetup } from './types';

Expand All @@ -33,12 +32,6 @@ export interface SetupDependencies {
assistantDashboards?: AssistantSetup;
}

interface LoadCachehookOutput {
loadStatus: DirectQueryLoadingStatus;
startLoading: (dataSourceName: string, databaseName?: string, tableName?: string) => void;
stopLoading: () => void;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ObservabilitySetup {}

Expand All @@ -61,6 +54,9 @@ export interface ObservabilityStart {
useLoadAccelerationsToCacheHook: () => LoadCachehookOutput;
}

export type CatalogCacheManagerType = typeof CatalogCacheManager;
export type LoadCachehookOutputType = LoadCachehookOutput;

/**
* Introduce a compile dependency on dashboards-assistant
* as observerability need some types from the plugin.
Expand Down

0 comments on commit f1aef4f

Please sign in to comment.