Documenting sync.config properties (#1312)

* Documenting sync.config properties
* Updating TypeScript definitions
This commit is contained in:
Kenneth Geisshirt 2017-09-15 15:22:44 +02:00 committed by GitHub
parent e18f54594f
commit b3ff7ada62
2 changed files with 8 additions and 1 deletions

View File

@ -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`.
*/
/**

3
lib/index.d.ts vendored
View File

@ -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;