Skip to content

Commit

Permalink
Add interface for expression Images
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeelmers committed Jun 10, 2019
1 parent 3b1f5f9 commit 52b752c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/legacy/core_plugins/interpreter/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export {
DatatableColumn,
DatatableRow,
DatatableColumnType,
ExpressionImage,
Filter,
InterpreterError,
InterpreterErrorType,
isDatatable,
KibanaContext,
KibanaDatatable,
Expand Down
10 changes: 8 additions & 2 deletions src/legacy/core_plugins/interpreter/common/types/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ import { Render } from './render';

const name = 'image';

export const image = (): ExpressionTypeDef<typeof name, undefined> => ({
export interface ExpressionImage {
type: 'image';
mode: string;
dataurl: string;
}

export const image = (): ExpressionTypeDef<typeof name, ExpressionImage> => ({
name,
to: {
render: <T>(input: T): Render<T> => {
render: (input): Render<Pick<ExpressionImage, 'mode' | 'dataurl'>> => {
return {
type: 'render',
as: 'image',
Expand Down
1 change: 1 addition & 0 deletions src/legacy/core_plugins/interpreter/common/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const typeSpecs = [
export * from './datatable';
export * from './error';
export * from './filter';
export * from './image';
export * from './kibana_context';
export * from './kibana_datatable';
export * from './pointseries';
Expand Down

0 comments on commit 52b752c

Please sign in to comment.