import { RulesetsInjectorInterface, ApplyRulesetsOptions } from './injector.js';
import { ManifestLoaderInterface } from './loader.js';

type PatchManifestOptions = ApplyRulesetsOptions & {
    /**
     * Match pattern to match filter files.
     *
     * @default `filter_+([0-9]).txt`
     */
    filtersMatch?: string;
};
/**
 * Api for patching manifest.
 */
declare class ManifestPatcher {
    private loader;
    private injector;
    /**
     * Default glob patter to match filter files.
     */
    static readonly DEFAULT_FILTERS_MATCH_GLOB = "filter_+([0-9]).txt";
    /**
     * Create new instance of {@link ManifestPatcher}.
     *
     * @param loader {@link ManifestLoaderInterface}.
     * @param injector {@link RulesetsInjectorInterface}.
     */
    constructor(loader?: ManifestLoaderInterface, injector?: RulesetsInjectorInterface);
    /**
     * Append rulesets into manifest `declarative_net_request` property.
     * If {@link options.forceUpdate} flag is enabled, overwrite rulesets with existing id, otherwise throw error.
     *
     * @param manifestPath Path to manifest file.
     * @param filtersPath Path to filters directory.
     * @param options Patch options {@link PatchManifestOptions}.
     *
     * @throws Error if manifest already contains ruleset with the specified ids
     * and {@link options.forceUpdate} is disabled or if manifest file or filters directory are not found.
     */
    patch(manifestPath: string, filtersPath: string, options?: Partial<PatchManifestOptions>): void;
    /**
     * Get relative path for manifest ruleset config.
     *
     * @param filtersDirPath Absolute path to filters directory.
     * @param manifestDirPath Absolute path to manifest directory.
     * @param rulesetName Ruleset Name.
     *
     * @returns Relative path to specified ruleset config.
     */
    private static getRelativeRulesetPath;
    /**
     * Gets absolute path for specified file.
     *
     * @param filePath Path to file.
     *
     * @returns Absolute path to file.
     *
     * @throws Error if file is not found.
     */
    private static getAbsolutePath;
}

export { ManifestPatcher };
export type { PatchManifestOptions };
