diff --git a/libs/plugin-types/index.d.ts b/libs/plugin-types/index.d.ts index f0dce08..72975cd 100644 --- a/libs/plugin-types/index.d.ts +++ b/libs/plugin-types/index.d.ts @@ -207,7 +207,7 @@ export interface PenpotFile extends PenpotPluginData { * - `'penpot'` will create a *.penpot file with a binary representation of the file * - `'zip'` will create a *.zip with the file exported in several SVG files with some JSON metadata */ - export(exportType: 'penpot' | 'zip'): Uint8Array; + export(exportType: 'penpot' | 'zip'): Promise; } /** diff --git a/libs/plugins-runtime/src/lib/api/index.ts b/libs/plugins-runtime/src/lib/api/index.ts index dbb9c6c..847d7da 100644 --- a/libs/plugins-runtime/src/lib/api/index.ts +++ b/libs/plugins-runtime/src/lib/api/index.ts @@ -368,6 +368,21 @@ export function createApi(context: PenpotContext, manifest: Manifest): Penpot { checkPermission('content:read'); return context.generateStyle(shapes, options); }, + + openViewer(): void { + checkPermission('content:read'); + context.openViewer(); + }, + + createPage(): PenpotPage { + checkPermission('content:write'); + return context.createPage(); + }, + + openPage(page: PenpotPage): void { + checkPermission('content:read'); + context.openPage(page); + }, }; return penpot;