Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
wylieconlon committed Aug 12, 2020
1 parent ac0495d commit 02fd473
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Ast } from '@kbn/interpreter/common';
import { buildExpression } from '../../../../../src/plugins/expressions/public';
import { createMockDatasource } from '../editor_frame_service/mocks';
import { DatatableVisualizationState, datatableVisualization } from './visualization';
Expand Down Expand Up @@ -339,7 +340,7 @@ describe('Datatable Visualization', () => {
label: 'label',
});

const expression = datatableVisualization.toExpression({ layers: [layer] }, frame);
const expression = datatableVisualization.toExpression({ layers: [layer] }, frame) as Ast;
const tableArgs = buildExpression(expression).findFunction('lens_datatable_columns');

expect(tableArgs).toHaveLength(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Ast } from '@kbn/interpreter/common';
import { i18n } from '@kbn/i18n';
import { SuggestionRequest, Visualization, VisualizationSuggestion, Operation } from '../types';
import chartTableSVG from '../assets/chart_datatable.svg';
Expand Down Expand Up @@ -185,7 +186,7 @@ export const datatableVisualization: Visualization<
};
},

toExpression(state, frame) {
toExpression(state, frame): Ast {
const layer = state.layers[0];
const datasource = frame.datasourceLayers[layer.layerId];
const originalOrder = datasource.getTableSpec().map(({ columnId }) => columnId);
Expand Down

0 comments on commit 02fd473

Please sign in to comment.