Skip to content

Commit 6782a59

Browse files
fix typescript definitions
1 parent 302dd45 commit 6782a59

File tree

10 files changed

+20
-113
lines changed

10 files changed

+20
-113
lines changed

index.d.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ declare module "node-appwrite" {
304304
* @param {number} height
305305
* @param {number} quality
306306
* @throws {AppwriteException}
307-
* @returns {string}
307+
* @returns {Promise}
308308
*/
309-
getBrowser(code: string, width?: number, height?: number, quality?: number): string;
309+
getBrowser(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;
310310

311311
/**
312312
* Get Credit Card Icon
@@ -320,9 +320,9 @@ declare module "node-appwrite" {
320320
* @param {number} height
321321
* @param {number} quality
322322
* @throws {AppwriteException}
323-
* @returns {string}
323+
* @returns {Promise}
324324
*/
325-
getCreditCard(code: string, width?: number, height?: number, quality?: number): string;
325+
getCreditCard(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;
326326

327327
/**
328328
* Get Favicon
@@ -333,9 +333,9 @@ declare module "node-appwrite" {
333333
*
334334
* @param {string} url
335335
* @throws {AppwriteException}
336-
* @returns {string}
336+
* @returns {Promise}
337337
*/
338-
getFavicon(url: string): string;
338+
getFavicon(url: string): Promise<Buffer>;
339339

340340
/**
341341
* Get Country Flag
@@ -349,9 +349,9 @@ declare module "node-appwrite" {
349349
* @param {number} height
350350
* @param {number} quality
351351
* @throws {AppwriteException}
352-
* @returns {string}
352+
* @returns {Promise}
353353
*/
354-
getFlag(code: string, width?: number, height?: number, quality?: number): string;
354+
getFlag(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;
355355

356356
/**
357357
* Get Image from URL
@@ -365,9 +365,9 @@ declare module "node-appwrite" {
365365
* @param {number} width
366366
* @param {number} height
367367
* @throws {AppwriteException}
368-
* @returns {string}
368+
* @returns {Promise}
369369
*/
370-
getImage(url: string, width?: number, height?: number): string;
370+
getImage(url: string, width?: number, height?: number): Promise<Buffer>;
371371

372372
/**
373373
* Get User Initials
@@ -389,9 +389,9 @@ declare module "node-appwrite" {
389389
* @param {string} color
390390
* @param {string} background
391391
* @throws {AppwriteException}
392-
* @returns {string}
392+
* @returns {Promise}
393393
*/
394-
getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): string;
394+
getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): Promise<Buffer>;
395395

396396
/**
397397
* Get QR Code
@@ -404,9 +404,9 @@ declare module "node-appwrite" {
404404
* @param {number} margin
405405
* @param {boolean} download
406406
* @throws {AppwriteException}
407-
* @returns {string}
407+
* @returns {Promise}
408408
*/
409-
getQR(text: string, size?: number, margin?: number, download?: boolean): string;
409+
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<Buffer>;
410410
}
411411
export class Database extends Service {
412412

@@ -1057,9 +1057,9 @@ declare module "node-appwrite" {
10571057
*
10581058
* @param {string} fileId
10591059
* @throws {AppwriteException}
1060-
* @returns {string}
1060+
* @returns {Promise}
10611061
*/
1062-
getFileDownload(fileId: string): string;
1062+
getFileDownload(fileId: string): Promise<Buffer>;
10631063

10641064
/**
10651065
* Get File Preview
@@ -1081,9 +1081,9 @@ declare module "node-appwrite" {
10811081
* @param {string} background
10821082
* @param {string} output
10831083
* @throws {AppwriteException}
1084-
* @returns {string}
1084+
* @returns {Promise}
10851085
*/
1086-
getFilePreview(fileId: string, width?: number, height?: number, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: string): string;
1086+
getFilePreview(fileId: string, width?: number, height?: number, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: string): Promise<Buffer>;
10871087

10881088
/**
10891089
* Get File for View
@@ -1094,9 +1094,9 @@ declare module "node-appwrite" {
10941094
*
10951095
* @param {string} fileId
10961096
* @throws {AppwriteException}
1097-
* @returns {string}
1097+
* @returns {Promise}
10981098
*/
1099-
getFileView(fileId: string): string;
1099+
getFileView(fileId: string): Promise<Buffer>;
11001100
}
11011101
export class Teams extends Service {
11021102

lib/services/account.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Account extends Service {
1010
*
1111
* @throws {AppwriteException}
1212
* @returns {Promise}
13-
1413
*/
1514
async get() {
1615
let path = '/account';
@@ -32,7 +31,6 @@ class Account extends Service {
3231
*
3332
* @throws {AppwriteException}
3433
* @returns {Promise}
35-
3634
*/
3735
async delete() {
3836
let path = '/account';
@@ -57,7 +55,6 @@ class Account extends Service {
5755
* @param {string} password
5856
* @throws {AppwriteException}
5957
* @returns {Promise}
60-
6158
*/
6259
async updateEmail(email, password) {
6360
if (typeof email === 'undefined') {
@@ -92,7 +89,6 @@ class Account extends Service {
9289
*
9390
* @throws {AppwriteException}
9491
* @returns {Promise}
95-
9692
*/
9793
async getLogs() {
9894
let path = '/account/logs';
@@ -111,7 +107,6 @@ class Account extends Service {
111107
* @param {string} name
112108
* @throws {AppwriteException}
113109
* @returns {Promise}
114-
115110
*/
116111
async updateName(name) {
117112
if (typeof name === 'undefined') {
@@ -141,7 +136,6 @@ class Account extends Service {
141136
* @param {string} oldPassword
142137
* @throws {AppwriteException}
143138
* @returns {Promise}
144-
145139
*/
146140
async updatePassword(password, oldPassword) {
147141
if (typeof password === 'undefined') {
@@ -171,7 +165,6 @@ class Account extends Service {
171165
*
172166
* @throws {AppwriteException}
173167
* @returns {Promise}
174-
175168
*/
176169
async getPrefs() {
177170
let path = '/account/prefs';
@@ -191,7 +184,6 @@ class Account extends Service {
191184
* @param {object} prefs
192185
* @throws {AppwriteException}
193186
* @returns {Promise}
194-
195187
*/
196188
async updatePrefs(prefs) {
197189
if (typeof prefs === 'undefined') {
@@ -226,7 +218,6 @@ class Account extends Service {
226218
* @param {string} url
227219
* @throws {AppwriteException}
228220
* @returns {Promise}
229-
230221
*/
231222
async createRecovery(email, url) {
232223
if (typeof email === 'undefined') {
@@ -272,7 +263,6 @@ class Account extends Service {
272263
* @param {string} passwordAgain
273264
* @throws {AppwriteException}
274265
* @returns {Promise}
275-
276266
*/
277267
async updateRecovery(userId, secret, password, passwordAgain) {
278268
if (typeof userId === 'undefined') {
@@ -323,7 +313,6 @@ class Account extends Service {
323313
*
324314
* @throws {AppwriteException}
325315
* @returns {Promise}
326-
327316
*/
328317
async getSessions() {
329318
let path = '/account/sessions';
@@ -342,7 +331,6 @@ class Account extends Service {
342331
*
343332
* @throws {AppwriteException}
344333
* @returns {Promise}
345-
346334
*/
347335
async deleteSessions() {
348336
let path = '/account/sessions';
@@ -363,7 +351,6 @@ class Account extends Service {
363351
* @param {string} sessionId
364352
* @throws {AppwriteException}
365353
* @returns {Promise}
366-
367354
*/
368355
async deleteSession(sessionId) {
369356
if (typeof sessionId === 'undefined') {
@@ -400,7 +387,6 @@ class Account extends Service {
400387
* @param {string} url
401388
* @throws {AppwriteException}
402389
* @returns {Promise}
403-
404390
*/
405391
async createVerification(url) {
406392
if (typeof url === 'undefined') {
@@ -431,7 +417,6 @@ class Account extends Service {
431417
* @param {string} secret
432418
* @throws {AppwriteException}
433419
* @returns {Promise}
434-
435420
*/
436421
async updateVerification(userId, secret) {
437422
if (typeof userId === 'undefined') {

lib/services/avatars.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Avatars extends Service {
1717
* @param {number} quality
1818
* @throws {AppwriteException}
1919
* @returns {Promise}
20-
2120
*/
2221
async getBrowser(code, width, height, quality) {
2322
if (typeof code === 'undefined') {
@@ -57,7 +56,6 @@ class Avatars extends Service {
5756
* @param {number} quality
5857
* @throws {AppwriteException}
5958
* @returns {Promise}
60-
6159
*/
6260
async getCreditCard(code, width, height, quality) {
6361
if (typeof code === 'undefined') {
@@ -94,7 +92,6 @@ class Avatars extends Service {
9492
* @param {string} url
9593
* @throws {AppwriteException}
9694
* @returns {Promise}
97-
9895
*/
9996
async getFavicon(url) {
10097
if (typeof url === 'undefined') {
@@ -126,7 +123,6 @@ class Avatars extends Service {
126123
* @param {number} quality
127124
* @throws {AppwriteException}
128125
* @returns {Promise}
129-
130126
*/
131127
async getFlag(code, width, height, quality) {
132128
if (typeof code === 'undefined') {
@@ -166,7 +162,6 @@ class Avatars extends Service {
166162
* @param {number} height
167163
* @throws {AppwriteException}
168164
* @returns {Promise}
169-
170165
*/
171166
async getImage(url, width, height) {
172167
if (typeof url === 'undefined') {
@@ -214,7 +209,6 @@ class Avatars extends Service {
214209
* @param {string} background
215210
* @throws {AppwriteException}
216211
* @returns {Promise}
217-
218212
*/
219213
async getInitials(name, width, height, color, background) {
220214
let path = '/avatars/initials';
@@ -257,7 +251,6 @@ class Avatars extends Service {
257251
* @param {boolean} download
258252
* @throws {AppwriteException}
259253
* @returns {Promise}
260-
261254
*/
262255
async getQR(text, size, margin, download) {
263256
if (typeof text === 'undefined') {

lib/services/database.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Database extends Service {
1717
* @param {string} orderType
1818
* @throws {AppwriteException}
1919
* @returns {Promise}
20-
2120
*/
2221
async listCollections(search, limit, offset, orderType) {
2322
let path = '/database/collections';
@@ -55,7 +54,6 @@ class Database extends Service {
5554
* @param {string[]} rules
5655
* @throws {AppwriteException}
5756
* @returns {Promise}
58-
5957
*/
6058
async createCollection(name, read, write, rules) {
6159
if (typeof name === 'undefined') {
@@ -107,7 +105,6 @@ class Database extends Service {
107105
* @param {string} collectionId
108106
* @throws {AppwriteException}
109107
* @returns {Promise}
110-
111108
*/
112109
async getCollection(collectionId) {
113110
if (typeof collectionId === 'undefined') {
@@ -134,7 +131,6 @@ class Database extends Service {
134131
* @param {string[]} rules
135132
* @throws {AppwriteException}
136133
* @returns {Promise}
137-
138134
*/
139135
async updateCollection(collectionId, name, read, write, rules) {
140136
if (typeof collectionId === 'undefined') {
@@ -178,7 +174,6 @@ class Database extends Service {
178174
* @param {string} collectionId
179175
* @throws {AppwriteException}
180176
* @returns {Promise}
181-
182177
*/
183178
async deleteCollection(collectionId) {
184179
if (typeof collectionId === 'undefined') {
@@ -211,7 +206,6 @@ class Database extends Service {
211206
* @param {string} search
212207
* @throws {AppwriteException}
213208
* @returns {Promise}
214-
215209
*/
216210
async listDocuments(collectionId, filters, limit, offset, orderField, orderType, orderCast, search) {
217211
if (typeof collectionId === 'undefined') {
@@ -271,7 +265,6 @@ class Database extends Service {
271265
* @param {string} parentPropertyType
272266
* @throws {AppwriteException}
273267
* @returns {Promise}
274-
275268
*/
276269
async createDocument(collectionId, data, read, write, parentDocument, parentProperty, parentPropertyType) {
277270
if (typeof collectionId === 'undefined') {
@@ -324,7 +317,6 @@ class Database extends Service {
324317
* @param {string} documentId
325318
* @throws {AppwriteException}
326319
* @returns {Promise}
327-
328320
*/
329321
async getDocument(collectionId, documentId) {
330322
if (typeof collectionId === 'undefined') {
@@ -356,7 +348,6 @@ class Database extends Service {
356348
* @param {string[]} write
357349
* @throws {AppwriteException}
358350
* @returns {Promise}
359-
360351
*/
361352
async updateDocument(collectionId, documentId, data, read, write) {
362353
if (typeof collectionId === 'undefined') {
@@ -402,7 +393,6 @@ class Database extends Service {
402393
* @param {string} documentId
403394
* @throws {AppwriteException}
404395
* @returns {Promise}
405-
406396
*/
407397
async deleteDocument(collectionId, documentId) {
408398
if (typeof collectionId === 'undefined') {

0 commit comments

Comments
 (0)