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

FormatOptions type does not support format: "sixteens" #27

Open
AlijaDelic opened this issue Apr 4, 2024 · 4 comments
Open

FormatOptions type does not support format: "sixteens" #27

AlijaDelic opened this issue Apr 4, 2024 · 4 comments

Comments

@AlijaDelic
Copy link

Hello,

I see that description says that format should support "sixteens" but in https://github.com/a2800276/hexy.js/blob/main/index.d.ts#L8C11-L8C12 it is not, even though it is used in code:
https://github.com/a2800276/hexy.js/blob/main/hexy.js#L271

Extending a type should be enough.

Thanks and regards

@a2800276
Copy link
Owner

a2800276 commented Apr 4, 2024

Thanks for the issue. I'm not sure I understand what you mean. Could you please provide a concrete example of what you are doing, the results you expect and the results you are getting?
Thank!

@AlijaDelic
Copy link
Author

`import { FormatOptions } from "hexy";

const formatOptions: FormatOptions = {
format: "sixteens"
}`

this code ends with type error:
Type '"sixteens"' is not assignable to type '"eights" | "fours" | "twos" | "none" | undefined'.

@AlijaDelic
Copy link
Author

Editing this line
https://github.com/a2800276/hexy.js/blob/main/index.d.ts#L8

to
format?: "sixteens" | "eights" | "fours" | "twos" | "none";

is going to be enough.
Everything works fine after this.

Thanks again for this code, it saved me a lot of time

@rom-p
Copy link
Contributor

rom-p commented Apr 8, 2024

I introduced the "sixteens" mode, but missed the module declaration file. I think that the change proposed above should work fine.

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

3 participants