Chore: Migrate REST API - spotlight to Typescript (#3821)
* Chore: Migrate REST API - spotlight to Typescript * minor tweak
This commit is contained in:
parent
d43da089bf
commit
b21d044f13
|
@ -0,0 +1,11 @@
|
|||
import { IServerRoomItem } from './IRoom';
|
||||
import { IUser } from './IUser';
|
||||
|
||||
export type TSpotlightUser = Pick<IUser, '_id' | 'status' | 'name' | 'username'> & { outside: boolean };
|
||||
|
||||
export type ISpotlightRoom = Pick<IServerRoomItem, '_id' | 'name' | 't'> & Partial<Pick<IServerRoomItem, 'lastMessage'>>;
|
||||
|
||||
export interface ISpotlight {
|
||||
users: TSpotlightUser[];
|
||||
rooms: ISpotlightRoom[];
|
||||
}
|
|
@ -2,6 +2,7 @@ import sdk from './sdk';
|
|||
import { TEAM_TYPE } from '../../../definitions/ITeam';
|
||||
import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType';
|
||||
import { SubscriptionType, INotificationPreferences } from '../../../definitions';
|
||||
import { ISpotlight } from '../../../definitions/ISpotlight';
|
||||
|
||||
export const createChannel = ({
|
||||
name,
|
||||
|
@ -72,7 +73,7 @@ export const forgotPassword = (email: string) =>
|
|||
export const sendConfirmationEmail = (email: string): Promise<{ message: string; success: boolean }> =>
|
||||
sdk.methodCallWrapper('sendConfirmationEmail', email);
|
||||
|
||||
export const spotlight = (search: string, usernames: string, type: { users: boolean; rooms: boolean }) =>
|
||||
export const spotlight = (search: string, usernames: string[], type: { users: boolean; rooms: boolean }): Promise<ISpotlight> =>
|
||||
// RC 0.51.0
|
||||
sdk.methodCallWrapper('spotlight', search, usernames, type);
|
||||
|
||||
|
|
Loading…
Reference in New Issue