@leafer/interface 2.0.3 → 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
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
|
}
|
|
@@ -79,6 +79,7 @@ export interface IInteraction extends IControl {
|
|
|
79
79
|
cancelHover(): void
|
|
80
80
|
stopDragAnimate(): void
|
|
81
81
|
|
|
82
|
+
replaceDownTarget(target: ILeaf): void
|
|
82
83
|
updateDownData(data?: IPointerEvent, options?: IPickOptions, merge?: boolean): void
|
|
83
84
|
updateHoverData(data: IPointerEvent): void
|
|
84
85
|
|
|
@@ -104,6 +105,7 @@ export interface IInteractionConfig {
|
|
|
104
105
|
eventer?: IObject
|
|
105
106
|
cursor?: boolean
|
|
106
107
|
keyEvent?: boolean
|
|
108
|
+
shadowDOM?: boolean
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
export interface IZoomConfig {
|
|
@@ -81,6 +81,7 @@ export interface IPlatform {
|
|
|
81
81
|
resize(image: any, width: number, height: number, xGap?: number, yGap?: number, clip?: IBoundsData, smooth?: boolean, opacity?: number, filters?: IObject, interlace?: IInterlace): any
|
|
82
82
|
canUse(image: any): boolean
|
|
83
83
|
setPatternTransform(pattern: ICanvasPattern, transform?: IMatrixData, paint?: IObject): void
|
|
84
|
+
applyFilter?(canvas: any, image: any, filter: any[]): void
|
|
84
85
|
},
|
|
85
86
|
|
|
86
87
|
canCreateImageBitmap?: boolean // 是否能使用 createImageBitmap
|
package/types/index.d.ts
CHANGED
|
@@ -340,6 +340,7 @@ interface ILayouter extends IControl {
|
|
|
340
340
|
layouting: boolean;
|
|
341
341
|
waitAgain: boolean;
|
|
342
342
|
config: ILayouterConfig;
|
|
343
|
+
__updatedList: ILeafList;
|
|
343
344
|
disable(): void;
|
|
344
345
|
layout(): void;
|
|
345
346
|
layoutAgain(): void;
|
|
@@ -1963,8 +1964,10 @@ type ICanvasType = 'skia' | 'napi' | 'canvas' | 'miniapp';
|
|
|
1963
1964
|
interface ISkiaCanvas {
|
|
1964
1965
|
toBuffer(format: IExportFileType, config: ISkiaCanvasExportConfig): Promise<any>;
|
|
1965
1966
|
toBufferSync(format: IExportFileType, config: ISkiaCanvasExportConfig): any;
|
|
1966
|
-
toDataURL(
|
|
1967
|
+
toDataURL(mime?: 'image/png'): string;
|
|
1968
|
+
toDataURL(mime: 'image/jpeg' | 'image/webp' | string, quality?: number): string;
|
|
1967
1969
|
toDataURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string;
|
|
1970
|
+
toURLSync(format: IExportImageType, config: ISkiaCanvasExportConfig): string;
|
|
1968
1971
|
saveAs(filename: string, config: ISkiaCanvasExportConfig): Promise<void>;
|
|
1969
1972
|
saveAsSync(filename: string, config: ISkiaCanvasExportConfig): void;
|
|
1970
1973
|
}
|
|
@@ -2096,6 +2099,7 @@ interface IPlatform {
|
|
|
2096
2099
|
resize(image: any, width: number, height: number, xGap?: number, yGap?: number, clip?: IBoundsData, smooth?: boolean, opacity?: number, filters?: IObject, interlace?: IInterlace): any;
|
|
2097
2100
|
canUse(image: any): boolean;
|
|
2098
2101
|
setPatternTransform(pattern: ICanvasPattern, transform?: IMatrixData, paint?: IObject): void;
|
|
2102
|
+
applyFilter?(canvas: any, image: any, filter: any[]): void;
|
|
2099
2103
|
};
|
|
2100
2104
|
canCreateImageBitmap?: boolean;
|
|
2101
2105
|
canClipImageBitmap?: boolean;
|
|
@@ -2191,6 +2195,7 @@ interface ILeaferImage {
|
|
|
2191
2195
|
isPlacehold?: boolean;
|
|
2192
2196
|
parent?: ILeaferImage;
|
|
2193
2197
|
childrenMap?: ILeaferImageMap;
|
|
2198
|
+
filter?: any[];
|
|
2194
2199
|
filterKey?: string;
|
|
2195
2200
|
largeThumb?: ILeaferImageLevel;
|
|
2196
2201
|
thumb?: ILeaferImageLevel;
|
|
@@ -2363,6 +2368,7 @@ interface IInteraction extends IControl {
|
|
|
2363
2368
|
isFocus(leaf: ILeaf): boolean;
|
|
2364
2369
|
cancelHover(): void;
|
|
2365
2370
|
stopDragAnimate(): void;
|
|
2371
|
+
replaceDownTarget(target: ILeaf): void;
|
|
2366
2372
|
updateDownData(data?: IPointerEvent, options?: IPickOptions, merge?: boolean): void;
|
|
2367
2373
|
updateHoverData(data: IPointerEvent): void;
|
|
2368
2374
|
updateCursor(hoverData?: IPointerEvent): void;
|
|
@@ -2382,6 +2388,7 @@ interface IInteractionConfig {
|
|
|
2382
2388
|
eventer?: IObject;
|
|
2383
2389
|
cursor?: boolean;
|
|
2384
2390
|
keyEvent?: boolean;
|
|
2391
|
+
shadowDOM?: boolean;
|
|
2385
2392
|
}
|
|
2386
2393
|
interface IZoomConfig {
|
|
2387
2394
|
disabled?: boolean;
|