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

template literals support: Only declares and type imports are allowed inside declare module. #188

Open
unional opened this issue Jun 27, 2022 · 1 comment

Comments

@unional
Copy link

unional commented Jun 27, 2022

Seems like there is a bug when transforming template literals:

export type StoreVersion = `${number}.${number}.${number}` | number;

transforms to:

declare export type StoreVersion = undefined: /* NO PRINT IMPLEMENTED: TemplateLiteralType */ any | number;

Which flowgen crash caused by SyntaxError when checking by pretter:

SyntaxError: Only declares and type imports are allowed inside declare module

I have a repo here: https://github.com/unional/global-store/tree/flow (pnpm build:flow)

@orta
Copy link
Collaborator

orta commented Jun 27, 2022

Nice find, open to a fix

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