Repository navigation
Expand file tree
/
Copy pathindex.d.ts
More file actions
73 lines (65 loc) · 2.41 KB
/
Copy pathindex.d.ts
File metadata and controls
73 lines (65 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Type definitions for Juice 12.0.0
// Project: https://github.com/Automattic/juice
// Definitions by: Kamil Nikel <https://github.com/knikel>
declare namespace juice {
export interface Callback { (err: Error, html: string): any; }
export interface Options {
addImportantToPseudoClasses?: boolean;
applyAttributesTableElements?: boolean;
applyHeightAttributes?: boolean;
applyStyleTags?: boolean;
applyWidthAttributes?: boolean;
decodeStyleAttributes?: boolean;
extraCss?: string;
inlineDuplicateProperties?: boolean;
inlinePseudoElements?: boolean;
insertPreservedExtraCss?: boolean;
preservedSelectors?: string[];
preserveContainerQueries?: boolean;
preserveFontFaces?: boolean;
preserveImportant?: boolean;
preserveKeyFrames?: boolean;
preserveLayers?: boolean;
preserveMediaQueries?: boolean;
preservePseudos?: boolean;
removeInlinedSelectors?: boolean;
removeStyleTags?: boolean;
resolveCSSVariables?: boolean;
webResources?: WebResourcesOptions;
xmlMode?: boolean;
}
export interface WebResourcesOptions {
fileContent?: string;
images?: boolean | number;
inlineAttribute?: string;
links?: boolean | number;
rebaseRelativeTo?: string;
relativeTo?: string;
scripts?: boolean | number;
strict?: boolean;
svgs?: boolean | number;
}
}
interface Juice {
(html: string, options?: juice.Options): string;
juiceResources(html: string, options: juice.Options, callback: juice.Callback): string;
juiceFile(filePath: string, options: juice.Options, callback: juice.Callback): string;
inlineExternal(html: string, options: juice.WebResourcesOptions, callback: juice.Callback): void;
juiceDocument($: any, options?: juice.Options): any;
inlineContent(html: string, css: string, options?: juice.Options): string;
inlineDocument($: any, css: string, options?: juice.Options): any;
codeBlocks: { [index: string]: { start: string, end: string } };
excludedProperties: string[];
/** Upper-case tag names, e.g. `['TABLE', 'TD', 'TH', 'IMG']` */
heightElements: string[];
ignoredPseudos: string[];
/** Upper-case tag names */
nonVisualElements: string[];
styleToAttribute: { [index: string]: string };
/** Upper-case tag names */
tableElements: string[];
/** Upper-case tag names, e.g. `['TABLE', 'TD', 'TH', 'IMG']` */
widthElements: string[];
}
declare const juice: Juice;
export default juice;