SyncAdaptorModules encapsulate storage mechanisms that can be used by the SyncMechanism. Two examples are:
* The TiddlyWebAdaptor interfaces with servers compatible with TiddlyWeb's HTTP API, such as TiddlyWeb itself and TiddlyWiki5's built-in ServerMechanism.
SyncAdaptorModules are represented as JavaScript tiddlers with the field `module-type` set to `syncadaptor`.
! Exports
The following properties should be exposed via the `exports` object:
|!Property |!Description |
|adaptorClass |The JavaScript class for the adaptor |
Nothing should be exported if the adaptor detects that it isn't capable of operating successfully (eg, because it only runs on either the browser or the server, or because a dependency is missing).
! Adaptor Module Methods
Adaptor modules must handle the following methods.
!! `Constructor(syncer)`
Initialises a new adaptor instance.
|!Parameter |!Description |
|syncer |Syncer object that is using this adaptor |
!! `getTiddlerInfo(tiddler)`
Gets the supplemental information that the adaptor needs to keep track of for a particular tiddler. For example, the TiddlyWeb adaptor includes a `bag` field indicating the original bag of the tiddler.
|!Parameter |!Description |
|tiddler |Target tiddler |
Returns an object storing any additional information required by the adaptor.
This method is optional. If an adaptor doesn't implement it then synchronisation will be unidirectional from the TiddlyWiki store to the adaptor, but not the other way.