You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
Merge branch 'dev' of github.com:laurent22/joplin into dev
This commit is contained in:
@ -11,6 +11,18 @@ import Logger from '../../../Logger';
|
||||
|
||||
/**
|
||||
* This is the main entry point to the Joplin API. You can access various services using the provided accessors.
|
||||
*
|
||||
* **This is a beta API**
|
||||
*
|
||||
* Please note that the plugin API is relatively new and should be considered Beta state. Besides possible bugs, what it means is that there might be necessary breaking changes from one version to the next. Whenever such change is needed, best effort will be done to:
|
||||
*
|
||||
* - Maintain backward compatibility;
|
||||
* - When possible, deprecate features instead of removing them;
|
||||
* - Document breaking changes in the changelog;
|
||||
*
|
||||
* So if you are developing a plugin, please keep an eye on the changelog as everything will be in there with information about how to update your code. There won't be any major API rewrite or architecture changes, but possibly small tweaks like function signature change, type change, etc.
|
||||
*
|
||||
* Eventually, the plugin API will be versioned to make this process smoother.
|
||||
*/
|
||||
export default class Joplin {
|
||||
|
||||
|
@ -1,12 +1,13 @@
|
||||
import Plugin from '../Plugin';
|
||||
import createViewHandle from '../utils/createViewHandle';
|
||||
import WebviewController, { ContainerType } from '../WebviewController';
|
||||
import { ButtonSpec, ViewHandle, ButtonId } from './types';
|
||||
import { ButtonSpec, ViewHandle, DialogResult } from './types';
|
||||
|
||||
/**
|
||||
* Allows creating and managing dialogs. A dialog is modal window that contains a webview and a row of buttons. You can update the update the webview using the `setHtml` method.
|
||||
* Dialogs are hidden by default and you need to call `open()` to open them. Once the user clicks on a button, the `open` call will return and provide the button ID that was
|
||||
* clicked on. There is currently no "close" method since the dialog should be thought as a modal one and thus can only be closed by clicking on one of the buttons.
|
||||
* Dialogs are hidden by default and you need to call `open()` to open them. Once the user clicks on a button, the `open` call will return an object indicating what button was clicked
|
||||
* on. If your HTML content included one or more form, a `formData` object will also be included with the key/value for each form.
|
||||
* There is currently no "close" method since the dialog should be thought as a modal one and thus can only be closed by clicking on one of the buttons.
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/dialog)
|
||||
*/
|
||||
@ -65,7 +66,7 @@ export default class JoplinViewsDialogs {
|
||||
/**
|
||||
* Opens the dialog
|
||||
*/
|
||||
async open(handle: ViewHandle): Promise<ButtonId> {
|
||||
async open(handle: ViewHandle): Promise<DialogResult> {
|
||||
return this.controller(handle).open();
|
||||
}
|
||||
|
||||
|
@ -261,6 +261,11 @@ export interface EditorCommand {
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export interface DialogResult {
|
||||
id: ButtonId;
|
||||
formData?: any;
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Settings types
|
||||
// =================================================================
|
||||
|
Reference in New Issue
Block a user