"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sharedPerformanceConfigSchema = exports.SplitCustomSchema = exports.SplitBySizeSchema = exports.BaseSplitRulesSchema = exports.ForceSplittingSchema = exports.BuildCacheOptionsSchema = exports.ConsoleTypeSchema = void 0;
const utils_1 = require("../utils");
exports.ConsoleTypeSchema = utils_1.z.literals([
    'log',
    'info',
    'warn',
    'error',
    'table',
    'group',
]);
exports.BuildCacheOptionsSchema = utils_1.z.partialObj({ cacheDirectory: utils_1.z.string() });
exports.ForceSplittingSchema = utils_1.z
    .union([
    utils_1.z.array(utils_1.z.instanceof(RegExp)),
    utils_1.z.record(utils_1.z.string(), utils_1.z.instanceof(RegExp)),
])
    .optional();
exports.BaseSplitRulesSchema = utils_1.z.object({
    strategy: utils_1.z.string(),
    forceSplitting: exports.ForceSplittingSchema,
    override: utils_1.z.any().optional(),
});
exports.SplitBySizeSchema = exports.BaseSplitRulesSchema.extend({
    strategy: utils_1.z.literal('split-by-size'),
    minSize: utils_1.z.number().optional(),
    maxSize: utils_1.z.number().optional(),
});
exports.SplitCustomSchema = exports.BaseSplitRulesSchema.extend({
    strategy: utils_1.z.literal('custom'),
    splitChunks: utils_1.z.any().optional(),
});
exports.sharedPerformanceConfigSchema = utils_1.z.partialObj({
    removeConsole: utils_1.z.union([utils_1.z.boolean(), utils_1.z.array(exports.ConsoleTypeSchema)]),
    removeMomentLocale: utils_1.z.boolean(),
    buildCache: utils_1.z.union([exports.BuildCacheOptionsSchema, utils_1.z.boolean()]),
    profile: utils_1.z.boolean(),
    printFileSize: utils_1.z.boolean(),
});
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _schema = exports.sharedPerformanceConfigSchema;
