/**
 * Promise representing the response to subscription, and offering an additional
 * cancel() method to stop listening for updates.
 *
 * This is returned from DCRFClient.subscribe.
 */ export class SubscriptionPromise < T > extends Promise < T > { protected unsubscribe : ( ) => Promise < boolean > ; constructor ( executor , unsubscribe ) { super ( executor ) ; this . unsubscribe = unsubscribe ; } return public async cancel ( ) { return await this . unsubscribe ( ) ; } }