"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageNumberResolver = void 0;
const options_resolver_1 = require("../options-resolver");
const integer_validator_1 = require("../validators/integer.validator");
/**
 * Page number resolver
 */
class PageNumberResolver {
    /**
     * Resolves an page number 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 : 'pageNumber', () => undefined, altText ? altText : 'Enter page number:', 'number', new integer_validator_1.IntegerValidator()));
        return resolution;
    }
}
exports.PageNumberResolver = PageNumberResolver;
