You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
Tools: Add class member accessibility modifiers and converted rule @typescript-eslint/explicit-member-accessibility to an error
This commit is contained in:
@ -71,7 +71,7 @@ export default class JoplinCommands {
|
||||
* await joplin.commands.execute('newFolder', "SOME_FOLDER_ID");
|
||||
* ```
|
||||
*/
|
||||
async execute(commandName: string, ...args: any[]): Promise<any | void> {
|
||||
public async execute(commandName: string, ...args: any[]): Promise<any | void> {
|
||||
return CommandService.instance().execute(commandName, ...args);
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ export default class JoplinCommands {
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
async register(command: Command) {
|
||||
public async register(command: Command) {
|
||||
const declaration: CommandDeclaration = {
|
||||
name: command.name,
|
||||
label: command.label,
|
||||
|
@ -7,11 +7,11 @@ import eventManager from '../../../eventManager';
|
||||
* so for now disable filters.
|
||||
*/
|
||||
export default class JoplinFilters {
|
||||
async on(name: string, callback: Function) {
|
||||
public async on(name: string, callback: Function) {
|
||||
eventManager.filterOn(name, callback);
|
||||
}
|
||||
|
||||
async off(name: string, callback: Function) {
|
||||
public async off(name: string, callback: Function) {
|
||||
eventManager.filterOff(name, callback);
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import { ExportModule, ImportModule } from './types';
|
||||
*/
|
||||
export default class JoplinInterop {
|
||||
|
||||
async registerExportModule(module: ExportModule) {
|
||||
public async registerExportModule(module: ExportModule) {
|
||||
const internalModule: Module = {
|
||||
...module,
|
||||
type: ModuleType.Exporter,
|
||||
@ -27,7 +27,7 @@ export default class JoplinInterop {
|
||||
return InteropService.instance().registerModule(internalModule);
|
||||
}
|
||||
|
||||
async registerImportModule(module: ImportModule) {
|
||||
public async registerImportModule(module: ImportModule) {
|
||||
const internalModule: Module = {
|
||||
...module,
|
||||
type: ModuleType.Importer,
|
||||
|
@ -23,7 +23,7 @@ export default class JoplinViews {
|
||||
private toolbarButtons_: JoplinViewsToolbarButtons = null;
|
||||
private implementation_: any = null;
|
||||
|
||||
constructor(implementation: any, plugin: Plugin, store: any) {
|
||||
public constructor(implementation: any, plugin: Plugin, store: any) {
|
||||
this.store = store;
|
||||
this.plugin = plugin;
|
||||
this.implementation_ = implementation;
|
||||
|
@ -39,7 +39,7 @@ export default class JoplinViewsDialogs {
|
||||
private plugin: Plugin;
|
||||
private implementation_: any;
|
||||
|
||||
constructor(implementation: any, plugin: Plugin, store: any) {
|
||||
public constructor(implementation: any, plugin: Plugin, store: any) {
|
||||
this.store = store;
|
||||
this.plugin = plugin;
|
||||
this.implementation_ = implementation;
|
||||
@ -52,7 +52,7 @@ export default class JoplinViewsDialogs {
|
||||
/**
|
||||
* Creates a new dialog
|
||||
*/
|
||||
async create(id: string): Promise<ViewHandle> {
|
||||
public async create(id: string): Promise<ViewHandle> {
|
||||
if (!id) {
|
||||
this.plugin.deprecationNotice('1.5', 'Creating a view without an ID is deprecated. To fix it, change your call to `joplin.views.dialogs.create("my-unique-id")`', true);
|
||||
id = `${this.plugin.viewCount}`;
|
||||
@ -67,14 +67,14 @@ 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"
|
||||
*/
|
||||
async showMessageBox(message: string): Promise<number> {
|
||||
public async showMessageBox(message: string): Promise<number> {
|
||||
return this.implementation_.showMessageBox(`${_('(In plugin: %s)', this.plugin.manifest.name)}\n\n${message}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the dialog HTML content
|
||||
*/
|
||||
async setHtml(handle: ViewHandle, html: string) {
|
||||
public async setHtml(handle: ViewHandle, html: string) {
|
||||
return this.controller(handle).html = html;
|
||||
}
|
||||
|
||||
@ -88,14 +88,14 @@ export default class JoplinViewsDialogs {
|
||||
/**
|
||||
* Sets the dialog buttons.
|
||||
*/
|
||||
async setButtons(handle: ViewHandle, buttons: ButtonSpec[]) {
|
||||
public async setButtons(handle: ViewHandle, buttons: ButtonSpec[]) {
|
||||
return this.controller(handle).buttons = buttons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the dialog
|
||||
*/
|
||||
async open(handle: ViewHandle): Promise<DialogResult> {
|
||||
public async open(handle: ViewHandle): Promise<DialogResult> {
|
||||
return this.controller(handle).open();
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ export default class JoplinViewsDialogs {
|
||||
* When set to false, the dialog is set to 90vw and 80vh
|
||||
* @default true
|
||||
*/
|
||||
async setFitToContent(handle: ViewHandle, status: boolean) {
|
||||
public async setFitToContent(handle: ViewHandle, status: boolean) {
|
||||
return this.controller(handle).fitToContent = status;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ export default class JoplinViewsMenus {
|
||||
private store: any;
|
||||
private plugin: Plugin;
|
||||
|
||||
constructor(plugin: Plugin, store: any) {
|
||||
public constructor(plugin: Plugin, store: any) {
|
||||
this.store = store;
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export default class JoplinViewsToolbarButtons {
|
||||
private store: any;
|
||||
private plugin: Plugin;
|
||||
|
||||
constructor(plugin: Plugin, store: any) {
|
||||
public constructor(plugin: Plugin, store: any) {
|
||||
this.store = store;
|
||||
this.plugin = plugin;
|
||||
}
|
||||
@ -21,7 +21,7 @@ export default class JoplinViewsToolbarButtons {
|
||||
/**
|
||||
* Creates a new toolbar button and associate it with the given command.
|
||||
*/
|
||||
async create(id: string, commandName: string, location: ToolbarButtonLocation) {
|
||||
public async create(id: string, commandName: string, location: ToolbarButtonLocation) {
|
||||
if (arguments.length < 3) {
|
||||
this.plugin.deprecationNotice('1.5', 'Creating a view without an ID is deprecated. To fix it, change your call to `joplin.views.toolbarButtons.create("my-unique-id", ...)`', true);
|
||||
location = commandName as any;
|
||||
|
Reference in New Issue
Block a user