import * as CleanCSS from 'clean-css'; import { Options as HTMLOptions } from 'html-minifier'; import { TemplatePart } from 'parse-literals'; /** * A strategy on how to minify HTML and optionally CSS. * * @template O minify HTML options * @template C minify CSS options */ export interface Strategy { /** * Retrieve a placeholder for the given array of template parts. The * placeholder returned should be the same if the function is invoked with the * same array of parts. * * The placeholder should be an HTML-compliant string that is not present in * any of the parts' text. * * @param parts the parts to get a placeholder for * @returns the placeholder */ getPlaceholder(parts: TemplatePart[]): string; /** * Combines the parts' HTML text strings together into a single string using * the provided placeholder. The placeholder indicates where a template * expression occurs. * * @param parts the parts to combine * @param placeholder the placeholder to use between parts * @returns the combined parts' text strings */ combineHTMLStrings(parts: TemplatePart[], placeholder: string): string; /** * Minfies the provided HTML string. * * @param html the html to minify * @param options html minify options * @returns minified HTML string */ minifyHTML(html: string, options?: O): string; /** * Minifies the provided CSS string. * * @param css the css to minfiy * @param options css minify options * @returns minified CSS string */ minifyCSS?(css: string, options?: C): string; /** * Splits a minfied HTML string back into an array of strings from the * provided placeholder. The returned array of strings should be the same * length as the template parts that were combined to make the HTML string. * * @param html the html string to split * @param placeholder the placeholder to split by * @returns an array of html strings */ splitHTMLByPlaceholder(html: string, placeholder: string): string[]; } /** * The default clean-css options, optimized for production * minification. */ export declare const defaultMinifyCSSOptions: CleanCSS.Options; /** * The default html-minifier options, optimized for production * minification. */ export declare const defaultMinifyOptions: HTMLOptions; /** * The default strategy. This uses html-minifier to minify HTML and * clean-css to minify CSS. */ export declare const defaultStrategy: Strategy; export declare function adjustMinifyCSSOptions(options?: CleanCSS.Options): CleanCSS.Options;