Static Member Summary
Static Public Members | ||
public static get |
adapters: Object Provides a public access to the base adapter class. |
|
public static get |
syncStrategy: Object Synchronization strategies. |
Constructor Summary
Public Constructor | ||
public |
constructor(options: Object) Constructor. |
Member Summary
Public Members | ||
public |
api: KintoClient The kinto HTTP client instance. |
|
public |
events: EventEmitter The event emitter instance. |
Private Members | ||
private |
_options: {...defaults: Object, ...options: Object} |
Method Summary
Public Methods | ||
public |
collection(collName: String, options: Object): Collection Creates a Collection instance. |
Static Public Members
public static get adapters: Object source
Provides a public access to the base adapter class. Users can create a custom DB adapter by extending BaseAdapter.
public static get syncStrategy: Object source
Synchronization strategies. Available strategies are:
MANUAL
: Conflicts will be reported in a dedicated array.SERVER_WINS
: Conflicts are resolved using remote data.CLIENT_WINS
: Conflicts are resolved using local data.
Public Constructors
public constructor(options: Object) source
Constructor.
Options:
{String}
remote
The server URL to use.{String}
bucket
The collection bucket name.{EventEmitter}
events
Events handler.{BaseAdapter}
adapter
The base DB adapter class.{Object}
adapterOptions
Options given to the adapter.{Object}
headers
The HTTP headers to use.{Object}
retry
Number of retries when the server fails to process the request (default:1
){String}
requestMode
The HTTP CORS mode to use.{Number}
timeout
The requests timeout in ms (default:5000
).
Params:
Name | Type | Attribute | Description |
options | Object | The options object. |
Public Methods
public collection(collName: String, options: Object): Collection source
Creates a Collection instance. The second (optional) parameter
will set collection-level options like e.g. remoteTransformers
.
Params:
Name | Type | Attribute | Description |
collName | String | The collection name. |
|
options | Object |
|
Extra options or override client's options. |
options.idSchema | Object |
|
IdSchema instance (default: UUID) |
options.remoteTransformers | Object |
|
Array<RemoteTransformer> (default: |
options.hooks | Object |
|
Array<Hook> (default: |
options.localFields | Object |
|
Array<Field> (default: |