@leafer/interface 2.0.4 → 2.0.5
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/package.json +1 -1
- package/src/canvas/ISkiaCanvas.ts +6 -1
- package/types/index.d.ts +3 -1
package/package.json
CHANGED
|
@@ -6,8 +6,13 @@ export type ICanvasType = 'skia' | 'napi' | 'canvas' | 'miniapp'
|
|
|
6
6
|
export interface ISkiaCanvas {
|
|
7
7
|
toBuffer(format: IExportFileType, config: ISkiaCanvasExportConfig): Promise<any>
|
|
8
8
|
toBufferSync(format: IExportFileType, config: ISkiaCanvasExportConfig): any
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
toDataURL(mime?: 'image/png'): string
|
|
11
|
+
toDataURL(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): string
|
|
12
|
+
|
|
10
13
|
toDataURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string
|
|
14
|
+
toURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string
|
|
15
|
+
|
|
11
16
|
saveAs(filename: string, config: ISkiaCanvasExportConfig): Promise<void>
|
|
12
17
|
saveAsSync(filename: string, config: ISkiaCanvasExportConfig): void
|
|
13
18
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1964,8 +1964,10 @@ type ICanvasType = 'skia' | 'napi' | 'canvas' | 'miniapp';
|
|
|
1964
1964
|
interface ISkiaCanvas {
|
|
1965
1965
|
toBuffer(format: IExportFileType, config: ISkiaCanvasExportConfig): Promise<any>;
|
|
1966
1966
|
toBufferSync(format: IExportFileType, config: ISkiaCanvasExportConfig): any;
|
|
1967
|
-
toDataURL(
|
|
1967
|
+
toDataURL(mime?: 'image/png'): string;
|
|
1968
|
+
toDataURL(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): string;
|
|
1968
1969
|
toDataURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string;
|
|
1970
|
+
toURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string;
|
|
1969
1971
|
saveAs(filename: string, config: ISkiaCanvasExportConfig): Promise<void>;
|
|
1970
1972
|
saveAsSync(filename: string, config: ISkiaCanvasExportConfig): void;
|
|
1971
1973
|
}
|