aboutsummaryrefslogtreecommitdiff
path: root/api/JoplinPlugins.d.ts
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2025-07-04 12:03:11 -0500
committerMark Powers <mark@marks.kitchen>2025-07-04 12:03:11 -0500
commit13feb30f3ff9b913670a5fe7c8a9c1907d2c1740 (patch)
treeab6c820b4904ee7b05cb284af87ea2afc680d628 /api/JoplinPlugins.d.ts
Initial commitmain
Diffstat (limited to 'api/JoplinPlugins.d.ts')
-rw-r--r--api/JoplinPlugins.d.ts43
1 files changed, 43 insertions, 0 deletions
diff --git a/api/JoplinPlugins.d.ts b/api/JoplinPlugins.d.ts
new file mode 100644
index 0000000..a1e4a83
--- /dev/null
+++ b/api/JoplinPlugins.d.ts
@@ -0,0 +1,43 @@
+import Plugin from '../Plugin';
+import { ContentScriptType, Script } from './types';
+/**
+ * This class provides access to plugin-related features.
+ */
+export default class JoplinPlugins {
+ private plugin;
+ constructor(plugin: Plugin);
+ /**
+ * 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>;
+ /**
+ * @deprecated Use joplin.contentScripts.register()
+ */
+ registerContentScript(type: ContentScriptType, id: string, scriptPath: string): Promise<void>;
+ /**
+ * Gets the plugin own data directory path. Use this to store any
+ * plugin-related data. Unlike [[installationDir]], any data stored here
+ * will be persisted.
+ */
+ dataDir(): Promise<string>;
+ /**
+ * Gets the plugin installation directory. This can be used to access any
+ * asset that was packaged with the plugin. This directory should be
+ * considered read-only because any data you store here might be deleted or
+ * re-created at any time. To store new persistent data, use [[dataDir]].
+ */
+ installationDir(): Promise<string>;
+ /**
+ * @deprecated Use joplin.require()
+ */
+ require(_path: string): any;
+}