Skip to content

Commit

Permalink
Small refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuznietsov committed Jun 22, 2021
1 parent 447ca29 commit 5520b09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { DefaultInterpreterRenderHandlers, InterpreterRenderHandlers } from './types';

export function getDefaultHandlers<T = {}>(): InterpreterRenderHandlers<T> {
return new DefaultInterpreterRenderHandlers<T>() as InterpreterRenderHandlers<T>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
export * from './types';
export * from './expression_renderer';
export * from './expression_renderer_registry';
export * from './expression_handlers';
4 changes: 0 additions & 4 deletions src/plugins/expressions/common/expression_renderers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,3 @@ export class DefaultInterpreterRenderHandlers<Emitters = {}> implements IInterpr
}

export type InterpreterRenderHandlers<T = {}> = T & DefaultInterpreterRenderHandlers<T>;

export function getDefaultHandlers<T = {}>(): InterpreterRenderHandlers<T> {
return new DefaultInterpreterRenderHandlers<T>() as InterpreterRenderHandlers<T>;
}

0 comments on commit 5520b09

Please sign in to comment.