"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sharedToolsConfigSchema = exports.FileFilterUtilSchema = void 0;
const dev_1 = require("./dev");
const utils_1 = require("../utils");
exports.FileFilterUtilSchema = utils_1.z.function(utils_1.z.tuple([utils_1.z.arrayOrNot(utils_1.z.union([utils_1.z.string(), utils_1.z.instanceof(RegExp)]))]), utils_1.z.void());
const sharedDevServerConfigSchema = utils_1.z.partialObj({
    after: utils_1.z.array(utils_1.z.function()),
    before: utils_1.z.array(utils_1.z.function()),
    client: utils_1.z.partialObj({
        protocol: utils_1.z.string(),
        path: utils_1.z.string(),
        port: utils_1.z.string(),
        host: utils_1.z.string(),
    }),
    devMiddleware: utils_1.z.object({
        writeToDisk: utils_1.z.union([
            utils_1.z.boolean(),
            utils_1.z.function().args(utils_1.z.string()).returns(utils_1.z.boolean()),
        ]),
    }),
    historyApiFallback: utils_1.z.union([utils_1.z.boolean(), utils_1.z.record(utils_1.z.unknown())]),
    compress: utils_1.z.boolean(),
    hot: utils_1.z.boolean(),
    https: dev_1.DevServerHttpsOptionsSchema,
    liveReload: utils_1.z.boolean(),
    setupMiddlewares: utils_1.z.array(utils_1.z.function()),
    headers: utils_1.z.record(utils_1.z.union([utils_1.z.string(), utils_1.z.array(utils_1.z.string())])),
    proxy: utils_1.z.union([utils_1.z.record(utils_1.z.unknown()), utils_1.z.array(utils_1.z.any())]),
    watch: utils_1.z.boolean(),
});
exports.sharedToolsConfigSchema = utils_1.z.partialObj({
    devServer: sharedDevServerConfigSchema,
    bundlerChain: utils_1.z.arrayOrNot(utils_1.z.function()),
});
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _schema = exports.sharedToolsConfigSchema;
