Skip to content

Commit

Permalink
ts fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Nov 26, 2019
1 parent 0107d9d commit e4eaa02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
ResponseFacade,
ReportingResponseToolkit,
Logger,
JobIDForImmediate,
JobDocOutputExecuted,
} from '../../types';
import { JobDocPayloadPanelCsv } from '../../export_types/csv_from_savedobject/types';
Expand Down Expand Up @@ -57,11 +56,7 @@ export function registerGenerateCsvFromSavedObjectImmediate(
content_type: jobOutputContentType,
content: jobOutputContent,
size: jobOutputSize,
}: JobDocOutputExecuted = await executeJobFn(
null as JobIDForImmediate,
jobDocPayload,
request
);
}: JobDocOutputExecuted = await executeJobFn(null, jobDocPayload, request);

logger.info(`Job output size: ${jobOutputSize} bytes`);

Expand Down
20 changes: 7 additions & 13 deletions x-pack/legacy/plugins/reporting/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,6 @@ export interface ESQueueWorker {
on: (event: string, handler: any) => void;
}

interface JobParamsSavedObject {
savedObjectType: string;
savedObjectId: string;
isImmediate: boolean;
}

type JobParamsUrl = object;

export type ESQueueCreateJobFn<JobParamsType> = (
jobParams: JobParamsType,
headers: Record<string, string>,
Expand All @@ -274,16 +266,18 @@ export type ImmediateCreateJobFn<JobParamsType> = (
jobParams: JobParamsType;
}>;

export type ESQueueWorkerExecuteFn<JobParamsType> = (
export type ESQueueWorkerExecuteFn<JobDocPayloadType> = (
jobId: string,
job: JobParamsType,
job: JobDocPayloadType,
cancellationToken?: CancellationToken
) => void;

export type JobIDForImmediate = null;

/*
* ImmediateExecuteFn receives the job doc payload because the payload was
* generated in the CreateFn
*/
export type ImmediateExecuteFn<JobParamsType> = (
jobId: JobIDForImmediate,
jobId: null,
job: JobDocPayload<JobParamsType>,
request: RequestFacade
) => Promise<JobDocOutputExecuted>;
Expand Down

0 comments on commit e4eaa02

Please sign in to comment.