@leafer/interface 1.12.2 → 1.12.3
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/app/ILeafer.ts +3 -0
- package/src/image/ILeaferImage.ts +28 -3
- package/src/index.ts +1 -1
- package/types/index.d.ts +26 -3
package/package.json
CHANGED
package/src/app/ILeafer.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ICanvasPattern } from '../canvas/ICanvas'
|
|
|
2
2
|
import { IObject } from '../data/IData'
|
|
3
3
|
import { InnerId } from '../event/IEventer'
|
|
4
4
|
import { IExportFileType } from '../file/IFileType'
|
|
5
|
-
import { IBoundsData, IMatrixData, IPointData } from '../math/IMath'
|
|
5
|
+
import { IBoundsData, IMatrixData, IPointData, ISizeData } from '../math/IMath'
|
|
6
6
|
import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
|
|
7
7
|
import { IProgressData } from '../event/IProgress'
|
|
8
8
|
import { IImageCrossOrigin } from '../platform/IPlatform'
|
|
@@ -11,13 +11,28 @@ import { IRangeSize } from '../display/ILeaf'
|
|
|
11
11
|
|
|
12
12
|
export interface ILeaferImageConfig {
|
|
13
13
|
url: string
|
|
14
|
-
|
|
14
|
+
lod?: IImageLOD
|
|
15
15
|
format?: IExportFileType
|
|
16
16
|
crossOrigin?: IImageCrossOrigin
|
|
17
17
|
showProgress?: boolean | string // 是否显示进度
|
|
18
18
|
view?: IObject | ILeaferImage | ILeaferCanvas
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
export interface IImageLOD {
|
|
22
|
+
url: string // 'thumb-{level}-{width}-{height}.jpg'
|
|
23
|
+
width: number
|
|
24
|
+
height: number
|
|
25
|
+
thumb?: number
|
|
26
|
+
min?: number
|
|
27
|
+
tile?: IImageTileLOD
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IImageTileLOD {
|
|
31
|
+
url: string // 'tile-{level}-{index}-{x}-{y}-{width}-{height}.jpg'
|
|
32
|
+
size: number
|
|
33
|
+
min?: number
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
export interface ILeaferImageOnLoaded {
|
|
22
37
|
(image?: ILeaferImage): any
|
|
23
38
|
}
|
|
@@ -60,6 +75,7 @@ export interface ILeaferImageLevel {
|
|
|
60
75
|
export interface ILeaferImage {
|
|
61
76
|
readonly innerId: InnerId
|
|
62
77
|
readonly url: string
|
|
78
|
+
readonly crossOrigin: IImageCrossOrigin
|
|
63
79
|
|
|
64
80
|
view: any
|
|
65
81
|
width: number
|
|
@@ -76,22 +92,31 @@ export interface ILeaferImage {
|
|
|
76
92
|
isPlacehold?: boolean // 是否显示占位符,一般在加载100ms后自动判断
|
|
77
93
|
|
|
78
94
|
largeThumb?: ILeaferImageLevel
|
|
95
|
+
thumb?: ILeaferImageLevel
|
|
79
96
|
levels?: ILeaferImageLevel[]
|
|
80
97
|
levelsRange?: IRangeSize
|
|
81
98
|
minLevel?: number
|
|
99
|
+
loadId?: any
|
|
82
100
|
|
|
83
101
|
progress?: IProgressData // 加载进度
|
|
84
102
|
|
|
85
103
|
use: number // 引用次数
|
|
86
104
|
config: ILeaferImageConfig
|
|
87
105
|
|
|
88
|
-
load(onSuccess?: ILeaferImageOnLoaded, onError?: ILeaferImageOnError): number
|
|
106
|
+
load(onSuccess?: ILeaferImageOnLoaded, onError?: ILeaferImageOnError, thumbSize?: ISizeData): number
|
|
89
107
|
unload(index: number, stopEvent?: boolean): void
|
|
90
108
|
getFull(filters?: IObject): any
|
|
91
109
|
getCanvas(width: number, height: number, opacity?: number, filters?: IObject, xGap?: number, yGap?: number, smooth?: boolean): any
|
|
92
110
|
getPattern(canvas: any, repeat: string | null, transform?: IMatrixData, paint?: IObject): ICanvasPattern
|
|
93
111
|
|
|
112
|
+
getLoadUrl(thumbSize?: ISizeData): string
|
|
113
|
+
setThumbView(view: number): void
|
|
114
|
+
getThumbSize(): ISizeData
|
|
115
|
+
|
|
116
|
+
getMinLevel(): number
|
|
117
|
+
getLevelData(_level: number): ILeaferImageLevel
|
|
94
118
|
clearLevels(checkUse?: boolean): void
|
|
119
|
+
|
|
95
120
|
destroy(): void
|
|
96
121
|
}
|
|
97
122
|
|
package/src/index.ts
CHANGED
|
@@ -40,7 +40,7 @@ export { IMotionPathData } from './path/IPathData'
|
|
|
40
40
|
export { IWindingRule, ICanvasContext2D, ICanvasContext2DSettings, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas'
|
|
41
41
|
export { CanvasPathCommand, IPathCommandData, MCommandData, HCommandData, VCommandData, LCommandData, CCommandData, SCommandData, QCommandData, TCommandData, ZCommandData, ACommandData, RectCommandData, RoundRectCommandData, EllipseCommandData, ArcCommandData, ArcToCommandData, MoveToCommandObject, LineToCommandObject, BezierCurveToCommandObject, QuadraticCurveToCommandObject, IPathCommandObject, IPathCommandNodeBase, MoveToCommandNode, LineToCommandNode, BezierCurveToCommandNode, ClosePathCommandNode, IPathCommandNode, PathNodeHandleType, PathNodeHandleName, IPathNodeBase } from './path/IPathCommand'
|
|
42
42
|
|
|
43
|
-
export { ILeaferImage, ILeaferImageConfig, ILeaferImageSliceData, ILeaferImageSlice, ILeaferImageLevel, ILeaferImageOnLoaded, ILeaferImageOnError, ILeaferImageCacheCanvas, ILeaferImagePatternPaint } from './image/ILeaferImage'
|
|
43
|
+
export { ILeaferImage, ILeaferImageConfig, IImageLOD, IImageTileLOD, ILeaferImageSliceData, ILeaferImageSlice, ILeaferImageLevel, ILeaferImageOnLoaded, ILeaferImageOnError, ILeaferImageCacheCanvas, ILeaferImagePatternPaint } from './image/ILeaferImage'
|
|
44
44
|
export { IResource } from './file/IResource'
|
|
45
45
|
export { IExportFileType, IExportImageType } from './file/IFileType'
|
|
46
46
|
export { IExportOptions, IJSONOptions, IExportResult, IExportResultFunction, IExportOnCanvasFunction } from './file/IExport'
|
package/types/index.d.ts
CHANGED
|
@@ -2018,12 +2018,25 @@ interface ITaskOptions {
|
|
|
2018
2018
|
|
|
2019
2019
|
interface ILeaferImageConfig {
|
|
2020
2020
|
url: string;
|
|
2021
|
-
|
|
2021
|
+
lod?: IImageLOD;
|
|
2022
2022
|
format?: IExportFileType;
|
|
2023
2023
|
crossOrigin?: IImageCrossOrigin;
|
|
2024
2024
|
showProgress?: boolean | string;
|
|
2025
2025
|
view?: IObject | ILeaferImage | ILeaferCanvas;
|
|
2026
2026
|
}
|
|
2027
|
+
interface IImageLOD {
|
|
2028
|
+
url: string;
|
|
2029
|
+
width: number;
|
|
2030
|
+
height: number;
|
|
2031
|
+
thumb?: number;
|
|
2032
|
+
min?: number;
|
|
2033
|
+
tile?: IImageTileLOD;
|
|
2034
|
+
}
|
|
2035
|
+
interface IImageTileLOD {
|
|
2036
|
+
url: string;
|
|
2037
|
+
size: number;
|
|
2038
|
+
min?: number;
|
|
2039
|
+
}
|
|
2027
2040
|
interface ILeaferImageOnLoaded {
|
|
2028
2041
|
(image?: ILeaferImage): any;
|
|
2029
2042
|
}
|
|
@@ -2059,6 +2072,7 @@ interface ILeaferImageLevel {
|
|
|
2059
2072
|
interface ILeaferImage {
|
|
2060
2073
|
readonly innerId: InnerId;
|
|
2061
2074
|
readonly url: string;
|
|
2075
|
+
readonly crossOrigin: IImageCrossOrigin;
|
|
2062
2076
|
view: any;
|
|
2063
2077
|
width: number;
|
|
2064
2078
|
height: number;
|
|
@@ -2070,17 +2084,24 @@ interface ILeaferImage {
|
|
|
2070
2084
|
loading: boolean;
|
|
2071
2085
|
isPlacehold?: boolean;
|
|
2072
2086
|
largeThumb?: ILeaferImageLevel;
|
|
2087
|
+
thumb?: ILeaferImageLevel;
|
|
2073
2088
|
levels?: ILeaferImageLevel[];
|
|
2074
2089
|
levelsRange?: IRangeSize;
|
|
2075
2090
|
minLevel?: number;
|
|
2091
|
+
loadId?: any;
|
|
2076
2092
|
progress?: IProgressData;
|
|
2077
2093
|
use: number;
|
|
2078
2094
|
config: ILeaferImageConfig;
|
|
2079
|
-
load(onSuccess?: ILeaferImageOnLoaded, onError?: ILeaferImageOnError): number;
|
|
2095
|
+
load(onSuccess?: ILeaferImageOnLoaded, onError?: ILeaferImageOnError, thumbSize?: ISizeData): number;
|
|
2080
2096
|
unload(index: number, stopEvent?: boolean): void;
|
|
2081
2097
|
getFull(filters?: IObject): any;
|
|
2082
2098
|
getCanvas(width: number, height: number, opacity?: number, filters?: IObject, xGap?: number, yGap?: number, smooth?: boolean): any;
|
|
2083
2099
|
getPattern(canvas: any, repeat: string | null, transform?: IMatrixData, paint?: IObject): ICanvasPattern;
|
|
2100
|
+
getLoadUrl(thumbSize?: ISizeData): string;
|
|
2101
|
+
setThumbView(view: number): void;
|
|
2102
|
+
getThumbSize(): ISizeData;
|
|
2103
|
+
getMinLevel(): number;
|
|
2104
|
+
getLevelData(_level: number): ILeaferImageLevel;
|
|
2084
2105
|
clearLevels(checkUse?: boolean): void;
|
|
2085
2106
|
destroy(): void;
|
|
2086
2107
|
}
|
|
@@ -2360,6 +2381,8 @@ interface ILeaferAttrData {
|
|
|
2360
2381
|
readonly cursorPoint: IPointData;
|
|
2361
2382
|
readonly clientBounds: IBoundsData;
|
|
2362
2383
|
leafs: number;
|
|
2384
|
+
isPullDown?: boolean;
|
|
2385
|
+
isReachDottom?: boolean;
|
|
2363
2386
|
__eventIds: IEventListenerId[];
|
|
2364
2387
|
__nextRenderWait: IFunction[];
|
|
2365
2388
|
init(userConfig?: ILeaferConfig, parentApp?: IAppBase): void;
|
|
@@ -2493,4 +2516,4 @@ interface ITransformer {
|
|
|
2493
2516
|
}
|
|
2494
2517
|
|
|
2495
2518
|
export { PathNodeHandleType };
|
|
2496
|
-
export type { ACommandData, ArcCommandData, ArcToCommandData, BezierCurveToCommandNode, BezierCurveToCommandObject, CCommandData, CanvasPathCommand, ClosePathCommandNode, EllipseCommandData, HCommandData, IAlign, IAnimateEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEvent, IAnimateEventFunction, IAnimateEvents, IAnimateOptions, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IAutoBoxData, IAutoSize, IAxis, IAxisAlign, IAxisReverse, IBaseLineAlign, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsEvent, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasSizeAttr, ICanvasStrokeOptions, ICanvasType, IChildEvent, IClientPointData, IConstraint, IConstraintType, IControl, ICreator, ICubicBezierEasing, ICursorConfig, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, ICustomEasingFunction, IDataProcessor, IDataTypeHandle, IDirection, IDirection4, IDragBoundsType, IDragEvent, IDropEvent, IEditSize, IEraserType, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventOption, IEventParams, IEventParamsMap, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFilter, IFindCondition, IFindMethod, IFinder, IFlowAlign, IFlowAxisAlign, IFlowBoxType, IFlowType, IFlowWrap, IFourNumber, IFromToData, IFunction, IFunctionMap, IGap, IGestureType, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCrossOrigin, IImageCursor, IImageEvent, IImageManager, IInteraction, IInteractionCanvas, IInteractionConfig, IJSONOptions, IKeepTouchData, IKeyCodes, IKeyEvent, ILayoutAttr, ILayoutBlockData, ILayoutBoundsData, ILayoutChangedData, ILayoutData, ILayoutEvent, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafAttrDescriptor, ILeafAttrDescriptorFn, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataOptions, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeaferAttrData, ILeaferBase, ILeaferCanvas, ILeaferCanvasConfig, ILeaferCanvasView, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageCacheCanvas, ILeaferImageConfig, ILeaferImageLevel, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferImagePatternPaint, ILeaferImageSlice, ILeaferImageSliceData, ILeaferMode, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILocationType, IMaskType, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IMatrixWithOptionHalfData, IMatrixWithOptionScaleData, IMatrixWithScaleData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMotionPathData, IMoveConfig, IMoveEvent, IMultiTouchConfig, IMultiTouchData, INumber, INumberFunction, INumberMap, IObject, IObjectFunction, IOffsetBoundsData, IOptionSizeData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCommandNode, IPathCommandNodeBase, IPathCommandObject, IPathCreator, IPathDrawer, IPathNodeBase, IPathString, IPercentData, IPickBottom, IPickOptions, IPickResult, IPicker, IPlatform, IPlugin, IPoint, IPointData, IPointDataFunction, IPointDataMap, IPointGap, IPointerConfig, IPointerEvent, IProgressData, IProgressFunction, IPropertyEvent, IRadiusPointData, IRangeSize, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IResource, IRotateEvent, IRotationPointData, IScaleData, IScaleFixed, IScaleRotationData, IScreenSizeData, IScrollPointData, ISelector, ISelectorConfig, ISelectorProxy, IShortcutKeyCodes, IShortcutKeys, IShortcutKeysCheck, ISide, ISingleGestureConfig, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IStepsEasing, IString, IStringFunction, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITouchConfig, ITouchEvent, ITransformer, ITransition, ITwoPointBoundsData, IUICreator, IUIEvent, IUnitData, IUnitPointData, IUpdateEvent, IValue, IValueFunction, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWheelEvent, IWindingRule, IWindingRuleData, IZoomConfig, IZoomEvent, IZoomOptions, IZoomType, IZoomView, InnerId, LCommandData, LineToCommandNode, LineToCommandObject, MCommandData, MoveToCommandNode, MoveToCommandObject, PathNodeHandleName, PointerType, QCommandData, QuadraticCurveToCommandObject, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
|
|
2519
|
+
export type { ACommandData, ArcCommandData, ArcToCommandData, BezierCurveToCommandNode, BezierCurveToCommandObject, CCommandData, CanvasPathCommand, ClosePathCommandNode, EllipseCommandData, HCommandData, IAlign, IAnimateEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEvent, IAnimateEventFunction, IAnimateEvents, IAnimateOptions, IAnswer, IAppBase, IAround, IAttrDecorator, IAutoBounds, IAutoBoundsData, IAutoBoxData, IAutoSize, IAxis, IAxisAlign, IAxisReverse, IBaseLineAlign, IBlendMode, IBlob, IBlobFunction, IBoolean, IBooleanMap, IBounds, IBoundsData, IBoundsDataFn, IBoundsEvent, IBoundsType, IBranch, IBranchRender, IBranchRenderModule, ICachedLeaf, ICanvasAttr, ICanvasCacheOptions, ICanvasContext2D, ICanvasContext2DSettings, ICanvasManager, ICanvasPattern, ICanvasSizeAttr, ICanvasStrokeOptions, ICanvasType, IChildEvent, IClientPointData, IConstraint, IConstraintType, IControl, ICreator, ICubicBezierEasing, ICursorConfig, ICursorRotate, ICursorRotateMap, ICursorType, ICursorTypeMap, ICustomEasingFunction, IDataProcessor, IDataTypeHandle, IDirection, IDirection4, IDragBoundsType, IDragEvent, IDropEvent, IEditSize, IEraserType, IEvent, IEventListener, IEventListenerId, IEventListenerItem, IEventListenerMap, IEventListenerOptions, IEventOption, IEventParams, IEventParamsMap, IEventTarget, IEventer, IExportFileType, IExportImageType, IExportOnCanvasFunction, IExportOptions, IExportResult, IExportResultFunction, IFilter, IFindCondition, IFindMethod, IFinder, IFlowAlign, IFlowAxisAlign, IFlowBoxType, IFlowType, IFlowWrap, IFourNumber, IFromToData, IFunction, IFunctionMap, IGap, IGestureType, IHitCanvas, IHitCanvasConfig, IHitCanvasManager, IHitType, IImageCrossOrigin, IImageCursor, IImageEvent, IImageLOD, IImageManager, IImageTileLOD, IInteraction, IInteractionCanvas, IInteractionConfig, IJSONOptions, IKeepTouchData, IKeyCodes, IKeyEvent, ILayoutAttr, ILayoutBlockData, ILayoutBoundsData, ILayoutChangedData, ILayoutData, ILayoutEvent, ILayouter, ILayouterConfig, ILeaf, ILeafArrayMap, ILeafAttrData, ILeafAttrDescriptor, ILeafAttrDescriptorFn, ILeafBounds, ILeafBoundsModule, ILeafComputedData, ILeafData, ILeafDataOptions, ILeafDataProxy, ILeafDataProxyModule, ILeafEventer, ILeafEventerModule, ILeafHit, ILeafHitModule, ILeafInputData, ILeafLayout, ILeafLevelList, ILeafList, ILeafListItemCallback, ILeafMap, ILeafMatrix, ILeafMatrixModule, ILeafRender, ILeafRenderModule, ILeaferAttrData, ILeaferBase, ILeaferCanvas, ILeaferCanvasConfig, ILeaferCanvasView, ILeaferConfig, ILeaferEvent, ILeaferImage, ILeaferImageCacheCanvas, ILeaferImageConfig, ILeaferImageLevel, ILeaferImageOnError, ILeaferImageOnLoaded, ILeaferImagePatternPaint, ILeaferImageSlice, ILeaferImageSliceData, ILeaferMode, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILocationType, IMaskType, IMatrix, IMatrixData, IMatrixWithBoundsData, IMatrixWithBoundsScaleData, IMatrixWithLayoutData, IMatrixWithOptionHalfData, IMatrixWithOptionScaleData, IMatrixWithScaleData, IMiniapp, IMiniappSelect, IMiniappSizeView, IMotionPathData, IMoveConfig, IMoveEvent, IMultiTouchConfig, IMultiTouchData, INumber, INumberFunction, INumberMap, IObject, IObjectFunction, IOffsetBoundsData, IOptionSizeData, IPartLayoutConfig, IPath2D, IPathCommandData, IPathCommandNode, IPathCommandNodeBase, IPathCommandObject, IPathCreator, IPathDrawer, IPathNodeBase, IPathString, IPercentData, IPickBottom, IPickOptions, IPickResult, IPicker, IPlatform, IPlugin, IPoint, IPointData, IPointDataFunction, IPointDataMap, IPointGap, IPointerConfig, IPointerEvent, IProgressData, IProgressFunction, IPropertyEvent, IRadiusPointData, IRangeSize, IRenderEvent, IRenderOptions, IRenderer, IRendererConfig, IResizeEvent, IResizeEventListener, IResource, IRotateEvent, IRotationPointData, IScaleData, IScaleFixed, IScaleRotationData, IScreenSizeData, IScrollPointData, ISelector, ISelectorConfig, ISelectorProxy, IShortcutKeyCodes, IShortcutKeys, IShortcutKeysCheck, ISide, ISingleGestureConfig, ISize, ISizeData, ISkewData, ISkiaCanvas, ISkiaCanvasExportConfig, ISkiaNAPICanvas, IStateStyleType, IStepsEasing, IString, IStringFunction, IStringMap, ISwipeEvent, ITaskItem, ITaskOptions, ITaskProcessor, ITaskProcessorConfig, ITextMetrics, ITimer, ITouchConfig, ITouchEvent, ITransformer, ITransition, ITwoPointBoundsData, IUICreator, IUIEvent, IUnitData, IUnitPointData, IUpdateEvent, IValue, IValueFunction, IWatchEvent, IWatchEventData, IWatcher, IWatcherConfig, IWheelConfig, IWheelEvent, IWindingRule, IWindingRuleData, IZoomConfig, IZoomEvent, IZoomOptions, IZoomType, IZoomView, InnerId, LCommandData, LineToCommandNode, LineToCommandObject, MCommandData, MoveToCommandNode, MoveToCommandObject, PathNodeHandleName, PointerType, QCommandData, QuadraticCurveToCommandObject, RectCommandData, RoundRectCommandData, SCommandData, TCommandData, VCommandData, ZCommandData };
|