/* tslint:disable */
/* eslint-disable */

export type MinifierType = "js-module" | "js-script" | "json" | "css" | "html";

export interface Attribute {
    namespace?: string;
    prefix?: string;
    name: string;
    value?: string;
}

export interface Element {
    tagName: string;
    namespace: string;
    attributes: Attribute[];
    isSelfClosing: boolean;
}

export interface Diagnostic {
    level: string;
    message: string;
    span: unknown;
}

export interface TransformOutput {
    code: string;
    errors?: Diagnostic[];
}

export interface Options {
    filename?: string;
    iframeSrcdoc?: boolean;
    scriptingEnabled?: boolean;
    forceSetHtml5Doctype?: boolean;
    collapseWhitespaces?: "none" | "all" | "smart" | "conservative" | "advanced-conservative" | "only-metadata";
    removeEmptyMetadataElements?: boolean;
    removeComments?: boolean;
    preserveComments?: string[];
    minifyConditionalComments?: boolean;
    removeEmptyAttributes?: boolean;
    removeRedundantAttributes?: "none" | "all" | "smart";
    collapseBooleanAttributes?: boolean;
    normalizeAttributes?: boolean;
    minifyJson?: boolean | { pretty?: boolean };
    minifyJs?: boolean | { parser?: unknown; minifier?: unknown; codegen?: unknown };
    minifyCss?: boolean | { lib: "lightningcss" } | { lib: "swc"; parser?: unknown; minifier?: unknown; codegen?: unknown };
    minifyAdditionalScriptsContent?: [string, MinifierType][];
    minifyAdditionalAttributes?: [string, MinifierType][];
    sortSpaceSeparatedAttributeValues?: boolean;
    sortAttributes?: boolean;
    mergeMetadataElements?: boolean;
    tagOmission?: boolean | "keep-head-and-body";
    selfClosingVoidElements?: boolean;
    quotes?: boolean;
}

export interface FragmentOptions extends Options {
    mode?: "no-quirks" | "limited-quirks" | "quirks";
    contextElement?: Element;
    context_element?: Element;
    formElement?: Element;
    form_element?: Element;
}

export function minify(content: string, options?: Options): Promise<TransformOutput>;
export function minifySync(content: string, options?: Options): TransformOutput;
export function minifyFragment(content: string, options?: FragmentOptions): Promise<TransformOutput>;
export function minifyFragmentSync(content: string, options?: FragmentOptions): TransformOutput;


