pyjs 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. pyjs/__init__.py +6 -0
  2. pyjs/__main__.py +6 -0
  3. pyjs/cli.py +816 -0
  4. pyjs/decorators.py +170 -0
  5. pyjs/docs/__init__.py +6 -0
  6. pyjs/docs/builder.py +351 -0
  7. pyjs/docs/cli.py +55 -0
  8. pyjs/docs/config.py +45 -0
  9. pyjs/docs/favicon.svg +18 -0
  10. pyjs/docs/markdown.py +61 -0
  11. pyjs/docs/models.py +38 -0
  12. pyjs/docs/navigation.py +61 -0
  13. pyjs/docs/style.css +901 -0
  14. pyjs/docs/ui.py +349 -0
  15. pyjs/nativescript/__init__.py +77 -0
  16. pyjs/scaffolding/__init__.py +418 -0
  17. pyjs/scaffolding/templates/app/README.md.template +33 -0
  18. pyjs/scaffolding/templates/app/__PYJS_SOURCE_ROOT__/__PYJS_PACKAGE__/__PYJS_PACKAGE__.py.template +81 -0
  19. pyjs/scaffolding/templates/app/__PYJS_SOURCE_ROOT__/__PYJS_PACKAGE__/__init__.py.template +0 -0
  20. pyjs/scaffolding/templates/app/__PYJS_SOURCE_ROOT__/__PYJS_PACKAGE__/__main__.py.template +5 -0
  21. pyjs/scaffolding/templates/app/tests/test_app.py.template +22 -0
  22. pyjs/scaffolding/templates/app/tests/test_browser_app.py.template +19 -0
  23. pyjs/scaffolding/templates/app_test.py.template +8 -0
  24. pyjs/server.py +468 -0
  25. pyjs/skills/pyjs/SKILL.md +161 -0
  26. pyjs/state.py +101 -0
  27. pyjs/testing/__init__.py +3 -0
  28. pyjs/testing/android.py +248 -0
  29. pyjs/testing/artifacts.py +37 -0
  30. pyjs/testing/assertion_rewriter.py +125 -0
  31. pyjs/testing/builder.py +191 -0
  32. pyjs/testing/capture.py +133 -0
  33. pyjs/testing/client/__init__.py +1 -0
  34. pyjs/testing/client/app.py +718 -0
  35. pyjs/testing/client/assertions.py +49 -0
  36. pyjs/testing/client/runtime.py +123 -0
  37. pyjs/testing/client/sidebar.py +377 -0
  38. pyjs/testing/client/state.py +107 -0
  39. pyjs/testing/client/viewer.py +361 -0
  40. pyjs/testing/daemon.py +641 -0
  41. pyjs/testing/helpers.py +155 -0
  42. pyjs/testing/protocol.py +56 -0
  43. pyjs/testing/pytest_plugin.py +797 -0
  44. pyjs/testing/web.py +97 -0
  45. pyjs/testing/webgpu.py +27 -0
  46. pyjs/tooling/__init__.py +4 -0
  47. pyjs/tooling/android.py +138 -0
  48. pyjs/tooling/browser.py +676 -0
  49. pyjs/tooling/command.py +75 -0
  50. pyjs/tooling/nativescript.py +156 -0
  51. pyjs/tooling/node.py +170 -0
  52. pyjs/tooling/perf.py +163 -0
  53. pyjs/transpiler/__init__.py +23 -0
  54. pyjs/transpiler/_builtins.py +485 -0
  55. pyjs/transpiler/analyzer.py +1495 -0
  56. pyjs/transpiler/objects.py +1015 -0
  57. pyjs/transpiler/source.py +189 -0
  58. pyjs/transpiler/transpiler.py +748 -0
  59. pyjs/transpiler/utils.py +150 -0
  60. pyjs/web/__init__.py +5 -0
  61. pyjs/web/console.py +16 -0
  62. pyjs/web/dom.py +1529 -0
  63. pyjs/web/domx.py +474 -0
  64. pyjs/web/dragdrop.py +102 -0
  65. pyjs/web/events.py +1306 -0
  66. pyjs/web/files.py +203 -0
  67. pyjs/web/geometry.py +475 -0
  68. pyjs/web/html.py +927 -0
  69. pyjs/web/indexeddb.py +410 -0
  70. pyjs/web/javascript.py +112 -0
  71. pyjs/web/network.py +193 -0
  72. pyjs/web/ssr.py +70 -0
  73. pyjs/web/streams.py +17 -0
  74. pyjs/web/svg.py +684 -0
  75. pyjs/web/timers.py +29 -0
  76. pyjs/web/ui/__init__.py +18 -0
  77. pyjs/web/ui/accordion.py +166 -0
  78. pyjs/web/ui/alert.py +52 -0
  79. pyjs/web/ui/alert_dialog.py +102 -0
  80. pyjs/web/ui/aspect_ratio.py +12 -0
  81. pyjs/web/ui/attachment.py +80 -0
  82. pyjs/web/ui/avatar.py +105 -0
  83. pyjs/web/ui/badge.py +48 -0
  84. pyjs/web/ui/breadcrumb.py +85 -0
  85. pyjs/web/ui/bubble.py +38 -0
  86. pyjs/web/ui/button.py +86 -0
  87. pyjs/web/ui/calendar.py +124 -0
  88. pyjs/web/ui/card.py +58 -0
  89. pyjs/web/ui/carousel.py +99 -0
  90. pyjs/web/ui/chart.py +56 -0
  91. pyjs/web/ui/checkbox.py +31 -0
  92. pyjs/web/ui/collapsible.py +71 -0
  93. pyjs/web/ui/combobox.py +36 -0
  94. pyjs/web/ui/command.py +118 -0
  95. pyjs/web/ui/context_menu.py +65 -0
  96. pyjs/web/ui/date_picker.py +24 -0
  97. pyjs/web/ui/dialog.py +289 -0
  98. pyjs/web/ui/direction.py +9 -0
  99. pyjs/web/ui/drawer.py +72 -0
  100. pyjs/web/ui/dropdown_menu.py +239 -0
  101. pyjs/web/ui/empty.py +69 -0
  102. pyjs/web/ui/field.py +96 -0
  103. pyjs/web/ui/floating.py +90 -0
  104. pyjs/web/ui/hover_card.py +128 -0
  105. pyjs/web/ui/input.py +48 -0
  106. pyjs/web/ui/input_group.py +77 -0
  107. pyjs/web/ui/input_otp.py +76 -0
  108. pyjs/web/ui/item.py +78 -0
  109. pyjs/web/ui/kbd.py +26 -0
  110. pyjs/web/ui/label.py +14 -0
  111. pyjs/web/ui/marker.py +29 -0
  112. pyjs/web/ui/menubar.py +52 -0
  113. pyjs/web/ui/message.py +57 -0
  114. pyjs/web/ui/message_scroller.py +45 -0
  115. pyjs/web/ui/native_select.py +47 -0
  116. pyjs/web/ui/navigation_menu.py +110 -0
  117. pyjs/web/ui/pagination.py +63 -0
  118. pyjs/web/ui/popover.py +217 -0
  119. pyjs/web/ui/progress.py +44 -0
  120. pyjs/web/ui/radio_group.py +129 -0
  121. pyjs/web/ui/resizable.py +194 -0
  122. pyjs/web/ui/scroll_area.py +29 -0
  123. pyjs/web/ui/select.py +83 -0
  124. pyjs/web/ui/separator.py +24 -0
  125. pyjs/web/ui/sheet.py +77 -0
  126. pyjs/web/ui/sidebar.py +162 -0
  127. pyjs/web/ui/skeleton.py +15 -0
  128. pyjs/web/ui/slider.py +46 -0
  129. pyjs/web/ui/sonner.py +70 -0
  130. pyjs/web/ui/spinner.py +14 -0
  131. pyjs/web/ui/switch.py +35 -0
  132. pyjs/web/ui/table.py +84 -0
  133. pyjs/web/ui/tabs.py +167 -0
  134. pyjs/web/ui/text.py +15 -0
  135. pyjs/web/ui/textarea.py +28 -0
  136. pyjs/web/ui/toggle.py +109 -0
  137. pyjs/web/ui/tooltip.py +164 -0
  138. pyjs/web/ui/typography.py +79 -0
  139. pyjs/web/url.py +76 -0
  140. pyjs/web/webgpu.py +496 -0
  141. pyjs-0.0.1.dist-info/METADATA +441 -0
  142. pyjs-0.0.1.dist-info/RECORD +146 -0
  143. pyjs-0.0.1.dist-info/WHEEL +5 -0
  144. pyjs-0.0.1.dist-info/entry_points.txt +5 -0
  145. pyjs-0.0.1.dist-info/licenses/LICENSE +28 -0
  146. pyjs-0.0.1.dist-info/top_level.txt +1 -0
