1 | import { Collection } from './collection';
|
2 | import { NodeCallback } from './utilities';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare class CouchbaseList {
|
11 | private _coll;
|
12 | private _key;
|
13 | |
14 |
|
15 |
|
16 | constructor(collection: Collection, key: string);
|
17 | private _get;
|
18 | /**
|
19 | * Returns the entire list of items in this list.
|
20 | *
|
21 | * @param callback A node-style callback to be invoked after execution.
|
22 | */
|
23 | getAll(callback?: NodeCallback<any[]>): Promise<any[]>;
|
24 | /**
|
25 | * Iterates each item in the list.
|
26 | *
|
27 | * @param rowCallback A callback invoked for each item in the list.
|
28 | * @param callback A node-style callback to be invoked after execution.
|
29 | */
|
30 | forEach(rowCallback: (value: any, index: number, array: CouchbaseList) => void, callback?: NodeCallback<void>): Promise<void>;
|
31 | /**
|
32 | * Provides the ability to async-for loop this object.
|
33 | */
|
34 | [Symbol.asyncIterator](): AsyncIterator<any>;
|
35 | /**
|
36 | * Retrieves the item at a specific index in the list.
|
37 | *
|
38 | * @param index The index to retrieve.
|
39 | * @param callback A node-style callback to be invoked after execution.
|
40 | */
|
41 | getAt(index: number, callback?: NodeCallback<any>): Promise<any>;
|
42 | /**
|
43 | * Removes an item at a specific index from the list.
|
44 | *
|
45 | * @param index The index to remove.
|
46 | * @param callback A node-style callback to be invoked after execution.
|
47 | */
|
48 | removeAt(index: number, callback?: NodeCallback<void>): Promise<void>;
|
49 | /**
|
50 | * Returns the index of a specific value from the list.
|
51 | *
|
52 | * @param value The value to search for.
|
53 | * @param callback A node-style callback to be invoked after execution.
|
54 | */
|
55 | indexOf(value: any, callback?: NodeCallback<number>): Promise<number>;
|
56 | /**
|
57 | * Returns the number of items in the list.
|
58 | *
|
59 | * @param callback A node-style callback to be invoked after execution.
|
60 | */
|
61 | size(callback?: NodeCallback<number>): Promise<number>;
|
62 | /**
|
63 | * Adds a new item to the end of the list.
|
64 | *
|
65 | * @param value The value to add.
|
66 | * @param callback A node-style callback to be invoked after execution.
|
67 | */
|
68 | push(value: any, callback?: NodeCallback<void>): Promise<void>;
|
69 | /**
|
70 | * Adds a new item to the beginning of the list.
|
71 | *
|
72 | * @param value The value to add.
|
73 | * @param callback A node-style callback to be invoked after execution.
|
74 | */
|
75 | unshift(value: any, callback?: NodeCallback<void>): Promise<void>;
|
76 | }
|
77 | /**
|
78 | * CouchbaseMap provides a simplified interface for storing a map
|
79 | * within a Couchbase document.
|
80 | *
|
81 | * @see {@link Collection.map}
|
82 | * @category Datastructures
|
83 | */
|
84 | export declare class CouchbaseMap {
|
85 | private _coll;
|
86 | private _key;
|
87 | |
88 |
|
89 |
|
90 | constructor(collection: Collection, key: string);
|
91 | private _get;
|
92 | /**
|
93 | * Returns an object representing all items in the map.
|
94 | *
|
95 | * @param callback A node-style callback to be invoked after execution.
|
96 | */
|
97 | getAll(callback?: NodeCallback<{
|
98 | [key: string]: any;
|
99 | }>): Promise<{
|
100 | [key: string]: any;
|
101 | }>;
|
102 | |
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 | forEach(rowCallback: (value: any, key: string, map: CouchbaseMap) => void, callback?: NodeCallback<void>): Promise<void>;
|
109 | |
110 |
|
111 |
|
112 | [Symbol.asyncIterator](): AsyncIterator<[any, string]>;
|
113 | |
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | set(item: string, value: any, callback?: NodeCallback<void>): Promise<void>;
|
121 | |
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | get(item: string, callback?: NodeCallback<any>): Promise<any>;
|
128 | |
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | remove(item: string, callback?: NodeCallback<void>): Promise<void>;
|
135 | |
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | exists(item: string, callback?: NodeCallback<boolean>): Promise<boolean>;
|
142 | |
143 |
|
144 |
|
145 |
|
146 |
|
147 | keys(callback?: NodeCallback<string[]>): Promise<string[]>;
|
148 | |
149 |
|
150 |
|
151 |
|
152 |
|
153 | values(callback?: NodeCallback<any[]>): Promise<any[]>;
|
154 | |
155 |
|
156 |
|
157 |
|
158 |
|
159 | size(callback?: NodeCallback<number>): Promise<number>;
|
160 | }
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 | export declare class CouchbaseQueue {
|
169 | private _coll;
|
170 | private _key;
|
171 | |
172 |
|
173 |
|
174 | constructor(collection: Collection, key: string);
|
175 | private _get;
|
176 | /**
|
177 | * Returns the number of items in the queue.
|
178 | *
|
179 | * @param callback A node-style callback to be invoked after execution.
|
180 | */
|
181 | size(callback?: NodeCallback<number>): Promise<number>;
|
182 | /**
|
183 | * Adds a new item to the back of the queue.
|
184 | *
|
185 | * @param value The value to add.
|
186 | * @param callback A node-style callback to be invoked after execution.
|
187 | */
|
188 | push(value: any, callback?: NodeCallback<void>): Promise<void>;
|
189 | /**
|
190 | * Removes an item from the front of the queue.
|
191 | *
|
192 | * @param callback A node-style callback to be invoked after execution.
|
193 | */
|
194 | pop(callback?: NodeCallback<any>): Promise<any>;
|
195 | }
|
196 | /**
|
197 | * CouchbaseSet provides a simplified interface for storing a set
|
198 | * within a Couchbase document.
|
199 | *
|
200 | * @see {@link Collection.set}
|
201 | * @category Datastructures
|
202 | */
|
203 | export declare class CouchbaseSet {
|
204 | private _coll;
|
205 | private _key;
|
206 | |
207 |
|
208 |
|
209 | constructor(collection: Collection, key: string);
|
210 | private _get;
|
211 | /**
|
212 | * Adds a new item to the set. Returning whether the item already existed
|
213 | * in the set or not.
|
214 | *
|
215 | * @param item The item to add.
|
216 | * @param callback A node-style callback to be invoked after execution.
|
217 | */
|
218 | add(item: any, callback?: NodeCallback<boolean>): Promise<boolean>;
|
219 | /**
|
220 | * Returns whether a specific value already exists in the set.
|
221 | *
|
222 | * @param item The value to search for.
|
223 | * @param callback A node-style callback to be invoked after execution.
|
224 | */
|
225 | contains(item: any, callback?: NodeCallback<boolean>): Promise<boolean>;
|
226 | /**
|
227 | * Removes a specific value from the set.
|
228 | *
|
229 | * @param item The value to remove.
|
230 | * @param callback A node-style callback to be invoked after execution.
|
231 | */
|
232 | remove(item: any, callback?: NodeCallback<void>): Promise<void>;
|
233 | /**
|
234 | * Returns a list of all values in the set.
|
235 | *
|
236 | * @param callback A node-style callback to be invoked after execution.
|
237 | */
|
238 | values(callback?: NodeCallback<any[]>): Promise<any[]>;
|
239 | /**
|
240 | * Returns the number of elements in this set.
|
241 | *
|
242 | * @param callback A node-style callback to be invoked after execution.
|
243 | */
|
244 | size(callback?: NodeCallback<number>): Promise<number>;
|
245 | }
|