This commit is contained in:
syuilo 2018-03-15 19:53:46 +09:00
parent f02fcd0e2a
commit 1439c3245b
22 changed files with 446 additions and 101 deletions

View file

@ -1,12 +1,13 @@
import Stream from './stream';
import StreamManager from './stream-manager';
import MiOS from '../../mios';
/**
* Drive stream connection
*/
export class DriveStream extends Stream {
constructor(me) {
super('drive', {
constructor(os: MiOS, me) {
super(os, 'drive', {
i: me.token
});
}
@ -14,16 +15,18 @@ export class DriveStream extends Stream {
export class DriveStreamManager extends StreamManager<DriveStream> {
private me;
private os: MiOS;
constructor(me) {
constructor(os: MiOS, me) {
super();
this.me = me;
this.os = os;
}
public getConnection() {
if (this.connection == null) {
this.connection = new DriveStream(this.me);
this.connection = new DriveStream(this.os, this.me);
}
return this.connection;