import { Minimatch } from 'minimatch'; import { Api, RedbudBaseConfig, RedbudBuildTypes, RedbudBundleConfig, RedbudBundlessConfig, RedbudBundlessTypes, RedbudConfig } from '../types'; /** * declare bundler config */ export interface BundleConfig extends RedbudBaseConfig, Omit { type: RedbudBuildTypes.BUNDLE; bundler: 'webpack'; entry: string; output: { filename: string; path: string; }; } /** * declare bundless config */ export interface BundlessConfig extends RedbudBaseConfig, Omit { type: RedbudBuildTypes.BUNDLESS; format: RedbudBundlessTypes; input: string; output: NonNullable; } /** * declare union builder config */ export declare type IBuilderConfig = BundleConfig | BundlessConfig; /** * * convert alias from tsconfig paths * @export * @param {string} cwd */ export declare function convertAliasByTsconfigPaths(cwd: string): { bundle: Record; bundless: Record; }; /** * normalize user config to bundler configs * @param userConfig config from user */ export declare function normalizeUserConfig(userConfig: RedbudConfig, pkg: Api['pkg']): IBuilderConfig[]; declare class Minimatcher { matcher?: InstanceType; ignoreMatchers: InstanceType[]; constructor(pattern: string, ignores?: string[]); match(filePath: string): boolean; } declare class ConfigProvider { pkg: ConstructorParameters[0]; constructor(pkg: Api['pkg']); onConfigChange(): void; } export declare class BundleConfigProvider extends ConfigProvider { type: RedbudBuildTypes; configs: BundleConfig[]; constructor(configs: BundleConfig[], pkg: ConstructorParameters[0]); } export declare class BundlessConfigProvider extends ConfigProvider { type: RedbudBuildTypes; configs: BundlessConfig[]; input: string; output: string; matchers: InstanceType[]; constructor(configs: BundlessConfig[], pkg: ConstructorParameters[0]); getConfigForFile(filePath: string): BundlessConfig; } export declare function createConfigProviders(userConfig: RedbudConfig, pkg: Api['pkg'], cwd: string): { bundless: { esm?: BundlessConfigProvider; cjs?: BundlessConfigProvider; }; bundle?: BundleConfigProvider | undefined; }; export {};