@amityco/ts-sdk
Version:
Amity Social Cloud Typescript SDK
29 lines • 1.33 kB
TypeScript
/**
* ```js
* import { RoomRepository } from '@amityco/ts-sdk'
*
* let rooms = []
* const unsub = RoomRepository.getRooms({
* type: 'direct_streaming',
* statuses: ['live', 'idle'],
* sortBy: 'lastCreated',
* limit: 20,
* includeDeleted: false
* }, response => merge(rooms, response.data))
* ```
*
* Observe all mutations on a list of {@link Amity.Room} for a given query
*
* @param params.type the type of rooms to filter by ('direct_streaming' | 'co_hosts')
* @param params.statuses array of room statuses to filter by (['idle', 'live', 'waiting_reconnect', 'ended', 'recorded'])
* @param params.sortBy sort rooms by creation time ('firstCreated' | 'lastCreated')
* @param params.limit maximum number of rooms to retrieve per page
* @param params.includeDeleted whether to include deleted rooms in the results
* @param callback the function to call when new data are available
* @param config optional configuration for the live collection
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the rooms
*
* @category Rooms Live Collection
*/
export declare const getRooms: (params: Amity.RoomLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Room>, config?: Amity.LiveCollectionConfig) => Amity.Unsubscriber;
//# sourceMappingURL=getRooms.d.ts.map