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

possible use for a suffix option? #5

Closed
bhenderson opened this issue Aug 27, 2021 · 2 comments
Closed

possible use for a suffix option? #5

bhenderson opened this issue Aug 27, 2021 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@bhenderson
Copy link
Contributor

I wanted to wrap the types in a namespace, so I set the prefix to be namespace DB { but I needed a closing }. I ended up just using fs to write it to the file, but I'm wondering if this would be a good use case for adding a suffix option.

By the way, I'm new to typings in javascript, but having the namespace made it so I didn't have to import the file to use any of the table definitions.

@koistya koistya added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 28, 2021
@koistya
Copy link
Member

koistya commented Aug 28, 2021

That can be useful. Alternatively, adding global: true option that would wrap generated types into declare global { .. }.

bhenderson added a commit to bhenderson/knex-types that referenced this issue Aug 29, 2021
@bhenderson
Copy link
Contributor Author

I implemented the suffix option because I think it's more flexible. But it's your lib, let me know if you prefer the global option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants