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 working on a browser-based live code editor where we'd like to use various APIs from the TypeScriptWorker, for example getEmitOutput to compile our code--similar to #289.
However, in the typings the API to get the worker returns any, and there's no declaration file generated/published for the TypeScriptWorker file. This makes the worker much less convenient/safe to use.
import*asmonacofrom'monaco-editor';consteditor=monaco.editor.create(/*args*/);consturi=editor.getModel().uri;// This should have type TypeScriptWorker but actually has type anyconstworker=awaitmonaco.languages.typescript.getTypeScriptWorker();// Now this code isn't type-safe and the API methods aren't discoverableconstworkerInstance=awaitworker(uri);constresult=awaitworkerInstance.getEmitOutput(uri.toString());
We worked around the issue locally by cloning monaco-typescript, building it with declaration: true set in the tsconfig, and copying the declaration files into our project--but it would be much better if the complete typings were included in the published package.
monaco-editor version: 0.17.0
Browser: n/a
OS: n/a
Steps or JS usage snippet reproducing the issue:
I'm working on a browser-based live code editor where we'd like to use various APIs from the
TypeScriptWorker
, for examplegetEmitOutput
to compile our code--similar to #289.However, in the typings the API to get the worker returns
any
, and there's no declaration file generated/published for theTypeScriptWorker
file. This makes the worker much less convenient/safe to use.We worked around the issue locally by cloning
monaco-typescript
, building it withdeclaration: true
set in the tsconfig, and copying the declaration files into our project--but it would be much better if the complete typings were included in the published package.cc: @nishikaza @sopranopillow @kenotron
The text was updated successfully, but these errors were encountered: