Skip to main content

Class: Polygon

Extends

  • BaseType<{ id: number; properties: { brush: RawDataOf<Color>; category: string; line: number; pen: RawDataOf<Color>; }; type: number; } & XOR<{ polygon: { x: number; y: number; }[]; }, { inners: { x: number; y: number; }[][]; outer: { x: number; y: number; }[]; }>>

Constructors

new Polygon()

new Polygon(raw: {
id: number;
properties: {
brush: {
a: number;
b: number;
g: number;
r: number;
};
category: string;
line: number;
pen: {
a: number;
b: number;
g: number;
r: number;
};
};
type: number;
} & XOR<{
polygon: {
x: number;
y: number;
}[];
}, {
inners: {
x: number;
y: number;
}[][];
outer: {
x: number;
y: number;
}[];
}>): Polygon

Parameters

ParameterType

raw

{ id: number; properties: { brush: { a: number; b: number; g: number; r: number; }; category: string; line: number; pen: { a: number; b: number; g: number; r: number; }; }; type: number; } & XOR<{ polygon: { x: number; y: number; }[]; }, { inners: { x: number; y: number; }[][]; outer: { x: number; y: number; }[]; }>

Returns

Polygon

Inherited from

BaseType<
{
id: number;
properties: {
brush: RawDataOf<Color>;
pen: RawDataOf<Color>;
category: string;
line: number;
};
type: number;
} & XOR<
{polygon: {x: number; y: number}[]},
{inners: {x: number; y: number}[][]; outer: {x: number; y: number}[]}
>
>.constructor

Properties

raw

readonly raw: {
id: number;
properties: {
brush: {
a: number;
b: number;
g: number;
r: number;
};
category: string;
line: number;
pen: {
a: number;
b: number;
g: number;
r: number;
};
};
type: number;
} & XOR<{
polygon: {
x: number;
y: number;
}[];
}, {
inners: {
x: number;
y: number;
}[][];
outer: {
x: number;
y: number;
}[];
}>;

Type declaration

id
id: number;
properties
properties: {
brush: {
a: number;
b: number;
g: number;
r: number;
};
category: string;
line: number;
pen: {
a: number;
b: number;
g: number;
r: number;
};
};
properties.brush
brush: {
a: number;
b: number;
g: number;
r: number;
};
properties.brush.a?
optional a: number;
properties.brush.b
b: number;
properties.brush.g
g: number;
properties.brush.r
r: number;
properties.category
category: string;
properties.line
line: number;
properties.pen
pen: {
a: number;
b: number;
g: number;
r: number;
};
properties.pen.a?
optional a: number;
properties.pen.b
b: number;
properties.pen.g
g: number;
properties.pen.r
r: number;
type
type: number;

Inherited from

BaseType.raw

Accessors

inners

get inners(): {
x: number;
y: number;
}[][]

Returns

{ x: number; y: number; }[][]


points

get points(): {
x: number;
y: number;
}[]

Returns

{ x: number; y: number; }[]


svgPath

get svgPath(): string

Returns

string

Methods

toJSON()

toJSON(): {
id: number;
properties: {
brush: {
a: number;
b: number;
g: number;
r: number;
};
category: string;
line: number;
pen: {
a: number;
b: number;
g: number;
r: number;
};
};
type: number;
} & XOR<{
polygon: {
x: number;
y: number;
}[];
}, {
inners: {
x: number;
y: number;
}[][];
outer: {
x: number;
y: number;
}[];
}>

Returns

{ id: number; properties: { brush: { a: number; b: number; g: number; r: number; }; category: string; line: number; pen: { a: number; b: number; g: number; r: number; }; }; type: number; } & XOR<{ polygon: { x: number; y: number; }[]; }, { inners: { x: number; y: number; }[][]; outer: { x: number; y: number; }[]; }>

Inherited from

BaseType.toJSON