Skip to content

Commit

Permalink
Fixed ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Oct 25, 2021
1 parent 4724744 commit c68acf8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getQueryFilters } from '../../../common/lib/build_embeddable_filters';
import { decode, encode } from '../../../common/lib/embeddable_dataurl';
import { InitializeArguments } from '.';

interface Arguments {
export interface Arguments {
config: string;
type: string;
}
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/canvas/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export const initializeCanvas = async (
prependBasePath: coreStart.http.basePath.prepend,
types: setupPlugins.expressions.getTypes(),
paletteService: await setupPlugins.charts.palettes.getPalettes(),
embeddablesService: startPlugins.embeddable,
});

for (const fn of canvasFunctions) {
Expand Down
10 changes: 6 additions & 4 deletions x-pack/plugins/canvas/types/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { UnwrapPromiseOrReturn } from '@kbn/utility-types';
import { functions as commonFunctions } from '../canvas_plugin_src/functions/common';
import { functions as browserFunctions } from '../canvas_plugin_src/functions/browser';
import { functions as serverFunctions } from '../canvas_plugin_src/functions/server';
import { functions as externalFunctions } from '../canvas_plugin_src/functions/external';
import { initFunctions } from '../public/functions';
import { initFunctions as initExternalFunctions } from '../canvas_plugin_src/functions/external';
import { initFunctions as initClientFunctions } from '../public/functions';

/**
* A `ExpressionFunctionFactory` is a powerful type used for any function that produces
Expand Down Expand Up @@ -90,9 +90,11 @@ export type FunctionFactory<FnFactory> =
type CommonFunction = FunctionFactory<typeof commonFunctions[number]>;
type BrowserFunction = FunctionFactory<typeof browserFunctions[number]>;
type ServerFunction = FunctionFactory<typeof serverFunctions[number]>;
type ExternalFunction = FunctionFactory<typeof externalFunctions[number]>;
type ExternalFunction = FunctionFactory<
ReturnType<typeof initExternalFunctions> extends Array<infer U> ? U : never
>;
type ClientFunctions = FunctionFactory<
ReturnType<typeof initFunctions> extends Array<infer U> ? U : never
ReturnType<typeof initClientFunctions> extends Array<infer U> ? U : never
>;

/**
Expand Down

0 comments on commit c68acf8

Please sign in to comment.