API version 1. This page lists everything a plugin can call. A plugin's main.js sees the global athanor object and standard JavaScript, and nothing else. Calls that ask Athanor for something return promises; the host answers each one only if the plugin holds the permission it needs, and otherwise the promise rejects with a sentence naming the permission.
Makes the change as one undo step named "Plugin: label". added lists the ids of added structures ("s:…") and text ("n:…"). Rejects, with nothing changed, if any op is refused. At most 5 a second (20 for official plugins).
Makes the change and shows it with Accept and Reject in a box naming the plugin. Resolves when the person answers. A new proposal from the same plugin rejects the previous one.
Shows Athanor's toast, prefixed with the plugin's name. Cut at 100 characters; at most 12 a minute, any more are dropped. error: true shows it as an error.
athanor.closePlugin(message?: string)
void
Shows the optional message (up to 100 characters) and closes the plugin's window.
Each registers the handler Athanor calls. Register one handler per key; when two are registered for the same key, only the first runs. A handler may return a value or a promise.
Member
Handler gets
Handler returns
Description
athanor.commands.on(key: string, fn)
parameters: Record<string, unknown> (always {} in API 1)
anything (ignored)
Runs when the person runs the command declared with that key.
The template's athanor.d.ts does not yet declare everything on this page. athanor.propose, athanor.conformer, the stereo field of setBond (it declares order as required) and Structure.stereocenters all work, but your editor's type check reports them as errors. Add a // @ts-ignore above such a line, or extend the typings in your own copy of the file. This page is the reference; the typings will catch up.