mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-25 14:53:10 +02:00
32 lines
496 B
TypeScript
32 lines
496 B
TypeScript
|
import Stream from './stream';
|
||
|
import StreamManager from './stream-manager';
|
||
|
|
||
|
/**
|
||
|
* Drive stream connection
|
||
|
*/
|
||
|
export class DriveStream extends Stream {
|
||
|
constructor(me) {
|
||
|
super('drive', {
|
||
|
i: me.token
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export class DriveStreamManager extends StreamManager<DriveStream> {
|
||
|
private me;
|
||
|
|
||
|
constructor(me) {
|
||
|
super();
|
||
|
|
||
|
this.me = me;
|
||
|
}
|
||
|
|
||
|
public getConnection() {
|
||
|
if (this.connection == null) {
|
||
|
this.connection = new DriveStream(this.me);
|
||
|
}
|
||
|
|
||
|
return this.connection;
|
||
|
}
|
||
|
}
|