sfml.js 0.0.1 → 1.0.0-rc.1

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 (696) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +24 -16
  3. package/binding.gyp +95 -183
  4. package/dist/audio/effect-processor.d.ts +22 -0
  5. package/dist/audio/effect-processor.js +28 -0
  6. package/dist/audio/input-sound-file.d.ts +52 -0
  7. package/dist/audio/input-sound-file.js +167 -0
  8. package/dist/audio/listener.d.ts +28 -0
  9. package/dist/audio/listener.js +86 -0
  10. package/dist/audio/music.d.ts +60 -0
  11. package/dist/audio/music.js +192 -0
  12. package/dist/audio/output-sound-file.d.ts +15 -0
  13. package/dist/audio/output-sound-file.js +70 -0
  14. package/dist/audio/playback-device.d.ts +35 -0
  15. package/dist/audio/playback-device.js +71 -0
  16. package/dist/audio/sound-buffer-recorder.d.ts +34 -0
  17. package/dist/audio/sound-buffer-recorder.js +62 -0
  18. package/dist/audio/sound-buffer.d.ts +45 -0
  19. package/dist/audio/sound-buffer.js +152 -0
  20. package/dist/audio/sound-file-factory.d.ts +27 -0
  21. package/dist/audio/sound-file-factory.js +152 -0
  22. package/dist/audio/sound-file-reader.d.ts +60 -0
  23. package/dist/audio/sound-file-reader.js +61 -0
  24. package/dist/audio/sound-file-writer.d.ts +17 -0
  25. package/dist/audio/sound-file-writer.js +9 -0
  26. package/dist/audio/sound-recorder.d.ts +60 -0
  27. package/dist/audio/sound-recorder.js +162 -0
  28. package/dist/audio/sound-source.d.ts +108 -0
  29. package/dist/audio/sound-source.js +161 -0
  30. package/dist/audio/sound-stream.d.ts +28 -0
  31. package/dist/audio/sound-stream.js +47 -0
  32. package/dist/audio/sound.d.ts +14 -0
  33. package/dist/audio/sound.js +39 -0
  34. package/dist/audio/value.d.ts +116 -0
  35. package/dist/audio/value.js +157 -0
  36. package/dist/audio/worker.d.ts +88 -0
  37. package/dist/audio/worker.js +2 -0
  38. package/dist/graphics/blend-mode.d.ts +82 -0
  39. package/dist/graphics/blend-mode.js +98 -0
  40. package/dist/graphics/boolean-vector.d.ts +48 -0
  41. package/dist/graphics/boolean-vector.js +116 -0
  42. package/dist/graphics/circle-shape.d.ts +27 -0
  43. package/dist/graphics/circle-shape.js +41 -0
  44. package/dist/graphics/color.d.ts +93 -0
  45. package/dist/graphics/color.js +146 -0
  46. package/dist/graphics/convex-shape.d.ts +18 -0
  47. package/dist/graphics/convex-shape.js +33 -0
  48. package/dist/graphics/drawable.d.ts +9 -0
  49. package/dist/graphics/drawable.js +15 -0
  50. package/dist/graphics/font.d.ts +70 -0
  51. package/dist/graphics/font.js +221 -0
  52. package/dist/graphics/glsl-matrix.d.ts +25 -0
  53. package/dist/graphics/glsl-matrix.js +69 -0
  54. package/dist/graphics/glsl.d.ts +57 -0
  55. package/dist/graphics/glsl.js +112 -0
  56. package/dist/graphics/glyph.d.ts +44 -0
  57. package/dist/graphics/glyph.js +74 -0
  58. package/dist/graphics/image.d.ts +57 -0
  59. package/dist/graphics/image.js +181 -0
  60. package/dist/graphics/primitive-type.d.ts +16 -0
  61. package/dist/graphics/primitive-type.js +25 -0
  62. package/dist/graphics/rect.d.ts +67 -0
  63. package/dist/graphics/rect.js +164 -0
  64. package/dist/graphics/rectangle-shape.d.ts +18 -0
  65. package/dist/graphics/rectangle-shape.js +34 -0
  66. package/dist/graphics/render-states.d.ts +60 -0
  67. package/dist/graphics/render-states.js +74 -0
  68. package/dist/graphics/render-target.d.ts +99 -0
  69. package/dist/graphics/render-target.js +341 -0
  70. package/dist/graphics/render-texture.d.ts +46 -0
  71. package/dist/graphics/render-texture.js +120 -0
  72. package/dist/graphics/render-window.d.ts +49 -0
  73. package/dist/graphics/render-window.js +106 -0
  74. package/dist/graphics/shader.d.ts +63 -0
  75. package/dist/graphics/shader.js +215 -0
  76. package/dist/graphics/shape.d.ts +77 -0
  77. package/dist/graphics/shape.js +180 -0
  78. package/dist/graphics/sprite.d.ts +44 -0
  79. package/dist/graphics/sprite.js +116 -0
  80. package/dist/graphics/stencil-mode.d.ts +69 -0
  81. package/dist/graphics/stencil-mode.js +72 -0
  82. package/dist/graphics/swap.d.ts +6 -0
  83. package/dist/graphics/swap.js +16 -0
  84. package/dist/graphics/text.d.ts +238 -0
  85. package/dist/graphics/text.js +354 -0
  86. package/dist/graphics/texture.d.ts +78 -0
  87. package/dist/graphics/texture.js +274 -0
  88. package/dist/graphics/transform.d.ts +50 -0
  89. package/dist/graphics/transform.js +195 -0
  90. package/dist/graphics/transformable.d.ts +13 -0
  91. package/dist/graphics/transformable.js +27 -0
  92. package/dist/graphics/vertex-array.d.ts +54 -0
  93. package/dist/graphics/vertex-array.js +176 -0
  94. package/dist/graphics/vertex-buffer.d.ts +69 -0
  95. package/dist/graphics/vertex-buffer.js +167 -0
  96. package/dist/graphics/vertex.d.ts +42 -0
  97. package/dist/graphics/vertex.js +98 -0
  98. package/dist/graphics/view.d.ts +54 -0
  99. package/dist/graphics/view.js +209 -0
  100. package/dist/index.d.ts +116 -0
  101. package/dist/index.js +251 -0
  102. package/dist/internal/audio-codec-registry.d.ts +13 -0
  103. package/dist/internal/audio-codec-registry.js +64 -0
  104. package/dist/internal/audio-input-stream.d.ts +13 -0
  105. package/dist/internal/audio-input-stream.js +44 -0
  106. package/dist/internal/audio-music-pump.d.ts +63 -0
  107. package/dist/internal/audio-music-pump.js +193 -0
  108. package/dist/internal/audio-native.d.ts +145 -0
  109. package/dist/internal/audio-native.js +24 -0
  110. package/dist/internal/audio-recorder-session.d.ts +77 -0
  111. package/dist/internal/audio-recorder-session.js +182 -0
  112. package/dist/internal/audio-worker-session.d.ts +18 -0
  113. package/dist/internal/audio-worker-session.js +82 -0
  114. package/dist/internal/audio-worker.d.ts +1 -0
  115. package/dist/internal/audio-worker.js +134 -0
  116. package/dist/internal/glsl-value.d.ts +26 -0
  117. package/dist/internal/glsl-value.js +44 -0
  118. package/dist/internal/graphics-state.d.ts +45 -0
  119. package/dist/internal/graphics-state.js +123 -0
  120. package/dist/internal/input-stream.d.ts +4 -0
  121. package/dist/internal/input-stream.js +25 -0
  122. package/dist/internal/lazy-value.d.ts +17 -0
  123. package/dist/internal/lazy-value.js +43 -0
  124. package/dist/internal/native.d.ts +317 -0
  125. package/dist/internal/native.js +8 -0
  126. package/dist/internal/numeric-properties.d.ts +2 -0
  127. package/dist/internal/numeric-properties.js +39 -0
  128. package/dist/internal/render-states.d.ts +4 -0
  129. package/dist/internal/render-states.js +44 -0
  130. package/dist/internal/scalar.d.ts +44 -0
  131. package/dist/internal/scalar.js +95 -0
  132. package/dist/internal/shaped-glyph.d.ts +32 -0
  133. package/dist/internal/shaped-glyph.js +51 -0
  134. package/dist/internal/struct-view.d.ts +11 -0
  135. package/dist/internal/struct-view.js +39 -0
  136. package/dist/internal/text-indices.d.ts +7 -0
  137. package/dist/internal/text-indices.js +22 -0
  138. package/dist/internal/transformable.d.ts +53 -0
  139. package/dist/internal/transformable.js +121 -0
  140. package/dist/internal/value-storage.d.ts +26 -0
  141. package/dist/internal/value-storage.js +21 -0
  142. package/dist/network/common.d.ts +18 -0
  143. package/dist/network/common.js +73 -0
  144. package/dist/network/dns.d.ts +35 -0
  145. package/dist/network/dns.js +93 -0
  146. package/dist/network/ftp.d.ts +81 -0
  147. package/dist/network/ftp.js +233 -0
  148. package/dist/network/gen/constants.d.ts +252 -0
  149. package/dist/network/gen/constants.js +260 -0
  150. package/dist/network/http.d.ts +150 -0
  151. package/dist/network/http.js +424 -0
  152. package/dist/network/ip-address.d.ts +57 -0
  153. package/dist/network/ip-address.js +161 -0
  154. package/dist/network/packet.d.ts +78 -0
  155. package/dist/network/packet.js +238 -0
  156. package/dist/network/sftp.d.ts +220 -0
  157. package/dist/network/sftp.js +557 -0
  158. package/dist/network/socket-selector.d.ts +38 -0
  159. package/dist/network/socket-selector.js +125 -0
  160. package/dist/network/socket.d.ts +89 -0
  161. package/dist/network/socket.js +225 -0
  162. package/dist/network/tcp-listener.d.ts +36 -0
  163. package/dist/network/tcp-listener.js +126 -0
  164. package/dist/network/tcp-socket.d.ts +108 -0
  165. package/dist/network/tcp-socket.js +362 -0
  166. package/dist/network/tls-material.d.ts +6 -0
  167. package/dist/network/tls-material.js +36 -0
  168. package/dist/network/udp-socket.d.ts +60 -0
  169. package/dist/network/udp-socket.js +197 -0
  170. package/dist/system/angle.d.ts +27 -0
  171. package/dist/system/angle.js +72 -0
  172. package/dist/system/clock.d.ts +22 -0
  173. package/dist/system/clock.js +56 -0
  174. package/dist/system/err.d.ts +6 -0
  175. package/dist/system/err.js +49 -0
  176. package/dist/system/error.d.ts +5 -0
  177. package/dist/system/error.js +12 -0
  178. package/dist/system/file-input-stream.d.ts +21 -0
  179. package/dist/system/file-input-stream.js +101 -0
  180. package/dist/system/input-stream.d.ts +30 -0
  181. package/dist/system/input-stream.js +54 -0
  182. package/dist/system/operators.d.ts +164 -0
  183. package/dist/system/operators.js +402 -0
  184. package/dist/system/sleep.d.ts +4 -0
  185. package/dist/system/sleep.js +23 -0
  186. package/dist/system/suspend-aware-clock.d.ts +7 -0
  187. package/dist/system/suspend-aware-clock.js +14 -0
  188. package/dist/system/time.d.ts +31 -0
  189. package/dist/system/time.js +134 -0
  190. package/dist/system/timeout-with-predicate.d.ts +19 -0
  191. package/dist/system/timeout-with-predicate.js +35 -0
  192. package/dist/system/unicode.d.ts +18 -0
  193. package/dist/system/unicode.js +31 -0
  194. package/dist/system/vector2.d.ts +98 -0
  195. package/dist/system/vector2.js +225 -0
  196. package/dist/system/vector3.d.ts +83 -0
  197. package/dist/system/vector3.js +178 -0
  198. package/dist/system/version.d.ts +15 -0
  199. package/dist/system/version.js +18 -0
  200. package/dist/window/clipboard.d.ts +4 -0
  201. package/dist/window/clipboard.js +16 -0
  202. package/dist/window/context-settings.d.ts +29 -0
  203. package/dist/window/context-settings.js +59 -0
  204. package/dist/window/context.d.ts +27 -0
  205. package/dist/window/context.js +77 -0
  206. package/dist/window/cursor.d.ts +20 -0
  207. package/dist/window/cursor.js +56 -0
  208. package/dist/window/event.d.ts +176 -0
  209. package/dist/window/event.js +57 -0
  210. package/dist/window/gen/constants.d.ts +637 -0
  211. package/dist/window/gen/constants.js +651 -0
  212. package/dist/window/joystick.d.ts +25 -0
  213. package/dist/window/joystick.js +44 -0
  214. package/dist/window/keyboard.d.ts +14 -0
  215. package/dist/window/keyboard.js +37 -0
  216. package/dist/window/mouse.d.ts +10 -0
  217. package/dist/window/mouse.js +36 -0
  218. package/dist/window/sensor.d.ts +9 -0
  219. package/dist/window/sensor.js +23 -0
  220. package/dist/window/touch.d.ts +12 -0
  221. package/dist/window/touch.js +29 -0
  222. package/dist/window/video-mode.d.ts +26 -0
  223. package/dist/window/video-mode.js +69 -0
  224. package/dist/window/vulkan.d.ts +9 -0
  225. package/dist/window/vulkan.js +22 -0
  226. package/dist/window/window.d.ts +103 -0
  227. package/dist/window/window.js +227 -0
  228. package/docs/api.md +1113 -0
  229. package/docs/audio.md +212 -0
  230. package/docs/development.md +77 -0
  231. package/docs/network.md +169 -0
  232. package/native/addon.cc +129 -0
  233. package/native/audio-binding.cc +543 -0
  234. package/native/audio-codec-binding.cc +246 -0
  235. package/native/audio-device-binding.cc +160 -0
  236. package/native/audio-file-binding.cc +192 -0
  237. package/native/audio-recorder-binding.cc +237 -0
  238. package/native/audio-recorder.h +39 -0
  239. package/native/audio-state.h +220 -0
  240. package/native/audio-stream-binding.cc +284 -0
  241. package/native/audio-stream.h +28 -0
  242. package/native/audio-worker-binding.cc +447 -0
  243. package/native/audio-worker.h +121 -0
  244. package/native/batch-drawable.cc +189 -0
  245. package/native/batch-drawable.h +57 -0
  246. package/native/context-binding.cc +180 -0
  247. package/native/context-settings.h +74 -0
  248. package/native/deferred-delete.cc +49 -0
  249. package/native/deferred-delete.h +84 -0
  250. package/native/error-stream-binding.cc +270 -0
  251. package/native/exception-boundary.h +97 -0
  252. package/native/font-binding.cc +210 -0
  253. package/native/font-state.h +27 -0
  254. package/native/graphics-binding.cc +338 -0
  255. package/native/graphics-state.h +253 -0
  256. package/native/image-binding.cc +258 -0
  257. package/native/image-state.h +93 -0
  258. package/native/input-binding.cc +246 -0
  259. package/native/numeric-fields.h +96 -0
  260. package/native/render-window-binding.cc +103 -0
  261. package/native/render-window-state.h +22 -0
  262. package/native/shader-binding.cc +292 -0
  263. package/native/shape-binding.cc +283 -0
  264. package/native/shape-state.h +68 -0
  265. package/native/shaped-glyph-storage.h +45 -0
  266. package/native/shared-handle.h +69 -0
  267. package/native/stream-binding.cc +286 -0
  268. package/native/system-binding.cc +91 -0
  269. package/native/text-binding.cc +205 -0
  270. package/native/text-state.h +101 -0
  271. package/native/texture-binding.cc +330 -0
  272. package/native/texture-resource.h +52 -0
  273. package/native/time-value.h +28 -0
  274. package/native/transformable-binding.cc +23 -0
  275. package/native/transformable-state.h +44 -0
  276. package/native/value-binding.h +200 -0
  277. package/native/value-layout.h +116 -0
  278. package/native/values-binding.cc +27 -0
  279. package/native/vertex-binding.cc +50 -0
  280. package/native/vertex-buffer-binding.cc +232 -0
  281. package/native/vertex-storage.h +20 -0
  282. package/native/view-data.h +24 -0
  283. package/native/window-binding.cc +388 -0
  284. package/native/window-event.h +92 -0
  285. package/native/window-owner.h +81 -0
  286. package/package.json +77 -35
  287. package/src/audio/effect-processor.ts +41 -0
  288. package/src/audio/input-sound-file.ts +173 -0
  289. package/src/audio/listener.ts +74 -0
  290. package/src/audio/music.ts +191 -0
  291. package/src/audio/output-sound-file.ts +64 -0
  292. package/src/audio/playback-device.ts +59 -0
  293. package/src/audio/sound-buffer-recorder.ts +61 -0
  294. package/src/audio/sound-buffer.ts +170 -0
  295. package/src/audio/sound-file-factory.ts +162 -0
  296. package/src/audio/sound-file-reader.ts +93 -0
  297. package/src/audio/sound-file-writer.ts +19 -0
  298. package/src/audio/sound-recorder.ts +180 -0
  299. package/src/audio/sound-source.ts +168 -0
  300. package/src/audio/sound-stream.ts +60 -0
  301. package/src/audio/sound.ts +36 -0
  302. package/src/audio/value.ts +165 -0
  303. package/src/audio/worker.ts +90 -0
  304. package/src/graphics/blend-mode.ts +125 -0
  305. package/src/graphics/boolean-vector.ts +139 -0
  306. package/src/graphics/circle-shape.ts +56 -0
  307. package/src/graphics/color.ts +189 -0
  308. package/src/graphics/convex-shape.ts +38 -0
  309. package/src/graphics/drawable.ts +19 -0
  310. package/src/graphics/font.ts +248 -0
  311. package/src/graphics/glsl-matrix.ts +73 -0
  312. package/src/graphics/glsl.ts +121 -0
  313. package/src/graphics/glyph.ts +97 -0
  314. package/src/graphics/image.ts +231 -0
  315. package/src/graphics/primitive-type.ts +21 -0
  316. package/src/graphics/rect.ts +214 -0
  317. package/src/graphics/rectangle-shape.ts +39 -0
  318. package/src/graphics/render-states.ts +110 -0
  319. package/src/graphics/render-target.ts +431 -0
  320. package/src/graphics/render-texture.ts +150 -0
  321. package/src/graphics/render-window.ts +155 -0
  322. package/src/graphics/shader.ts +224 -0
  323. package/src/graphics/shape.ts +231 -0
  324. package/src/graphics/sprite.ts +143 -0
  325. package/src/graphics/stencil-mode.ts +97 -0
  326. package/src/graphics/swap.ts +17 -0
  327. package/src/graphics/text.ts +423 -0
  328. package/src/graphics/texture.ts +352 -0
  329. package/src/graphics/transform.ts +242 -0
  330. package/src/graphics/transformable.ts +26 -0
  331. package/src/graphics/vertex-array.ts +201 -0
  332. package/src/graphics/vertex-buffer.ts +209 -0
  333. package/src/graphics/vertex.ts +142 -0
  334. package/src/graphics/view.ts +237 -0
  335. package/src/index.ts +147 -0
  336. package/src/internal/audio-codec-registry.ts +68 -0
  337. package/src/internal/audio-input-stream.ts +42 -0
  338. package/src/internal/audio-music-pump.ts +199 -0
  339. package/src/internal/audio-native.ts +176 -0
  340. package/src/internal/audio-recorder-session.ts +234 -0
  341. package/src/internal/audio-worker-session.ts +89 -0
  342. package/src/internal/audio-worker.ts +146 -0
  343. package/src/internal/glsl-value.ts +54 -0
  344. package/src/internal/graphics-state.ts +131 -0
  345. package/src/internal/input-stream.ts +30 -0
  346. package/src/internal/lazy-value.ts +62 -0
  347. package/src/internal/native.ts +581 -0
  348. package/src/internal/numeric-properties.ts +37 -0
  349. package/src/internal/render-states.ts +42 -0
  350. package/src/internal/scalar.ts +109 -0
  351. package/src/internal/shaped-glyph.ts +68 -0
  352. package/src/internal/struct-view.ts +49 -0
  353. package/src/internal/text-indices.ts +19 -0
  354. package/src/internal/transformable.ts +189 -0
  355. package/src/internal/value-storage.ts +33 -0
  356. package/src/network/common.ts +53 -0
  357. package/src/network/dns.ts +102 -0
  358. package/src/network/ftp.ts +202 -0
  359. package/src/network/gen/constants.ts +253 -0
  360. package/src/network/http.ts +372 -0
  361. package/src/network/ip-address.ts +158 -0
  362. package/src/network/packet.ts +217 -0
  363. package/src/network/sftp.ts +574 -0
  364. package/src/network/socket-selector.ts +112 -0
  365. package/src/network/socket.ts +203 -0
  366. package/src/network/tcp-listener.ts +115 -0
  367. package/src/network/tcp-socket.ts +370 -0
  368. package/src/network/tls-material.ts +30 -0
  369. package/src/network/udp-socket.ts +176 -0
  370. package/src/system/angle.ts +82 -0
  371. package/src/system/clock.ts +61 -0
  372. package/src/system/err.ts +46 -0
  373. package/src/system/error.ts +8 -0
  374. package/src/system/file-input-stream.ts +100 -0
  375. package/src/system/input-stream.ts +66 -0
  376. package/src/system/operators.ts +554 -0
  377. package/src/system/sleep.ts +20 -0
  378. package/src/system/suspend-aware-clock.ts +12 -0
  379. package/src/system/time.ts +149 -0
  380. package/src/system/timeout-with-predicate.ts +53 -0
  381. package/src/system/unicode.ts +28 -0
  382. package/src/system/vector2.ts +345 -0
  383. package/src/system/vector3.ts +267 -0
  384. package/src/system/version.ts +30 -0
  385. package/src/window/clipboard.ts +12 -0
  386. package/src/window/context-settings.ts +78 -0
  387. package/src/window/context.ts +92 -0
  388. package/src/window/cursor.ts +78 -0
  389. package/src/window/event.ts +227 -0
  390. package/src/window/gen/constants.ts +655 -0
  391. package/src/window/joystick.ts +52 -0
  392. package/src/window/keyboard.ts +42 -0
  393. package/src/window/mouse.ts +37 -0
  394. package/src/window/sensor.ts +20 -0
  395. package/src/window/touch.ts +27 -0
  396. package/src/window/video-mode.ts +85 -0
  397. package/src/window/vulkan.ts +19 -0
  398. package/src/window/window.ts +311 -0
  399. package/test/native/audio-probes.cc +181 -0
  400. package/test/native/deferred-delete-probes.cc +62 -0
  401. package/test/native/drawable-probes.cc +168 -0
  402. package/test/native/exception-probes.cc +83 -0
  403. package/test/native/image-probes.cc +105 -0
  404. package/test/native/matrix-probes.cc +67 -0
  405. package/test/native/network-oracle.cc +32 -0
  406. package/test/native/render-texture-probes.cc +193 -0
  407. package/test/native/shader-probes.cc +69 -0
  408. package/test/native/shape-probes.cc +160 -0
  409. package/test/native/sprite-probes.cc +146 -0
  410. package/test/native/system-probes.cc +109 -0
  411. package/test/native/text-probes.cc +211 -0
  412. package/test/native/texture-probes.cc +200 -0
  413. package/test/native/time-probes.cc +143 -0
  414. package/test/native/transform-probes.cc +92 -0
  415. package/test/native/transformable-probes.cc +152 -0
  416. package/test/native/value-oracle.h +88 -0
  417. package/test/native/value-probes.cc +379 -0
  418. package/test/native/vertex-array-probes.cc +82 -0
  419. package/test/native/vertex-buffer-probes.cc +87 -0
  420. package/test/native/view-probes.cc +150 -0
  421. package/test/native/window-probes.cc +172 -0
  422. package/test/tsconfig.json +8 -0
  423. package/tools/configure-lsp.cjs +23 -0
  424. package/tools/generate-network-constants.cjs +47 -0
  425. package/tools/generate-window-constants.cjs +164 -0
  426. package/tools/lib_downloader.cjs +92 -0
  427. package/tools/lib_downloader_urls.cjs +23 -0
  428. package/tsconfig.json +11 -4
  429. package/index.d.ts +0 -1
  430. package/lib/clock.d.ts +0 -8
  431. package/lib/clock.js +0 -5
  432. package/lib/color.d.ts +0 -11
  433. package/lib/color.js +0 -98
  434. package/lib/common.js +0 -47
  435. package/lib/drawable/circle_shape.d.ts +0 -5
  436. package/lib/drawable/circle_shape.js +0 -26
  437. package/lib/drawable/convex_shape.d.ts +0 -5
  438. package/lib/drawable/convex_shape.js +0 -35
  439. package/lib/drawable/drawable.d.ts +0 -6
  440. package/lib/drawable/drawable.js +0 -18
  441. package/lib/drawable/plugin_package.d.ts +0 -31
  442. package/lib/drawable/plugin_package.js +0 -102
  443. package/lib/drawable/rectangle_shape.d.ts +0 -9
  444. package/lib/drawable/rectangle_shape.js +0 -28
  445. package/lib/drawable/shape.d.ts +0 -14
  446. package/lib/drawable/shape.js +0 -30
  447. package/lib/drawable/sprite.d.ts +0 -17
  448. package/lib/drawable/sprite.js +0 -53
  449. package/lib/drawable/text.d.ts +0 -26
  450. package/lib/drawable/text.js +0 -88
  451. package/lib/drawable/transformable.d.ts +0 -28
  452. package/lib/drawable/transformable.js +0 -113
  453. package/lib/drawable/vertex_array.d.ts +0 -40
  454. package/lib/drawable/vertex_array.js +0 -128
  455. package/lib/font.d.ts +0 -24
  456. package/lib/font.js +0 -137
  457. package/lib/image.d.ts +0 -26
  458. package/lib/image.js +0 -147
  459. package/lib/joystick.d.ts +0 -21
  460. package/lib/joystick.js +0 -72
  461. package/lib/keyboard.d.ts +0 -113
  462. package/lib/keyboard.js +0 -17
  463. package/lib/mouse.d.ts +0 -6
  464. package/lib/mouse.js +0 -39
  465. package/lib/poll_event.d.ts +0 -138
  466. package/lib/rect.d.ts +0 -18
  467. package/lib/rect.js +0 -119
  468. package/lib/render_window.d.ts +0 -67
  469. package/lib/render_window.js +0 -197
  470. package/lib/sensor.d.ts +0 -12
  471. package/lib/sensor.js +0 -34
  472. package/lib/sfml.d.ts +0 -32
  473. package/lib/sfml.js +0 -36
  474. package/lib/sound/base.d.ts +0 -33
  475. package/lib/sound/base.js +0 -109
  476. package/lib/sound/music.d.ts +0 -15
  477. package/lib/sound/music.js +0 -65
  478. package/lib/sound/sound.d.ts +0 -16
  479. package/lib/sound/sound.js +0 -55
  480. package/lib/sound/sound_buffer.d.ts +0 -14
  481. package/lib/sound/sound_buffer.js +0 -78
  482. package/lib/texture.d.ts +0 -21
  483. package/lib/texture.js +0 -127
  484. package/lib/time.d.ts +0 -13
  485. package/lib/time.js +0 -41
  486. package/lib/touch.d.ts +0 -7
  487. package/lib/touch.js +0 -34
  488. package/lib/vector2.d.ts +0 -49
  489. package/lib/vector2.js +0 -141
  490. package/lib/vector3.d.ts +0 -47
  491. package/lib/vector3.js +0 -154
  492. package/lib/vertex.d.ts +0 -14
  493. package/lib/vertex.js +0 -177
  494. package/lib/video_mode.d.ts +0 -12
  495. package/lib/video_mode.js +0 -99
  496. package/src/base_class_with_loading.h +0 -21
  497. package/src/clock.cc +0 -71
  498. package/src/clock.h +0 -30
  499. package/src/color.cc +0 -189
  500. package/src/color.h +0 -49
  501. package/src/drawable/circle_shape.cc +0 -78
  502. package/src/drawable/circle_shape.h +0 -28
  503. package/src/drawable/convex_shape.cc +0 -57
  504. package/src/drawable/convex_shape.h +0 -29
  505. package/src/drawable/drawable-inl.h +0 -29
  506. package/src/drawable/drawable.cc +0 -41
  507. package/src/drawable/drawable.h +0 -49
  508. package/src/drawable/package_plugin-inl.h +0 -191
  509. package/src/drawable/package_plugin.h +0 -60
  510. package/src/drawable/rectangle_shape.cc +0 -69
  511. package/src/drawable/rectangle_shape.h +0 -29
  512. package/src/drawable/shape.cc +0 -67
  513. package/src/drawable/shape.h +0 -39
  514. package/src/drawable/sprite.cc +0 -122
  515. package/src/drawable/sprite.h +0 -45
  516. package/src/drawable/text.cc +0 -133
  517. package/src/drawable/text.h +0 -54
  518. package/src/drawable/vertex_array.cc +0 -248
  519. package/src/drawable/vertex_array.h +0 -46
  520. package/src/font.cc +0 -214
  521. package/src/font.h +0 -44
  522. package/src/gen/.gitkeep +0 -0
  523. package/src/gen/joystick_axis.cc +0 -30
  524. package/src/gen/keycode.cc +0 -226
  525. package/src/gen/mouse_button.cc +0 -30
  526. package/src/gen/sensor_type.cc +0 -26
  527. package/src/image.cc +0 -379
  528. package/src/image.h +0 -72
  529. package/src/joystick.cc +0 -132
  530. package/src/joystick.h +0 -32
  531. package/src/keyboard.cc +0 -65
  532. package/src/keyboard.h +0 -27
  533. package/src/mouse.cc +0 -95
  534. package/src/mouse.h +0 -30
  535. package/src/plugins/transformable_plugin-inl.h +0 -121
  536. package/src/plugins/transformable_plugin.h +0 -42
  537. package/src/poll_event.cc +0 -326
  538. package/src/poll_event.h +0 -18
  539. package/src/rect-inl.h +0 -154
  540. package/src/rect.cc +0 -28
  541. package/src/rect.h +0 -105
  542. package/src/render_window.cc +0 -413
  543. package/src/render_window.h +0 -111
  544. package/src/render_window_async_display.cc +0 -49
  545. package/src/render_window_async_draw.cc +0 -56
  546. package/src/resizable_buffer.h +0 -104
  547. package/src/sensor.cc +0 -82
  548. package/src/sensor.h +0 -28
  549. package/src/sfml.cc +0 -85
  550. package/src/sound/music.cc +0 -113
  551. package/src/sound/music.h +0 -35
  552. package/src/sound/sound.cc +0 -116
  553. package/src/sound/sound.h +0 -41
  554. package/src/sound/sound_buffer.cc +0 -226
  555. package/src/sound/sound_buffer.h +0 -46
  556. package/src/sound/sound_source.cc +0 -124
  557. package/src/sound/sound_source.h +0 -80
  558. package/src/texture.cc +0 -246
  559. package/src/texture.h +0 -47
  560. package/src/time.cc +0 -177
  561. package/src/time.h +0 -42
  562. package/src/touch.cc +0 -54
  563. package/src/touch.h +0 -23
  564. package/src/utils-inl.h +0 -48
  565. package/src/utils.h +0 -21
  566. package/src/vector2-inl.h +0 -198
  567. package/src/vector2.cc +0 -36
  568. package/src/vector2.h +0 -133
  569. package/src/vector3-inl.h +0 -200
  570. package/src/vector3.cc +0 -36
  571. package/src/vector3.h +0 -134
  572. package/src/vertex.cc +0 -238
  573. package/src/vertex.h +0 -114
  574. package/src/video_mode.cc +0 -184
  575. package/src/video_mode.h +0 -38
  576. package/src/workers/load_from_file_worker.h +0 -79
  577. package/src/workers/save_to_file_worker.h +0 -79
  578. package/third_party/sfml/include/SFML/Audio/AlResource.hpp +0 -70
  579. package/third_party/sfml/include/SFML/Audio/Export.hpp +0 -48
  580. package/third_party/sfml/include/SFML/Audio/InputSoundFile.hpp +0 -268
  581. package/third_party/sfml/include/SFML/Audio/Listener.hpp +0 -234
  582. package/third_party/sfml/include/SFML/Audio/Music.hpp +0 -337
  583. package/third_party/sfml/include/SFML/Audio/OutputSoundFile.hpp +0 -133
  584. package/third_party/sfml/include/SFML/Audio/Sound.hpp +0 -264
  585. package/third_party/sfml/include/SFML/Audio/SoundBuffer.hpp +0 -352
  586. package/third_party/sfml/include/SFML/Audio/SoundBufferRecorder.hpp +0 -144
  587. package/third_party/sfml/include/SFML/Audio/SoundFileFactory.hpp +0 -197
  588. package/third_party/sfml/include/SFML/Audio/SoundFileFactory.inl +0 -100
  589. package/third_party/sfml/include/SFML/Audio/SoundFileReader.hpp +0 -165
  590. package/third_party/sfml/include/SFML/Audio/SoundFileWriter.hpp +0 -125
  591. package/third_party/sfml/include/SFML/Audio/SoundRecorder.hpp +0 -410
  592. package/third_party/sfml/include/SFML/Audio/SoundSource.hpp +0 -332
  593. package/third_party/sfml/include/SFML/Audio/SoundStream.hpp +0 -420
  594. package/third_party/sfml/include/SFML/Audio.hpp +0 -56
  595. package/third_party/sfml/include/SFML/Config.hpp +0 -248
  596. package/third_party/sfml/include/SFML/GpuPreference.hpp +0 -74
  597. package/third_party/sfml/include/SFML/Graphics/BlendMode.hpp +0 -219
  598. package/third_party/sfml/include/SFML/Graphics/CircleShape.hpp +0 -154
  599. package/third_party/sfml/include/SFML/Graphics/Color.hpp +0 -275
  600. package/third_party/sfml/include/SFML/Graphics/ConvexShape.hpp +0 -153
  601. package/third_party/sfml/include/SFML/Graphics/Drawable.hpp +0 -126
  602. package/third_party/sfml/include/SFML/Graphics/Export.hpp +0 -48
  603. package/third_party/sfml/include/SFML/Graphics/Font.hpp +0 -496
  604. package/third_party/sfml/include/SFML/Graphics/Glsl.hpp +0 -227
  605. package/third_party/sfml/include/SFML/Graphics/Glsl.inl +0 -155
  606. package/third_party/sfml/include/SFML/Graphics/Glyph.hpp +0 -81
  607. package/third_party/sfml/include/SFML/Graphics/Image.hpp +0 -346
  608. package/third_party/sfml/include/SFML/Graphics/PrimitiveType.hpp +0 -58
  609. package/third_party/sfml/include/SFML/Graphics/Rect.hpp +0 -274
  610. package/third_party/sfml/include/SFML/Graphics/Rect.inl +0 -171
  611. package/third_party/sfml/include/SFML/Graphics/RectangleShape.hpp +0 -132
  612. package/third_party/sfml/include/SFML/Graphics/RenderStates.hpp +0 -174
  613. package/third_party/sfml/include/SFML/Graphics/RenderTarget.hpp +0 -518
  614. package/third_party/sfml/include/SFML/Graphics/RenderTexture.hpp +0 -334
  615. package/third_party/sfml/include/SFML/Graphics/RenderWindow.hpp +0 -302
  616. package/third_party/sfml/include/SFML/Graphics/Shader.hpp +0 -875
  617. package/third_party/sfml/include/SFML/Graphics/Shape.hpp +0 -355
  618. package/third_party/sfml/include/SFML/Graphics/Sprite.hpp +0 -279
  619. package/third_party/sfml/include/SFML/Graphics/Text.hpp +0 -513
  620. package/third_party/sfml/include/SFML/Graphics/Texture.hpp +0 -733
  621. package/third_party/sfml/include/SFML/Graphics/Transform.hpp +0 -497
  622. package/third_party/sfml/include/SFML/Graphics/Transformable.hpp +0 -429
  623. package/third_party/sfml/include/SFML/Graphics/Vertex.hpp +0 -148
  624. package/third_party/sfml/include/SFML/Graphics/VertexArray.hpp +0 -223
  625. package/third_party/sfml/include/SFML/Graphics/VertexBuffer.hpp +0 -408
  626. package/third_party/sfml/include/SFML/Graphics/View.hpp +0 -343
  627. package/third_party/sfml/include/SFML/Graphics.hpp +0 -68
  628. package/third_party/sfml/include/SFML/Main.hpp +0 -43
  629. package/third_party/sfml/include/SFML/Network/Export.hpp +0 -48
  630. package/third_party/sfml/include/SFML/Network/Ftp.hpp +0 -616
  631. package/third_party/sfml/include/SFML/Network/Http.hpp +0 -482
  632. package/third_party/sfml/include/SFML/Network/IpAddress.hpp +0 -328
  633. package/third_party/sfml/include/SFML/Network/Packet.hpp +0 -545
  634. package/third_party/sfml/include/SFML/Network/Socket.hpp +0 -219
  635. package/third_party/sfml/include/SFML/Network/SocketHandle.hpp +0 -57
  636. package/third_party/sfml/include/SFML/Network/SocketSelector.hpp +0 -263
  637. package/third_party/sfml/include/SFML/Network/TcpListener.hpp +0 -170
  638. package/third_party/sfml/include/SFML/Network/TcpSocket.hpp +0 -316
  639. package/third_party/sfml/include/SFML/Network/UdpSocket.hpp +0 -292
  640. package/third_party/sfml/include/SFML/Network.hpp +0 -53
  641. package/third_party/sfml/include/SFML/OpenGL.hpp +0 -78
  642. package/third_party/sfml/include/SFML/System/Clock.hpp +0 -117
  643. package/third_party/sfml/include/SFML/System/Err.hpp +0 -80
  644. package/third_party/sfml/include/SFML/System/Export.hpp +0 -48
  645. package/third_party/sfml/include/SFML/System/FileInputStream.hpp +0 -169
  646. package/third_party/sfml/include/SFML/System/InputStream.hpp +0 -152
  647. package/third_party/sfml/include/SFML/System/Lock.hpp +0 -139
  648. package/third_party/sfml/include/SFML/System/MemoryInputStream.hpp +0 -148
  649. package/third_party/sfml/include/SFML/System/Mutex.hpp +0 -148
  650. package/third_party/sfml/include/SFML/System/NativeActivity.hpp +0 -62
  651. package/third_party/sfml/include/SFML/System/NonCopyable.hpp +0 -129
  652. package/third_party/sfml/include/SFML/System/Sleep.hpp +0 -52
  653. package/third_party/sfml/include/SFML/System/String.hpp +0 -669
  654. package/third_party/sfml/include/SFML/System/String.inl +0 -53
  655. package/third_party/sfml/include/SFML/System/Thread.hpp +0 -282
  656. package/third_party/sfml/include/SFML/System/Thread.inl +0 -90
  657. package/third_party/sfml/include/SFML/System/ThreadLocal.hpp +0 -103
  658. package/third_party/sfml/include/SFML/System/ThreadLocalPtr.hpp +0 -158
  659. package/third_party/sfml/include/SFML/System/ThreadLocalPtr.inl +0 -77
  660. package/third_party/sfml/include/SFML/System/Time.hpp +0 -488
  661. package/third_party/sfml/include/SFML/System/Utf.hpp +0 -763
  662. package/third_party/sfml/include/SFML/System/Utf.inl +0 -752
  663. package/third_party/sfml/include/SFML/System/Vector2.hpp +0 -301
  664. package/third_party/sfml/include/SFML/System/Vector2.inl +0 -161
  665. package/third_party/sfml/include/SFML/System/Vector3.hpp +0 -302
  666. package/third_party/sfml/include/SFML/System/Vector3.inl +0 -168
  667. package/third_party/sfml/include/SFML/System.hpp +0 -60
  668. package/third_party/sfml/include/SFML/Window/Clipboard.hpp +0 -119
  669. package/third_party/sfml/include/SFML/Window/Context.hpp +0 -195
  670. package/third_party/sfml/include/SFML/Window/ContextSettings.hpp +0 -149
  671. package/third_party/sfml/include/SFML/Window/Cursor.hpp +0 -241
  672. package/third_party/sfml/include/SFML/Window/Event.hpp +0 -285
  673. package/third_party/sfml/include/SFML/Window/Export.hpp +0 -48
  674. package/third_party/sfml/include/SFML/Window/GlResource.hpp +0 -109
  675. package/third_party/sfml/include/SFML/Window/Joystick.hpp +0 -227
  676. package/third_party/sfml/include/SFML/Window/Keyboard.hpp +0 -491
  677. package/third_party/sfml/include/SFML/Window/Mouse.hpp +0 -180
  678. package/third_party/sfml/include/SFML/Window/Sensor.hpp +0 -150
  679. package/third_party/sfml/include/SFML/Window/Touch.hpp +0 -137
  680. package/third_party/sfml/include/SFML/Window/VideoMode.hpp +0 -228
  681. package/third_party/sfml/include/SFML/Window/Vulkan.hpp +0 -115
  682. package/third_party/sfml/include/SFML/Window/Window.hpp +0 -354
  683. package/third_party/sfml/include/SFML/Window/WindowBase.hpp +0 -518
  684. package/third_party/sfml/include/SFML/Window/WindowHandle.hpp +0 -101
  685. package/third_party/sfml/include/SFML/Window/WindowStyle.hpp +0 -53
  686. package/third_party/sfml/include/SFML/Window.hpp +0 -58
  687. package/tools/clang_format.js +0 -9
  688. package/tools/copier/linux.js +0 -21
  689. package/tools/copier/macos.js +0 -34
  690. package/tools/copier/windows.js +0 -33
  691. package/tools/joystick_axis.js +0 -63
  692. package/tools/keycode.js +0 -92
  693. package/tools/lib_downloader.js +0 -107
  694. package/tools/lib_downloader_urls.js +0 -59
  695. package/tools/mouse_button.js +0 -92
  696. package/tools/sensor_type.js +0 -63
