bwip-js icon indicating copy to clipboard operation
bwip-js copied to clipboard

SVG related functions are not represented in the .d.ts files

Open waweber opened this issue 1 year ago • 4 comments

I'm using version 4.1.1 and the SVG related functions don't seem to be included in the declaration files for any platform.

waweber avatar Oct 25 '23 02:10 waweber

I discovered this issue about 3 days ago and the fix is already queued up on my local branch. I am expecting to cut the release - which addresses #306 - this weekend. In the interim, if you want to manually add in the definitions:

    export function toSVG(opts: RenderOptions): string;
    export function drawingSVG(): DrawingContext<string>;

They will appear immediately above the // platform-specific exports comment.

metafloor avatar Oct 25 '23 03:10 metafloor

Was testing the new version and got the found de same issue.

When trying to use the toSVG function I get a TS error:

Property 'toSVG' does not exist on type 'typeof BwipJs'.ts(2339)

hatsantos avatar Nov 01 '23 20:11 hatsantos

v4.1.2 now contains the SVG declarations. Please give it a try.

metafloor avatar Nov 01 '23 20:11 metafloor

Looks good to me! 💯

Thank you.

hatsantos avatar Nov 03 '23 09:11 hatsantos