2020-10-13 13:57:03 +02:00
|
|
|
import Plugin from '../Plugin';
|
2020-11-13 19:09:28 +02:00
|
|
|
import { ContentScriptType, Script } from './types';
|
2020-10-13 13:57:03 +02:00
|
|
|
/**
|
|
|
|
* This class provides access to plugin-related features.
|
|
|
|
*/
|
|
|
|
export default class JoplinPlugins {
|
|
|
|
private plugin;
|
2020-11-23 19:06:52 +02:00
|
|
|
constructor(plugin: Plugin);
|
2020-10-13 13:57:03 +02:00
|
|
|
/**
|
|
|
|
* Registers a new plugin. This is the entry point when creating a plugin. You should pass a simple object with an `onStart` method to it.
|
|
|
|
* That `onStart` method will be executed as soon as the plugin is loaded.
|
|
|
|
*
|
|
|
|
* ```typescript
|
|
|
|
* joplin.plugins.register({
|
|
|
|
* onStart: async function() {
|
|
|
|
* // Run your plugin code here
|
|
|
|
* }
|
|
|
|
* });
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
register(script: Script): Promise<void>;
|
2020-11-13 19:09:28 +02:00
|
|
|
/**
|
2021-01-12 01:34:06 +02:00
|
|
|
* @deprecated Use joplin.contentScripts.register()
|
2020-11-13 19:09:28 +02:00
|
|
|
*/
|
|
|
|
registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise<void>;
|
2020-10-13 13:57:03 +02:00
|
|
|
}
|