Add .gitignore to exclude all node packages and lock files

This commit is contained in:
Adolfo Reyna
2026-02-23 21:56:04 -05:00
parent faae96c9ed
commit dcc5c6c044
9747 changed files with 1555105 additions and 2 deletions
@@ -0,0 +1,30 @@
import { compose } from './compose';
export const createFrame = async ({ div, width, height, logLevel, internalState, }) => {
const canvas = new OffscreenCanvas(width, height);
const context = canvas.getContext('2d');
if (!context) {
throw new Error('Could not get context');
}
await compose({
element: div,
context,
logLevel,
parentRect: new DOMRect(0, 0, width, height),
internalState,
onlyBackgroundClip: false,
});
return canvas;
};
export const takeScreenshot = async ({ div, width, height, imageFormat, logLevel, internalState, }) => {
const frame = await createFrame({
div,
width,
height,
logLevel,
internalState,
});
const imageData = await frame.convertToBlob({
type: `image/${imageFormat}`,
});
return imageData;
};