feat(plugins): add clipboard image and media URL APIs

This commit is contained in:
t8y2 committed 2026-09-27 09:52:03 +08:00
1 parent 0ea6598c90
commit 422908e78f
10 files changed
+494 -23

No files matched your search

+8
View File
@@ -5372,6 +5372,14 @@ export async function closePluginLocalFile(_pluginId: string, _handleId: string)
throw new Error("Plugin local file access is not available in the web backend");
}
export async function openPluginMedia(_pluginId: string, _method: string, _params: Record<string, unknown>): Promise<string> {
throw new Error("Plugin media URLs are not available in the web backend");
}
export async function closePluginMedia(_pluginId: string, _token: string): Promise<void> {
throw new Error("Plugin media URLs are not available in the web backend");
}
// Plugin UI storage goes through the Rust plugin-data tree on native hosts;
// the web workbench host keeps its localStorage fallback in the component, so
// these only exist to satisfy the shared backend surface.
+8
View File
@@ -2673,6 +2673,14 @@ export async function closePluginLocalFile(pluginId: string, handleId: string):
return invoke("plugin_file_close", { pluginId, handleId });
}
export async function openPluginMedia(pluginId: string, method: string, params: Record<string, unknown>): Promise<string> {
return invoke("plugin_media_open", { pluginId, method, params });
}
export async function closePluginMedia(pluginId: string, token: string): Promise<void> {
return invoke("plugin_media_close", { pluginId, token });
}
export async function getPluginUiStorage(pluginId: string, key: string): Promise<unknown> {
return invoke("plugin_ui_storage_get", { pluginId, key });
}