UNPKG

1.17 kBTypeScriptView Raw
1import { ImageLike } from '../core/types';
2import { SVGVNode } from '../svg/core';
3declare type ImagePatternRepeat = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
4export interface PatternObjectBase {
5 id?: number;
6 type?: 'pattern';
7 x?: number;
8 y?: number;
9 rotation?: number;
10 scaleX?: number;
11 scaleY?: number;
12}
13export interface ImagePatternObject extends PatternObjectBase {
14 image: ImageLike | string;
15 repeat?: ImagePatternRepeat;
16 imageWidth?: number;
17 imageHeight?: number;
18}
19export interface InnerImagePatternObject extends ImagePatternObject {
20 __image?: ImageLike;
21}
22export interface SVGPatternObject extends PatternObjectBase {
23 svgElement?: SVGVNode;
24 svgWidth?: number;
25 svgHeight?: number;
26}
27export declare type PatternObject = ImagePatternObject | SVGPatternObject;
28declare class Pattern {
29 type: 'pattern';
30 image: ImageLike | string;
31 svgElement: SVGElement | string;
32 repeat: ImagePatternRepeat;
33 x: number;
34 y: number;
35 rotation: number;
36 scaleX: number;
37 scaleY: number;
38 constructor(image: ImageLike | string, repeat: ImagePatternRepeat);
39}
40export default Pattern;