import { AuthClient } from '../../auth' ; import { RealtimeClient , RealtimeCallback , SubscribeOption , } from '../../realtime' ; export default class Realtime { private _realtime : RealtimeClient ; private _auth : AuthClient ; constructor ( realtime , auth ) { this . _realtime = realtime ; this . _auth = auth ; } subscribe < T > ( name , option , callback ) { return this . _realtime . subscribe < T > ( name , { where : option ?. where , event : option ?. event , token : this . _auth . token ( ) , } , callback ) ; } unsubscribe ( key ) { return this . _realtime . unsubscribe ( key ) ; } }