@leafer-ui/interface 1.0.0-beta.2 → 1.0.0-beta.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 +2 -2
- package/src/IUI.ts +4 -1
- package/src/index.ts +1 -0
- package/src/module/IExport.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"description": "@leafer-ui/interface",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"leaferjs"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@leafer/interface": "1.0.0-beta.
|
|
22
|
+
"@leafer/interface": "1.0.0-beta.5"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/src/IUI.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, IPathString, ILeaferImage } from '@leafer/interface'
|
|
1
|
+
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, IPathString, ILeaferImage, IBlob } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { IOverflow } from './type/IType'
|
|
4
4
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
IEffectAttrData, IEffectInputData, IEffectComputedData,
|
|
11
11
|
ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData
|
|
12
12
|
} from './ICommonAttr'
|
|
13
|
+
import { IExportOptions } from './module/IExport'
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
// Line
|
|
@@ -267,6 +268,8 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
267
268
|
|
|
268
269
|
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void
|
|
269
270
|
__drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void
|
|
271
|
+
|
|
272
|
+
export(filename: string, options?: IExportOptions | number): Promise<IBlob | string | boolean>
|
|
270
273
|
}
|
|
271
274
|
|
|
272
275
|
export interface IUIData extends IUIComputedData, ILeafData {
|
package/src/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { ILeafFill, ILeafPaint, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEf
|
|
|
25
25
|
export { IUIRenderModule, IRectRenderModule, IImageRenderModule, ITextRenderModule, IGroupRenderModule, IFrameRenderModule } from './module/IUIRender'
|
|
26
26
|
export { IUIBoundsModule } from './module/IUIBounds'
|
|
27
27
|
export { IUIHitModule } from './module/IUIHit'
|
|
28
|
+
export { IExportModule, IExportOptions, IExportResult } from './module/IExport'
|
|
28
29
|
|
|
29
30
|
export { IPaintModule } from './module/IPaint'
|
|
30
31
|
export { IEffectModule } from './module/IEffect'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ILeaf, IExportFileType, IBlob } from '@leafer/interface'
|
|
2
|
+
|
|
3
|
+
export interface IExportOptions {
|
|
4
|
+
quality?: number
|
|
5
|
+
blob?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IExportResult {
|
|
9
|
+
data: IBlob | string | boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IExportModule {
|
|
13
|
+
export(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>
|
|
14
|
+
}
|