This repository was archived by the owner on Sep 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathapp-pouchdb-document.d.ts
More file actions
84 lines (78 loc) · 2.52 KB
/
app-pouchdb-document.d.ts
File metadata and controls
84 lines (78 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* DO NOT EDIT
*
* This file was automatically generated by
* https://github.com/Polymer/gen-typescript-declarations
*
* To modify these typings, edit the source file(s):
* app-pouchdb-document.html
*/
/// <reference path="../polymer/types/polymer.d.ts" />
/// <reference path="../app-storage/app-storage-behavior.d.ts" />
/// <reference path="app-pouchdb-database-behavior.d.ts" />
/// <reference path="pouchdb.d.ts" />
/**
* `app-pouchdb-document` is an implementation of `Polymer.AppStorageBehavior`
* for reading and writing to individual PouchDB documents.
*
* In order to refer to a PouchDB document, provide the name of the database
* (both local and remote databases are supported) and the ID of the document.
*
* For example:
*
* ```html
* <app-pouchdb-document
* db-name="cats"
* doc-id="parsnip">
* </app-pouchdb-document>
* ```
*
* In the above example, a PouchDB instance will be created to connect to the
* local database named "cats". Then it will check to see if a document with the
* ID "parsnip" exists. If it does, the `data` property of the document will be
* set to the value of the document. If it does not, then any subsequent
* assignments to the `data` property will cause a document with ID "parsnip" to
* be created.
*
* Here is an example of a simple form that can be used to read and write to a
* PouchDB document:
*
* ```html
* <app-pouchdb-document
* db-name="cats"
* doc-id="parsnip"
* data="{{cat}}">
* </app-pouchdb-document>
* <input
* is="iron-input"
* bind-value="{{cat.name}}">
* </input>
* ```
*/
interface AppPouchdbDocumentElement extends Polymer.Element, Polymer.AppStorageBehavior, Polymer.AppPouchDBDatabaseBehavior {
readonly isNew: any;
readonly zeroValue: any;
/**
* The value of the _id (Pouch/Couch unique identifier) of the PouchDB
* document that this element's data should refer to.
*/
docId: string|null|undefined;
/**
* The current _rev (revision) of the PouchDB document that this
* element's data refers to, if the document is not new.
*/
readonly rev: string|null|undefined;
/**
* A changes event emitter. Notifies of changes to the PouchDB document
* referred to by `docId`, if a `docId` has been provided.
*/
readonly changes: object|null|undefined;
saveValue(): any;
reset(): void;
destroy(): any;
getStoredValue(storagePath: any): any;
setStoredValue(storagePath: any, value: any): any;
}
interface HTMLElementTagNameMap {
"app-pouchdb-document": AppPouchdbDocumentElement;
}