mizzkey/src/client/app/common/scripts/streaming/drive.ts

35 lines
598 B
TypeScript
Raw Normal View History

2018-03-07 17:48:32 +09:00
import Stream from './stream';
import StreamManager from './stream-manager';
2018-04-29 21:37:51 +09:00
import MiOS from '../../../mios';
2018-03-07 17:48:32 +09:00
/**
* Drive stream connection
*/
export class DriveStream extends Stream {
2018-03-15 19:53:46 +09:00
constructor(os: MiOS, me) {
super(os, 'drive', {
2018-04-08 03:58:11 +09:00
i: me.token
2018-03-07 17:48:32 +09:00
});
}
}
export class DriveStreamManager extends StreamManager<DriveStream> {
private me;
2018-03-15 19:53:46 +09:00
private os: MiOS;
2018-03-07 17:48:32 +09:00
2018-03-15 19:53:46 +09:00
constructor(os: MiOS, me) {
2018-03-07 17:48:32 +09:00
super();
this.me = me;
2018-03-15 19:53:46 +09:00
this.os = os;
2018-03-07 17:48:32 +09:00
}
public getConnection() {
if (this.connection == null) {
2018-03-15 19:53:46 +09:00
this.connection = new DriveStream(this.os, this.me);
2018-03-07 17:48:32 +09:00
}
return this.connection;
}
}