-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
49 lines (42 loc) · 1.24 KB
/
index.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
declare function getStyleObj(dom?: Element): CSSStyleDeclaration
declare function toHyphenCase(name: string): string
declare function stringifyStyle(styleObj: CSSStyleDeclaration): string
declare function stringifyAttrs(
el: Element,
extraAttrs?: {
[key: string]: string
},
): string
declare function stringifyNode(el: ChildNode): string
interface CallPrinterOptions {
/**
* Delay time to waiting the content loaded
*
* Default: 100
* */
delay: number
}
/**
* @param { string | Element} [content] the content you want print.
*
* 如果值类型为元素节点,将打印对应节点
* if content is an Element, it will print this element;
*
* 如果值类型为字符串,将打印解析得到的 html
* else if content is a string, it will print this string as a html file.
*
* @param { CallPrinterOptions } [options]
* */
declare function callPrinter(
content?: string | Element,
options?: CallPrinterOptions,
): void
export {
CallPrinterOptions,
callPrinter,
getStyleObj,
stringifyAttrs,
stringifyNode,
stringifyStyle,
toHyphenCase,
}