roosterjs-editor-api is a JavaScript/TypeScript package that provided programmatic APIs for interacting with the RoosterJs rich-text editor in its 8.x major version series. This package allowed developers to perform various editor operations such as applying formatting, inserting content, and managing selection directly on an `IEditor` instance. It is now considered deprecated, as the RoosterJs project has transitioned to a new architecture in its 9.x series, primarily utilizing packages prefixed with `roosterjs-content-model-`. The current stable version of this specific package is 8.62.0, with new feature development and ongoing maintenance efforts focused exclusively on the `roosterjs-content-model-api` package. Users are strongly encouraged to migrate to the 9.x content model architecture to benefit from ongoing updates, security fixes, and new features. Its key differentiator was providing a direct API layer for the legacy 8.x editor instances, operating on a DOM-based content model rather than the newer Content Model data structure.
npm install roosterjs-editor-apiVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically use API functions (like `toggleBold`, `insertNode`) from the *legacy* `roosterjs-editor-api` package on an assumed RoosterJs v8 editor instance. For new projects, developers should use the `roosterjs-content-model-api` package with a v9+ editor.
Migrate your editor implementation to use packages prefixed with `roosterjs-content-model-` (e.g., `roosterjs-content-model-core`, `roosterjs-content-model-api`). Refer to the official RoosterJs 9.x upgrade guide on GitHub for detailed migration steps: `https://github.com/microsoft/roosterjs/wiki/RoosterJs-9`.
Immediately plan to upgrade your application to RoosterJs 9.x using the `roosterjs-content-model-api` for editor operations. This will ensure you receive ongoing support and critical updates.
Ensure that your editor instance and all interacting APIs and plugins strictly adhere to either the 8.x (DOM-based) or 9.x (Content Model-based) architecture. Do not combine them. Use `roosterjs-editor-adapter` if you need to bridge some legacy v8 plugins to a v9 editor temporarily.
Update your code to use the equivalent API from `roosterjs-content-model-api` for your v9 editor. For example, `toggleBold(editor)` would become `editor.toggleContentModel(ContentModelSegmentFormat.Bold);` or a similar content model operation.
Use ES module import syntax: `import { someFunction } from 'roosterjs-editor-api';`. Ensure `roosterjs-editor-api` is listed in your `package.json` and properly installed, and your TypeScript `tsconfig.json` has `moduleResolution` set appropriately (e.g., 'Node').In RoosterJs v8, the editor instance was typically created from `roosterjs` (facade) or `roosterjs-editor-core`. For v9+, use `createEditor` from `roosterjs` or `roosterjs-content-model-core`.
No dependency data recorded yet.