@saber2pr/monaco
TypeScript icon, indicating that this package has built-in type declarations

0.0.88 • Public • Published

@saber2pr/monaco

monaco

yarn add @saber2pr/monaco

Usage

editor:

import { createEditor } from '@saber2pr/monaco'

// 1. create editor
const editor = await createEditor(
  dom,
  {
    // file: file-content
    'input.jsx': "const a = 'hello';",
    'input.css': '#root { color: red; }',
  },
  { theme: 'vs-dark' }
)

// get current modal value
editor.getValue()

// set value to current modal
editor.setValue('code')

// change current modal
editor.changeModel('input.css')

// get modal
editor.getModel('input.jsx').onDidChangeContent

diffEditor:

import { createDiffEditor } from '@saber2pr/monaco'

// container, oldText, newText, language
createDiffEditor(dom, '{"name": "app"}', '{"name": "subApp"}', 'json')

/@saber2pr/monaco/

    Package Sidebar

    Install

    npm i @saber2pr/monaco

    Weekly Downloads

    36

    Version

    0.0.88

    License

    ISC

    Unpacked Size

    594 kB

    Total Files

    106

    Last publish

    Collaborators

    • saber2pr