PluginsEarly
Plugin API reference
Every element, event, method, command and limit a Graphide plugin can use.
From the plugin interface of gr 0.2.16. gr plugin api prints it on your machine, and gr plugin api --dts the declaration file.
This release serves API versions 0.1, 0.2 and 0.3. A plugin names the one it is written for in plugin.toml with api = "0.3", and can use everything marked as arriving in that version or earlier. Names with no version have been there since 0.1.
| Elements | what a view is built from | 29 |
| Events | what a plugin listens for | 35 |
| Methods | the calls on $ | 58 |
| Commands | what a handler asks the app to do | 20 |
| Actions | app actions a plugin may run | 54 |
| Context keys | what a handler is told about the app's state | 21 |
| Capabilities | what a plugin may ask for | 16 |
| Types | the types in plugin.d.ts | 44 |
| Test API | a plugin's own tests | 47 |
| Limits | time, size and count | 86 |
| Errors | every error code | 93 |
The script
A plugin's TypeScript runs in a small sandboxed host, not in Node or a browser. These globals are there: h, Fragment, setTimeout, setInterval, clearTimeout, clearInterval, queueMicrotask, console. These are not: require, process, Buffer, fetch, XMLHttpRequest, eval, Function. Files, the network and programs are reached through $, and only with the capability for each.
Reserved for later
A plugin cannot take these names yet; later versions of the interface may use them.
| Plugin names | graphide, gr, core, builtin, test, api, plugin, plugins, list, tree, pane, tab, jump, attention, agent, agents, map, node, picker, buffer, change, hunk, toggle, symbols, definition, architecture, explorer, source_control, terminal, search, sessions, nav, changes, tests, servers, deslop, experimental, browser, diffs, inbox, scratchpad, design, and the names Graphide uses inside |
|---|---|
| Events | cursor, decorations, query |
| $ namespaces | queries, secrets |
| Commands | terminal.open, agent.start |
| Elements | board, canvas, editor |
These docs describe Graphide 0.2.16, the latest release. Something wrong or missing? Tell us onDiscord or at hello@graphide.com.