pyjs/web/svg.py ADDED
@@ -0,0 +1,684 @@
1
+ from pyjs import js
2
+ from pyjs.web.dom import (
3
+ DOMRect,
4
+ Element,
5
+ Node,
6
+ NodeList,
7
+ )
8
+ from pyjs.web.geometry import DOMMatrix, DOMMatrix2DInit, DOMPoint, DOMPointInit
9
+
10
+
11
+ @js(builtin=True)
12
+ class SVGAngle:
13
+ """WebIDL source: @webref/idl/SVG.idl
14
+
15
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAngle
16
+
17
+ Browser support: Chrome 1, Safari 3"""
18
+
19
+ SVG_ANGLETYPE_DEG = 2
20
+ SVG_ANGLETYPE_GRAD = 4
21
+ SVG_ANGLETYPE_RAD = 3
22
+ SVG_ANGLETYPE_UNKNOWN = 0
23
+ SVG_ANGLETYPE_UNSPECIFIED = 1
24
+
25
+ def __init__(self):
26
+ self.unitType: int = 0
27
+ self.value: float = 0.0
28
+ self.valueAsString: str = ""
29
+ self.valueInSpecifiedUnits: float = 0.0
30
+
31
+ def convertToSpecifiedUnits(self, unitType: int) -> None: ...
32
+
33
+ def newValueSpecifiedUnits(
34
+ self, unitType: int, valueInSpecifiedUnits: float
35
+ ) -> None: ...
36
+
37
+
38
+ @js(builtin=True)
39
+ class SVGAnimatedEnumeration:
40
+ """WebIDL source: @webref/idl/SVG.idl
41
+
42
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedEnumeration
43
+
44
+ Browser support: Chrome 1, Safari 3"""
45
+
46
+ def __init__(self):
47
+ self.animVal: int = 0
48
+ self.baseVal: int = 0
49
+
50
+
51
+ @js(builtin=True)
52
+ class SVGAnimatedLength:
53
+ """WebIDL source: @webref/idl/SVG.idl
54
+
55
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedLength
56
+
57
+ Browser support: Chrome 1, Safari 3"""
58
+
59
+ def __init__(self):
60
+ self.animVal: SVGLength = None
61
+ self.baseVal: SVGLength = None
62
+
63
+
64
+ @js(builtin=True)
65
+ class SVGAnimatedLengthList:
66
+ """WebIDL source: @webref/idl/SVG.idl
67
+
68
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedLengthList
69
+
70
+ Browser support: Chrome 1, Safari 3"""
71
+
72
+ def __init__(self):
73
+ self.animVal: SVGLengthList = None
74
+ self.baseVal: SVGLengthList = None
75
+
76
+
77
+ @js(builtin=True)
78
+ class SVGAnimatedNumber:
79
+ """WebIDL source: @webref/idl/SVG.idl
80
+
81
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedNumber
82
+
83
+ Browser support: Chrome 1, Safari 3"""
84
+
85
+ def __init__(self):
86
+ self.animVal: float = 0.0
87
+ self.baseVal: float = 0.0
88
+
89
+
90
+ @js(builtin=True)
91
+ class SVGAnimatedNumberList:
92
+ """WebIDL source: @webref/idl/SVG.idl
93
+
94
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedNumberList
95
+
96
+ Browser support: Chrome 6, Safari 5"""
97
+
98
+ def __init__(self):
99
+ self.animVal: SVGNumberList = None
100
+ self.baseVal: SVGNumberList = None
101
+
102
+
103
+ @js(builtin=True)
104
+ class SVGAnimatedPreserveAspectRatio:
105
+ """WebIDL source: @webref/idl/SVG.idl
106
+
107
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedPreserveAspectRatio
108
+
109
+ Browser support: Chrome 5, Safari 5"""
110
+
111
+ def __init__(self):
112
+ self.animVal: SVGPreserveAspectRatio = None
113
+ self.baseVal: SVGPreserveAspectRatio = None
114
+
115
+
116
+ @js(builtin=True)
117
+ class SVGAnimatedRect:
118
+ """WebIDL source: @webref/idl/SVG.idl
119
+
120
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedRect
121
+
122
+ Browser support: Chrome 1, Safari 3"""
123
+
124
+ def __init__(self):
125
+ self.animVal: DOMRect = None
126
+ self.baseVal: DOMRect = None
127
+
128
+
129
+ @js(builtin=True)
130
+ class SVGAnimatedString:
131
+ """WebIDL source: @webref/idl/SVG.idl
132
+
133
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedString
134
+
135
+ Browser support: Chrome 1, Safari 3"""
136
+
137
+ def __init__(self):
138
+ self.animVal: str = ""
139
+ self.baseVal: str | TrustedScriptURL = None
140
+
141
+
142
+ @js(builtin=True)
143
+ class SVGAnimatedTransformList:
144
+ """WebIDL source: @webref/idl/SVG.idl
145
+
146
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGAnimatedTransformList
147
+
148
+ Browser support: Chrome 1, Safari 3"""
149
+
150
+ def __init__(self):
151
+ self.animVal: SVGTransformList = None
152
+ self.baseVal: SVGTransformList = None
153
+
154
+
155
+ @js
156
+ class SVGBoundingBoxOptions:
157
+ """WebIDL source: @webref/idl/SVG.idl"""
158
+
159
+ def __init__(
160
+ self,
161
+ clipped: bool = False,
162
+ fill: bool = True,
163
+ markers: bool = False,
164
+ stroke: bool = False,
165
+ ):
166
+ self.clipped = clipped
167
+ self.fill = fill
168
+ self.markers = markers
169
+ self.stroke = stroke
170
+
171
+
172
+ @js(builtin=True)
173
+ class SVGElement(Element):
174
+ """WebIDL source: @webref/idl/SVG.idl
175
+
176
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGElement
177
+
178
+ Browser support: Chrome 1, Safari 3"""
179
+
180
+ def __init__(self):
181
+ super().__init__()
182
+ self.className: SVGAnimatedString = None
183
+ self.ownerSVGElement: SVGSVGElement | None = None
184
+ self.viewportElement: SVGElement | None = None
185
+
186
+
187
+ @js(builtin=True)
188
+ class SVGLength:
189
+ """WebIDL source: @webref/idl/SVG.idl
190
+
191
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGLength
192
+
193
+ Browser support: Chrome 1, Safari 3"""
194
+
195
+ SVG_LENGTHTYPE_CM = 6
196
+ SVG_LENGTHTYPE_EMS = 3
197
+ SVG_LENGTHTYPE_EXS = 4
198
+ SVG_LENGTHTYPE_IN = 8
199
+ SVG_LENGTHTYPE_MM = 7
200
+ SVG_LENGTHTYPE_NUMBER = 1
201
+ SVG_LENGTHTYPE_PC = 10
202
+ SVG_LENGTHTYPE_PERCENTAGE = 2
203
+ SVG_LENGTHTYPE_PT = 9
204
+ SVG_LENGTHTYPE_PX = 5
205
+ SVG_LENGTHTYPE_UNKNOWN = 0
206
+
207
+ def __init__(self):
208
+ self.unitType: int = 0
209
+ self.value: float = 0.0
210
+ self.valueAsString: str = ""
211
+ self.valueInSpecifiedUnits: float = 0.0
212
+
213
+ def convertToSpecifiedUnits(self, unitType: int) -> None: ...
214
+
215
+ def newValueSpecifiedUnits(
216
+ self, unitType: int, valueInSpecifiedUnits: float
217
+ ) -> None: ...
218
+
219
+
220
+ @js(builtin=True)
221
+ class SVGLengthList:
222
+ """WebIDL source: @webref/idl/SVG.idl
223
+
224
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGLengthList
225
+
226
+ Browser support: Chrome 1, Safari 3"""
227
+
228
+ def __init__(self):
229
+ self.length: int = 0
230
+ self.numberOfItems: int = 0
231
+
232
+ @js(inline="{self}[{index}] = {newItem}")
233
+ def __setitem__(self, index: int, newItem: SVGLength) -> None: ...
234
+
235
+ def appendItem(self, newItem: SVGLength) -> SVGLength: ...
236
+
237
+ def clear(self) -> None: ...
238
+
239
+ @js(inline="{self}[{index}]")
240
+ def getItem(self, index: int) -> SVGLength: ...
241
+
242
+ def initialize(self, newItem: SVGLength) -> SVGLength: ...
243
+
244
+ def insertItemBefore(self, newItem: SVGLength, index: int) -> SVGLength: ...
245
+
246
+ def removeItem(self, index: int) -> SVGLength: ...
247
+
248
+ def replaceItem(self, newItem: SVGLength, index: int) -> SVGLength: ...
249
+
250
+
251
+ @js(builtin=True)
252
+ class SVGNumber:
253
+ """WebIDL source: @webref/idl/SVG.idl
254
+
255
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGNumber
256
+
257
+ Browser support: Chrome 1, Safari 3"""
258
+
259
+ def __init__(self):
260
+ self.value: float = 0.0
261
+
262
+
263
+ @js(builtin=True)
264
+ class SVGNumberList:
265
+ """WebIDL source: @webref/idl/SVG.idl
266
+
267
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGNumberList
268
+
269
+ Browser support: Chrome 6, Safari 5"""
270
+
271
+ def __init__(self):
272
+ self.length: int = 0
273
+ self.numberOfItems: int = 0
274
+
275
+ @js(inline="{self}[{index}] = {newItem}")
276
+ def __setitem__(self, index: int, newItem: SVGNumber) -> None: ...
277
+
278
+ def appendItem(self, newItem: SVGNumber) -> SVGNumber: ...
279
+
280
+ def clear(self) -> None: ...
281
+
282
+ @js(inline="{self}[{index}]")
283
+ def getItem(self, index: int) -> SVGNumber: ...
284
+
285
+ def initialize(self, newItem: SVGNumber) -> SVGNumber: ...
286
+
287
+ def insertItemBefore(self, newItem: SVGNumber, index: int) -> SVGNumber: ...
288
+
289
+ def removeItem(self, index: int) -> SVGNumber: ...
290
+
291
+ def replaceItem(self, newItem: SVGNumber, index: int) -> SVGNumber: ...
292
+
293
+
294
+ @js(builtin=True)
295
+ class SVGPreserveAspectRatio:
296
+ """WebIDL source: @webref/idl/SVG.idl
297
+
298
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGPreserveAspectRatio
299
+
300
+ Browser support: Chrome 1, Safari 3"""
301
+
302
+ SVG_MEETORSLICE_MEET = 1
303
+ SVG_MEETORSLICE_SLICE = 2
304
+ SVG_MEETORSLICE_UNKNOWN = 0
305
+ SVG_PRESERVEASPECTRATIO_NONE = 1
306
+ SVG_PRESERVEASPECTRATIO_UNKNOWN = 0
307
+ SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10
308
+ SVG_PRESERVEASPECTRATIO_XMAXYMID = 7
309
+ SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4
310
+ SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9
311
+ SVG_PRESERVEASPECTRATIO_XMIDYMID = 6
312
+ SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3
313
+ SVG_PRESERVEASPECTRATIO_XMINYMAX = 8
314
+ SVG_PRESERVEASPECTRATIO_XMINYMID = 5
315
+ SVG_PRESERVEASPECTRATIO_XMINYMIN = 2
316
+
317
+ def __init__(self):
318
+ self.align: int = 0
319
+ self.meetOrSlice: int = 0
320
+
321
+
322
+ @js(builtin=True)
323
+ class SVGStringList:
324
+ """WebIDL source: @webref/idl/SVG.idl
325
+
326
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGStringList
327
+
328
+ Browser support: Chrome 1, Safari 3"""
329
+
330
+ def __init__(self):
331
+ self.length: int = 0
332
+ self.numberOfItems: int = 0
333
+
334
+ @js(inline="{self}[{index}] = {newItem}")
335
+ def __setitem__(self, index: int, newItem: str) -> None: ...
336
+
337
+ def appendItem(self, newItem: str) -> str: ...
338
+
339
+ def clear(self) -> None: ...
340
+
341
+ @js(inline="{self}[{index}]")
342
+ def getItem(self, index: int) -> str: ...
343
+
344
+ def initialize(self, newItem: str) -> str: ...
345
+
346
+ def insertItemBefore(self, newItem: str, index: int) -> str: ...
347
+
348
+ def removeItem(self, index: int) -> str: ...
349
+
350
+ def replaceItem(self, newItem: str, index: int) -> str: ...
351
+
352
+
353
+ @js(builtin=True)
354
+ class SVGTransform:
355
+ """WebIDL source: @webref/idl/SVG.idl
356
+
357
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGTransform
358
+
359
+ Browser support: Chrome 1, Safari 4"""
360
+
361
+ SVG_TRANSFORM_MATRIX = 1
362
+ SVG_TRANSFORM_ROTATE = 4
363
+ SVG_TRANSFORM_SCALE = 3
364
+ SVG_TRANSFORM_SKEWX = 5
365
+ SVG_TRANSFORM_SKEWY = 6
366
+ SVG_TRANSFORM_TRANSLATE = 2
367
+ SVG_TRANSFORM_UNKNOWN = 0
368
+
369
+ def __init__(self):
370
+ self.angle: float = 0.0
371
+ self.matrix: DOMMatrix = None
372
+ self.type: int = 0
373
+
374
+ def setMatrix(self, matrix: DOMMatrix2DInit | None = None) -> None: ...
375
+
376
+ def setRotate(self, angle: float, cx: float, cy: float) -> None: ...
377
+
378
+ def setScale(self, sx: float, sy: float) -> None: ...
379
+
380
+ def setSkewX(self, angle: float) -> None: ...
381
+
382
+ def setSkewY(self, angle: float) -> None: ...
383
+
384
+ def setTranslate(self, tx: float, ty: float) -> None: ...
385
+
386
+
387
+ @js(builtin=True)
388
+ class SVGTransformList:
389
+ """WebIDL source: @webref/idl/SVG.idl
390
+
391
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGTransformList
392
+
393
+ Browser support: Chrome 1, Safari 3"""
394
+
395
+ def __init__(self):
396
+ self.length: int = 0
397
+ self.numberOfItems: int = 0
398
+
399
+ @js(inline="{self}[{index}] = {newItem}")
400
+ def __setitem__(self, index: int, newItem: SVGTransform) -> None: ...
401
+
402
+ def appendItem(self, newItem: SVGTransform) -> SVGTransform: ...
403
+
404
+ def clear(self) -> None: ...
405
+
406
+ def consolidate(self) -> SVGTransform | None: ...
407
+
408
+ def createSVGTransformFromMatrix(
409
+ self, matrix: DOMMatrix2DInit | None = None
410
+ ) -> SVGTransform: ...
411
+
412
+ @js(inline="{self}[{index}]")
413
+ def getItem(self, index: int) -> SVGTransform: ...
414
+
415
+ def initialize(self, newItem: SVGTransform) -> SVGTransform: ...
416
+
417
+ def insertItemBefore(self, newItem: SVGTransform, index: int) -> SVGTransform: ...
418
+
419
+ def removeItem(self, index: int) -> SVGTransform: ...
420
+
421
+ def replaceItem(self, newItem: SVGTransform, index: int) -> SVGTransform: ...
422
+
423
+
424
+ @js(builtin=True)
425
+ class TrustedScriptURL:
426
+ """WebIDL source: @webref/idl/trusted-types.idl
427
+
428
+ MDN: https://developer.mozilla.org/docs/Web/API/TrustedScriptURL
429
+
430
+ Browser support: Chrome 83, Safari 26"""
431
+
432
+ pass
433
+
434
+
435
+ @js(builtin=True)
436
+ class SVGGraphicsElement(SVGElement):
437
+ """WebIDL source: @webref/idl/SVG.idl
438
+
439
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGGraphicsElement
440
+
441
+ Browser support: Chrome 30, Safari 7"""
442
+
443
+ def __init__(self):
444
+ super().__init__()
445
+ self.requiredExtensions: SVGStringList = None
446
+ self.systemLanguage: SVGStringList = None
447
+ self.transform: SVGAnimatedTransformList = None
448
+
449
+ def getBBox(
450
+ self,
451
+ *,
452
+ fill: bool = True,
453
+ stroke: bool = False,
454
+ markers: bool = False,
455
+ clipped: bool = False,
456
+ ) -> DOMRect: ...
457
+
458
+ def getCTM(self) -> DOMMatrix | None: ...
459
+
460
+ def getScreenCTM(self) -> DOMMatrix | None: ...
461
+
462
+
463
+ @js(builtin=True)
464
+ class SVGGElement(SVGGraphicsElement):
465
+ """WebIDL source: @webref/idl/SVG.idl
466
+
467
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGGElement
468
+
469
+ Browser support: Chrome 1, Safari 3"""
470
+
471
+ pass
472
+
473
+
474
+ @js(builtin=True)
475
+ class SVGGeometryElement(SVGGraphicsElement):
476
+ """WebIDL source: @webref/idl/SVG.idl
477
+
478
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGGeometryElement
479
+
480
+ Browser support: Chrome 56, Safari 12"""
481
+
482
+ def __init__(self):
483
+ super().__init__()
484
+ self.pathLength: SVGAnimatedNumber = None
485
+
486
+ def getPointAtLength(self, distance: float) -> DOMPoint: ...
487
+
488
+ def getTotalLength(self) -> float: ...
489
+
490
+ def isPointInFill(self, point: DOMPointInit | None = None) -> bool: ...
491
+
492
+ def isPointInStroke(self, point: DOMPointInit | None = None) -> bool: ...
493
+
494
+
495
+ @js(builtin=True)
496
+ class SVGSVGElement(SVGGraphicsElement):
497
+ """WebIDL source: @webref/idl/SVG.idl
498
+
499
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGSVGElement
500
+
501
+ Browser support: Chrome 1, Safari 3"""
502
+
503
+ def __init__(self):
504
+ super().__init__()
505
+ self.currentScale: float = 0.0
506
+ self.currentTranslate: DOMPoint = None
507
+ self.height: SVGAnimatedLength = None
508
+ self.preserveAspectRatio: SVGAnimatedPreserveAspectRatio = None
509
+ self.viewBox: SVGAnimatedRect = None
510
+ self.width: SVGAnimatedLength = None
511
+ self.x: SVGAnimatedLength = None
512
+ self.y: SVGAnimatedLength = None
513
+
514
+ def checkEnclosure(self, element: SVGElement, rect: DOMRect) -> bool: ...
515
+
516
+ def checkIntersection(self, element: SVGElement, rect: DOMRect) -> bool: ...
517
+
518
+ def createSVGAngle(self) -> SVGAngle: ...
519
+
520
+ def createSVGLength(self) -> SVGLength: ...
521
+
522
+ def createSVGMatrix(self) -> DOMMatrix: ...
523
+
524
+ def createSVGNumber(self) -> SVGNumber: ...
525
+
526
+ def createSVGPoint(self) -> DOMPoint: ...
527
+
528
+ def createSVGRect(self) -> DOMRect: ...
529
+
530
+ def createSVGTransform(self) -> SVGTransform: ...
531
+
532
+ def createSVGTransformFromMatrix(
533
+ self, matrix: DOMMatrix2DInit | None = None
534
+ ) -> SVGTransform: ...
535
+
536
+ def deselectAll(self) -> None: ...
537
+
538
+ def forceRedraw(self) -> None: ...
539
+
540
+ def getElementById(self, elementId: str) -> Element | None: ...
541
+
542
+ def getEnclosureList(
543
+ self, rect: DOMRect, referenceElement: SVGElement | None
544
+ ) -> NodeList[Node]: ...
545
+
546
+ def getIntersectionList(
547
+ self, rect: DOMRect, referenceElement: SVGElement | None
548
+ ) -> NodeList[Node]: ...
549
+
550
+ def suspendRedraw(self, maxWaitMilliseconds: int) -> int: ...
551
+
552
+ def unsuspendRedraw(self, suspendHandleID: int) -> None: ...
553
+
554
+ def unsuspendRedrawAll(self) -> None: ...
555
+
556
+
557
+ @js(builtin=True)
558
+ class SVGTextContentElement(SVGGraphicsElement):
559
+ """WebIDL source: @webref/idl/SVG.idl
560
+
561
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGTextContentElement
562
+
563
+ Browser support: Chrome 1, Safari 3"""
564
+
565
+ LENGTHADJUST_SPACING = 1
566
+ LENGTHADJUST_SPACINGANDGLYPHS = 2
567
+ LENGTHADJUST_UNKNOWN = 0
568
+
569
+ def __init__(self):
570
+ super().__init__()
571
+ self.lengthAdjust: SVGAnimatedEnumeration = None
572
+ self.textLength: SVGAnimatedLength = None
573
+
574
+ def getCharNumAtPosition(self, point: DOMPointInit | None = None) -> int: ...
575
+
576
+ def getComputedTextLength(self) -> float: ...
577
+
578
+ def getEndPositionOfChar(self, charnum: int) -> DOMPoint: ...
579
+
580
+ def getExtentOfChar(self, charnum: int) -> DOMRect: ...
581
+
582
+ def getNumberOfChars(self) -> int: ...
583
+
584
+ def getRotationOfChar(self, charnum: int) -> float: ...
585
+
586
+ def getStartPositionOfChar(self, charnum: int) -> DOMPoint: ...
587
+
588
+ def getSubStringLength(self, charnum: int, nchars: int) -> float: ...
589
+
590
+ def selectSubString(self, charnum: int, nchars: int) -> None: ...
591
+
592
+
593
+ @js(builtin=True)
594
+ class SVGCircleElement(SVGGeometryElement):
595
+ """WebIDL source: @webref/idl/SVG.idl
596
+
597
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGCircleElement
598
+
599
+ Browser support: Chrome 1, Safari 3"""
600
+
601
+ def __init__(self):
602
+ super().__init__()
603
+ self.cx: SVGAnimatedLength = None
604
+ self.cy: SVGAnimatedLength = None
605
+ self.r: SVGAnimatedLength = None
606
+
607
+
608
+ @js(builtin=True)
609
+ class SVGLineElement(SVGGeometryElement):
610
+ """WebIDL source: @webref/idl/SVG.idl
611
+
612
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGLineElement
613
+
614
+ Browser support: Chrome 1, Safari 3"""
615
+
616
+ def __init__(self):
617
+ super().__init__()
618
+ self.x1: SVGAnimatedLength = None
619
+ self.x2: SVGAnimatedLength = None
620
+ self.y1: SVGAnimatedLength = None
621
+ self.y2: SVGAnimatedLength = None
622
+
623
+
624
+ @js(builtin=True)
625
+ class SVGPathElement(SVGGeometryElement):
626
+ """WebIDL source: @webref/idl/svg-paths.idl
627
+
628
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGPathElement
629
+
630
+ Browser support: Chrome 1, Safari 3"""
631
+
632
+ def __init__(self):
633
+ super().__init__()
634
+ self.pathLength: SVGAnimatedNumber = None
635
+
636
+ def getPointAtLength(self, distance: float) -> DOMPoint: ...
637
+
638
+ def getTotalLength(self) -> float: ...
639
+
640
+
641
+ @js(builtin=True)
642
+ class SVGRectElement(SVGGeometryElement):
643
+ """WebIDL source: @webref/idl/SVG.idl
644
+
645
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGRectElement
646
+
647
+ Browser support: Chrome 1, Safari 3"""
648
+
649
+ def __init__(self):
650
+ super().__init__()
651
+ self.height: SVGAnimatedLength = None
652
+ self.rx: SVGAnimatedLength = None
653
+ self.ry: SVGAnimatedLength = None
654
+ self.width: SVGAnimatedLength = None
655
+ self.x: SVGAnimatedLength = None
656
+ self.y: SVGAnimatedLength = None
657
+
658
+
659
+ @js(builtin=True)
660
+ class SVGTextPositioningElement(SVGTextContentElement):
661
+ """WebIDL source: @webref/idl/SVG.idl
662
+
663
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGTextPositioningElement
664
+
665
+ Browser support: Chrome 1, Safari 3"""
666
+
667
+ def __init__(self):
668
+ super().__init__()
669
+ self.dx: SVGAnimatedLengthList = None
670
+ self.dy: SVGAnimatedLengthList = None
671
+ self.rotate: SVGAnimatedNumberList = None
672
+ self.x: SVGAnimatedLengthList = None
673
+ self.y: SVGAnimatedLengthList = None
674
+
675
+
676
+ @js(builtin=True)
677
+ class SVGTextElement(SVGTextPositioningElement):
678
+ """WebIDL source: @webref/idl/SVG.idl
679
+
680
+ MDN: https://developer.mozilla.org/docs/Web/API/SVGTextElement
681
+
682
+ Browser support: Chrome 1, Safari 3"""
683
+
684
+ pass
pyjs/web/timers.py ADDED
@@ -0,0 +1,29 @@
1
+ from pyjs import js
2
+
3
+
4
+ @js(builtin=True)
5
+ def setTimeout(callback: callable, milliseconds: int = 0, *arguments: object) -> int: ...
6
+
7
+
8
+ @js(builtin=True)
9
+ def clearTimeout(timer: int | None = None) -> None: ...
10
+
11
+
12
+ @js(builtin=True)
13
+ def setInterval(callback: callable, milliseconds: int = 0, *arguments: object) -> int: ...
14
+
15
+
16
+ @js(builtin=True)
17
+ def clearInterval(timer: int | None = None) -> None: ...
18
+
19
+
20
+ @js(builtin=True)
21
+ def queueMicrotask(callback: callable) -> None: ...
22
+
23
+
24
+ @js(builtin=True)
25
+ def requestAnimationFrame(callback: callable) -> int: ...
26
+
27
+
28
+ @js(builtin=True)
29
+ def cancelAnimationFrame(request_id: int) -> None: ...