ts-reset icon indicating copy to clipboard operation
ts-reset copied to clipboard

Add typescript reference declaration to documentation

Open pc-erin opened this issue 2 years ago • 0 comments

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.

pc-erin avatar Aug 24 '23 22:08 pc-erin