-
| 
         Hi! In the past, when I used the Monaco Editor, I was able to add  However, for some reason, when I try to perform this action, I am getting  
 import * as monaco from 'monaco-editor';
//same with import * as editor from 'monaco-editor/esm/vs/editor/editor.api';
...
monaco.languages.typescript.javascriptDefaults.addExtraLib(lib)
   void getApi().then(async (api: vscodeAPI) => {
      ...
      const extraLib = api.languages.typescript.javascriptDefaults.addExtraLib(lib);Am I missing something, or is there another way to add libraries?  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
| 
         Hello, Those apis are added by the monaco standalone typescript worker. It that project, we tend to encourage using VSCode stuff instead, and you should be able to use the VSCode typescript default extension for the typescript intellisense (cf. the demo). You would be able to add types but adding your  However, there is something that can be blocking for many users: the VSCode typescript extension requires the  For that reason, it's still possible to use the monaco typescript worker, you just need to install and import   | 
  
Beta Was this translation helpful? Give feedback.

Hello,
Those apis are added by the monaco standalone typescript worker.
It that project, we tend to encourage using VSCode stuff instead, and you should be able to use the VSCode typescript default extension for the typescript intellisense (cf. the demo). You would be able to add types but adding your
.d.tsfile in the project directly in the virtual filesystem, or referencing published types (there is a type acquisition feature).However, there is something that can be blocking for many users: the VSCode typescript extension requires the
crossOriginIsolatedflag to be enable to fully operate (akaproject-wideintellisense).For that reason, it's still possible to use the monaco typescrip…