/** * The generic class which contains the cursor and pagination result. * * The class instance is returned when you make a paginated query. */ export class ChatCursorResult { /** * The cursor that specifies where to start to get data. */ cursor: string; /** * The request result. */ list?: Array; constructor(params: { cursor: string; list?: Array; opt?: { map: (obj: any) => any }; }) { this.cursor = params.cursor; let data: Array = []; params.list?.forEach((value) => { data.push(params.opt ? params.opt.map(value) : value); }); this.list = data; } }