1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +02:00

Tools: Apply rule @typescript-eslint/type-annotation-spacing

This commit is contained in:
Laurent Cozic
2020-11-12 19:13:28 +00:00
parent 62feb7ff60
commit d20694e52c
291 changed files with 2205 additions and 2203 deletions

View File

@ -1,8 +1,8 @@
import Global from '../api/Global';
type EventHandler = (callbackId:string, args:any[]) => void;
type EventHandler = (callbackId: string, args: any[])=> void;
function createEventHandlers(arg:any, eventHandler:EventHandler) {
function createEventHandlers(arg: any, eventHandler: EventHandler) {
if (Array.isArray(arg)) {
for (let i = 0; i < arg.length; i++) {
arg[i] = createEventHandlers(arg[i], eventHandler);
@ -10,7 +10,7 @@ function createEventHandlers(arg:any, eventHandler:EventHandler) {
return arg;
} else if (typeof arg === 'string' && arg.indexOf('___plugin_event_') === 0) {
const callbackId = arg;
return async (...args:any[]) => {
return async (...args: any[]) => {
const result = await eventHandler(callbackId, args);
return result;
};
@ -25,11 +25,11 @@ function createEventHandlers(arg:any, eventHandler:EventHandler) {
return arg;
}
export default async function executeSandboxCall(pluginId:string, sandbox:Global, path:string, args:any[], eventHandler:EventHandler) {
export default async function executeSandboxCall(pluginId: string, sandbox: Global, path: string, args: any[], eventHandler: EventHandler) {
const pathFragments = path.split('.');
let parent:any = null;
let fn:any = sandbox;
let parent: any = null;
let fn: any = sandbox;
if (!fn) throw new Error(`No sandbox for plugin ${pluginId}`); // Sanity check as normally cannot happen