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

"enum Format" doesn't have export keyword #74

Open
GoodSimonVM opened this issue Jun 28, 2022 · 1 comment
Open

"enum Format" doesn't have export keyword #74

GoodSimonVM opened this issue Jun 28, 2022 · 1 comment

Comments

@GoodSimonVM
Copy link

GoodSimonVM commented Jun 28, 2022

I think we need to replace the declare keyword to export to declare enum Format in index.d.ts
I try convert svg to jpeg:

import { default as svg2img, Format, ResvgRenderOptions, svg2imgOptions } from "svg2img";
svg2img(pathToSvgFile, { format: Format.jpg, 'quality': 75 }, saveCallback);

But I can't do it, because I get error from tsc on import { Format } from "svg2img";:

Module '"svg2img"' has no exported member 'Format'.

Also, I can't use string for format option:

svg2img(pathToSvgFile, { format: 'jpg', 'quality': 75 }, saveCallback);

Because I get this error:

Type '"jpg"' is not assignable to type 'Format | undefined'. Did you mean 'Format.jpeg'?
@WhosyVox
Copy link

WhosyVox commented Apr 7, 2023

It looks like the issue was resolved some 9 months ago by converting it to a type, but that change never made it to npm.

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