Skip to content

Commit

Permalink
Fixing typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnarkhede committed Mar 20, 2020
1 parent 230878a commit c7fefa8
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions types/stream-chat/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class Channel {
show(userId?: string): Promise<APIResponse>;
getMessagesById(messageIds: string[]): Promise<APIResponse>;

mute(options?: object): Promise<MuteAPIResponse>;
mute(options?: object): Promise<MuteChannelAPIResponse>;
unmute(options?: object): Promise<UnmuteAPIResponse>;
}

Expand Down Expand Up @@ -496,11 +496,16 @@ export interface BanUserAPIResponse extends APIResponse {}
export interface UnbanUserAPIResponse extends APIResponse {}

export interface MuteAPIResponse extends APIResponse {
mute: MuteResponse;
channel_mute: MuteChannelResponse;
mute: MuteUserResponse;
own_user: OwnUserResponse;
}

export interface MuteChannelAPIResponse extends APIResponse {
mute: MuteUserResponse;
own_user: OwnUserResponse;
channel_mute: ChannelMute;
}

export interface UnmuteAPIResponse extends APIResponse {}

export interface FlagAPIResponse extends APIResponse {
Expand Down Expand Up @@ -629,6 +634,7 @@ export interface OwnUserResponse extends UserResponse {
total_unread_count: number;
unread_channels: number;
mutes: Mute[];
channel_mutes: ChannelMute[];
}

export interface Mute {
Expand Down Expand Up @@ -689,19 +695,24 @@ export interface ReadResponse {
export interface MuteResponse {
user: UserResponse;
target?: UserResponse;
channel?: Channel;
created_at?: string;
updated_at?: string;
}

export interface MuteChannelResponse {
export interface MuteUserResponse extends MuteResponse {}
export interface ChannelMute {
user: UserResponse;
channel?: Channel;
expires?: string;
created_at?: string;
updated_at?: string;
}

export interface MuteChannelAPIResponse {
channel_mute: ChannelMute;
own_user: OwnUserResponse;
}

export interface FlagResponse {
created_by_automod: boolean;
user?: UserResponse;
Expand Down

0 comments on commit c7fefa8

Please sign in to comment.