export class SearchQuery { constructor({ size, page, sort, filters }) { this.size = size this.page = page this.sort = sort this.filters = filters } } export class SearchResult { constructor({ list = [], num = 0, size = 0, total = 0 } = {}) { if (typeof num !== 'number') { throw new Error('Invalid num parameter') } if (typeof size !== 'number') { throw new Error('Invalid size parameter') } if (typeof total !== 'number') { throw new Error('Invalid total parameter') } this.list = list this.num = num this.size = size this.total = total } }