ui 与 resources
调用前检查可选 UI 方法。exportFile 接受不含目录的文件名及最多 16 MiB 数据;Lite 显示保存对话框,Serve 发起下载,命令和移动端不提供此方法。它不需要文件写入权限。Lite resources 需要 workspace 文件读取权限,从绑定文件解析路径,在 Space 内最多渲染 12 个只读面板,不支持嵌套 Dashboard。View 关闭时应释放挂载。
签名、参数及返回类型从 SDK 自动生成;可选成员不保证在每个宿主和上下文中存在。
ResourceMount
Section titled “ResourceMount”interface ResourceMount extends Disposable { /* members below */ }ResourceMount.refresh
Section titled “ResourceMount.refresh”支持宿主: Lite
重新加载引用的资源。
refresh(): Promise<void>;返回值: Promise<void>.
关联类型: Disposable.
HostResources
Section titled “HostResources”HostResources.listViews
Section titled “HostResources.listViews”支持宿主: Lite
列出相对路径可用的文件预览或已保存的 Eidos 视图。
listViews(path: string): Promise<ResourceViewInfo[]>;| 参数 | 类型 | 必填 |
|---|---|---|
path |
string |
是 |
返回值: Promise<ResourceViewInfo[]>.
HostResources.mount
Section titled “HostResources.mount”支持宿主: Lite
在矩形元素中挂载由宿主渲染的只读资源。
mount(element: HTMLElement, source: ResourceSource): Promise<ResourceMount>;| 参数 | 类型 | 必填 |
|---|---|---|
element |
HTMLElement |
是 |
source |
ResourceSource |
是 |
返回值: Promise<ResourceMount>.
关联类型: ResourceViewInfo, ResourceSource, ResourceMount.
HostUI
Section titled “HostUI”HostUI.resources
Section titled “HostUI.resources”支持宿主: Lite
resources?: HostResources;HostUI.notify
Section titled “HostUI.notify”支持宿主: Lite Serve Mobile
显示宿主通知。
notify(message: string): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
message |
string |
是 |
返回值: Promise<void>.
HostUI.exportFile
Section titled “HostUI.exportFile”支持宿主: Lite Serve
请求宿主导出生成的字节,取消是正常返回结果。
exportFile?(request: FileExportRequest): Promise<FileExportResult>;| 参数 | 类型 | 必填 |
|---|---|---|
request |
FileExportRequest |
是 |
返回值: Promise<FileExportResult>.
HostUI.openFile
Section titled “HostUI.openFile”支持宿主: Lite Mobile
在宿主中打开已有的 Space 相对路径文件。
openFile?(relativePath: string): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
relativePath |
string |
是 |
返回值: Promise<void>.
HostUI.navigate
Section titled “HostUI.navigate”支持宿主: Lite Mobile
跳转到插件的页面 View,可传入页面路由。
navigate?(viewId: string, route?: string): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
viewId |
string |
是 |
route |
string |
否 |
返回值: Promise<void>.