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/converters/createPenpotArtboard.ts

23 lines
551 B
TypeScript
Raw Normal View History

import { PenpotFile } from '@ui/lib/penpot';
import { FRAME_TYPE } from '@ui/lib/types/frame/frameAttributes';
import { FrameShape } from '@ui/lib/types/frame/frameShape';
import { createPenpotItem } from '.';
export const createPenpotArtboard = (
file: PenpotFile,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
{ type, children = [], ...rest }: FrameShape
) => {
file.addArtboard({
type: FRAME_TYPE,
...rest
});
for (const child of children) {
createPenpotItem(file, child);
}
file.closeArtboard();
};