import PostHTML from 'posthtml';

type PostHTMLNodeLike = PostHTML.Node | string;
type PostHTMLTreeLike = [PostHTMLNodeLike] & PostHTML.NodeAPI & {
    options?: {
        quoteAllAttributes?: boolean | undefined;
        quoteStyle?: 0 | 1 | 2 | undefined;
        replaceQuote?: boolean | undefined;
    } | undefined;
    render(): string;
    render(node: PostHTMLNodeLike | PostHTMLTreeLike, renderOptions?: any): string;
};
type MaybeArray<T> = T | Array<T>;
type HtmlnanoTemplateRule = {
    tag: string;
    attrs?: Record<string, string | boolean | void>;
};
type MinifyHtmlTemplateOptions = boolean | HtmlnanoTemplateRule[];
type HtmlnanoMinifyCssOptions = object;
type HtmlnanoMinifyJsOptions = object;
type HtmlnanoMinifySvgOptions = object;
type HtmlnanoPurgeCssPattern = string | RegExp;
type HtmlnanoPurgeCssExtractorResultDetailed = {
    attributes: {
        names: string[];
        values: string[];
    };
    classes: string[];
    ids: string[];
    tags: string[];
    undetermined: string[];
};
type HtmlnanoPurgeCssExtractorResult = HtmlnanoPurgeCssExtractorResultDetailed | string[];
type HtmlnanoPurgeCssDefaultExtractor = (content: string) => HtmlnanoPurgeCssExtractorResult;
type HtmlnanoPurgeCssSourceMapOptions = {
    absolute?: boolean;
    annotation?: boolean | string;
    from?: string;
    inline?: boolean;
    prev?: boolean | object | string;
    sourcesContent?: boolean;
    to?: string;
};
type HtmlnanoPurgeCssSafelist = HtmlnanoPurgeCssPattern[] | {
    standard?: HtmlnanoPurgeCssPattern[];
    deep?: RegExp[];
    greedy?: RegExp[];
    variables?: HtmlnanoPurgeCssPattern[];
    keyframes?: HtmlnanoPurgeCssPattern[];
};
interface HtmlnanoPurgeCssOptions {
    tool: 'purgeCSS';
    defaultExtractor?: HtmlnanoPurgeCssDefaultExtractor;
    fontFace?: boolean;
    keyframes?: boolean;
    output?: string;
    rejected?: boolean;
    rejectedCss?: boolean;
    sourceMap?: boolean | HtmlnanoPurgeCssSourceMapOptions;
    stdin?: boolean;
    stdout?: boolean;
    variables?: boolean;
    safelist?: HtmlnanoPurgeCssSafelist;
    blocklist?: HtmlnanoPurgeCssPattern[];
    skippedContentGlobs?: string[];
    dynamicAttributes?: string[];
}
interface HtmlnanoOptions {
    skipConfigLoading?: boolean;
    configPath?: string;
    skipInternalWarnings?: boolean;
    collapseAttributeWhitespace?: boolean;
    collapseBooleanAttributes?: {
        amphtml?: boolean;
    };
    collapseWhitespace?: 'conservative' | 'all' | 'aggressive';
    custom?: MaybeArray<(tree: PostHTMLTreeLike, options?: any) => (PostHTML.Node | PostHTMLTreeLike)>;
    deduplicateAttributeValues?: boolean;
    minifyUrls?: URL | string | false;
    mergeStyles?: boolean;
    mergeScripts?: boolean;
    minifyCss?: HtmlnanoMinifyCssOptions | boolean;
    minifyHtmlTemplate?: MinifyHtmlTemplateOptions;
    minifyConditionalComments?: boolean;
    minifyJs?: HtmlnanoMinifyJsOptions | boolean;
    minifyJson?: boolean;
    minifyAttributes?: boolean | {
        metaContent?: boolean;
        redundantWhitespaces?: 'safe' | 'agressive' | false;
    };
    minifySvg?: HtmlnanoMinifySvgOptions | boolean;
    normalizeAttributeValues?: boolean;
    removeAttributeQuotes?: boolean | {
        force?: boolean;
    };
    removeComments?: boolean | RegExp | ((comment: string) => boolean) | string;
    removeEmptyAttributes?: boolean;
    removeEmptyElements?: boolean | {
        removeWithAttributes?: boolean;
    };
    removeRedundantAttributes?: boolean;
    removeOptionalTags?: boolean;
    removeUnusedCss?: boolean | HtmlnanoPurgeCssOptions | {
        tool?: 'uncss';
        banner?: boolean;
        csspath?: string;
        htmlroot?: string;
        ignore?: (string | RegExp)[];
        inject?: string;
        jsdom?: object;
        media?: string[];
        report?: boolean;
        strictSSL?: boolean;
        timeout?: number;
        uncssrc?: string;
        userAgent?: string;
    };
    sortAttributes?: boolean | 'alphabetical' | 'frequency';
    sortAttributesWithLists?: boolean | 'alphabetical' | 'frequency';
}
type HtmlnanoModuleAttrsHandler = (attrs: Record<string, string | boolean | void>, node: PostHTML.Node) => Record<string, string | boolean | void>;
type HtmlnanoModuleContentHandler = (content: Array<PostHTMLNodeLike>, node: PostHTML.Node) => MaybeArray<PostHTMLNodeLike>;
type HtmlnanoModuleNodeHandler = (node: PostHTMLNodeLike) => PostHTML.Node | string;
type OptionalOptions<T> = T extends boolean | string | Function | number | null | undefined ? T : T extends Array<infer Item> ? Array<Item> : T extends object ? Partial<T> : T;
type HtmlnanoModule<Options = any> = {
    onAttrs?: (options: Partial<HtmlnanoOptions>, moduleOptions: OptionalOptions<Options>) => HtmlnanoModuleAttrsHandler;
    onContent?: (options: Partial<HtmlnanoOptions>, moduleOptions: OptionalOptions<Options>) => HtmlnanoModuleContentHandler;
    onNode?: (options: Partial<HtmlnanoOptions>, moduleOptions: OptionalOptions<Options>) => HtmlnanoModuleNodeHandler;
    default?: (tree: PostHTMLTreeLike, options: Partial<HtmlnanoOptions>, moduleOptions: OptionalOptions<Options>) => PostHTMLTreeLike | Promise<PostHTMLTreeLike>;
};

type RemoveAttributeQuotesOptions = {
    force?: boolean;
};
declare const mod: HtmlnanoModule<RemoveAttributeQuotesOptions>;

export { mod as default };
