命令与 hooks
通过 ExtensionContext 注册已声明的贡献点。格式化器返回文本,由宿主执行可撤销编辑。Hooks 需 API 3.3,只能返回事件文档的修改计划,没有环境文件、网络或 DOM 权限。Hooks 在本地修改成功后运行,失败不回滚此前修改。表格命令更新前必须等待 declareOutputs,取消会保留已完成的写入。
签名、参数及返回类型从 SDK 自动生成;可选成员不保证在每个宿主和上下文中存在。
FileHookContext
Section titled “FileHookContext”FileHookContext.event
Section titled “FileHookContext.event”支持宿主: Lite Mobile
readonly event: FileHookEvent;FileHookContext.signal
Section titled “FileHookContext.signal”支持宿主: Lite Mobile
readonly signal: AbortSignal;FileHookContext.settings
Section titled “FileHookContext.settings”支持宿主: Lite Mobile
readonly settings: Readonly<Record<string, SettingValue>>;关联类型: FileHookEvent, SettingValue.
FileHookHandler
Section titled “FileHookHandler”支持宿主: Lite Mobile
export type FileHookHandler = (context: FileHookContext) => FileHookPlan | void | Promise<FileHookPlan | void>;关联类型: FileHookContext, FileHookPlan.
FormatterProvider
Section titled “FormatterProvider”FormatterProvider.format
Section titled “FormatterProvider.format”支持宿主: Lite
format(input: FormatterInput): { text: string;} | Promise<{ text: string;}>;| 参数 | 类型 | 必填 |
|---|---|---|
input |
FormatterInput |
是 |
返回值: { text: string; } | Promise<{ text: string; }>.
关联类型: FormatterInput.
TableActionCapabilities
Section titled “TableActionCapabilities”TableActionCapabilities.eidos
Section titled “TableActionCapabilities.eidos”支持宿主: Lite Mobile
readonly eidos: { readonly table: Pick<EidosTable, "tableId" | "viewId" | "readContext">; readonly config: Pick<EidosConfig, "read">;};TableActionCapabilities.target
Section titled “TableActionCapabilities.target”支持宿主: 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>;};TableActionCapabilities.connections
Section titled “TableActionCapabilities.connections”支持宿主: Lite Mobile
readonly connections: { request(input: { connection: string; body: JsonObject; }): Promise<JsonObject>;};TableActionCapabilities.task
Section titled “TableActionCapabilities.task”支持宿主: 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.
TableActionProvider
Section titled “TableActionProvider”TableActionProvider.getItems
Section titled “TableActionProvider.getItems”支持宿主: 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[]> | TableActionItem[].
TableActionProvider.run
Section titled “TableActionProvider.run”支持宿主: Lite Mobile
run(context: TableActionContext, itemId: string): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
context |
TableActionContext |
是 |
itemId |
string |
是 |
返回值: Promise<void>.
关联类型: PluginI18n, TableActionCapabilities, TableActionItem, TableActionContext.