generated from HugoDF/jsdoc-type-d-ts-node-pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
65 lines (52 loc) · 1.89 KB
/
types.d.ts
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
declare const cache: {
set: (...params: any[]) => any;
get: (...params: any[]) => any;
};
declare function matchRemoteHref(tag: string): string | null;
declare function purgeStyles(html: string, styleSheetContents: { url: string; asset: { value: string; size: number; }; }[]): Promise<{ url: string; asset: { value: string; size: number; }; }[]>;
/**
* Inline & purge CSS rules from CDN/remote includes into HTML
* @param html - HTML document string into which to inline remote asset
*/
declare function inlineCss(html: string, options: {
maxSize?: number;
cssMaxSize?: number;
}): Promise<string>;
declare function matchRemoteSrc(tag: string): string | null;
/**
* Inline JavaScript loaded from CDN/remote into HTML script directly
* @param html - HTML document string
* @param options.maxSize - Maximum size of asset to be inlined (in bytes)
*/
declare function inlineJs(html: string, options: {
maxSize: number;
}): Promise<string>;
/**
* Load & cache (to fs) remote stylesheets
* @param url - Stylesheet URL to load
*/
declare function loadRemoteAsset(url: string): Promise<{ size: number; value: string; }>;
/**
* Inline Remote Assets
*/
declare module "inline-remote-assets/main" {
/**
* @param options.maxSize - Maximum size of asset to be inlined (in bytes)
*/
function main(globPattern: string, options: {
maxSize: number;
output?: string;
cssMaxSize?: number;
}): Promise<void>;
}
declare function matchRemoteResource(tag: string, resourceLocationRegex: RegExp): string | null;
/**
* @param string - string to digest
*/
declare function digest(string: string): string;
/**
* @param p - Path to check
*/
declare function isPathWriteable(p: string): void;
declare function ensureWriteablePath(filePath: string): Promise<void>;
declare function urlsToAssets(urlsWithAssets: { url: string; asset: object; }[]): Record<string, object>;