@ addore/ 编辑- 核心
代码编辑器的文档模式,没有DOM和依赖性. DocumentModel 保存文本、选择、撤消历史和编辑命令:用括号对等、智能输入、注释切换、行动、多处护理、搜索和折叠等输入。 它在浏览器Bun和Node中运行. @adecore/editor 画到屏幕上.
安装
bun add @adecore/editor-core
使用
import { DocumentModel } from '@adecore/editor-core';
const document = new DocumentModel('const greeting = "hello";\n');
document.setSelections([{ anchor: 26, head: 26 }]);
document.typeText('(', { language: 'typescript' }); // the closer comes along
document.undo();
偏移为UTF-16代码单元,行和列为零基. 一组编辑同时进行,在它面前的文本的坐标上.
文档
| 页次 | 它包含什么 |
|---|---|
| 概览 | 坐标、限制和出处 |
| 文件和编辑 | 文本、选择、编辑批次、修订、历史和更改事件 |
| 键入和命令 | typeText, (中文(简体) ), paste, (中文(简体) ), execute 及其选择 |
| 搜索和折叠 | 查找和替换、折叠范围和角色 |
| API 参考 | 模型旁边的助手和类型 |
许可证
FSL-1.1-麻省理工学院,但其中的词源上游部分除外 src/words.ts,改编自IntelliJ平台(英语:EditorActionUtil.java 喷气管/内利-社区 7184b03af6c5370e79a01ded0df68cf56d7669da, 第934行至第982行在Apache 2.0. NOTICE 财务报告和审定财务报表 LICENSE.apache-2.0.txt 带包裹的船.