0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

feat(plugins-runtime): add method for pages

This commit is contained in:
alonso.torres 2024-07-23 13:31:41 +02:00 committed by Alonso Torres
parent a5547755b5
commit 9a9b33a8fe
2 changed files with 16 additions and 1 deletions

View file

@ -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<Uint8Array>;
}
/**

View file

@ -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;