@gsc-basic/functions 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +6 -0
- package/README.md +13 -9
- package/dist/index.cjs +14 -1
- package/dist/index.d.cts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +14 -1
- package/package.json +7 -6
package/dist/index.d.cts
CHANGED
|
@@ -84,4 +84,23 @@ declare class IfActivity {
|
|
|
84
84
|
now(check?: ActivityStatus): boolean;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
type OutputType = 'png' | 'jpeg' | 'svg' | 'blob';
|
|
88
|
+
interface Options {
|
|
89
|
+
input: HTMLElement | string;
|
|
90
|
+
type?: OutputType;
|
|
91
|
+
quality?: number;
|
|
92
|
+
width?: number;
|
|
93
|
+
height?: number;
|
|
94
|
+
backgroundColor?: string;
|
|
95
|
+
pixelRatio?: number;
|
|
96
|
+
style?: Record<string, string>;
|
|
97
|
+
filter?: (node: Element) => boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 简化封装:把 `html-to-image` 常用用法合并为一个易用的函数。
|
|
101
|
+
* - `input` 支持 HTMLElement、CSS selector 或 HTML 字符串
|
|
102
|
+
* - 返回值为 dataURL (png/jpeg/svg) 或 Blob
|
|
103
|
+
*/
|
|
104
|
+
declare function toImage(opts: Options): Promise<string | Blob | null>;
|
|
105
|
+
|
|
106
|
+
export { type DayOptions, type HighlightHtmlResult, type HighlightKeyword, type HighlightKeywordOption, IfActivity, type Options as ToImageOptions, type OutputType as ToImageOutputType, getFestival, getTerm, highlightHtml, setFestivalListener, setSpecificDayListener, setTermListener, toImage };
|
package/dist/index.d.ts
CHANGED
|
@@ -84,4 +84,23 @@ declare class IfActivity {
|
|
|
84
84
|
now(check?: ActivityStatus): boolean;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
type OutputType = 'png' | 'jpeg' | 'svg' | 'blob';
|
|
88
|
+
interface Options {
|
|
89
|
+
input: HTMLElement | string;
|
|
90
|
+
type?: OutputType;
|
|
91
|
+
quality?: number;
|
|
92
|
+
width?: number;
|
|
93
|
+
height?: number;
|
|
94
|
+
backgroundColor?: string;
|
|
95
|
+
pixelRatio?: number;
|
|
96
|
+
style?: Record<string, string>;
|
|
97
|
+
filter?: (node: Element) => boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 简化封装:把 `html-to-image` 常用用法合并为一个易用的函数。
|
|
101
|
+
* - `input` 支持 HTMLElement、CSS selector 或 HTML 字符串
|
|
102
|
+
* - 返回值为 dataURL (png/jpeg/svg) 或 Blob
|
|
103
|
+
*/
|
|
104
|
+
declare function toImage(opts: Options): Promise<string | Blob | null>;
|
|
105
|
+
|
|
106
|
+
export { type DayOptions, type HighlightHtmlResult, type HighlightKeyword, type HighlightKeywordOption, IfActivity, type Options as ToImageOptions, type OutputType as ToImageOutputType, getFestival, getTerm, highlightHtml, setFestivalListener, setSpecificDayListener, setTermListener, toImage };
|