0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/ui-src/parser/creators/createPage.ts
Jordi Sala Morales 1f8f4bf539
Add more loaders so we can track the progress better (#145)
* Add more loaders so we can track the progress better

* fix lint
2024-06-06 17:24:59 +02:00

20 lines
480 B
TypeScript

// @TODO: Direct import on purpose, to avoid problems with the tsc linting
import { sleep } from '@plugin/utils/sleep';
import { PenpotFile } from '@ui/lib/types/penpotFile';
import { PenpotPage } from '@ui/lib/types/penpotPage';
import { createItems } from '.';
export const createPage = async (
file: PenpotFile,
{ name, options, children = [] }: PenpotPage
) => {
file.addPage(name, options);
createItems(file, children);
await sleep(0);
file.closePage();
};