Skip to content

Commit

Permalink
tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Aug 13, 2020
1 parent becc56f commit 934f94e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
22 changes: 19 additions & 3 deletions x-pack/plugins/file_upload/public/get_file_upload_component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { React } from 'react';
import React from 'react';
import { FeatureCollection } from 'geojson';

let lazyLoadPromise: Promise<React.ComponentType<unknown>>;
export interface FileUploadComponentProps {
appName: string;
isIndexingTriggered: boolean;
onFileUpload: (geojsonFile: FeatureCollection, name: string) => void;
onFileRemove: () => void;
onIndexReady: (indexReady: boolean) => void;
transformDetails: string;
onIndexingComplete: (indexResponses: {
indexDataResp: unknown;
indexPatternResp: unknown;
}) => void;
}

let lazyLoadPromise: Promise<React.ComponentType<FileUploadComponentProps>>;

export async function getFileUploadComponent(): Promise<React.ComponentType<unknown>> {
export async function getFileUploadComponent(): Promise<
React.ComponentType<FileUploadComponentProps>
> {
if (typeof lazyLoadPromise !== 'undefined') {
return lazyLoadPromise;
}
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/file_upload/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ import { FileUploadPlugin } from './plugin';
export function plugin() {
return new FileUploadPlugin();
}

export { FileUploadComponentProps } from './get_file_upload_component';
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { VectorLayer } from '../../layers/vector_layer/vector_layer';
// @ts-expect-error
import { createDefaultLayerDescriptor } from '../../sources/es_search_source';
import { RenderWizardArguments } from '../../layers/layer_wizard_registry';
import { FileUploadComponentProps } from '../../../../../file_upload/public';

export const INDEX_SETUP_STEP_ID = 'INDEX_SETUP_STEP_ID';
export const INDEXING_STEP_ID = 'INDEXING_STEP_ID';
Expand All @@ -32,12 +33,13 @@ enum INDEXING_STAGE {

interface State {
indexingStage: INDEXING_STAGE | null;
fileUploadComponent: React.ComponentType<FileUploadComponentProps> | null;
}

export class ClientFileCreateSourceEditor extends Component<RenderWizardArguments, State> {
private _isMounted: boolean = false;

state = {
state: State = {
indexingStage: null,
fileUploadComponent: null,
};
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/maps/public/kibana_services.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';
import { DataPublicPluginStart } from 'src/plugins/data/public';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { IndexPatternsService } from 'src/plugins/data/public/index_patterns';
import { NavigateToAppOptions } from 'kibana/public';
import { MapsConfigType } from '../config';
import { MapsLegacyConfigType } from '../../../../src/plugins/maps_legacy/public';
import { EmbeddableStart } from '../../../../src/plugins/embeddable/public';
import { FileUploadComponentProps } from '../../file_upload/public';

export function getLicenseId(): any;
export function getInspector(): any;
export function getFileUploadComponent(): Promise<any>;
export function getFileUploadComponent(): Promise<React.ComponentType<FileUploadComponentProps>>;
export function getIndexPatternSelectComponent(): any;
export function getHttp(): any;
export function getTimeFilter(): any;
Expand Down

0 comments on commit 934f94e

Please sign in to comment.