Skip to content

Commit

Permalink
fix typescript definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Jun 3, 2021
1 parent 302dd45 commit 6782a59
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 113 deletions.
40 changes: 20 additions & 20 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ declare module "node-appwrite" {
* @param {number} height
* @param {number} quality
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getBrowser(code: string, width?: number, height?: number, quality?: number): string;
getBrowser(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;

/**
* Get Credit Card Icon
Expand All @@ -320,9 +320,9 @@ declare module "node-appwrite" {
* @param {number} height
* @param {number} quality
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getCreditCard(code: string, width?: number, height?: number, quality?: number): string;
getCreditCard(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;

/**
* Get Favicon
Expand All @@ -333,9 +333,9 @@ declare module "node-appwrite" {
*
* @param {string} url
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getFavicon(url: string): string;
getFavicon(url: string): Promise<Buffer>;

/**
* Get Country Flag
Expand All @@ -349,9 +349,9 @@ declare module "node-appwrite" {
* @param {number} height
* @param {number} quality
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getFlag(code: string, width?: number, height?: number, quality?: number): string;
getFlag(code: string, width?: number, height?: number, quality?: number): Promise<Buffer>;

/**
* Get Image from URL
Expand All @@ -365,9 +365,9 @@ declare module "node-appwrite" {
* @param {number} width
* @param {number} height
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getImage(url: string, width?: number, height?: number): string;
getImage(url: string, width?: number, height?: number): Promise<Buffer>;

/**
* Get User Initials
Expand All @@ -389,9 +389,9 @@ declare module "node-appwrite" {
* @param {string} color
* @param {string} background
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): string;
getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): Promise<Buffer>;

/**
* Get QR Code
Expand All @@ -404,9 +404,9 @@ declare module "node-appwrite" {
* @param {number} margin
* @param {boolean} download
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getQR(text: string, size?: number, margin?: number, download?: boolean): string;
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<Buffer>;
}
export class Database extends Service {

Expand Down Expand Up @@ -1057,9 +1057,9 @@ declare module "node-appwrite" {
*
* @param {string} fileId
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getFileDownload(fileId: string): string;
getFileDownload(fileId: string): Promise<Buffer>;

/**
* Get File Preview
Expand All @@ -1081,9 +1081,9 @@ declare module "node-appwrite" {
* @param {string} background
* @param {string} output
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getFilePreview(fileId: string, width?: number, height?: number, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: string): string;
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>;

/**
* Get File for View
Expand All @@ -1094,9 +1094,9 @@ declare module "node-appwrite" {
*
* @param {string} fileId
* @throws {AppwriteException}
* @returns {string}
* @returns {Promise}
*/
getFileView(fileId: string): string;
getFileView(fileId: string): Promise<Buffer>;
}
export class Teams extends Service {

Expand Down
15 changes: 0 additions & 15 deletions lib/services/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Account extends Service {
*
* @throws {AppwriteException}
* @returns {Promise}
*/
async get() {
let path = '/account';
Expand All @@ -32,7 +31,6 @@ class Account extends Service {
*
* @throws {AppwriteException}
* @returns {Promise}
*/
async delete() {
let path = '/account';
Expand All @@ -57,7 +55,6 @@ class Account extends Service {
* @param {string} password
* @throws {AppwriteException}
* @returns {Promise}
*/
async updateEmail(email, password) {
if (typeof email === 'undefined') {
Expand Down Expand Up @@ -92,7 +89,6 @@ class Account extends Service {
*
* @throws {AppwriteException}
* @returns {Promise}
*/
async getLogs() {
let path = '/account/logs';
Expand All @@ -111,7 +107,6 @@ class Account extends Service {
* @param {string} name
* @throws {AppwriteException}
* @returns {Promise}
*/
async updateName(name) {
if (typeof name === 'undefined') {
Expand Down Expand Up @@ -141,7 +136,6 @@ class Account extends Service {
* @param {string} oldPassword
* @throws {AppwriteException}
* @returns {Promise}
*/
async updatePassword(password, oldPassword) {
if (typeof password === 'undefined') {
Expand Down Expand Up @@ -171,7 +165,6 @@ class Account extends Service {
*
* @throws {AppwriteException}
* @returns {Promise}
*/
async getPrefs() {
let path = '/account/prefs';
Expand All @@ -191,7 +184,6 @@ class Account extends Service {
* @param {object} prefs
* @throws {AppwriteException}
* @returns {Promise}
*/
async updatePrefs(prefs) {
if (typeof prefs === 'undefined') {
Expand Down Expand Up @@ -226,7 +218,6 @@ class Account extends Service {
* @param {string} url
* @throws {AppwriteException}
* @returns {Promise}
*/
async createRecovery(email, url) {
if (typeof email === 'undefined') {
Expand Down Expand Up @@ -272,7 +263,6 @@ class Account extends Service {
* @param {string} passwordAgain
* @throws {AppwriteException}
* @returns {Promise}
*/
async updateRecovery(userId, secret, password, passwordAgain) {
if (typeof userId === 'undefined') {
Expand Down Expand Up @@ -323,7 +313,6 @@ class Account extends Service {
*
* @throws {AppwriteException}
* @returns {Promise}
*/
async getSessions() {
let path = '/account/sessions';
Expand All @@ -342,7 +331,6 @@ class Account extends Service {
*
* @throws {AppwriteException}
* @returns {Promise}
*/
async deleteSessions() {
let path = '/account/sessions';
Expand All @@ -363,7 +351,6 @@ class Account extends Service {
* @param {string} sessionId
* @throws {AppwriteException}
* @returns {Promise}
*/
async deleteSession(sessionId) {
if (typeof sessionId === 'undefined') {
Expand Down Expand Up @@ -400,7 +387,6 @@ class Account extends Service {
* @param {string} url
* @throws {AppwriteException}
* @returns {Promise}
*/
async createVerification(url) {
if (typeof url === 'undefined') {
Expand Down Expand Up @@ -431,7 +417,6 @@ class Account extends Service {
* @param {string} secret
* @throws {AppwriteException}
* @returns {Promise}
*/
async updateVerification(userId, secret) {
if (typeof userId === 'undefined') {
Expand Down
7 changes: 0 additions & 7 deletions lib/services/avatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Avatars extends Service {
* @param {number} quality
* @throws {AppwriteException}
* @returns {Promise}
*/
async getBrowser(code, width, height, quality) {
if (typeof code === 'undefined') {
Expand Down Expand Up @@ -57,7 +56,6 @@ class Avatars extends Service {
* @param {number} quality
* @throws {AppwriteException}
* @returns {Promise}
*/
async getCreditCard(code, width, height, quality) {
if (typeof code === 'undefined') {
Expand Down Expand Up @@ -94,7 +92,6 @@ class Avatars extends Service {
* @param {string} url
* @throws {AppwriteException}
* @returns {Promise}
*/
async getFavicon(url) {
if (typeof url === 'undefined') {
Expand Down Expand Up @@ -126,7 +123,6 @@ class Avatars extends Service {
* @param {number} quality
* @throws {AppwriteException}
* @returns {Promise}
*/
async getFlag(code, width, height, quality) {
if (typeof code === 'undefined') {
Expand Down Expand Up @@ -166,7 +162,6 @@ class Avatars extends Service {
* @param {number} height
* @throws {AppwriteException}
* @returns {Promise}
*/
async getImage(url, width, height) {
if (typeof url === 'undefined') {
Expand Down Expand Up @@ -214,7 +209,6 @@ class Avatars extends Service {
* @param {string} background
* @throws {AppwriteException}
* @returns {Promise}
*/
async getInitials(name, width, height, color, background) {
let path = '/avatars/initials';
Expand Down Expand Up @@ -257,7 +251,6 @@ class Avatars extends Service {
* @param {boolean} download
* @throws {AppwriteException}
* @returns {Promise}
*/
async getQR(text, size, margin, download) {
if (typeof text === 'undefined') {
Expand Down
10 changes: 0 additions & 10 deletions lib/services/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Database extends Service {
* @param {string} orderType
* @throws {AppwriteException}
* @returns {Promise}
*/
async listCollections(search, limit, offset, orderType) {
let path = '/database/collections';
Expand Down Expand Up @@ -55,7 +54,6 @@ class Database extends Service {
* @param {string[]} rules
* @throws {AppwriteException}
* @returns {Promise}
*/
async createCollection(name, read, write, rules) {
if (typeof name === 'undefined') {
Expand Down Expand Up @@ -107,7 +105,6 @@ class Database extends Service {
* @param {string} collectionId
* @throws {AppwriteException}
* @returns {Promise}
*/
async getCollection(collectionId) {
if (typeof collectionId === 'undefined') {
Expand All @@ -134,7 +131,6 @@ class Database extends Service {
* @param {string[]} rules
* @throws {AppwriteException}
* @returns {Promise}
*/
async updateCollection(collectionId, name, read, write, rules) {
if (typeof collectionId === 'undefined') {
Expand Down Expand Up @@ -178,7 +174,6 @@ class Database extends Service {
* @param {string} collectionId
* @throws {AppwriteException}
* @returns {Promise}
*/
async deleteCollection(collectionId) {
if (typeof collectionId === 'undefined') {
Expand Down Expand Up @@ -211,7 +206,6 @@ class Database extends Service {
* @param {string} search
* @throws {AppwriteException}
* @returns {Promise}
*/
async listDocuments(collectionId, filters, limit, offset, orderField, orderType, orderCast, search) {
if (typeof collectionId === 'undefined') {
Expand Down Expand Up @@ -271,7 +265,6 @@ class Database extends Service {
* @param {string} parentPropertyType
* @throws {AppwriteException}
* @returns {Promise}
*/
async createDocument(collectionId, data, read, write, parentDocument, parentProperty, parentPropertyType) {
if (typeof collectionId === 'undefined') {
Expand Down Expand Up @@ -324,7 +317,6 @@ class Database extends Service {
* @param {string} documentId
* @throws {AppwriteException}
* @returns {Promise}
*/
async getDocument(collectionId, documentId) {
if (typeof collectionId === 'undefined') {
Expand Down Expand Up @@ -356,7 +348,6 @@ class Database extends Service {
* @param {string[]} write
* @throws {AppwriteException}
* @returns {Promise}
*/
async updateDocument(collectionId, documentId, data, read, write) {
if (typeof collectionId === 'undefined') {
Expand Down Expand Up @@ -402,7 +393,6 @@ class Database extends Service {
* @param {string} documentId
* @throws {AppwriteException}
* @returns {Promise}
*/
async deleteDocument(collectionId, documentId) {
if (typeof collectionId === 'undefined') {
Expand Down
Loading

0 comments on commit 6782a59

Please sign in to comment.