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

26 lines
3.5 KiB
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExpressionAstFunctionBuilder](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.md)
## ExpressionAstFunctionBuilder interface
<b>Signature:</b>
```typescript
export interface ExpressionAstFunctionBuilder<FnDef extends AnyExpressionFunctionDefinition = AnyExpressionFunctionDefinition>
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [addArgument](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.addargument.md) | <code>&lt;A extends FunctionArgName&lt;FnDef&gt;&gt;(name: A, value: FunctionArgs&lt;FnDef&gt;[A] &#124; ExpressionAstExpressionBuilder) =&gt; this</code> | Adds an additional argument to the function. For multi-args, this should be called once for each new arg. Note that TS will not enforce whether multi-args are available, so only use this to update an existing arg if you are certain it is a multi-arg. |
| [arguments](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.arguments.md) | <code>FunctionBuilderArguments&lt;FnDef&gt;</code> | Object of all args currently added to the function. This is structured similarly to <code>ExpressionAstFunction['arguments']</code>, however any subexpressions are returned as expression builder instances instead of expression ASTs. |
| [getArgument](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.getargument.md) | <code>&lt;A extends FunctionArgName&lt;FnDef&gt;&gt;(name: A) =&gt; Array&lt;FunctionArgs&lt;FnDef&gt;[A] &#124; ExpressionAstExpressionBuilder&gt; &#124; undefined</code> | Retrieves an existing argument by name. Useful when you want to retrieve the current array of args and add something to it before calling <code>replaceArgument</code>. Any subexpression arguments will be returned as expression builder instances. |
| [name](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.name.md) | <code>InferFunctionDefinition&lt;FnDef&gt;['name']</code> | Name of this expression function. |
| [removeArgument](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.removeargument.md) | <code>&lt;A extends OptionalKeys&lt;FunctionArgs&lt;FnDef&gt;&gt;&gt;(name: A) =&gt; this</code> | Removes an (optional) argument from the function.<!-- -->TypeScript will enforce that you only remove optional arguments. For manipulating required args, use <code>replaceArgument</code>. |
| [replaceArgument](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.replaceargument.md) | <code>&lt;A extends FunctionArgName&lt;FnDef&gt;&gt;(name: A, value: Array&lt;FunctionArgs&lt;FnDef&gt;[A] &#124; ExpressionAstExpressionBuilder&gt;) =&gt; this</code> | Overwrites an existing argument with a new value. In order to support multi-args, the value given must always be an array. |
| [toAst](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.toast.md) | <code>() =&gt; ExpressionAstFunction</code> | Converts function to an AST. <code>ExpressionAstFunction</code> |
| [toString](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.tostring.md) | <code>() =&gt; string</code> | Converts function to an expression string. <code>string</code> |
| [type](./kibana-plugin-plugins-expressions-public.expressionastfunctionbuilder.type.md) | <code>'expression_function_builder'</code> | Used to identify expression function builder objects. |