TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

Add [Symbol.toStringTag] property to all interfaces

Open petamoriken opened this issue 1 year ago • 3 comments

Fixes #1641 Past PR #1699

petamoriken avatar Jul 28 '24 16:07 petamoriken

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

github-actions[bot] avatar Jul 28 '24 16:07 github-actions[bot]

I wonder we should instead have WebIDLInterface interface with toStringTag and let others extend it. Doing so could just fold the extra member in existing .iterable.d.ts without extra files. (because .iterable.d.ts is effectively for es2015 which introduced toStringTag). This would allow easier change when the Web IDL spec ever adds any other well-known symbol in interface binding.

// dom.generated.d.ts
interface WebIDLInterface {}

interface AbortSignal extends WebIDLInterface {} // Let others extend it

// dom.iterable.generated.d.ts - augment the interface
interface WebIDLInterface { /* */ } 

saschanaz avatar Jul 28 '24 18:07 saschanaz

IMHO, it's weird to have unrelated types in *.iterable.d.ts, so separate files is better.

petamoriken avatar Sep 05 '24 03:09 petamoriken

Theoretically this is now unblocked, so long as it's only applied to TS 6.0.

jakebailey avatar Oct 03 '25 20:10 jakebailey