@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
34 lines • 1.39 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntityQueryResult = exports.QueryResultBase = void 0;
const guard_1 = __importDefault(require("../../guard"));
const entity_iterator_1 = require("./entity-iterator");
class QueryResultBase {
constructor(totalItems, offset) {
guard_1.default.notNegative(totalItems);
guard_1.default.notNegative(offset);
this.totalNumberOfResults = totalItems;
this.offset = offset;
}
}
exports.QueryResultBase = QueryResultBase;
class EntityQueryResult extends QueryResultBase {
constructor(client, query, loadConfiguration, entities, totalItems, offset) {
super(totalItems, offset);
guard_1.default.notNullOrUndefined(client);
guard_1.default.notNullOrUndefined(query);
guard_1.default.notNullOrUndefined(entities);
this._client = client;
this._query = query;
this._loadConfiguration = loadConfiguration;
this.items = [...entities];
}
createIterator() {
return new entity_iterator_1.EntityIterator(this._client, this._query, this._loadConfiguration, this);
}
}
exports.EntityQueryResult = EntityQueryResult;
//# sourceMappingURL=entity-query-result.js.map