feat: add download file method for files generated by plugin

This commit is contained in:
Paulhenry Saux
2026-07-13 21:18:36 +02:00
committed by Linus Rath
parent a08a9e9ed3
commit a679d82cc3
4 changed files with 28 additions and 1 deletions
+3
View File
@@ -232,6 +232,9 @@ function buildPluginApi(manifest: PluginManifest) {
/** Opens an http/https URL in a new tab via host `window.open`. */
openExternalUrl: (url: string, target?: string) =>
callApi('ui.openExternalUrl', [url, target]) as Promise<void>,
/** Downloads a file generated by the plugin. Not a user's file or attachment. */
downloadFile: (opts: { content: string; filename: string; contentType?: string }) =>
callApi('ui.downloadFile', [opts]) as Promise<void>,
},
admin: {
getConfig: (key: string) => callApi('admin.getConfig', [key]),