You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a library that also has some submodules which extend the functionality of built-in types, so there's nothing to export
Example:
declare global {interfaceArray<T>{randomPick(): T;}}Array.prototype.randomPick=function<T>(): T{returnthis[Math.floor(Math.random()*this.length)];};export{};
When compiled using tsdown, the output of the .d.ts file looks like this
//#region src/array.d.tsdeclare global {interfaceArray<T>{randomPick(): T;}}
The empty export is missing, but it is required for the global declaration to take effect.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm creating a library that also has some submodules which extend the functionality of built-in types, so there's nothing to export
Example:
When compiled using tsdown, the output of the .d.ts file looks like this
The empty export is missing, but it is required for the global declaration to take effect.
Beta Was this translation helpful? Give feedback.
All reactions