A mapping of the events this model could emit to each event's unique name. Use this to refer an event name:
modelService.on(ModelService.Events.OFFLINE_MODEL_DELETED, (e) => {
// ...
})
See IModelServiceEvents for information on each event.
Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Creates a new model according to the options provided. If a model with the given ID already exists, this will return a rejected Promise.
A options object specifying how the model is to be created.
A Promise that is resolved with the id of the created model.
Provides the events emitted by this object as an Observable stream.
An Observable stream of all events emitted by this object.
Gets the meta data for all models currently stored offline.
The list of currently available offline models.
Gets the list of model ids that are are currently subscribed to, to be available offline.
The list of currently subscribed models.
Opens an existing model, by id, in history mode.
The id of the model to open in history mode.
A Promise resolved with the HistoricalModel when opened.
Determines if a model with the specified id is opened.
The id of the model to check.
True if the model is open, false otherwise.
Determines if a model with the specified ID is currently in the process of being opened.
The id of the model to check.
True if the model is opening, false otherwise.
Removes a single event listener for a specific event.
The name of the event to remove the listener for.
The listener callback to unregister.
This object, in support of a fluent API.
Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Adds a single shot event listener for the specified event. The listener will be called the first time the specified event is fired after the event registration occurs, after which the registration will be removed and no further events will be passed to the listener.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Opens an existing model with a known model id. A model with the specified id must already exist in the system.
Don't forget to RealTimeModel.close the model when you're done with it to avoid memory leaks!
The id of the model to open.
A promise that is resolved with the specified model, once open.
Opens a model, creating it if needed. If the model already exists, it will be opened. If the model does not exist it will be created first, and then opened.
See here for more context about race conditions this alleviates.
The options that define how to open and / or create the model.
A Promise resolved with the RealTimeModel, once opened.
Gets the permissions manager for a specific model, by id. The permissions manager will allow the caller to set the model permissions for the specified model.
The id of an existing model to get the permissions manager for.
A permissions manager for the specified model.
Searches for models using the model query syntax.
Only SELECT
s are currently supported. The grammar is as follows:
SELECT [ * ]
[ FROM <Collection> ]
[ WHERE <Condition>* ]
[ ORDER BY (<Field> [ ASC|DESC ])* ]
[ LIMIT <MaxRecords> ]
[ OFFSET <SkipRecords> ]
The query string to use to look up the model.
A promise that will be resolved with the query results.
Removes an existing model by id.
The id of the model to remove.
A Promise that is resolved when the model is successfully removed.
Removes all listeners for all events. This is useful for cleanup before disposing of this particular event emitter.
This object, in support of a fluent API.
Removes a single event listener for a specific event.
The name of the event to remove the listener for.
The listener callback to unregister.
This object, in support of a fluent API.
Removes all listeners bound on the given event.
the name of the event to remove listeners for
This object, in support of a fluent API.
The ConvergenceSession attached to this domain.
Sets the total set of models that will be proactively downloaded and made available offline. Any models currently subscribed to that do not appear in the supplied list of ids will be unsubscribe and immediately removed from the offline store.
An empty Promise that will be resolved upon successful subscription.
Adds a model or a list of models to the set of models that will be proactively downloaded and made available offline. Note that duplicates will simply be ignored.
A string or string array containing the unique ids of the models to be added to the current offline subscription list.
An empty Promise that will be resolved upon successful subscription.
Removes a model or a list of models to the set of models that will be proactively downloaded and made available offline. If a model is currently stored offline, and it is unsubscribed it will be purged from the offline store.
A string or string array containing the unique ids of the models to be removed from the current offline subscription list.
An empty Promise that will be resolved upon successful unsubscription.
This is the main entry point in Convergence for working with real time data models. RealTimeModels can be created, opened, deleted, and managed from the ModelService.
See IModelServiceEvents for the events that may be emitted on this model.