Fix indentation in sync docs source
This commit is contained in:
parent
94f8d5a891
commit
1bdc50ebf6
268
docs/sync.js
268
docs/sync.js
|
@ -21,40 +21,40 @@ import {stringify} from 'ini';
|
||||||
* @memberof Realm
|
* @memberof Realm
|
||||||
*/
|
*/
|
||||||
class Sync {
|
class Sync {
|
||||||
/**
|
/**
|
||||||
* Add a sync listener to listen to changes across multiple Realms
|
* Add a sync listener to listen to changes across multiple Realms
|
||||||
* @param {string} server_url - the sync server to listen to
|
* @param {string} server_url - the sync server to listen to
|
||||||
* @param {SyncUser} admin_user - an admin user obtained by calling `new Realm.Sync.User.adminUser`
|
* @param {SyncUser} admin_user - an admin user obtained by calling `new Realm.Sync.User.adminUser`
|
||||||
* @param {string} regex - a regular expression used to determine which cahnged Realms should trigger events -
|
* @param {string} regex - a regular expression used to determine which cahnged Realms should trigger events -
|
||||||
* Use `.*` to match all all Realms
|
* Use `.*` to match all all Realms
|
||||||
* @param {string} name - The name of event that should cause the callback to be called
|
* @param {string} name - The name of event that should cause the callback to be called
|
||||||
* _Currently only the 'change' event is supported_
|
* _Currently only the 'change' event is supported_
|
||||||
* @param {function(change_event)} change_callback - called when changes are made to any Realm which
|
* @param {function(change_event)} change_callback - called when changes are made to any Realm which
|
||||||
* match the given regular expression
|
* match the given regular expression
|
||||||
*/
|
*/
|
||||||
static addListener(server_url, admin_user, regex, name, change_callback) {}
|
static addListener(server_url, admin_user, regex, name, change_callback) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a previously registered sync listener
|
* Remove a previously registered sync listener
|
||||||
* @param {string} regex - the regular expression previously used to register the listener
|
* @param {string} regex - the regular expression previously used to register the listener
|
||||||
* @param {string} name - The event name
|
* @param {string} name - The event name
|
||||||
* _Currently only the 'change' event is supported_
|
* _Currently only the 'change' event is supported_
|
||||||
* @param {function(change_event)} change_callback - the previously registered callback to be removed
|
* @param {function(change_event)} change_callback - the previously registered callback to be removed
|
||||||
*/
|
*/
|
||||||
static removeListener(regex, name, change_callback) {}
|
static removeListener(regex, name, change_callback) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all previously regiestered listeners
|
* Remove all previously regiestered listeners
|
||||||
* @param {string} [name] - The name of the event whose listeners should be removed.
|
* @param {string} [name] - The name of the event whose listeners should be removed.
|
||||||
* _Currently only the 'change' event is supported_
|
* _Currently only the 'change' event is supported_
|
||||||
*/
|
*/
|
||||||
static removeAllListeners(name) {}
|
static removeAllListeners(name) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the sync log level.
|
* Set the sync log level.
|
||||||
* @param {string} log_level
|
* @param {string} log_level
|
||||||
*/
|
*/
|
||||||
static setLogLevel(log_level) {}
|
static setLogLevel(log_level) {}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -128,100 +128,100 @@ class AuthError extends Error {
|
||||||
* @memberof Realm.Sync
|
* @memberof Realm.Sync
|
||||||
*/
|
*/
|
||||||
class User {
|
class User {
|
||||||
/**
|
/**
|
||||||
* Login a sync user with username and password.
|
* Login a sync user with username and password.
|
||||||
* @param {string} server - authentication server
|
* @param {string} server - authentication server
|
||||||
* @param {string} username
|
* @param {string} username
|
||||||
* @param {string} password
|
* @param {string} password
|
||||||
* @param {function(error, user)} callback - called with the following arguments:
|
* @param {function(error, user)} callback - called with the following arguments:
|
||||||
* - `error` - an Error object is provided on failure
|
* - `error` - an Error object is provided on failure
|
||||||
* - `user` - a valid User object on success
|
* - `user` - a valid User object on success
|
||||||
*/
|
*/
|
||||||
static login(server, username, password, callback) {}
|
static login(server, username, password, callback) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register/login a sync user using an external login provider.
|
* Register/login a sync user using an external login provider.
|
||||||
* @param {string} server - authentication server
|
* @param {string} server - authentication server
|
||||||
* @param {object} options - options, containing the following:
|
* @param {object} options - options, containing the following:
|
||||||
* @param {string} options.provider - The provider type
|
* @param {string} options.provider - The provider type
|
||||||
* @param {string} options.providerToken - The access token for the given provider
|
* @param {string} options.providerToken - The access token for the given provider
|
||||||
* @param {object} [options.userInfo] - A map containing additional data required by the provider
|
* @param {object} [options.userInfo] - A map containing additional data required by the provider
|
||||||
* @param {function(error, User)} callback - called with the following arguments:
|
* @param {function(error, User)} callback - called with the following arguments:
|
||||||
* - `error` - an Error object is provided on failure
|
* - `error` - an Error object is provided on failure
|
||||||
* - `user` - a valid User object on success
|
* - `user` - a valid User object on success
|
||||||
*/
|
*/
|
||||||
static registerWithProvider(server, options, callback) {}
|
static registerWithProvider(server, options, callback) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a sync user with username and password.
|
* Register a sync user with username and password.
|
||||||
* @param {string} server - authentication server
|
* @param {string} server - authentication server
|
||||||
* @param {string} username
|
* @param {string} username
|
||||||
* @param {string} password
|
* @param {string} password
|
||||||
* @param {function(error, user)} callback - called with the following arguments:
|
* @param {function(error, user)} callback - called with the following arguments:
|
||||||
* - `error` - an Error object is provided on failure
|
* - `error` - an Error object is provided on failure
|
||||||
* - `user` - a valid User object on success
|
* - `user` - a valid User object on success
|
||||||
*/
|
*/
|
||||||
static register(server, username, password, callback) {}
|
static register(server, username, password, callback) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an admin user for the given authentication server with an existing token
|
* Create an admin user for the given authentication server with an existing token
|
||||||
* @param {string} adminToken - existing admin token
|
* @param {string} adminToken - existing admin token
|
||||||
* @return {User} - admin user populated with the given token and server
|
* @return {User} - admin user populated with the given token and server
|
||||||
*/
|
*/
|
||||||
static adminUser(adminToken) {}
|
static adminUser(adminToken) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A dictionary containing users that are currently logged in.
|
* A dictionary containing users that are currently logged in.
|
||||||
* The keys in the dictionary are user identities, values are corresponding User objects.
|
* The keys in the dictionary are user identities, values are corresponding User objects.
|
||||||
* @type {object}
|
* @type {object}
|
||||||
*/
|
*/
|
||||||
static get all() {}
|
static get all() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the currently logged in user.
|
* Get the currently logged in user.
|
||||||
* Throws error if > 1 user logged in, returns undefined if no users logged in.
|
* Throws error if > 1 user logged in, returns undefined if no users logged in.
|
||||||
* @type {User}
|
* @type {User}
|
||||||
*/
|
*/
|
||||||
static get current() {}
|
static get current() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the server URL that was used for authentication.
|
* Gets the server URL that was used for authentication.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
get server() {}
|
get server() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the identity of this user on the Realm Object Server.
|
* Gets the identity of this user on the Realm Object Server.
|
||||||
* The identity is a guaranteed to be unique among all users on the Realm Object Server.
|
* The identity is a guaranteed to be unique among all users on the Realm Object Server.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
get identity() {}
|
get identity() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets this user's refresh token. This is the user's credential for accessing the Realm
|
* Gets this user's refresh token. This is the user's credential for accessing the Realm
|
||||||
* Object Server and should be treated as sensitive data.
|
* Object Server and should be treated as sensitive data.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
get token() {}
|
get token() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this user is an administrator
|
* Returns true if this user is an administrator
|
||||||
* @type {bool}
|
* @type {bool}
|
||||||
*/
|
*/
|
||||||
get isAdmin() {}
|
get isAdmin() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs out the user from the Realm Object Server.
|
* Logs out the user from the Realm Object Server.
|
||||||
*/
|
*/
|
||||||
logout() {}
|
logout() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the management realm for this User.
|
* Get the management realm for this User.
|
||||||
* This Realm can be used to control access and permissions for Realms owned by the user.
|
* This Realm can be used to control access and permissions for Realms owned by the user.
|
||||||
* This includes giving others access to the Realms.
|
* This includes giving others access to the Realms.
|
||||||
* @returns {Realm}
|
* @returns {Realm}
|
||||||
*/
|
*/
|
||||||
openManagementRealm() {}
|
openManagementRealm() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -232,32 +232,32 @@ class User {
|
||||||
* @memberof Realm.Sync
|
* @memberof Realm.Sync
|
||||||
*/
|
*/
|
||||||
class Session {
|
class Session {
|
||||||
/**
|
/**
|
||||||
* Gets the Sync-part of the configuration that the corresponding Realm was
|
* Gets the Sync-part of the configuration that the corresponding Realm was
|
||||||
* constructed with.
|
* constructed with.
|
||||||
* @type {object}
|
* @type {object}
|
||||||
*/
|
*/
|
||||||
get config() {}
|
get config() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the User that this session was created with.
|
* Gets the User that this session was created with.
|
||||||
* @type {User}
|
* @type {User}
|
||||||
*/
|
*/
|
||||||
get user() {}
|
get user() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the URL of the Realm Object Server that this session is connected to.
|
* Gets the URL of the Realm Object Server that this session is connected to.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
get url() {}
|
get url() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current state of the session.
|
* Gets the current state of the session.
|
||||||
* Can be either:
|
* Can be either:
|
||||||
* - "active": The session is connected to the Realm Object Server and is actively transferring data.
|
* - "active": The session is connected to the Realm Object Server and is actively transferring data.
|
||||||
* - "inactive": The session is not currently communicating with the Realm Object Server.
|
* - "inactive": The session is not currently communicating with the Realm Object Server.
|
||||||
* - "invalid": A non-recoverable error has occurred, and this session is semantically invalid. A new session should be created.
|
* - "invalid": A non-recoverable error has occurred, and this session is semantically invalid. A new session should be created.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
get state() {}
|
get state() {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue