"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageSizeResolver = void 0;
const options_resolver_1 = require("../options-resolver");
const integer_validator_1 = require("../validators/integer.validator");
/**
 * Page size resolver
 */
class PageSizeResolver {
    /**
     * Resolves a page size provided by the user.
     * @param {Options} options - Command options.
     * @param {string} altText - Alternative text.
     * @param {string} altKey - Alternative key.
     * @returns {Promise<number>}
     */
    async resolve(options, altText, altKey) {
        const resolution = +(await (0, options_resolver_1.OptionsResolver)(options, altKey ? altKey : 'pageSize', () => undefined, altText ? altText : 'Enter page size:', 'number', new integer_validator_1.IntegerValidator()));
        return resolution;
    }
}
exports.PageSizeResolver = PageSizeResolver;
