- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/critters/src/index.d.ts
r59329aa re29cc2e 15 15 */ 16 16 17 declare module 'critters' { 18 export interface Options { 19 path?: string; 20 publicPath?: string; 21 external?: boolean; 22 inlineThreshold?: number; 23 minimumExternalSize?: number; 24 pruneSource?: boolean; 25 mergeStylesheets?: boolean; 26 additionalStylesheets?: string[]; 27 preload?: 'body' | 'media' | 'swap' | 'js' | 'js-lazy'; 28 noscriptFallback?: boolean; 29 inlineFonts?: boolean; 30 preloadFonts?: boolean; 31 fonts?: boolean; 32 keyframes?: string; 33 compress?: boolean; 34 logLevel?: 'info' | 'warn' | 'error' | 'trace' | 'debug' | 'silent'; 35 reduceInlineStyles?: boolean; 36 logger?: Logger; 37 } 17 export default class Critters { 18 /** 19 * Create an instance of Critters with custom options. 20 * The `.process()` method can be called repeatedly to re-use this instance and its cache. 21 */ 22 constructor(options: Options); 23 /** 24 * Process an HTML document to inline critical CSS from its stylesheets. 25 * @param {string} html String containing a full HTML document to be parsed. 26 * @returns {string} A modified copy of the provided HTML with critical CSS inlined. 27 */ 28 process(html: string): Promise<string>; 29 /** 30 * Read the contents of a file from the specified filesystem or disk. 31 * Override this method to customize how stylesheets are loaded. 32 */ 33 readFile(filename: string): Promise<string> | string; 34 /** 35 * Given a stylesheet URL, returns the corresponding CSS asset. 36 * Overriding this method requires doing your own URL normalization, so it's generally better to override `readFile()`. 37 */ 38 getCssAsset(href: string): Promise<string | undefined> | string | undefined; 39 } 38 40 39 export interface Logger { 40 trace?: (message: string) => void; 41 debug?: (message: string) => void; 42 info?: (message: string) => void; 43 warn?: (message: string) => void; 44 error?: (message: string) => void; 45 } 41 export interface Options { 42 path?: string; 43 publicPath?: string; 44 external?: boolean; 45 inlineThreshold?: number; 46 minimumExternalSize?: number; 47 pruneSource?: boolean; 48 mergeStylesheets?: boolean; 49 additionalStylesheets?: string[]; 50 preload?: 'body' | 'media' | 'swap' | 'js' | 'js-lazy'; 51 noscriptFallback?: boolean; 52 inlineFonts?: boolean; 53 preloadFonts?: boolean; 54 fonts?: boolean; 55 keyframes?: string; 56 compress?: boolean; 57 logLevel?: 'info' | 'warn' | 'error' | 'trace' | 'debug' | 'silent'; 58 reduceInlineStyles?: boolean; 59 logger?: Logger; 60 } 46 61 47 class Critters{48 constructor(options: Options);49 process(html: string): Promise<string>;50 }51 52 e xport default Critters;62 export interface Logger { 63 trace?: (message: string) => void; 64 debug?: (message: string) => void; 65 info?: (message: string) => void; 66 warn?: (message: string) => void; 67 error?: (message: string) => void; 53 68 }
Note:
See TracChangeset
for help on using the changeset viewer.