@singapor/core
v0.1.1
Published
Core runtime for the Singapor code editor.
Readme
@singapor/core
Core runtime for the Singapor code editor.
This package contains the editor class, document model, selection and anchor primitives, syntax session contracts, rendering types, plugin APIs, themes, keymaps, and the core stylesheet.
Install
npm install @singapor/coreSingapor packages publish TypeScript source and CSS assets. Use them with a bundler or runtime that can transpile TypeScript from dependencies.
Basic Usage
import { Editor } from '@singapor/core/editor'
import '@singapor/core/style.css'
const editor = new Editor(document.querySelector('#editor')!)
editor.openDocument({
documentId: 'example.ts',
text: 'const value = 1;\n',
languageId: 'typescript',
})Main Entry Points
@singapor/coreexports the public editor, document, rendering, syntax, keymap, and plugin APIs.@singapor/core/editorexports theEditorruntime and editor-specific types.@singapor/core/documentexports document sessions, snapshots, piece-table helpers, anchors, and text edit primitives.@singapor/core/extensionsexports plugin contribution contracts.@singapor/core/renderingexports themes and rendering types.@singapor/core/syntaxexports syntax provider and syntax token helpers.@singapor/core/style.cssis the base editor stylesheet.
