kibana/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.executioncontract.md
2020-09-30 09:10:28 +02:00

2.6 KiB

Home > kibana-plugin-plugins-expressions-public > ExecutionContract

ExecutionContract class

ExecutionContract is a wrapper around Execution class. It provides the same functionality but does not expose Expressions plugin internals.

Signature:

export declare class ExecutionContract<ExtraContext extends Record<string, unknown> = Record<string, unknown>, Input = unknown, Output = unknown, InspectorAdapters = unknown> 

Constructors

Constructor Modifiers Description
(constructor)(execution) Constructs a new instance of the ExecutionContract class

Properties

Property Modifiers Type Description
cancel () => void Cancel the execution of the expression. This will set abort signal (available in execution context) to aborted state, letting expression functions to stop their execution.
execution Execution<ExtraContext, Input, Output, InspectorAdapters>
getAst () => ExpressionAstExpression Get AST used to execute the expression.
getData () => Promise<Output | ExpressionValueError> Returns the final output of expression, if any error happens still wraps that error into ExpressionValueError type and returns that. This function never throws.
getExpression () => string Get string representation of the expression. Returns the original string if execution was started from a string. If execution was started from an AST this method returns a string generated from AST.
inspect () => InspectorAdapters Get Inspector adapters provided to all functions of expression through execution context.
isPending boolean