Skip to content

Commit

Permalink
chore: update rocketchat types
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlsilva committed Feb 4, 2022
1 parent d313073 commit bfcb513
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions app/definitions/IRocketChat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import rocketchat from '../lib/rocketchat';

type TRocketChat = typeof rocketchat;

export interface IRocketChatThis extends TRocketChat {
sdk: any;
}
7 changes: 4 additions & 3 deletions app/lib/methods/canOpenRoom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import database from '../database';
import { IRocketChatThis } from '../../definitions/IRocketChat';
import store from '../createStore';
import database from '../database';

const restTypes = {
channel: 'channels',
Expand All @@ -13,7 +14,7 @@ enum ETypes {
CHANNEL = 'channel'
}

async function open(this: any, { type, rid, name }: { type: ETypes; rid: string; name: string }) {
async function open(this: IRocketChatThis, { type, rid, name }: { type: ETypes; rid: string; name: string }) {
try {
const params = rid ? { roomId: rid } : { roomName: name };

Expand Down Expand Up @@ -63,7 +64,7 @@ async function open(this: any, { type, rid, name }: { type: ETypes; rid: string;
}

export default async function canOpenRoom(
this: any,
this: IRocketChatThis,
{ rid, path, isCall }: { rid: string; isCall: boolean; path: string }
): Promise<any> {
try {
Expand Down

0 comments on commit bfcb513

Please sign in to comment.