ngx-monaco-editor icon indicating copy to clipboard operation
ngx-monaco-editor copied to clipboard

Typing Of Monaco On Version 12

Open Planit-Scheduler-Solutions opened this issue 3 years ago • 5 comments

Hi, I work with ngx-monaco-editor version 12 and with angular 12. I am trying to implement my one language with this component, after I finish the flow for connect the component to my project as was explain on https://www.npmjs.com/package/ngx-monaco-editor.

First when I tried to influence on the monaco by: monaco.languages.register({ id: 'test', }); I got error that says "Cannot find name 'monaco'", for solve this I added declare let monaco: any; And it start to work, but I saw on some example that works on 9 version that not need to do this declare. So I walked to the project's node modules and found there a monaco.d.ts folder with monaco name space with all the needed classes and interfaces, and on version 12 this folder not exists. This typing is very helpful for understand the component. What wrong did I do?

Having the same issue as well.

yakeer avatar Jul 14 '21 06:07 yakeer

Yah, there was monaco.d.ts before. Where did you lose it?
image

webdevelopland avatar Apr 20 '22 03:04 webdevelopland

It's located inside monaco-editor
But how to import it from there?
image

webdevelopland avatar Apr 20 '22 04:04 webdevelopland

As workaround I installed latest version of ngx-monaco-editor, which had monaco.d.ts: 9.0.0 But don't import monaco build from there, it's outdated. Import it directly from monaco-editor:

{
  "glob": "**/*",
  "input": "node_modules/monaco-editor/min",
  "output": "./assets/monaco/"
}

webdevelopland avatar Apr 20 '22 04:04 webdevelopland

Alternative way is to just add import to every file:

import * as monaco from 'monaco-editor'

webdevelopland avatar Dec 11 '22 06:12 webdevelopland