1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-10 22:11:50 +02:00

Chore: Update plugin types

This commit is contained in:
Laurent Cozic
2025-04-07 18:30:20 +01:00
parent 911689a4ac
commit 8ac19d80ea
5 changed files with 24 additions and 8 deletions

View File

@@ -73,4 +73,8 @@ export default class Joplin {
*/
require(_path: string): any;
versionInfo(): Promise<import("./types").VersionInfo>;
/**
* Tells whether the current theme is a dark one or not.
*/
shouldUseDarkColors(): Promise<boolean>;
}

View File

@@ -52,11 +52,15 @@ export default class JoplinSettings {
*/
setValue(key: string, value: any): Promise<void>;
/**
* Gets a global setting value, including app-specific settings and those set by other plugins.
* Gets global setting values, including app-specific settings and those set by other plugins.
*
* The list of available settings is not documented yet, but can be found by looking at the source code:
*
* https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142
* https://github.com/laurent22/joplin/blob/dev/packages/lib/models/settings/builtInMetadata.ts
*/
globalValues(keys: string[]): Promise<any[]>;
/**
* @deprecated Use joplin.settings.globalValues()
*/
globalValue(key: string): Promise<any>;
/**

View File

@@ -43,6 +43,9 @@ export default class JoplinViewsDialogs {
* Displays a message box with OK/Cancel buttons. Returns the button index that was clicked - "0" for OK and "1" for "Cancel"
*/
showMessageBox(message: string): Promise<number>;
/**
* Displays a Toast notification in the corner of the application screen.
*/
showToast(toast: Toast): Promise<void>;
/**
* Displays a dialog to select a file or a directory. Same options and

View File

@@ -60,14 +60,14 @@ export default class JoplinViewsEditors {
*/
onMessage(handle: ViewHandle, callback: Function): Promise<void>;
/**
* Emitted when the editor can potentially be activated - this for example when the current note
* is changed, or when the application is opened. At that point should can check the current
* note and decide whether your editor should be activated or not. If it should return `true`,
* otherwise return `false`.
* Emitted when the editor can potentially be activated - this is for example when the current
* note is changed, or when the application is opened. At that point you should check the
* current note and decide whether your editor should be activated or not. If it should, return
* `true`, otherwise return `false`.
*/
onActivationCheck(handle: ViewHandle, callback: ActivationCheckCallback): Promise<void>;
/**
* Emitted when the editor content should be updated. This for example when the currently
* Emitted when your editor content should be updated. This is for example when the currently
* selected note changes, or when the user makes the editor visible.
*/
onUpdate(handle: ViewHandle, callback: UpdateCallback): Promise<void>;

View File

@@ -626,7 +626,7 @@ export interface CodeMirrorControl {
/**
* A CodeMirror [facet](https://codemirror.net/docs/ref/#state.EditorState.facet) that contains
* the ID of the note currently open in the editor.
*
*
* Access the value of this facet using
* ```ts
* const noteIdFacet = editorControl.joplinExtensions.noteIdFacet;
@@ -636,6 +636,11 @@ export interface CodeMirrorControl {
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- No better type available
noteIdFacet: any;
/**
* A CodeMirror [StateEffect](https://codemirror.net/docs/ref/#state.StateEffect) that is
* included in a [Transaction](https://codemirror.net/docs/ref/#state.Transaction) when the
* note ID changes.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- No better type available
setNoteIdEffect: any;
};