import { BaseSession } from './sessions' class SessionManager { private _current?: BaseSession clear() { this._current = undefined return this } setCurrent(session: BaseSession) { this._current = session return this } update(...args: Parameters) { this._current.update.call(null, ...args) return this } start(session: BaseSession) { this._current = session return this } compplete(...args: Parameters) { this._current.complete.call(null, ...args) return this } cancel(...args: Parameters) { this._current.cancel.call(null, ...args) return this } get current() { return this._current } } const session = new SessionManager() export default session