Skip to content

Commit

Permalink
✨ feat: getCommunities #3024
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Feb 13, 2023
1 parent 40d832f commit 02f2d32
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/api/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ declare module WAPI {
const getIndicatedNewMessages: () => any;
const getAllChatsWithMessages: (withNewMessageOnly?: boolean) => any;
const getAllChats: () => any;
const getCommunities: () => any;
const healthCheck: () => any;
const getState: () => string;
const getUnsentMessages: () => Promise<Message[]>;
Expand Down Expand Up @@ -527,6 +528,17 @@ export class Client {
return this._sessionInfo;
}

/**
* Easily resize page on the fly. Useful if you're showing screenshots in a web-app.
*/
public async resizePage(width = 1920, height = 1080) : Promise<boolean> {
await this._page.setViewport({
width,
height
});
return true;
}

/**
* Get the config which was used to set up the client. Sensitive details (like devTools username and password, and browserWSEndpoint) are scrubbed
*
Expand Down Expand Up @@ -2551,6 +2563,14 @@ public async testCallback(callbackToTest: SimpleListener, testData: any) : Prom
}
}

/**
* Retrieve all commmunity Ids
* @returns array of group ids
*/
public async getAllCommunities() : Promise<GroupId[]> {
return await this.pup(() => WAPI.getCommunities()) as GroupId[];
}

/**
* Retrieves group members as [Id] objects
* @param groupId group id
Expand Down

0 comments on commit 02f2d32

Please sign in to comment.