Open h-a-n-n-e-s opened 1 year ago
What's the use case here? Are you creating a script that works as a normal script and also as a worklet script?
I'm writing a web app (that's what I need the DOM for) which uses webAudio including the AudioWorkletProcessor class. The types of that class are unknown by default (I wonder why?) so I have to use a JS file to make use of the class. I would like to use TS for that class as well.
That doesn't answer the question. Can you move your worklet script to a subdirectory and add another tsconfig.json to apply another set of lib
? Why would you need both in one tsconfig?
Ok, that would be a solution. I didn't know that one can have more than one tsconfig.json, so I did some search and found this feature "project references". Do you mean that? I hope there is another way, because I just spent an hour trying to get this "references" thing to work, but it doesn't. (For example, I get this problem)
So I guess it is only possible with "project references".
Coming back to the original issue, I just tried to add @types-audioworklet
without deleting "DOM"
from "lib"
in the (one and only) tsconfig.json
and everything works fine!
Could somebody give an example of how a "clashing with the DOM APIs" could happen?
So I guess it is only possible with "project references".
Coming back to the original issue, I just tried to add
@types-audioworklet
without deleting"DOM"
from"lib"
in the (one and only)tsconfig.json
and everything works fine!Could somebody give an example of how a "clashing with the DOM APIs" could happen?
"lib": ["DOM", "ESNext"],
"compilerOptions": {
"types": [ "audioworklet"]
},
Sorry for asking very basic questions, but why do I need "types": [ "audioworklet"]
in "compilerOptions"
? For me everything works fine without it. (And with it nothing changes.)
Is there a proper way to use @types/audioworklet while keeping
"lib": ["DOM",...]
? (In the installation notes it says: Update your tsconfig.json to avoid clashing with the DOM APIs... You should remove "dom")For doing front-end development while using
AudioWorkletProcessor
that would be really helpful.