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

1.5 KiB

Home > kibana-plugin-plugins-expressions-server > buildExpressionFunction

buildExpressionFunction() function

Manages an AST for a single expression function. The return value can be provided to buildExpression to add this function to an expression.

Note that to preserve type safety and ensure no args are missing, all required arguments for the specified function must be provided up front. If desired, they can be changed or removed later.

Signature:

export declare function buildExpressionFunction<FnDef extends AnyExpressionFunctionDefinition = AnyExpressionFunctionDefinition>(fnName: InferFunctionDefinition<FnDef>['name'], 
initialArgs: {
    [K in keyof FunctionArgs<FnDef>]: FunctionArgs<FnDef>[K] | ExpressionAstExpressionBuilder | ExpressionAstExpressionBuilder[];
}): ExpressionAstFunctionBuilder<FnDef>;

Parameters

Parameter Type Description
fnName InferFunctionDefinition<FnDef>['name']
initialArgs {
[K in keyof FunctionArgs<FnDef>]: FunctionArgs<FnDef>[K] | ExpressionAstExpressionBuilder | ExpressionAstExpressionBuilder[];
}

Returns:

ExpressionAstFunctionBuilder<FnDef>