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 reference declaration to documentation #166

Open
pc-erin opened this issue Aug 24, 2023 · 0 comments
Open

Add typescript reference declaration to documentation #166

pc-erin opened this issue Aug 24, 2023 · 0 comments

Comments

@pc-erin
Copy link

pc-erin commented Aug 24, 2023

Something I had to figure out on my own after running into a similar problem to #150 is that you can import this so only typescript sees the changes by using a file like this:

env.d.ts

/// <reference types="@total-typescript/ts-reset" />

Maybe this should even be the default way of adding it, since we always want it's imports elided at runtime, but as far as I know, there's no way to declare a type-only side-effect import e.g. import type '@total-typescript/ts-reset'

This is also the only way I know of to make it play nice with verbatimModuleSyntax: true.

Anyway, was wondering if anyone wanted to add this method to the docs. I think it would helpful, especially for TS noobs.

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

1 participant