verdnatura-chat/app/definitions/rest/v1/im.ts

37 lines
763 B
TypeScript
Raw Normal View History

2022-02-28 18:00:47 +00:00
import type { IMessage } from '../../IMessage';
import type { IRoom } from '../../IRoom';
import type { IUser } from '../../IUser';
export type ImEndpoints = {
'im.create': {
POST: (
params: (
| {
username: Exclude<IUser['username'], undefined>;
}
| {
usernames: string;
}
) & {
excludeSelf?: boolean;
}
) => {
room: IRoom;
};
};
'im.files': {
GET: (params: { roomId: IRoom['_id']; count: number; sort: string; query: string }) => {
files: IMessage[];
total: number;
};
};
'im.members': {
GET: (params: { roomId: IRoom['_id']; offset?: number; count?: number; filter?: string; status?: string[] }) => {
count: number;
offset: number;
members: IUser[];
total: number;
};
};
};