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
Search Terms: "declaration emit", "has or is using private name"
Code
consta=123;const{ b }={b: 123};exportfunctionfoo(d: typeofa,// no errore: typeofb// error TS4078: Parameter 'e' of exported function has or is using private name 'b'.): void{}
If I comment e: typeof b and const { b } = { b: 123 } then this may produce runtime error as soon all members from declaration file can be imported (but there is no export with name a), but it looks like export {}; statement does something that disabled it, right? Could you please point what does it mean for TypeScript (link or description)? (I found only one mention in handbook, but it says about "exports nothing" only). When I should use it when write declaration by myself?
The text was updated successfully, but these errors were encountered:
TypeScript Version: [email protected]
Search Terms: "declaration emit", "has or is using private name"
Code
./node_modules/.bin/tsc --declaration true
Expected behavior:
Error for both
d
ande
args.Actual behavior:
Error for
e
arg only.Related Issues: #23127, #22798, #20080, #5284
If I comment
e: typeof b
andconst { b } = { b: 123 }
then this may produce runtime error as soon all members from declaration file can be imported (but there is no export with namea
), but it looks likeexport {};
statement does something that disabled it, right? Could you please point what does it mean for TypeScript (link or description)? (I found only one mention in handbook, but it says about "exports nothing" only). When I should use it when write declaration by myself?The text was updated successfully, but these errors were encountered: