package
Type-only exports of Monaco editor
npm install monaco-typesGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
4.2 kB
Includes dependencies.
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.
npm install monaco-typesInstead 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: MarkerSeverityBut TypeScript will show an error when using the import as a value
import { MarkerSeverity } from 'monaco-types'
let severity: MarkerSeverityAlso 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.
}This package follows the DefinitelyTyped support window.