@@ -72,13 +72,35 @@ interface IStyle {
7272 borderColor ?: string ;
7373 borderTopColor ?: string ;
7474 backgroundImage ?: string ;
75+ /**
76+ * 背景图片的渲染模式
77+ * simple: 简单拉伸(默认)
78+ * sliced: 九宫格拉伸
79+ * tiled: 平铺模式
80+ */
81+ backgroundImageType ?: 'simple' | 'sliced' | 'tiled' ;
82+ /**
83+ * 背景图片的九宫格参数,格式为 "left top right bottom"
84+ */
85+ backgroundImageInset ?: string ;
7586 borderBottomColor ?: string ;
7687 borderLeftColor ?: string ;
7788 borderRightColor ?: string ;
7889 opacity ?: number ;
7990 fontWeight ?: string ;
8091 fontFamily ?: string ;
8192 transform ?: string ;
93+ /**
94+ * 图片渲染模式(用于Image组件)
95+ * simple: 简单拉伸(默认)
96+ * sliced: 九宫格拉伸
97+ * tiled: 平铺模式
98+ */
99+ imageType ?: 'simple' | 'sliced' | 'tiled' ;
100+ /**
101+ * 图片的九宫格参数,格式为 "left top right bottom"
102+ */
103+ imageInset ?: string ;
82104 textStrokeWidth ?: number ;
83105 textStrokeColor ?: string ;
84106 /**
@@ -169,11 +191,26 @@ interface IElementOptions {
169191 dataset ?: IDataset ;
170192}
171193
194+ interface IInsetParams {
195+ /** 左边界距离 */
196+ left : number ;
197+ /** 上边界距离 */
198+ top : number ;
199+ /** 右边界距离 */
200+ right : number ;
201+ /** 下边界距离 */
202+ bottom : number ;
203+ }
204+ type ImageRenderMode = 'simple' | 'sliced' | 'tiled' ;
172205interface IRenderForLayout {
173206 rotate ?: number ;
174207 scaleX ?: number ;
175208 scaleY ?: number ;
176209 backgroundImage ?: HTMLImageElement ;
210+ backgroundImageType ?: ImageRenderMode ;
211+ backgroundImageInset ?: IInsetParams ;
212+ imageType ?: ImageRenderMode ;
213+ imageInset ?: IInsetParams ;
177214}
178215interface ITextShadow {
179216 offsetX : number ;
@@ -370,6 +407,10 @@ declare class Element {
370407 width : number ;
371408 height : number ;
372409 } ;
410+ /**
411+ * 渲染背景图片,支持三种模式:simple、sliced、tiled
412+ */
413+ private renderBackgroundImage ;
373414}
374415
375416declare enum STATE {
@@ -773,4 +814,5 @@ declare class Layout extends Element {
773814}
774815declare const layout : Layout ;
775816
776- export { BitMapText , Button , Canvas , EE , Element , type IStyle , Image , Layout , ScrollView , Text , View , layout as default , _default as env } ;
817+ export { BitMapText , Button , Canvas , EE , Element , Image , Layout , ScrollView , Text , View , layout as default , _default as env } ;
818+ export type { IStyle } ;
0 commit comments