kibana/docs/development/plugins/expressions/server/kibana-plugin-plugins-expressions-server.expressionfunction.md
Kibana Machine 32ebd0af7b
[Data cleanup] unify serializable state (#107745) (#108020)
* Use Serializable from package

* Rename to align with core

* fix

* more replacements

* docssss

* fix

* Move it to @kbn/utility-types and remove core export

* buildy build

* tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Liza Katz <lizka.k@gmail.com>
2021-08-10 13:33:44 +00:00

3.3 KiB

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

ExpressionFunction class

Signature:

export declare class ExpressionFunction implements PersistableState<ExpressionAstFunction['arguments']> 

Constructors

Constructor Modifiers Description
(constructor)(functionDefinition) Constructs a new instance of the ExpressionFunction class

Properties

Property Modifiers Type Description
accepts (type: string) => boolean
aliases string[] Aliases that can be used instead of name.
args Record<string, ExpressionFunctionParameter> Specification of expression function parameters.
disabled boolean
extract (state: ExpressionAstFunction['arguments']) => {
state: ExpressionAstFunction['arguments'];
references: SavedObjectReference[];
}
fn (input: ExpressionValue, params: Record<string, any>, handlers: object) => ExpressionValue Function to run function (context, args)
help string A short help text.
inject (state: ExpressionAstFunction['arguments'], references: SavedObjectReference[]) => ExpressionAstFunction['arguments']
inputTypes string[] | undefined Type of inputs that this function supports.
migrations {
[key: string]: (state: SerializableRecord) => SerializableRecord;
}
name string Name of function
telemetry (state: ExpressionAstFunction['arguments'], telemetryData: Record<string, any>) => Record<string, any>
type string Return type of function. This SHOULD be supplied. We use it for UI and autocomplete hinting. We may also use it for optimizations in the future.