Add a typescript declaration for Sync.SubscriptionState

This commit is contained in:
Thomas Goyne 2018-03-02 15:08:06 -08:00
parent 384f43c637
commit fadd35bb26
1 changed files with 9 additions and 1 deletions

10
lib/index.d.ts vendored
View File

@ -406,7 +406,7 @@ declare namespace Realm.Sync {
* @see { @link https://realm.io/docs/javascript/latest/api/Realm.Sync.Subscription.html }
*/
class Subscription {
readonly state: number;
readonly state: SubscriptionState;
readonly error: string;
unsubscribe(): void;
@ -414,6 +414,14 @@ declare namespace Realm.Sync {
removeListener(subscruptionCallback: SubscriptionNotificationCallback): void;
}
enum SubscriptionState {
Error,
Creating,
Pending,
Complete,
Invalidated,
}
/**
* AuthError
* @see { @link https://realm.io/docs/javascript/latest/api/Realm.Sync.AuthError.html }