1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "::js_sys::Object",
9 js_name = "Path2D",
10 typescript_type = "Path2D"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `Path2d` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
18 pub type Path2d;
19 #[wasm_bindgen(catch, constructor, js_class = "Path2D")]
20 #[doc = "The `new Path2d(..)` constructor, creating a new instance of `Path2d`."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/Path2D)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
25 pub fn new() -> Result<Path2d, JsValue>;
26 #[wasm_bindgen(catch, constructor, js_class = "Path2D")]
27 #[doc = "The `new Path2d(..)` constructor, creating a new instance of `Path2d`."]
28 #[doc = ""]
29 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/Path2D)"]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
32 pub fn new_with_other(other: &Path2d) -> Result<Path2d, JsValue>;
33 #[wasm_bindgen(catch, constructor, js_class = "Path2D")]
34 #[doc = "The `new Path2d(..)` constructor, creating a new instance of `Path2d`."]
35 #[doc = ""]
36 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/Path2D)"]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
39 pub fn new_with_path_string(path_string: &str) -> Result<Path2d, JsValue>;
40 #[wasm_bindgen(method, js_class = "Path2D", js_name = "addPath")]
41 #[doc = "The `addPath()` method."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/addPath)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
46 pub fn add_path(this: &Path2d, path: &Path2d);
47 #[cfg(feature = "SvgMatrix")]
48 #[wasm_bindgen(method, js_class = "Path2D", js_name = "addPath")]
49 #[doc = "The `addPath()` method."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/addPath)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `Path2d`, `SvgMatrix`*"]
54 pub fn add_path_with_transformation(this: &Path2d, path: &Path2d, transformation: &SvgMatrix);
55 #[wasm_bindgen(catch, method, js_class = "Path2D")]
56 #[doc = "The `arc()` method."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/arc)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
61 pub fn arc(
62 this: &Path2d,
63 x: f64,
64 y: f64,
65 radius: f64,
66 start_angle: f64,
67 end_angle: f64,
68 ) -> Result<(), JsValue>;
69 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "arc")]
70 #[doc = "The `arc()` method."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/arc)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
75 pub fn arc_with_anticlockwise(
76 this: &Path2d,
77 x: f64,
78 y: f64,
79 radius: f64,
80 start_angle: f64,
81 end_angle: f64,
82 anticlockwise: bool,
83 ) -> Result<(), JsValue>;
84 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "arcTo")]
85 #[doc = "The `arcTo()` method."]
86 #[doc = ""]
87 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/arcTo)"]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
90 pub fn arc_to(
91 this: &Path2d,
92 x1: f64,
93 y1: f64,
94 x2: f64,
95 y2: f64,
96 radius: f64,
97 ) -> Result<(), JsValue>;
98 #[wasm_bindgen(method, js_class = "Path2D", js_name = "bezierCurveTo")]
99 #[doc = "The `bezierCurveTo()` method."]
100 #[doc = ""]
101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/bezierCurveTo)"]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
104 pub fn bezier_curve_to(
105 this: &Path2d,
106 cp1x: f64,
107 cp1y: f64,
108 cp2x: f64,
109 cp2y: f64,
110 x: f64,
111 y: f64,
112 );
113 #[wasm_bindgen(method, js_class = "Path2D", js_name = "closePath")]
114 #[doc = "The `closePath()` method."]
115 #[doc = ""]
116 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/closePath)"]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
119 pub fn close_path(this: &Path2d);
120 #[wasm_bindgen(catch, method, js_class = "Path2D")]
121 #[doc = "The `ellipse()` method."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/ellipse)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
126 pub fn ellipse(
127 this: &Path2d,
128 x: f64,
129 y: f64,
130 radius_x: f64,
131 radius_y: f64,
132 rotation: f64,
133 start_angle: f64,
134 end_angle: f64,
135 ) -> Result<(), JsValue>;
136 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "ellipse")]
137 #[doc = "The `ellipse()` method."]
138 #[doc = ""]
139 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/ellipse)"]
140 #[doc = ""]
141 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
142 pub fn ellipse_with_anticlockwise(
143 this: &Path2d,
144 x: f64,
145 y: f64,
146 radius_x: f64,
147 radius_y: f64,
148 rotation: f64,
149 start_angle: f64,
150 end_angle: f64,
151 anticlockwise: bool,
152 ) -> Result<(), JsValue>;
153 #[wasm_bindgen(method, js_class = "Path2D", js_name = "lineTo")]
154 #[doc = "The `lineTo()` method."]
155 #[doc = ""]
156 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/lineTo)"]
157 #[doc = ""]
158 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
159 pub fn line_to(this: &Path2d, x: f64, y: f64);
160 #[wasm_bindgen(method, js_class = "Path2D", js_name = "moveTo")]
161 #[doc = "The `moveTo()` method."]
162 #[doc = ""]
163 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/moveTo)"]
164 #[doc = ""]
165 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
166 pub fn move_to(this: &Path2d, x: f64, y: f64);
167 #[wasm_bindgen(method, js_class = "Path2D", js_name = "quadraticCurveTo")]
168 #[doc = "The `quadraticCurveTo()` method."]
169 #[doc = ""]
170 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/quadraticCurveTo)"]
171 #[doc = ""]
172 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
173 pub fn quadratic_curve_to(this: &Path2d, cpx: f64, cpy: f64, x: f64, y: f64);
174 #[wasm_bindgen(method, js_class = "Path2D")]
175 #[doc = "The `rect()` method."]
176 #[doc = ""]
177 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/rect)"]
178 #[doc = ""]
179 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
180 pub fn rect(this: &Path2d, x: f64, y: f64, w: f64, h: f64);
181 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "roundRect")]
182 #[doc = "The `roundRect()` method."]
183 #[doc = ""]
184 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"]
185 #[doc = ""]
186 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
187 pub fn round_rect(this: &Path2d, x: f64, y: f64, w: f64, h: f64) -> Result<(), JsValue>;
188 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "roundRect")]
189 #[doc = "The `roundRect()` method."]
190 #[doc = ""]
191 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"]
192 #[doc = ""]
193 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
194 pub fn round_rect_with_f64(
195 this: &Path2d,
196 x: f64,
197 y: f64,
198 w: f64,
199 h: f64,
200 radii: f64,
201 ) -> Result<(), JsValue>;
202 #[cfg(feature = "DomPointInit")]
203 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "roundRect")]
204 #[doc = "The `roundRect()` method."]
205 #[doc = ""]
206 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"]
207 #[doc = ""]
208 #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `Path2d`*"]
209 pub fn round_rect_with_dom_point_init(
210 this: &Path2d,
211 x: f64,
212 y: f64,
213 w: f64,
214 h: f64,
215 radii: &DomPointInit,
216 ) -> Result<(), JsValue>;
217 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "roundRect")]
218 #[doc = "The `roundRect()` method."]
219 #[doc = ""]
220 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"]
221 #[doc = ""]
222 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
223 pub fn round_rect_with_f64_sequence(
224 this: &Path2d,
225 x: f64,
226 y: f64,
227 w: f64,
228 h: f64,
229 radii: &::wasm_bindgen::JsValue,
230 ) -> Result<(), JsValue>;
231 #[wasm_bindgen(catch, method, js_class = "Path2D", js_name = "roundRect")]
232 #[doc = "The `roundRect()` method."]
233 #[doc = ""]
234 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"]
235 #[doc = ""]
236 #[doc = "*This API requires the following crate features to be activated: `Path2d`*"]
237 pub fn round_rect_with_dom_point_init_sequence(
238 this: &Path2d,
239 x: f64,
240 y: f64,
241 w: f64,
242 h: f64,
243 radii: &::wasm_bindgen::JsValue,
244 ) -> Result<(), JsValue>;
245}