You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
Chore: Update plugin demo types
This commit is contained in:
@ -10,6 +10,7 @@ import JoplinSettings from './JoplinSettings';
|
||||
import JoplinContentScripts from './JoplinContentScripts';
|
||||
import JoplinClipboard from './JoplinClipboard';
|
||||
import JoplinWindow from './JoplinWindow';
|
||||
import BasePlatformImplementation from '../BasePlatformImplementation';
|
||||
/**
|
||||
* This is the main entry point to the Joplin API. You can access various services using the provided accessors.
|
||||
*
|
||||
@ -34,7 +35,8 @@ export default class Joplin {
|
||||
private contentScripts_;
|
||||
private clipboard_;
|
||||
private window_;
|
||||
constructor(implementation: any, plugin: Plugin, store: any);
|
||||
private implementation_;
|
||||
constructor(implementation: BasePlatformImplementation, plugin: Plugin, store: any);
|
||||
get data(): JoplinData;
|
||||
get clipboard(): JoplinClipboard;
|
||||
get window(): JoplinWindow;
|
||||
@ -65,4 +67,5 @@ export default class Joplin {
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/nativeModule)
|
||||
*/
|
||||
require(_path: string): any;
|
||||
versionInfo(): Promise<import("./types").VersionInfo>;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { ModelType } from '../../../BaseModel';
|
||||
import Plugin from '../Plugin';
|
||||
import { Path } from './types';
|
||||
/**
|
||||
* This module provides access to the Joplin data API: https://joplinapp.org/api/references/rest_api/
|
||||
@ -39,6 +40,8 @@ import { Path } from './types';
|
||||
export default class JoplinData {
|
||||
private api_;
|
||||
private pathSegmentRegex_;
|
||||
private plugin;
|
||||
constructor(plugin: Plugin);
|
||||
private serializeApiBody;
|
||||
private pathToString;
|
||||
get(path: Path, query?: any): Promise<any>;
|
||||
@ -47,4 +50,24 @@ export default class JoplinData {
|
||||
delete(path: Path, query?: any): Promise<any>;
|
||||
itemType(itemId: string): Promise<ModelType>;
|
||||
resourcePath(resourceId: string): Promise<string>;
|
||||
/**
|
||||
* Gets an item user data. User data are key/value pairs. The `key` can be any
|
||||
* arbitrary string, while the `value` can be of any type supported by
|
||||
* [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#description)
|
||||
*
|
||||
* User data is synchronised across devices, and each value wil be merged based on their timestamp:
|
||||
*
|
||||
* - If value is modified by client 1, then modified by client 2, it will take the value from client 2
|
||||
* - If value is modified by client 1, then deleted by client 2, the value will be deleted after merge
|
||||
* - If value is deleted by client 1, then updated by client 2, the value will be restored and set to the value from client 2 after merge
|
||||
*/
|
||||
userDataGet<T>(itemType: ModelType, itemId: string, key: string): Promise<T>;
|
||||
/**
|
||||
* Sets a note user data. See {@link JoplinData.userDataGet} for more details.
|
||||
*/
|
||||
userDataSet<T>(itemType: ModelType, itemId: string, key: string, value: T): Promise<void>;
|
||||
/**
|
||||
* Deletes a note user data. See {@link JoplinData.userDataGet} for more details.
|
||||
*/
|
||||
userDataDelete(itemType: ModelType, itemId: string, key: string): Promise<void>;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ export interface ChangeEvent {
|
||||
*/
|
||||
keys: string[];
|
||||
}
|
||||
export declare type ChangeHandler = (event: ChangeEvent) => void;
|
||||
export type ChangeHandler = (event: ChangeEvent) => void;
|
||||
/**
|
||||
* This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user.
|
||||
*
|
||||
|
@ -3,7 +3,7 @@ import { Disposable, MenuItem } from './types';
|
||||
export interface EditContextMenuFilterObject {
|
||||
items: MenuItem[];
|
||||
}
|
||||
declare type FilterHandler<T> = (object: T) => Promise<void>;
|
||||
type FilterHandler<T> = (object: T) => Promise<void>;
|
||||
declare enum ItemChangeEventType {
|
||||
Create = 1,
|
||||
Update = 2,
|
||||
@ -19,9 +19,9 @@ interface SyncStartEvent {
|
||||
interface ResourceChangeEvent {
|
||||
id: string;
|
||||
}
|
||||
declare type ItemChangeHandler = (event: ItemChangeEvent) => void;
|
||||
declare type SyncStartHandler = (event: SyncStartEvent) => void;
|
||||
declare type ResourceChangeHandler = (event: ResourceChangeEvent) => void;
|
||||
type ItemChangeHandler = (event: ItemChangeEvent) => void;
|
||||
type SyncStartHandler = (event: SyncStartEvent) => void;
|
||||
type ResourceChangeHandler = (event: ResourceChangeEvent) => void;
|
||||
/**
|
||||
* The workspace service provides access to all the parts of Joplin that
|
||||
* are being worked on - i.e. the currently selected notes or notebooks as
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* eslint-disable multiline-comment-style */
|
||||
|
||||
// =================================================================
|
||||
// Command API types
|
||||
// =================================================================
|
||||
@ -221,6 +223,12 @@ export enum ModelType {
|
||||
Command = 16,
|
||||
}
|
||||
|
||||
export interface VersionInfo {
|
||||
version: string;
|
||||
profileVersion: number;
|
||||
syncVersion: number;
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// Menu types
|
||||
// =================================================================
|
||||
|
Reference in New Issue
Block a user