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

Add TypeScript Support #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

cervantes-x
Copy link

This pull request introduces TypeScript support to the ReceiptPrinterEncoder.

@NielsLeenheer
Copy link
Owner

Thanks!

I'll take a look at it.

One thing I saw, was that you defined all the printers, codepage mappings and codepages. The code pages are imported from CodepageEncoder so it may make sense to define it there. Also the printers and mappings are automatically generated during build time, so perhaps the definitions for these could be in separate files and also be generated.

I'll be away for the next week or so, but after that I'll pick it up again.


qrcode(
value: string,
options: {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options is not mandatory. we can put a question mark there.

marginRight?: number;
paddingLeft?: number;
paddingRight?: number;
align: "left" | "right";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from my experience, "center" works with box as well.

width?: number;
marginLeft?: number;
marginRight?: number;
align?: "left" | "right";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from my experience, "center" works with table as well.

@brugaspar
Copy link

+1
Would be great to have TypeScript support

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

Successfully merging this pull request may close these issues.

4 participants