custom-functions-runtime package

CustomFunctions.Error

使用此类来处理错误并编写自定义错误消息。

接口

CustomFunctions.CancelableInvocation

提供有关可取消自定义函数的调用的信息。 可取消的自定义函数可以为 onCanceled 事件提供处理程序。

若要指示函数可取消,请在元数据 JSON 文件中,函数选项应指定: { "cancelable": true }

如果元数据 JSON 文件是从 JSDoc 注释生成的,请包含 标记 @cancelable

CustomFunctions.Invocation

提供有关调用自定义函数的信息。

CustomFunctions.StreamingInvocation

提供有关流式处理自定义函数的调用的信息。 流式处理自定义函数可以提供随时间变化的结果。

调用 setResult() 一次或多次以提供结果,而不是从 函数返回结果。

枚举

CustomFunctions.ErrorCode

自定义函数的错误代码。 错误代码将显示在调用函数的单元格中。

除了这些错误代码外,还显示自定义错误消息。 自定义消息显示在错误指示器菜单中,可通过将鼠标悬停在每个单元格上的错误标志上并显示错误来访问该菜单。

函数

CustomFunctions.associate(id, functionObject)

将 JavaScript 函数与元数据 JSON 文件中的“id”属性提供的名称相关联。

CustomFunctions.associate(mappings)

将 JavaScript 函数与元数据 JSON 文件中的“id”属性提供的名称相关联。

函数详细信息

CustomFunctions.associate(id, functionObject)

将 JavaScript 函数与元数据 JSON 文件中的“id”属性提供的名称相关联。

export function associate(id: string, functionObject: Function): void;

参数

id

string

functionObject

Function

返回

void

CustomFunctions.associate(mappings)

将 JavaScript 函数与元数据 JSON 文件中的“id”属性提供的名称相关联。

export function associate(mappings: { [key: string]: Function }): void;

参数

mappings

{ [key: string]: Function }

返回

void