com.vaadin.polymer.app.AppPouchdbConflictResolutionElement Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from app-pouchdb project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.app;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* app-pouchdb-conflict-resolution
enables declarative configuration of conflict
resolution strategies ordered by logical relationships in the DOM. Currently
two basic strategies are supported: firstWriteWins
and lastWriteWins
.
* To use app-pouchdb-conflict-resolution
, simply include the element somewhere
in a document subtree at or above the ShadowRoot of an app-pouchdb-document
or app-pouchdb-query
:
* <app-pouchdb-conflict-resolution
* strategy="lastWriteWins">
* </app-pouchdb-conflict-resolution>
* <app-pouchdb-document
* db-name="cats"
* doc-id="parsnip">
* </app-pouchdb-document>
*
* When a conflict occurs, the app-pouchdb-document
will request fire an event
to notify of the conflict and request a resolution strategy. The
app-pouchdb-conflict-resolution
element listens at its nearest ShadowRoot
boundary for conflict notifications, and responds to them as needed with a
configured strategy.
*/
@JsType(isNative=true)
public interface AppPouchdbConflictResolutionElement extends HTMLElement {
@JsOverlay public static final String TAG = "app-pouchdb-conflict-resolution";
@JsOverlay public static final String SRC = "app-pouchdb/app-pouchdb-conflict-resolution.html";
/**
* By default, this element stops propagation of any conflict events
that it is able to handle. If set to true
, the element will allow
such events to continue propagating, opening the possibility that
another conflict resolution strategy higher up the document tree will
superseed this one.
*
* JavaScript Info:
* @property allowAncestralResolution
* @type Boolean
*
*/
@JsProperty boolean getAllowAncestralResolution();
/**
* By default, this element stops propagation of any conflict events
that it is able to handle. If set to true
, the element will allow
such events to continue propagating, opening the possibility that
another conflict resolution strategy higher up the document tree will
superseed this one.
*
* JavaScript Info:
* @property allowAncestralResolution
* @type Boolean
*
*/
@JsProperty void setAllowAncestralResolution(boolean value);
/**
* The name of the strategy to use to reslve the conflict. Supported
strategies are firstWriteWins
(the default) and lastWriteWins
.
*
* JavaScript Info:
* @property strategy
* @type String
*
*/
@JsProperty String getStrategy();
/**
* The name of the strategy to use to reslve the conflict. Supported
strategies are firstWriteWins
(the default) and lastWriteWins
.
*
* JavaScript Info:
* @property strategy
* @type String
*
*/
@JsProperty void setStrategy(String value);
/**
*
*
* JavaScript Info:
* @method firstWriteWins
* @param {} db
* @param {} method
* @param {} doc
* @param {} error
*
*
*/
void firstWriteWins(Object db, Object method, Object doc, Object error);
/**
*
*
* JavaScript Info:
* @method lastWriteWins
* @param {} db
* @param {} method
* @param {} doc
* @param {} error
*
*
*/
void lastWriteWins(Object db, Object method, Object doc, Object error);
/**
*
*
* JavaScript Info:
* @method resolveConflict
* @param {} event
*
*
*/
void resolveConflict(Object event);
}