Skip to content

Commit

Permalink
fix typescripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Apr 7, 2021
1 parent fdc22a2 commit 0729616
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { SavedSearch, SortOrder } from '../../saved_searches/types';
import { AppState } from '../angular/discover_state';
import { getSortForSearchSource } from '../angular/doc_table';

interface SharingData {
export interface ISharingData {
columns: string[];
searchSource: SearchSourceFields;
}
Expand All @@ -25,7 +25,7 @@ export async function getSharingData(
currentSearchSource: ISearchSource,
state: AppState | SavedSearch,
config: IUiSettingsClient
): Promise<SharingData> {
): Promise<ISharingData> {
const searchSource = currentSearchSource.createCopy();
const index = searchSource.getField('index')!;

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/discover/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export function plugin(initializerContext: PluginInitializerContext) {

export { SavedSearch, SavedSearchLoader, createSavedSearchesLoader } from './saved_searches';
export { ISearchEmbeddable, SEARCH_EMBEDDABLE_TYPE, SearchInput } from './application/embeddable';
export { loadSharingDataHelpers } from './shared';
export { ISharingData, loadSharingDataHelpers } from './shared';
export { DISCOVER_APP_URL_GENERATOR, DiscoverUrlGeneratorState } from './url_generator';
2 changes: 2 additions & 0 deletions src/plugins/discover/public/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
export async function loadSharingDataHelpers() {
return await import('../application/helpers/get_sharing_data');
}

export { ISharingData } from '../application/helpers/get_sharing_data';
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@

import { i18n } from '@kbn/i18n';
import moment from 'moment-timezone';
import { CoreSetup } from 'src/core/public';
import {
loadSharingDataHelpers,
import type { CoreSetup } from 'src/core/public';
import type {
ISearchEmbeddable,
ISharingData,
SavedSearch,
SEARCH_EMBEDDABLE_TYPE,
} from '../../../../../src/plugins/discover/public';
import { IEmbeddable, ViewMode } from '../../../../../src/plugins/embeddable/public';
import {
IncompatibleActionError,
UiActionsActionDefinition as ActionDefinition,
} from '../../../../../src/plugins/ui_actions/public';
import { LicensingPluginSetup } from '../../../licensing/public';
loadSharingDataHelpers,
SEARCH_EMBEDDABLE_TYPE,
} from '../../../../../src/plugins/discover/public';
import type { IEmbeddable } from '../../../../../src/plugins/embeddable/public';
import { ViewMode } from '../../../../../src/plugins/embeddable/public';
import type { UiActionsActionDefinition as ActionDefinition } from '../../../../../src/plugins/ui_actions/public';
import { IncompatibleActionError } from '../../../../../src/plugins/ui_actions/public';
import type { LicensingPluginSetup } from '../../../licensing/public';
import { API_GENERATE_IMMEDIATE, CSV_REPORTING_ACTION } from '../../common/constants';
import { JobParamsDownloadCSV } from '../../server/export_types/csv_searchsource_immediate/types';
import type { JobParamsDownloadCSV } from '../../server/export_types/csv_searchsource_immediate/types';
import { checkLicense } from '../lib/license_check';

function isSavedSearchEmbeddable(
Expand Down Expand Up @@ -62,7 +64,10 @@ export class GetCsvReportPanelAction implements ActionDefinition<ActionContext>
});
}

public async getSearchSource(savedSearch: SavedSearch, embeddable: ISearchEmbeddable) {
public async getSearchSource(
savedSearch: SavedSearch,
embeddable: ISearchEmbeddable
): Promise<ISharingData> {
const { getSharingData } = await loadSharingDataHelpers();
return await getSharingData(
savedSearch.searchSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import { i18n } from '@kbn/i18n';
import moment from 'moment-timezone';
import React from 'react';
import { IUiSettingsClient, ToastsSetup } from 'src/core/public';
import { SearchSourceFields } from 'src/plugins/data/common';
import { ShareContext } from '../../../../../src/plugins/share/public';
import { LicensingPluginSetup } from '../../../licensing/public';
import type { IUiSettingsClient, ToastsSetup } from 'src/core/public';
import type { SearchSourceFields } from 'src/plugins/data/common';
import type { ShareContext } from '../../../../../src/plugins/share/public';
import type { LicensingPluginSetup } from '../../../licensing/public';
import { CSV_JOB_TYPE } from '../../common/constants';
import { JobParamsCSV } from '../../server/export_types/csv_searchsource/types';
import type { JobParamsCSV } from '../../server/export_types/csv_searchsource/types';
import { ReportingPanelContent } from '../components/reporting_panel_content_lazy';
import { checkLicense } from '../lib/license_check';
import { ReportingAPIClient } from '../lib/reporting_api_client';
import type { ReportingAPIClient } from '../lib/reporting_api_client';

interface ReportingProvider {
apiClient: ReportingAPIClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import { i18n } from '@kbn/i18n';
import moment from 'moment-timezone';
import React from 'react';
import { IUiSettingsClient, ToastsSetup } from 'src/core/public';
import { ShareContext } from '../../../../../src/plugins/share/public';
import { LicensingPluginSetup } from '../../../licensing/public';
import { LayoutParams } from '../../common/types';
import { JobParamsPNG } from '../../server/export_types/png/types';
import { JobParamsPDF } from '../../server/export_types/printable_pdf/types';
import type { IUiSettingsClient, ToastsSetup } from 'src/core/public';
import type { ShareContext } from '../../../../../src/plugins/share/public';
import type { LicensingPluginSetup } from '../../../licensing/public';
import type { LayoutParams } from '../../common/types';
import type { JobParamsPNG } from '../../server/export_types/png/types';
import type { JobParamsPDF } from '../../server/export_types/printable_pdf/types';
import { ScreenCapturePanelContent } from '../components/screen_capture_panel_content_lazy';
import { checkLicense } from '../lib/license_check';
import { ReportingAPIClient } from '../lib/reporting_api_client';
import type { ReportingAPIClient } from '../lib/reporting_api_client';

interface ReportingPDFPNGProvider {
apiClient: ReportingAPIClient;
Expand Down

0 comments on commit 0729616

Please sign in to comment.