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:
parent
a5547755b5
commit
9a9b33a8fe
2 changed files with 16 additions and 1 deletions
2
libs/plugin-types/index.d.ts
vendored
2
libs/plugin-types/index.d.ts
vendored
|
@ -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>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue