refactor: Use ESM (#8358)

* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
This commit is contained in:
syuilo
2022-02-27 11:07:39 +09:00
committed by GitHub
parent 0a882471f3
commit d071d18dd7
737 changed files with 4135 additions and 3678 deletions

View File

@@ -1,25 +1,27 @@
import autobind from 'autobind-decorator';
import Xev from 'xev';
import Channel from '../channel';
import { default as Xev } from 'xev';
import Channel from '../channel.js';
const ev = new Xev();
const ev = new Xev.default();
export default class extends Channel {
public readonly chName = 'queueStats';
public static shouldShare = true;
public static requireCredential = false;
@autobind
constructor(id: string, connection: Channel['connection']) {
super(id, connection);
this.onStats = this.onStats.bind(this);
this.onMessage = this.onMessage.bind(this);
}
public async init(params: any) {
ev.addListener('queueStats', this.onStats);
}
@autobind
private onStats(stats: any) {
this.send('stats', stats);
}
@autobind
public onMessage(type: string, body: any) {
switch (type) {
case 'requestLog':
@@ -34,7 +36,6 @@ export default class extends Channel {
}
}
@autobind
public dispose() {
ev.removeListener('queueStats', this.onStats);
}