From b3ff7ada624f9fcb6d6ad6abf19e862059513857 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Fri, 15 Sep 2017 15:22:44 +0200 Subject: [PATCH] Documenting sync.config properties (#1312) * Documenting sync.config properties * Updating TypeScript definitions --- docs/realm.js | 6 +++++- lib/index.d.ts | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/realm.js b/docs/realm.js index b6055106..63c14ad5 100644 --- a/docs/realm.js +++ b/docs/realm.js @@ -291,7 +291,11 @@ Realm.defaultPath; * @property {Object} [sync] - Sync configuration parameters with the following * child properties: * - `user` - A `User` object obtained by calling `Realm.Sync.User.login` - * - `url` - A `string` which contains a valid Realm Sync url + * - `url` - A `string` which contains a valid Realm Sync url + * - `error` - A callback function which is called in error situations + * - `validate_ssl` - Indicating if SSL certificates must be validated + * - `ssl_trust_certificate_path` - A path where to find trusted SSL certificates + * The `error` callback can take up to four optional arguments: `message`, `isFatal`, `category`, and `code`. */ /** diff --git a/lib/index.d.ts b/lib/index.d.ts index 19e9a085..941fe647 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -341,11 +341,14 @@ declare namespace Realm.Sync { expiresAt?: Date; } + type ErrorCallback = (message?: string, isFatal?: boolean, category?: string, code?: number) => void; + interface SyncConfiguration { user: User; url: string; validate_ssl?: boolean; ssl_trust_certificate_path?: string; + error?: ErrorCallback; } type ProgressNotificationCallback = (transferred: number, transferable: number) => void;