跳转到内容

命令与 hooks

通过 ExtensionContext 注册已声明的贡献点。格式化器返回文本,由宿主执行可撤销编辑。Hooks 需 API 3.3,只能返回事件文档的修改计划,没有环境文件、网络或 DOM 权限。Hooks 在本地修改成功后运行,失败不回滚此前修改。表格命令更新前必须等待 declareOutputs,取消会保留已完成的写入。

使用指南: actions. API 索引.

签名、参数及返回类型从 SDK 自动生成;可选成员不保证在每个宿主和上下文中存在。

源码

支持宿主: Lite Mobile

readonly event: FileHookEvent;

支持宿主: Lite Mobile

readonly signal: AbortSignal;

支持宿主: Lite Mobile

readonly settings: Readonly<Record<string, SettingValue>>;

关联类型: FileHookEvent, SettingValue.

源码

支持宿主: Lite Mobile

export type FileHookHandler = (context: FileHookContext) => FileHookPlan | void | Promise<FileHookPlan | void>;

关联类型: FileHookContext, FileHookPlan.

源码

支持宿主: Lite

format(input: FormatterInput): {
text: string;
} | Promise<{
text: string;
}>;
参数 类型 必填
input FormatterInput 是

返回值: { text: string; } &#124; Promise<{ text: string; }>.

关联类型: FormatterInput.

源码

支持宿主: Lite Mobile

readonly eidos: {
readonly table: Pick<EidosTable, "tableId" | "viewId" | "readContext">;
readonly config: Pick<EidosConfig, "read">;
};

支持宿主: Lite Mobile

readonly target: {
count: number;
readRows(options: {
offset: number;
limit: number;
fields: string[];
}): Promise<TableActionRecord[]>;
update(input: {
readToken: string;
values: Record<string, LogicalValue>;
}): Promise<void>;
};

支持宿主: Lite Mobile

readonly connections: {
request(input: {
connection: string;
body: JsonObject;
}): Promise<JsonObject>;
};

支持宿主: Lite Mobile

readonly task: {
declareOutputs(rows: Array<{
readToken: string;
values: Record<string, LogicalValue>;
}>): Promise<void>;
report(progress: {
completed: number;
message?: string;
}): Promise<void>;
};

关联类型: EidosTable, EidosConfig, TableActionRecord.

源码

支持宿主: Lite Mobile

getItems(context: {
readonly i18n: PluginI18n;
readonly signal: AbortSignal;
readonly capabilities: Pick<TableActionCapabilities, "eidos">;
}): Promise<TableActionItem[]> | TableActionItem[];
参数 类型 必填
context { readonly i18n: PluginI18n; readonly signal: AbortSignal; readonly capabilities: Pick<TableActionCapabilities, "eidos">; } 是

返回值: Promise<TableActionItem[]> &#124; TableActionItem[].

支持宿主: Lite Mobile

run(context: TableActionContext, itemId: string): Promise<void>;
参数 类型 必填
context TableActionContext 是
itemId string 是

返回值: Promise<void>.

关联类型: PluginI18n, TableActionCapabilities, TableActionItem, TableActionContext.