import { UnwrapPromiseOrReturn } from '@osd/utility-types' ; import { ArgumentType } from './arguments' ; import { TypeToString } from '../types/common' ; import { ExecutionContext } from '../execution/types' ; import { ExpressionFunctionClog , ExpressionFunctionFont , ExpressionFunctionOpenSearchDashboardsContext , ExpressionFunctionOpenSearchDashboards , ExpressionFunctionVarSet , ExpressionFunctionVar , ExpressionFunctionTheme , } from './specs' ; /**
 * `ExpressionFunctionDefinition` is the interface plugins have to implement to
 * register a function in `expressions` plugin.
 */ export interface ExpressionFunctionDefinition < Name extends string , Input , Arguments extends Record < string , any > , Output , Context extends ExecutionContext = ExecutionContext > { /**
     * The name of the function, as will be used in expression.
     */ name : Name ; /**
     * Name of type of value this function outputs.
     */ type ? : TypeToString < UnwrapPromiseOrReturn < Output > > ; /**
     * List of allowed type names for input value of this function. If this
     * property is set the input of function will be cast to the first possible
     * type in this list. If this property is missing the input will be provided
     * to the function as-is.
     */ inputTypes ? : Array < TypeToString < Input > > ; /**
     * Specification of arguments that function supports. This list will also be
     * used for autocomplete functionality when your function is being edited.
     */ args : { [ key in keyof Arguments ] : ArgumentType < Arguments [ key ] > ; } ; todo aliases ? : string [ ] ; /**
     * Help text displayed in the Expression editor. This text should be
     * internationalized.
     */ help : string ; param input param args param context fn ( input , args , context ) : Output ; deprecated context ? : { deprecated types : AnyExpressionFunctionDefinition [ 'inputTypes' ] ; } ; } /**
 * Type to capture every possible expression function definition.
 */ export type AnyExpressionFunctionDefinition = ExpressionFunctionDefinition < string , any , Record < string , any > , any > ; public export interface ExpressionFunctionDefinitions { clog : ExpressionFunctionClog ; font : ExpressionFunctionFont ; opensearch_dashboards_context : ExpressionFunctionOpenSearchDashboardsContext ; opensearchDashboards : ExpressionFunctionOpenSearchDashboards ; var_set : ExpressionFunctionVarSet ; var : ExpressionFunctionVar ; theme : ExpressionFunctionTheme ; }