New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

monaco-types

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monaco-types

Type-only exports of Monaco editor

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
73K
increased by9.09%
Maintainers
1
Weekly downloads
 
Created
Source

monaco-types

github actions npm prettier

Users of Monaco editor may insert it into their webpage via multiple sources, for example from the monaco-editor or monaco-editor-core package, from a CDN, or from a third party source.

This package provides type-only exports of Monaco editor from either monaco-editor or monaco-editor-core, whatever is available.

Installation

npm install monaco-types

Usage

Instead of importing from monaco-editor or monaco-editor-core, import all type definitions from monaco-types. This will allow you to write type annotations:

import { MarkerSeverity } from 'monaco-types'

let severity: MarkerSeverity

But TypeScript will show an error when using the import as a value

import { MarkerSeverity } from 'monaco-types'

let severity: MarkerSeverity

Also your user will only have to install either monaco-editor or monaco-editor-core to get type definitions, but you don’t have to enforce either on them.

In order to support this, your library needs to accept MonacoEditor as an argument instead of importing. For example:

import { IDisposable, MonacoEditor } from 'monaco-types'

export function configureMyPlugin(monaco: MonacoEditor): IDisposable {
  // Use monaco here.
}

License

MIT @ Remco Haszing

Keywords

FAQs

Package last updated on 03 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc