Skip to content

Commit 4970a4b

Browse files
Suport g, circle, ellipse, polygon, polyline svg elements (#2259)
* Fix Warming: Update Comment Capitalization * Extend IntrinsicElements and Add JsxGElementProps * Add svg circle support * Add svg ellipse support * Add svg polygon support * Add svg polyline support
1 parent b49506c commit 4970a4b

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

Diff for: src/lib/utils/jsx.elements.ts

+76
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,13 @@ export interface IntrinsicElements {
115115

116116
// SVG Elements
117117
svg: JsxSvgElementProps;
118+
g: JsxGElementProps;
118119
path: JsxPathElementProps;
119120
rect: JsxRectElementProps;
121+
circle: JsxCircleElementProps;
122+
ellipse: JsxEllipseElementProps;
123+
polygon: JsxPolygonElementProps;
124+
polyline: JsxPolylineElementProps;
120125
use: JsxUseElementProps;
121126
}
122127

@@ -1027,6 +1032,17 @@ export interface JsxSvgElementProps
10271032
y?: string | number;
10281033
}
10291034

1035+
/**
1036+
* Properties permitted on the `<g>` element.
1037+
*
1038+
* Reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g
1039+
*/
1040+
export interface JsxGElementProps
1041+
extends JsxSvgCoreProps,
1042+
JsxSvgStyleProps,
1043+
JsxSvgConditionalProcessingProps,
1044+
JsxSvgPresentationProps {}
1045+
10301046
/**
10311047
* Properties permitted on the `<path>` element.
10321048
*
@@ -1060,6 +1076,66 @@ export interface JsxRectElementProps
10601076
y?: string | number;
10611077
}
10621078

1079+
/**
1080+
* Properties permitted on the `<circle>` element.
1081+
*
1082+
* Reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/circle
1083+
*/
1084+
export interface JsxCircleElementProps
1085+
extends JsxSvgCoreProps,
1086+
JsxSvgStyleProps,
1087+
JsxSvgConditionalProcessingProps,
1088+
JsxSvgPresentationProps {
1089+
cx?: string | number;
1090+
cy?: string | number;
1091+
r?: string | number;
1092+
pathLength?: number;
1093+
}
1094+
1095+
/**
1096+
* Properties permitted on the `<ellipse>` element.
1097+
*
1098+
* Reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse
1099+
*/
1100+
export interface JsxEllipseElementProps
1101+
extends JsxSvgCoreProps,
1102+
JsxSvgStyleProps,
1103+
JsxSvgConditionalProcessingProps,
1104+
JsxSvgPresentationProps {
1105+
cx?: string | number;
1106+
cy?: string | number;
1107+
rx?: string | number;
1108+
ry?: string | number;
1109+
pathLength?: number;
1110+
}
1111+
1112+
/**
1113+
* Properties permitted on the `<polygon>` element.
1114+
*
1115+
* Reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polygon
1116+
*/
1117+
export interface JsxPolygonElementProps
1118+
extends JsxSvgCoreProps,
1119+
JsxSvgStyleProps,
1120+
JsxSvgConditionalProcessingProps,
1121+
JsxSvgPresentationProps {
1122+
points?: string;
1123+
pathLength?: number;
1124+
}
1125+
1126+
/** Properties permitted on the `<polyline>` element.
1127+
*
1128+
* Reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polyline
1129+
*/
1130+
export interface JsxPolylineElementProps
1131+
extends JsxSvgCoreProps,
1132+
JsxSvgStyleProps,
1133+
JsxSvgConditionalProcessingProps,
1134+
JsxSvgPresentationProps {
1135+
points?: string;
1136+
pathLength?: number;
1137+
}
1138+
10631139
/**
10641140
* Properties permitted on the `<use>` element.
10651141
*

Diff for: src/test/renderer/testProject/src/classes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export class SubClassA extends BaseClass implements PrintNameInterface {
216216
public print(value: string): void {}
217217

218218
/**
219-
* @inheritdoc
219+
* @inheritDoc
220220
*/
221221
public printName(): void {
222222
this.print(this.getName());

0 commit comments

Comments
 (0)