@@ -0,0 +1,14 @@
1
+ import { SoundSource } from './sound-source';
2
+ import { type ReadonlySoundBuffer } from './sound-buffer';
3
+ /** 播放内存中的短音效,持有 SoundBuffer 以保留样本存储。 */
4
+ export declare class Sound extends SoundSource {
5
+ private buffer;
6
+ /** 绑定音频缓冲区,或复制 Sound 的属性和缓冲区引用。 */
7
+ constructor(bufferOrSource: ReadonlySoundBuffer | Sound);
8
+ /** Copy attributes and buffer binding; stop and rewind this Sound. */
9
+ assign(source: Sound): this;
10
+ /** 替换并保留音频缓冲区引用,同时更新原生播放源。 */
11
+ setBuffer(buffer: ReadonlySoundBuffer): void;
12
+ /** 返回当前绑定缓冲区的只读引用。 */
13
+ getBuffer(): ReadonlySoundBuffer;
14
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Sound = void 0;
4
+ const audio_native_1 = require("../internal/audio-native");
5
+ const sound_source_1 = require("./sound-source");
6
+ const sound_buffer_1 = require("./sound-buffer");
7
+ /** 播放内存中的短音效,持有 SoundBuffer 以保留样本存储。 */
8
+ class Sound extends sound_source_1.SoundSource {
9
+ /** 绑定音频缓冲区,或复制 Sound 的属性和缓冲区引用。 */
10
+ constructor(bufferOrSource) {
11
+ const source = bufferOrSource instanceof Sound ? bufferOrSource : undefined;
12
+ const buffer = source ? source.getBuffer() : bufferOrSource;
13
+ if (!(buffer instanceof sound_buffer_1.SoundBuffer)) {
14
+ throw new TypeError('Expected a SoundBuffer or a Sound');
15
+ }
16
+ super(audio_native_1.audioNative.createAudioSource(buffer[audio_native_1.audioHandle], source?.[audio_native_1.audioHandle]));
17
+ this.buffer = buffer;
18
+ }
19
+ /** Copy attributes and buffer binding; stop and rewind this Sound. */
20
+ assign(source) {
21
+ if (!(source instanceof Sound))
22
+ throw new TypeError('Expected a Sound');
23
+ if (source === this)
24
+ return this;
25
+ audio_native_1.audioNative.assignAudioSource(this[audio_native_1.audioHandle], source[audio_native_1.audioHandle], true);
26
+ this.buffer = source.buffer;
27
+ return this;
28
+ }
29
+ /** 替换并保留音频缓冲区引用,同时更新原生播放源。 */
30
+ setBuffer(buffer) {
31
+ if (!(buffer instanceof sound_buffer_1.SoundBuffer))
32
+ throw new TypeError('Expected a SoundBuffer');
33
+ audio_native_1.audioNative.setAudioBuffer(this[audio_native_1.audioHandle], buffer[audio_native_1.audioHandle]);
34
+ this.buffer = buffer;
35
+ }
36
+ /** 返回当前绑定缓冲区的只读引用。 */
37
+ getBuffer() { return this.buffer; }
38
+ }
39
+ exports.Sound = Sound;
@@ -0,0 +1,116 @@
1
+ import { Angle } from '../system/angle';
2
+ import { Time } from '../system/time';
3
+ import { Vector3 } from '../system/vector3';
4
+ import type { ReadonlyValue as R } from '../internal/value-storage';
5
+ /** 交错 PCM 声道对应的扬声器位置。 */
6
+ export declare enum SoundChannel {
7
+ /** 未指定位置。 */
8
+ Unspecified = 0,
9
+ /** 单声道。 */
10
+ Mono = 1,
11
+ /** 前左。 */
12
+ FrontLeft = 2,
13
+ /** 前右。 */
14
+ FrontRight = 3,
15
+ /** 前中。 */
16
+ FrontCenter = 4,
17
+ /** 前中偏左。 */
18
+ FrontLeftOfCenter = 5,
19
+ /** 前中偏右。 */
20
+ FrontRightOfCenter = 6,
21
+ /** 低频效果声道。 */
22
+ LowFrequencyEffects = 7,
23
+ /** 后左。 */
24
+ BackLeft = 8,
25
+ /** 后右。 */
26
+ BackRight = 9,
27
+ /** 后中。 */
28
+ BackCenter = 10,
29
+ /** 侧左。 */
30
+ SideLeft = 11,
31
+ /** 侧右。 */
32
+ SideRight = 12,
33
+ /** 顶中。 */
34
+ TopCenter = 13,
35
+ /** 顶前左。 */
36
+ TopFrontLeft = 14,
37
+ /** 顶前右。 */
38
+ TopFrontRight = 15,
39
+ /** 顶前中。 */
40
+ TopFrontCenter = 16,
41
+ /** 顶后左。 */
42
+ TopBackLeft = 17,
43
+ /** 顶后右。 */
44
+ TopBackRight = 18,
45
+ /** 顶后中。 */
46
+ TopBackCenter = 19
47
+ }
48
+ /** 声源当前播放状态。 */
49
+ export declare enum SoundStatus {
50
+ /** 已停止。 */
51
+ Stopped = 0,
52
+ /** 已暂停,保留播放位置。 */
53
+ Paused = 1,
54
+ /** 正在播放。 */
55
+ Playing = 2
56
+ }
57
+ /** 16 位交错 PCM 的只读类型视图,保留底层原生存储。 */
58
+ export type ReadonlySamples = Readonly<Pick<Int16Array, number | 'length' | 'byteLength' | 'byteOffset' | typeof Symbol.iterator | 'slice' | 'entries' | 'keys' | 'values'>>;
59
+ /** 按交错顺序排列的声道位置只读视图。 */
60
+ export type ChannelMap = Readonly<Pick<Int32Array, number | 'length' | typeof Symbol.iterator | 'slice' | 'entries' | 'keys' | 'values'>>;
61
+ /** 空间声源或监听者的方向锥参数。 */
62
+ export interface ConeInput {
63
+ /** 不发生方向衰减的内锥完整角度。 */
64
+ innerAngle: R<Angle>;
65
+ /** 达到 outerGain 的外锥完整角度。 */
66
+ outerAngle: R<Angle>;
67
+ /** 外锥之外的增益倍率。 */
68
+ outerGain: number;
69
+ }
70
+ /** One native sf::SoundSource::Cone, exposed through its float fields. */
71
+ export declare class Cone {
72
+ private readonly values;
73
+ /** 创建角度和增益均为零的方向锥,或复制给定参数。 */
74
+ constructor(value?: Readonly<ConeInput>);
75
+ /** 内锥完整角度的副本。 */
76
+ get innerAngle(): Angle;
77
+ /** 复制内锥角度。 */
78
+ set innerAngle(value: R<Angle>);
79
+ /** 外锥完整角度的副本。 */
80
+ get outerAngle(): Angle;
81
+ /** 复制外锥角度。 */
82
+ set outerAngle(value: R<Angle>);
83
+ /** 外锥之外的增益倍率。 */
84
+ get outerGain(): number;
85
+ /** 设置外锥增益倍率。 */
86
+ set outerGain(value: number);
87
+ }
88
+ /** 音频时间段输入。 */
89
+ export interface TimeSpanInput {
90
+ /** 相对于音频起点的偏移。 */
91
+ offset: R<Time>;
92
+ /** 时间段长度。 */
93
+ length: R<Time>;
94
+ }
95
+ /** 可修改的音频时间段,按精确微秒数存储。 */
96
+ export declare class TimeSpan {
97
+ private readonly values;
98
+ /** 创建零偏移、零长度的时间段,或复制给定参数。 */
99
+ constructor(value?: Readonly<TimeSpanInput>);
100
+ /** 起点偏移的副本。 */
101
+ get offset(): Time;
102
+ /** 复制起点偏移。 */
103
+ set offset(value: R<Time>);
104
+ /** 时长的副本。 */
105
+ get length(): Time;
106
+ /** 复制时间段长度。 */
107
+ set length(value: R<Time>);
108
+ }
109
+ export declare function float(value: number): number;
110
+ export declare function flag(value: boolean): number;
111
+ export declare function unsigned(value: number): number;
112
+ export declare function duration(value: R<Time>): bigint;
113
+ export declare function angle(value: R<Angle>): number;
114
+ export declare function vector(value: R<Vector3<'f32'>>): void;
115
+ export declare function channels(map: Iterable<SoundChannel>): Int32Array;
116
+ export declare function samples(value: Int16Array): void;
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.samples = exports.channels = exports.vector = exports.angle = exports.duration = exports.unsigned = exports.flag = exports.float = exports.TimeSpan = exports.Cone = exports.SoundStatus = exports.SoundChannel = void 0;
4
+ const audio_native_1 = require("../internal/audio-native");
5
+ const angle_1 = require("../system/angle");
6
+ const time_1 = require("../system/time");
7
+ const vector3_1 = require("../system/vector3");
8
+ /** 交错 PCM 声道对应的扬声器位置。 */
9
+ var SoundChannel;
10
+ (function (SoundChannel) {
11
+ /** 未指定位置。 */
12
+ SoundChannel[SoundChannel["Unspecified"] = 0] = "Unspecified";
13
+ /** 单声道。 */
14
+ SoundChannel[SoundChannel["Mono"] = 1] = "Mono";
15
+ /** 前左。 */
16
+ SoundChannel[SoundChannel["FrontLeft"] = 2] = "FrontLeft";
17
+ /** 前右。 */
18
+ SoundChannel[SoundChannel["FrontRight"] = 3] = "FrontRight";
19
+ /** 前中。 */
20
+ SoundChannel[SoundChannel["FrontCenter"] = 4] = "FrontCenter";
21
+ /** 前中偏左。 */
22
+ SoundChannel[SoundChannel["FrontLeftOfCenter"] = 5] = "FrontLeftOfCenter";
23
+ /** 前中偏右。 */
24
+ SoundChannel[SoundChannel["FrontRightOfCenter"] = 6] = "FrontRightOfCenter";
25
+ /** 低频效果声道。 */
26
+ SoundChannel[SoundChannel["LowFrequencyEffects"] = 7] = "LowFrequencyEffects";
27
+ /** 后左。 */
28
+ SoundChannel[SoundChannel["BackLeft"] = 8] = "BackLeft";
29
+ /** 后右。 */
30
+ SoundChannel[SoundChannel["BackRight"] = 9] = "BackRight";
31
+ /** 后中。 */
32
+ SoundChannel[SoundChannel["BackCenter"] = 10] = "BackCenter";
33
+ /** 侧左。 */
34
+ SoundChannel[SoundChannel["SideLeft"] = 11] = "SideLeft";
35
+ /** 侧右。 */
36
+ SoundChannel[SoundChannel["SideRight"] = 12] = "SideRight";
37
+ /** 顶中。 */
38
+ SoundChannel[SoundChannel["TopCenter"] = 13] = "TopCenter";
39
+ /** 顶前左。 */
40
+ SoundChannel[SoundChannel["TopFrontLeft"] = 14] = "TopFrontLeft";
41
+ /** 顶前右。 */
42
+ SoundChannel[SoundChannel["TopFrontRight"] = 15] = "TopFrontRight";
43
+ /** 顶前中。 */
44
+ SoundChannel[SoundChannel["TopFrontCenter"] = 16] = "TopFrontCenter";
45
+ /** 顶后左。 */
46
+ SoundChannel[SoundChannel["TopBackLeft"] = 17] = "TopBackLeft";
47
+ /** 顶后右。 */
48
+ SoundChannel[SoundChannel["TopBackRight"] = 18] = "TopBackRight";
49
+ /** 顶后中。 */
50
+ SoundChannel[SoundChannel["TopBackCenter"] = 19] = "TopBackCenter";
51
+ })(SoundChannel = exports.SoundChannel || (exports.SoundChannel = {}));
52
+ /** 声源当前播放状态。 */
53
+ var SoundStatus;
54
+ (function (SoundStatus) {
55
+ /** 已停止。 */
56
+ SoundStatus[SoundStatus["Stopped"] = 0] = "Stopped";
57
+ /** 已暂停,保留播放位置。 */
58
+ SoundStatus[SoundStatus["Paused"] = 1] = "Paused";
59
+ /** 正在播放。 */
60
+ SoundStatus[SoundStatus["Playing"] = 2] = "Playing";
61
+ })(SoundStatus = exports.SoundStatus || (exports.SoundStatus = {}));
62
+ /** One native sf::SoundSource::Cone, exposed through its float fields. */
63
+ class Cone {
64
+ /** 创建角度和增益均为零的方向锥,或复制给定参数。 */
65
+ constructor(value) {
66
+ this.values = new Float32Array(audio_native_1.audioNative.createAudioValue(0));
67
+ if (value) {
68
+ this.innerAngle = value.innerAngle;
69
+ this.outerAngle = value.outerAngle;
70
+ this.outerGain = value.outerGain;
71
+ }
72
+ }
73
+ /** 内锥完整角度的副本。 */
74
+ get innerAngle() { return (0, angle_1.radians)(this.values[0]); }
75
+ /** 复制内锥角度。 */
76
+ set innerAngle(value) { this.values[0] = angle(value); }
77
+ /** 外锥完整角度的副本。 */
78
+ get outerAngle() { return (0, angle_1.radians)(this.values[1]); }
79
+ /** 复制外锥角度。 */
80
+ set outerAngle(value) { this.values[1] = angle(value); }
81
+ /** 外锥之外的增益倍率。 */
82
+ get outerGain() { return this.values[2]; }
83
+ /** 设置外锥增益倍率。 */
84
+ set outerGain(value) { this.values[2] = float(value); }
85
+ }
86
+ exports.Cone = Cone;
87
+ /** 可修改的音频时间段,按精确微秒数存储。 */
88
+ class TimeSpan {
89
+ /** 创建零偏移、零长度的时间段,或复制给定参数。 */
90
+ constructor(value) {
91
+ this.values = new BigInt64Array(audio_native_1.audioNative.createAudioValue(1));
92
+ if (value) {
93
+ this.offset = value.offset;
94
+ this.length = value.length;
95
+ }
96
+ }
97
+ /** 起点偏移的副本。 */
98
+ get offset() { return new time_1.Time(this.values[0]); }
99
+ /** 复制起点偏移。 */
100
+ set offset(value) { this.values[0] = duration(value); }
101
+ /** 时长的副本。 */
102
+ get length() { return new time_1.Time(this.values[1]); }
103
+ /** 复制时间段长度。 */
104
+ set length(value) { this.values[1] = duration(value); }
105
+ }
106
+ exports.TimeSpan = TimeSpan;
107
+ function float(value) {
108
+ if (typeof value !== 'number')
109
+ throw new TypeError('Expected a number');
110
+ return Math.fround(value);
111
+ }
112
+ exports.float = float;
113
+ function flag(value) {
114
+ if (typeof value !== 'boolean')
115
+ throw new TypeError('Expected a boolean');
116
+ return +value;
117
+ }
118
+ exports.flag = flag;
119
+ function unsigned(value) {
120
+ if (!Number.isInteger(value) || value < 0 || value > 0xffffffff) {
121
+ throw new RangeError('Expected an unsigned 32-bit integer');
122
+ }
123
+ return value;
124
+ }
125
+ exports.unsigned = unsigned;
126
+ function duration(value) {
127
+ if (!(value instanceof time_1.Time))
128
+ throw new TypeError('Expected a Time');
129
+ return value.asMicroseconds();
130
+ }
131
+ exports.duration = duration;
132
+ function angle(value) {
133
+ if (!(value instanceof angle_1.Angle))
134
+ throw new TypeError('Expected an Angle');
135
+ return value.asRadians();
136
+ }
137
+ exports.angle = angle;
138
+ function vector(value) {
139
+ if (!(value instanceof vector3_1.Vector3) || value.scalarType !== 'f32') {
140
+ throw new TypeError('Expected a Vector3f');
141
+ }
142
+ }
143
+ exports.vector = vector;
144
+ function channels(map) {
145
+ const values = Array.from(map);
146
+ if (values.some(value => !Number.isInteger(value) || value < 0 ||
147
+ value > SoundChannel.TopBackCenter)) {
148
+ throw new RangeError('Unknown sound channel');
149
+ }
150
+ return Int32Array.from(values);
151
+ }
152
+ exports.channels = channels;
153
+ function samples(value) {
154
+ if (!(value instanceof Int16Array))
155
+ throw new TypeError('Expected an Int16Array');
156
+ }
157
+ exports.samples = samples;
@@ -0,0 +1,88 @@
1
+ /// <reference types="node" />
2
+ import type { Time } from '../system/time';
3
+ import type { SoundChannel } from './value';
4
+ /** A module export is a factory receiving context and structured-clone data. */
5
+ export interface AudioWorkerModule {
6
+ /** Worker 加载的模块路径或 URL,导出音频回调工厂函数。 */
7
+ module: string | URL;
8
+ /** 工厂函数导出名,省略时使用默认导出。 */
9
+ exportName?: string;
10
+ /** 通过结构化克隆传给工厂函数的初始数据。 */
11
+ data?: unknown;
12
+ }
13
+ /** 音频 Worker 模块和分块队列配置。 */
14
+ export interface AudioWorkerOptions extends AudioWorkerModule {
15
+ /** 每个块的帧数,默认 1024;一帧包含所有声道的样本。 */
16
+ blockFrames?: number;
17
+ /** 原生队列中的块数,默认 8。 */
18
+ queueBlocks?: number;
19
+ }
20
+ /** 传给音频回调工厂的实际处理参数。 */
21
+ export interface AudioWorkerContext {
22
+ /** 每个声道每秒的采样数,单位为 Hz。 */
23
+ sampleRate: number;
24
+ /** 每帧的声道数。 */
25
+ channelCount: number;
26
+ /** 每个处理块的帧数。 */
27
+ blockFrames: number;
28
+ }
29
+ /** 自定义 PCM 播放流的格式和 Worker 配置。 */
30
+ export interface SoundStreamOptions extends AudioWorkerOptions {
31
+ /** 采样率,单位为 Hz。 */
32
+ sampleRate: number;
33
+ /** 交错 PCM 的声道数。 */
34
+ channelCount: number;
35
+ /** 每个交错声道对应的扬声器位置。 */
36
+ channelMap: Iterable<SoundChannel>;
37
+ }
38
+ /** samples aliases a reusable native slot, valid until the callback settles. */
39
+ export interface SoundStreamChunk {
40
+ /** 原生可复用的交错 16 位 PCM 写入区,仅在本次回调完成前有效。 */
41
+ readonly samples: Int16Array;
42
+ /** 本次填入的交错样本总数,须为声道数的倍数且不超过 samples.length。 */
43
+ sampleCount: number;
44
+ }
45
+ /** 在 Node Worker 中执行的播放流回调。 */
46
+ export interface SoundStreamCallbacks {
47
+ /** 填充 chunk;返回 true 继续读取,false 表示当前块是最后一块。 */
48
+ onGetData(chunk: SoundStreamChunk): boolean | Promise<boolean>;
49
+ /** 将数据源移动到指定播放时刻。 */
50
+ onSeek(offset: Time): void | Promise<void>;
51
+ /** Called while preparing the final block; returns an interleaved sample
52
+ * offset. undefined disables this loop, 0n restarts from the beginning. */
53
+ onLoop?(): bigint | undefined | Promise<bigint | undefined>;
54
+ /** Worker 会话关闭时释放数据源资源。 */
55
+ onClose?(): void | Promise<void>;
56
+ }
57
+ /** 在 Node Worker 中执行的录音回调。 */
58
+ export interface SoundRecorderCallbacks {
59
+ /** 开始采集前初始化;返回 false 拒绝启动。 */
60
+ onStart?(): boolean | Promise<boolean>;
61
+ /** 消费交错 16 位 PCM,视图仅在回调完成前有效;返回 false 停止录音。 */
62
+ onProcessSamples(samples: Int16Array): boolean | Promise<boolean>;
63
+ /** 停止采集并排空队列后执行收尾。 */
64
+ onStop?(): void | Promise<void>;
65
+ }
66
+ /** 效果处理器实际消费和生成的帧数。 */
67
+ export interface EffectFrames {
68
+ /** 已消费的输入帧数。 */
69
+ inputFrameCount: number;
70
+ /** 已写入的输出帧数。 */
71
+ outputFrameCount: number;
72
+ }
73
+ /** 在 Node Worker 中执行的浮点 PCM 效果回调。 */
74
+ export interface EffectProcessorCallbacks {
75
+ /** 处理交错浮点 PCM;input 为 null 时可继续生成尾音,视图仅在回调完成前有效。 */
76
+ process(input: Float32Array | null, inputFrameCount: number, output: Float32Array, outputFrameCount: number, channelCount: number): EffectFrames | void | Promise<EffectFrames | void>;
77
+ /** 效果会话关闭时执行清理。 */
78
+ onClose?(): void | Promise<void>;
79
+ }
80
+ /** 原生音频分块队列的累计统计。 */
81
+ export interface AudioWorkerStats {
82
+ /** 播放流为数据欠载次数;效果处理器为缺少的输出帧数。 */
83
+ underruns: bigint;
84
+ /** 队列满时丢弃的数量:录音器以交错样本计,效果处理器以帧计。 */
85
+ overruns: bigint;
86
+ /** 已处理数量:播放流和录音器以交错样本计,效果处理器以输入帧计。 */
87
+ processed: bigint;
88
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,82 @@
1
+ /** 混合方程中乘到源颜色或目标颜色上的因子。 */
2
+ export declare enum BlendFactor {
3
+ /** 常数 0。 */
4
+ Zero = 0,
5
+ /** 常数 1。 */
6
+ One = 1,
7
+ /** 源颜色。 */
8
+ SrcColor = 2,
9
+ /** 1 减去源颜色。 */
10
+ OneMinusSrcColor = 3,
11
+ /** 目标颜色。 */
12
+ DstColor = 4,
13
+ /** 1 减去目标颜色。 */
14
+ OneMinusDstColor = 5,
15
+ /** 源 Alpha。 */
16
+ SrcAlpha = 6,
17
+ /** 1 减去源 Alpha。 */
18
+ OneMinusSrcAlpha = 7,
19
+ /** 目标 Alpha。 */
20
+ DstAlpha = 8,
21
+ /** 1 减去目标 Alpha。 */
22
+ OneMinusDstAlpha = 9
23
+ }
24
+ /** 源与目标颜色乘以各自因子后的组合方式。 */
25
+ export declare enum BlendEquation {
26
+ /** 源加目标。 */
27
+ Add = 0,
28
+ /** 源减目标。 */
29
+ Subtract = 1,
30
+ /** 目标减源。 */
31
+ ReverseSubtract = 2,
32
+ /** 逐分量取较小值。 */
33
+ Min = 3,
34
+ /** 逐分量取较大值。 */
35
+ Max = 4
36
+ }
37
+ type Arguments = [] | [source: Readonly<BlendMode>] | [
38
+ source: BlendFactor,
39
+ destination: BlendFactor,
40
+ equation?: BlendEquation
41
+ ] | [
42
+ colorSource: BlendFactor,
43
+ colorDestination: BlendFactor,
44
+ colorEquation: BlendEquation,
45
+ alphaSource: BlendFactor,
46
+ alphaDestination: BlendFactor,
47
+ alphaEquation: BlendEquation
48
+ ];
49
+ /** sf::BlendMode. Values are copied into each recorded draw. */
50
+ export declare class BlendMode {
51
+ /** 混合因子枚举。 */
52
+ static readonly Factor: typeof BlendFactor;
53
+ /** 混合方程枚举。 */
54
+ static readonly Equation: typeof BlendEquation;
55
+ /** RGB 源颜色因子,默认 SrcAlpha。 */
56
+ colorSrcFactor: BlendFactor;
57
+ /** RGB 目标颜色因子,默认 OneMinusSrcAlpha。 */
58
+ colorDstFactor: BlendFactor;
59
+ /** RGB 混合方程,默认 Add。 */
60
+ colorEquation: BlendEquation;
61
+ /** Alpha 源因子,默认 One。 */
62
+ alphaSrcFactor: BlendFactor;
63
+ /** Alpha 目标因子,默认 OneMinusSrcAlpha。 */
64
+ alphaDstFactor: BlendFactor;
65
+ /** Alpha 混合方程,默认 Add。 */
66
+ alphaEquation: BlendEquation;
67
+ /** 创建默认透明混合、复制模式,或分别指定 RGB/Alpha 的源因子、目标因子和方程。 */
68
+ constructor(...args: Arguments);
69
+ }
70
+ /** 标准 Alpha 透明混合,只读。 */
71
+ export declare const BlendAlpha: Readonly<BlendMode>;
72
+ /** 源颜色按 Alpha 缩放后与目标相加,只读。 */
73
+ export declare const BlendAdd: Readonly<BlendMode>;
74
+ /** 源与目标逐分量相乘,只读。 */
75
+ export declare const BlendMultiply: Readonly<BlendMode>;
76
+ /** 逐分量取源与目标的较小值,只读。 */
77
+ export declare const BlendMin: Readonly<BlendMode>;
78
+ /** 逐分量取源与目标的较大值,只读。 */
79
+ export declare const BlendMax: Readonly<BlendMode>;
80
+ /** 源直接覆盖目标,不做颜色混合,只读。 */
81
+ export declare const BlendNone: Readonly<BlendMode>;
82
+ export {};
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BlendNone = exports.BlendMax = exports.BlendMin = exports.BlendMultiply = exports.BlendAdd = exports.BlendAlpha = exports.BlendMode = exports.BlendEquation = exports.BlendFactor = void 0;
4
+ const numeric_properties_1 = require("../internal/numeric-properties");
5
+ /** 混合方程中乘到源颜色或目标颜色上的因子。 */
6
+ var BlendFactor;
7
+ (function (BlendFactor) {
8
+ /** 常数 0。 */
9
+ BlendFactor[BlendFactor["Zero"] = 0] = "Zero";
10
+ /** 常数 1。 */
11
+ BlendFactor[BlendFactor["One"] = 1] = "One";
12
+ /** 源颜色。 */
13
+ BlendFactor[BlendFactor["SrcColor"] = 2] = "SrcColor";
14
+ /** 1 减去源颜色。 */
15
+ BlendFactor[BlendFactor["OneMinusSrcColor"] = 3] = "OneMinusSrcColor";
16
+ /** 目标颜色。 */
17
+ BlendFactor[BlendFactor["DstColor"] = 4] = "DstColor";
18
+ /** 1 减去目标颜色。 */
19
+ BlendFactor[BlendFactor["OneMinusDstColor"] = 5] = "OneMinusDstColor";
20
+ /** 源 Alpha。 */
21
+ BlendFactor[BlendFactor["SrcAlpha"] = 6] = "SrcAlpha";
22
+ /** 1 减去源 Alpha。 */
23
+ BlendFactor[BlendFactor["OneMinusSrcAlpha"] = 7] = "OneMinusSrcAlpha";
24
+ /** 目标 Alpha。 */
25
+ BlendFactor[BlendFactor["DstAlpha"] = 8] = "DstAlpha";
26
+ /** 1 减去目标 Alpha。 */
27
+ BlendFactor[BlendFactor["OneMinusDstAlpha"] = 9] = "OneMinusDstAlpha";
28
+ })(BlendFactor = exports.BlendFactor || (exports.BlendFactor = {}));
29
+ /** 源与目标颜色乘以各自因子后的组合方式。 */
30
+ var BlendEquation;
31
+ (function (BlendEquation) {
32
+ /** 源加目标。 */
33
+ BlendEquation[BlendEquation["Add"] = 0] = "Add";
34
+ /** 源减目标。 */
35
+ BlendEquation[BlendEquation["Subtract"] = 1] = "Subtract";
36
+ /** 目标减源。 */
37
+ BlendEquation[BlendEquation["ReverseSubtract"] = 2] = "ReverseSubtract";
38
+ /** 逐分量取较小值。 */
39
+ BlendEquation[BlendEquation["Min"] = 3] = "Min";
40
+ /** 逐分量取较大值。 */
41
+ BlendEquation[BlendEquation["Max"] = 4] = "Max";
42
+ })(BlendEquation = exports.BlendEquation || (exports.BlendEquation = {}));
43
+ /** sf::BlendMode. Values are copied into each recorded draw. */
44
+ class BlendMode {
45
+ /** 创建默认透明混合、复制模式,或分别指定 RGB/Alpha 的源因子、目标因子和方程。 */
46
+ constructor(...args) {
47
+ (0, numeric_properties_1.numericProperties)(this, {
48
+ colorSrcFactor: BlendFactor.SrcAlpha,
49
+ colorDstFactor: BlendFactor.OneMinusSrcAlpha,
50
+ colorEquation: BlendEquation.Add,
51
+ alphaSrcFactor: BlendFactor.One,
52
+ alphaDstFactor: BlendFactor.OneMinusSrcAlpha,
53
+ alphaEquation: BlendEquation.Add,
54
+ });
55
+ if (args.length === 0)
56
+ return;
57
+ if (args.length === 1 && args[0] instanceof BlendMode) {
58
+ const source = args[0];
59
+ this.colorSrcFactor = source.colorSrcFactor;
60
+ this.colorDstFactor = source.colorDstFactor;
61
+ this.colorEquation = source.colorEquation;
62
+ this.alphaSrcFactor = source.alphaSrcFactor;
63
+ this.alphaDstFactor = source.alphaDstFactor;
64
+ this.alphaEquation = source.alphaEquation;
65
+ }
66
+ else if (args.length === 2 || args.length === 3 || args.length === 6) {
67
+ this.colorSrcFactor = args[0];
68
+ this.colorDstFactor = args[1];
69
+ this.colorEquation = args[2] ?? BlendEquation.Add;
70
+ this.alphaSrcFactor = args.length === 6 ? args[3] : args[0];
71
+ this.alphaDstFactor = args.length === 6 ? args[4] : args[1];
72
+ this.alphaEquation = args.length === 6
73
+ ? args[5] : this.colorEquation;
74
+ }
75
+ else {
76
+ throw new TypeError('Expected a BlendMode or blend factors');
77
+ }
78
+ }
79
+ }
80
+ /** 混合因子枚举。 */
81
+ BlendMode.Factor = BlendFactor;
82
+ /** 混合方程枚举。 */
83
+ BlendMode.Equation = BlendEquation;
84
+ exports.BlendMode = BlendMode;
85
+ const F = BlendFactor;
86
+ const E = BlendEquation;
87
+ /** 标准 Alpha 透明混合,只读。 */
88
+ exports.BlendAlpha = Object.freeze(new BlendMode());
89
+ /** 源颜色按 Alpha 缩放后与目标相加,只读。 */
90
+ exports.BlendAdd = Object.freeze(new BlendMode(F.SrcAlpha, F.One, E.Add, F.One, F.One, E.Add));
91
+ /** 源与目标逐分量相乘,只读。 */
92
+ exports.BlendMultiply = Object.freeze(new BlendMode(F.DstColor, F.Zero));
93
+ /** 逐分量取源与目标的较小值,只读。 */
94
+ exports.BlendMin = Object.freeze(new BlendMode(F.One, F.One, E.Min));
95
+ /** 逐分量取源与目标的较大值,只读。 */
96
+ exports.BlendMax = Object.freeze(new BlendMode(F.One, F.One, E.Max));
97
+ /** 源直接覆盖目标,不做颜色混合,只读。 */
98
+ exports.BlendNone = Object.freeze(new BlendMode(F.One, F.Zero));
@@ -0,0 +1,48 @@
1
+ import { BooleanComponents } from '../internal/glsl-value';
2
+ import type { ReadonlyValue as R } from '../internal/value-storage';
3
+ import { Vector2 } from '../system/vector2';
4
+ import { Vector3 } from '../system/vector3';
5
+ import type { ScalarType } from '../internal/scalar';
6
+ /** 布尔向量运算基类,数值结果以非零为 true 转换。 */
7
+ export declare abstract class BooleanVector<K extends 'vector2' | 'vector3'> extends BooleanComponents<K> {
8
+ protected checkPair(rhs: R<BooleanVector<K>>): void;
9
+ /** 计算点积后转换为布尔值;任一对应分量同时为 true 时返回 true。 */
10
+ dot(rhs: R<BooleanVector<K>>): boolean;
11
+ /** 返回是否至少有一个分量为 true。 */
12
+ lengthSquared(): boolean;
13
+ protected checkDivisor(rhs: R<BooleanVector<K>>): void;
14
+ }
15
+ type Source2 = R<Bvec2> | R<Vector2<ScalarType>>;
16
+ type Arguments2 = [] | [x: boolean, y: boolean] | [source: Source2];
17
+ /** sf::Vector2<bool>; each component occupies one canonical 0/1 byte. */
18
+ export declare class Bvec2 extends BooleanVector<'vector2'> {
19
+ /** 创建全 false 向量,指定 x/y,或按非零为 true 转换复制二维向量。 */
20
+ constructor(...args: Arguments2);
21
+ /** 返回 (-y, x) 转换为布尔分量后的新向量,即 (y, x)。 */
22
+ perpendicular(): Bvec2;
23
+ /** 计算二维叉积并按非零为 true 转换。 */
24
+ cross(rhs: R<Bvec2>): boolean;
25
+ /** 返回逐分量逻辑与的新向量。 */
26
+ componentWiseMul(rhs: R<Bvec2>): Bvec2;
27
+ /** 返回本向量副本;rhs 任一分量为 false 时抛出 RangeError。 */
28
+ componentWiseDiv(rhs: R<Bvec2>): Bvec2;
29
+ }
30
+ type Source3 = R<Bvec3> | R<Vector3<ScalarType>>;
31
+ type Arguments3 = [
32
+ ] | [x: boolean, y: boolean, z: boolean] | [source: Source3];
33
+ /** sf::Vector3<bool>, sharing the same native family as numeric Vector3. */
34
+ export declare class Bvec3 extends BooleanVector<'vector3'> {
35
+ /** 创建全 false 向量,指定 x/y/z,或按非零为 true 转换复制三维向量。 */
36
+ constructor(...args: Arguments3);
37
+ /** Z 布尔分量。 */
38
+ get z(): boolean;
39
+ /** 设置 Z 分量,按 0/1 字节存储。 */
40
+ set z(value: boolean);
41
+ /** 计算三维叉积后将各分量按非零为 true 转换。 */
42
+ cross(rhs: R<Bvec3>): Bvec3;
43
+ /** 返回逐分量逻辑与的新向量。 */
44
+ componentWiseMul(rhs: R<Bvec3>): Bvec3;
45
+ /** 返回本向量副本;rhs 任一分量为 false 时抛出 RangeError。 */
46
+ componentWiseDiv(rhs: R<Bvec3>): Bvec3;
47
+ }
48
+ export {};