You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-03 23:50:33 +02:00
Tools: Apply rule @typescript-eslint/ban-types
This commit is contained in:
@ -21,6 +21,7 @@ export class EventManager {
|
||||
this.appStateListeners_ = {};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
public on(eventName: string, callback: Function) {
|
||||
return this.emitter_.on(eventName, callback);
|
||||
}
|
||||
@ -29,18 +30,22 @@ export class EventManager {
|
||||
return this.emitter_.emit(eventName, object);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
public removeListener(eventName: string, callback: Function) {
|
||||
return this.emitter_.removeListener(eventName, callback);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
public off(eventName: string, callback: Function) {
|
||||
return this.removeListener(eventName, callback);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
public filterOn(filterName: string, callback: Function) {
|
||||
return this.emitter_.on(`filter:${filterName}`, callback);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
public filterOff(filterName: string, callback: Function) {
|
||||
return this.removeListener(`filter:${filterName}`, callback);
|
||||
}
|
||||
@ -67,6 +72,7 @@ export class EventManager {
|
||||
return output;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
public appStateOn(propName: string, callback: Function) {
|
||||
if (!this.appStateListeners_[propName]) {
|
||||
this.appStateListeners_[propName] = [];
|
||||
@ -76,6 +82,7 @@ export class EventManager {
|
||||
this.appStateListeners_[propName].push(callback);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
public appStateOff(propName: string, callback: Function) {
|
||||
if (!this.appStateListeners_[propName]) {
|
||||
throw new Error('EventManager: Trying to unregister a state prop watch for a non-watched prop (1)');
|
||||
|
Reference in New Issue
Block a user