Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript: drawHTML is not exported by node_modules/rasterizehtml/dist/rasterizeHTML.js #215

Open
nhatlang19 opened this issue Oct 23, 2021 · 1 comment

Comments

@nhatlang19
Copy link

Any helps?

I using rollup to build my system
Screen Shot 2021-10-24 at 1 09 37 AM

This is my code

import * as rasterizeHTML from 'rasterizehtml’;
const canvas = document.createElement('canvas');
canvas.height = el.offsetHeight;
 canvas.width = el.offsetWidth;
            
rasterizeHTML.drawHTML(el.outerHTML, canvas);
reviewImage = canvas.toDataURL('image/jpeg');
@cburgmer
Copy link
Owner

I haven't used rasterizeHTML.js with TypeScript. But somebody back then was nice enough to set it up, in a way similar to what is described under https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html.

So, there is a type description shipped under dist/rasterizeHTML.d.ts, which should do the job.

I haven't configured Rollup myself before, so can't offer any help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants