Skip to main content
Version: Next

Introduction

tip

If you need the Rsvim manuals/usage you can find them in User Manual.

This chapter references all the APIs provided by the Rsvim editor.

1. ECMAScript Standard Built-in APIs

ECMAScript's standard built-in APIs are defined by the ECMA-262, natively implemented by the V8 engine embedded in Rsvim, i.e. these APIs are "global objects" that are available without import/require any additional/external modules. For example globalThis, encodeURI()/decodeURI(), Number, RegExp, etc.

Please reach out to MDN | Standard built-in objects - JavaScript for detailed built-in API references.

2. Web Platform APIs

Besides the ECMAScript standard, a large number of web APIs are also been widely implemented by most javascript-based runtimes: chrome/firefox browsers, node/deno runtimes, etc. The full list of all web APIs and interfaces can be found in MDN | Web APIs, and the WinterTC community group come up with the Minimum Common Web Platform API specification, which defines a minimum set of standard web platform APIs to both browser and non-browser javascript-based runtimes. Rsvim also follows the WinterTC standards, but (maybe) only provide a subset of these APIs due to the development effort.

The web APIs are "global objects", and can be accessed without import/require any additional/external modules, just like ECMAScript standard built-in APIs.

3. Rsvim APIs

Similar to node/deno, Rsvim also provide a set of non-standard APIs to help users manipulating both the editor and the operating system. The APIs can be divided into several groups: editor related, general purposed.

2.1. Editor APIs

Editor APIs are for the text editor itself, including windows, buffers, cursors, commands, etc. They can be accessed via the global object Rsvim, similar to the vim global namespace in Neovim's lua.

2.2. General APIs

General APIs are similar to the concept of the standard library in many programming languages. (From this perspective, there is no functional difference between Rsvim editor and general javascript runtimes such as Node.js and Deno, ) But Rsvim focus on text editing and processing, the existence of all APIs only serves this purpose, they provide functions mainly related to operating system such as file system, network/http, date and time, IPC/RPC and process management, etc. For web and browser related APIs, they will not be provided.

These APIs also share the same global object Rsvim, the implementations follow Deno APIs.

warning

Rsvim editor exposes the rust implemented APIs to the JavaScript world by binding them to the __InternalRsvimGlobalObject global object, which should never be directly used. The Rsvim is a thin wrapper on it.