html-minifier
Version:
Highly effective, super-configurable, well-tested web page minifier
44 lines • 1.52 kB
TypeScript
/**
* CSS and script content wrapping for minification
*/
import type { ProcessedOptions } from './options.js';
/** @import { ProcessedOptions } from './options.js' */
/**
* @param {string} text
* @param {string} [type]
*/
declare function wrapCSS(text: string, type?: string): string;
/**
* @param {string} text
* @param {string} [type]
*/
declare function unwrapCSS(text: string, type?: string): string;
/** @param {Array<{name: string, value?: string}>} attrs */
declare function hasJsonScriptType(attrs: Array<{
name: string;
value?: string;
}>): boolean;
/**
* @param {string} text
* @param {ProcessedOptions} options
* @param {string} tag
* @param {Array<{name: string, value?: string | undefined}>} currentAttrs
* @param {Function} minifyHTML
*/
declare function processScript(text: string, options: ProcessedOptions, tag: string, currentAttrs: Array<{
name: string;
value?: string | undefined;
}>, minifyHTML: Function): Promise<any>;
/**
* Collects the bodies of executable inline scripts, in document order, so they can be
* minified as one batch ahead of the parse. Duplicates are dropped: The minifier is
* content-keyed, so the same body only needs dispatching once.
* @param {string} html
* @returns {Array<{code: string, isModule: boolean}>}
*/
declare function extractScriptBodies(html: string): Array<{
code: string;
isModule: boolean;
}>;
export { wrapCSS, unwrapCSS, hasJsonScriptType, extractScriptBodies, processScript };
//# sourceMappingURL=content.d.ts.map