2022-02-25 21:32:03 +00:00
|
|
|
import type { IMessage, IMessageFromServer } from '../../IMessage';
|
2022-02-14 16:20:29 +00:00
|
|
|
import type { IRoom } from '../../IRoom';
|
|
|
|
import type { IUser } from '../../IUser';
|
|
|
|
|
|
|
|
export type ChannelsEndpoints = {
|
|
|
|
'channels.files': {
|
2022-02-25 21:32:03 +00:00
|
|
|
GET: (params: {
|
|
|
|
roomId: IRoom['_id'];
|
|
|
|
offset: number;
|
|
|
|
count: number;
|
|
|
|
sort: string | { uploadedAt: number };
|
|
|
|
query: string;
|
|
|
|
}) => {
|
2022-02-14 16:20:29 +00:00
|
|
|
files: IMessage[];
|
|
|
|
total: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
'channels.members': {
|
|
|
|
GET: (params: { roomId: IRoom['_id']; offset?: number; count?: number; filter?: string; status?: string[] }) => {
|
|
|
|
count: number;
|
|
|
|
offset: number;
|
|
|
|
members: IUser[];
|
|
|
|
total: number;
|
|
|
|
};
|
|
|
|
};
|
2022-02-25 21:32:03 +00:00
|
|
|
'channels.history': {
|
|
|
|
GET: (params: { roomId: string; count: number; latest?: string }) => {
|
|
|
|
messages: IMessageFromServer[];
|
|
|
|
};
|
|
|
|
};
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|