From fadd35bb262c0632475cf00a4ac57970fa119714 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 2 Mar 2018 15:08:06 -0800 Subject: [PATCH] Add a typescript declaration for Sync.SubscriptionState --- lib/index.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 490b43fa..3358b83d 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -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 }