Style
自定义样式。
type Style = PaintStyle | EffectStyle | TextStyle | GridStyle
PaintStyle:填充及描边样式,具体可查看类型PaintStyle。EffectStyle:特效样式,具体可查看类型EffectStyle。TextStyle:文字样式,具体可查看类型TextStyle。GridStyle:网格样式,具体可查看类型GridStyle。
StyleType
样式类型。
type StyleType = 'PAINT' | 'TEXT' | 'EFFECT' | 'GRID'
PAINT:填充。TEXT:文字。EFFECT:特效。GRID:网格。
PaintStyle
填充及描边样式。
interface PaintStyle extends BaseStyle {
type: 'PAINT'
paints: ReadonlyArray<Paint>
}
type:类型,取值为填充PAINT。paints:填充,具体可查看类型 PAINT。
EffectStyle
特效样式。
interface EffectStyle extends BaseStyle {
type: 'EFFECT'
effects: ReadonlyArray<Effect>
}
type:类型,取值为特效EFFECT。effects:特效,具体可查看类型Effect。
TextStyle
文字样式。
interface TextStyle extends BaseStyle {
type: 'TEXT'
fontSize: number
fontStyle: string
fontName: FontName
decoration: TextDecoration
letterSpacing: LetterSpacing
letterSpacingUnit: 'PERCENT' | 'PIXELS'
lineHeight: LineHeight
textCase: TextCase
}
type:类型,取值为文字TEXT。fontSize:文字尺寸。fontStyle:文字样式。fontName:字体。decoration:文字装饰线,具体可查看类型 TextDecoration。letterSpacing:字间距,具体可查看类型 LetterSpacing。letterSpacingUnit:字间距单位,取值为百分比PERCENT,或像素PIXELS。lineHeight:行高,具体可查看类型 LineHeight。textCase:字母大小写,具体可查看类型 TextCase。
GridStyle
网格样式。
interface GridStyle extends BaseStyle {
type: 'GRID'
layoutGrids: ReadonlyArray<LayoutGrid>
}
type:类型,取值为网格GRID。layoutGrids:网格布局样式,具体可查看类型 LayoutGrid。
BaseStyle
基础样式。
interface BaseStyle extends PublishableMixin {
readonly id: string
readonly type: StyleType
name: string
remove(): void
}
type:类型,具体可查看类型 StyleType。remove():删除样式。
TIP
您无法删除团队库样式,remove方法在调用时会出错。
PublishableMixin
发布状态。
interface PublishableMixin {
description: string
readonly isExternal: boolean
readonly ukey: string
readonly publishStatus: PublishStatus
}
description:描述。isExternal:是否是远端数据。ukey:唯一的key值。publishStatus:描述可发布到团队库的元素(即样式和组件)的状态,具体可查看类型 PublishStatus。