// A CoreService subclass is itself an IPlugin — `this` is the plugin // instance. Use `this.pluginSystem` to resolve interfaces declared in // the descriptor's `dependencies` array. constmodel = this.pluginSystem.findInterface(Editor.Model.IModel) asEditor.Model.IModel;
// React to the user switching projects (open/new) by registering a // handler on onProjectChanged. constconn = model.onProjectChanged.connect(() => { console.log(`Plugin ${this.id}: switched to a new project`); }); this.connections.push(conn);
Interface representing a plugin.
Example