sketch-json-parse
Version:
sketch-json解析
70 lines (69 loc) • 1.16 kB
TypeScript
import { Color } from '../common';
/**
* 背景图片
*/
type Image = {
url: string;
};
/**
* 背景图位置
*/
export type BGPosition = {
left: number | string;
top: number | string;
};
/**
* 背景图尺寸
*/
export type BGSize = {
width: number | string;
height: number | string;
};
/**
* 渐变节点列表
*/
export type GListItem = {
color: Color;
position: number;
};
/**
* 线性渐变
*/
export type LinearGradient = {
gAngle: number;
gList: GListItem[];
};
/**
* 圆角渐变
*/
export type RadialGradient = {
smallRadius: number;
largeRadius: number;
position: {
left: number | string;
top: number | string;
};
gList: GListItem[];
};
/**
*
*/
export declare enum BackgroundRepeat {
'repeat' = 0,
'repeat-x' = 1,
'no-repeat' = 2,
'repeat-y' = 3
}
/**
* 背景
*/
export type Background = {
color?: Color;
image?: Image;
position?: BGPosition;
size?: BGSize | 'contain' | 'cover';
repeat?: 'repeat' | 'repeat-x' | 'no-repeat' | 'repeat-y';
linearGradient?: LinearGradient;
radialGradient?: RadialGradient;
};
export {};