@defold-typescript/types 0.53.0 → 0.54.0

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 (335) hide show
  1. package/dist/cli-runtime.js +8966 -0
  2. package/dist/identity-vocabulary.json +660 -0
  3. package/dist/src/index.d.ts +18 -0
  4. package/fixtures/defold-1.12.4/b2d_body_doc.json +1327 -0
  5. package/fixtures/defold-1.12.4/b2d_doc.json +107 -0
  6. package/fixtures/defold-1.12.4/base_doc.json +758 -0
  7. package/fixtures/defold-1.12.4/bit_doc.json +404 -0
  8. package/fixtures/defold-1.12.4/buffer_doc.json +422 -0
  9. package/fixtures/defold-1.12.4/camera_doc.json +664 -0
  10. package/fixtures/defold-1.12.4/collectionfactory_doc.json +219 -0
  11. package/fixtures/defold-1.12.4/collectionproxy_doc.json +289 -0
  12. package/fixtures/defold-1.12.4/coroutine_doc.json +151 -0
  13. package/fixtures/defold-1.12.4/crash_doc.json +497 -0
  14. package/fixtures/defold-1.12.4/debug_doc.json +410 -0
  15. package/fixtures/defold-1.12.4/factory_doc.json +219 -0
  16. package/fixtures/defold-1.12.4/font_doc.json +141 -0
  17. package/fixtures/defold-1.12.4/globals_doc.json +42 -0
  18. package/fixtures/defold-1.12.4/go-instance-functions.json +111 -0
  19. package/fixtures/defold-1.12.4/go_doc.json +1901 -0
  20. package/fixtures/defold-1.12.4/graphics_doc.json +1634 -0
  21. package/fixtures/defold-1.12.4/gui_doc.json +5249 -0
  22. package/fixtures/defold-1.12.4/html5_doc.json +64 -0
  23. package/fixtures/defold-1.12.4/http_doc.json +66 -0
  24. package/fixtures/defold-1.12.4/image_doc.json +170 -0
  25. package/fixtures/defold-1.12.4/io_doc.json +399 -0
  26. package/fixtures/defold-1.12.4/json_doc.json +97 -0
  27. package/fixtures/defold-1.12.4/label_doc.json +220 -0
  28. package/fixtures/defold-1.12.4/liveupdate_doc.json +308 -0
  29. package/fixtures/defold-1.12.4/math_doc.json +702 -0
  30. package/fixtures/defold-1.12.4/messages_doc.json +579 -0
  31. package/fixtures/defold-1.12.4/model_doc.json +315 -0
  32. package/fixtures/defold-1.12.4/msg_doc.json +137 -0
  33. package/fixtures/defold-1.12.4/os_doc.json +266 -0
  34. package/fixtures/defold-1.12.4/package_doc.json +139 -0
  35. package/fixtures/defold-1.12.4/particlefx_doc.json +249 -0
  36. package/fixtures/defold-1.12.4/physics_doc.json +1120 -0
  37. package/fixtures/defold-1.12.4/profiler_doc.json +375 -0
  38. package/fixtures/defold-1.12.4/render_doc.json +1167 -0
  39. package/fixtures/defold-1.12.4/resource_doc.json +762 -0
  40. package/fixtures/defold-1.12.4/socket_doc.json +2194 -0
  41. package/fixtures/defold-1.12.4/sound_doc.json +582 -0
  42. package/fixtures/defold-1.12.4/sprite_doc.json +245 -0
  43. package/fixtures/defold-1.12.4/string_doc.json +412 -0
  44. package/fixtures/defold-1.12.4/sys_doc.json +853 -0
  45. package/fixtures/defold-1.12.4/table_doc.json +166 -0
  46. package/fixtures/defold-1.12.4/tilemap_doc.json +374 -0
  47. package/fixtures/defold-1.12.4/timer_doc.json +153 -0
  48. package/fixtures/defold-1.12.4/types_doc.json +212 -0
  49. package/fixtures/defold-1.12.4/vmath_doc.json +1814 -0
  50. package/fixtures/defold-1.12.4/window_doc.json +388 -0
  51. package/fixtures/defold-1.12.4/zlib_doc.json +70 -0
  52. package/fixtures/defold-1.13.0/b2d_body_doc.json +2428 -0
  53. package/fixtures/defold-1.13.0/b2d_chain_doc.json +394 -0
  54. package/fixtures/defold-1.13.0/b2d_doc.json +128 -0
  55. package/fixtures/defold-1.13.0/b2d_fixture_doc.json +594 -0
  56. package/fixtures/defold-1.13.0/b2d_joint_doc.json +3315 -0
  57. package/fixtures/defold-1.13.0/b2d_shape_doc.json +802 -0
  58. package/fixtures/defold-1.13.0/b2d_world_doc.json +1314 -0
  59. package/fixtures/defold-1.13.0/base_doc.json +758 -0
  60. package/fixtures/defold-1.13.0/bit_doc.json +404 -0
  61. package/fixtures/defold-1.13.0/buffer_doc.json +422 -0
  62. package/fixtures/defold-1.13.0/camera_doc.json +900 -0
  63. package/fixtures/defold-1.13.0/collectionfactory_doc.json +219 -0
  64. package/fixtures/defold-1.13.0/collectionproxy_doc.json +289 -0
  65. package/fixtures/defold-1.13.0/compute_doc.json +182 -0
  66. package/fixtures/defold-1.13.0/coroutine_doc.json +151 -0
  67. package/fixtures/defold-1.13.0/crash_doc.json +497 -0
  68. package/fixtures/defold-1.13.0/debug_doc.json +410 -0
  69. package/fixtures/defold-1.13.0/editor_doc.json +3665 -0
  70. package/fixtures/defold-1.13.0/editor_http_doc.json +273 -0
  71. package/fixtures/defold-1.13.0/editor_json_doc.json +59 -0
  72. package/fixtures/defold-1.13.0/editor_localization_doc.json +138 -0
  73. package/fixtures/defold-1.13.0/editor_pprint_doc.json +36 -0
  74. package/fixtures/defold-1.13.0/editor_tilemap_tiles_doc.json +235 -0
  75. package/fixtures/defold-1.13.0/editor_zip_doc.json +163 -0
  76. package/fixtures/defold-1.13.0/editor_zlib_doc.json +48 -0
  77. package/fixtures/defold-1.13.0/factory_doc.json +219 -0
  78. package/fixtures/defold-1.13.0/font_doc.json +141 -0
  79. package/fixtures/defold-1.13.0/globals_doc.json +42 -0
  80. package/fixtures/defold-1.13.0/go-instance-functions.json +101 -0
  81. package/fixtures/defold-1.13.0/go_doc.json +1989 -0
  82. package/fixtures/defold-1.13.0/graphics_doc.json +1886 -0
  83. package/fixtures/defold-1.13.0/gui_doc.json +5277 -0
  84. package/fixtures/defold-1.13.0/html5_doc.json +64 -0
  85. package/fixtures/defold-1.13.0/http_doc.json +66 -0
  86. package/fixtures/defold-1.13.0/image_doc.json +170 -0
  87. package/fixtures/defold-1.13.0/import-manifest.json +10558 -0
  88. package/fixtures/defold-1.13.0/io_doc.json +399 -0
  89. package/fixtures/defold-1.13.0/json_doc.json +97 -0
  90. package/fixtures/defold-1.13.0/label_doc.json +220 -0
  91. package/fixtures/defold-1.13.0/liveupdate_doc.json +330 -0
  92. package/fixtures/defold-1.13.0/material_doc.json +238 -0
  93. package/fixtures/defold-1.13.0/math_doc.json +702 -0
  94. package/fixtures/defold-1.13.0/model_doc.json +412 -0
  95. package/fixtures/defold-1.13.0/msg_doc.json +137 -0
  96. package/fixtures/defold-1.13.0/os_doc.json +266 -0
  97. package/fixtures/defold-1.13.0/package_doc.json +139 -0
  98. package/fixtures/defold-1.13.0/particlefx_doc.json +249 -0
  99. package/fixtures/defold-1.13.0/physics_doc.json +1492 -0
  100. package/fixtures/defold-1.13.0/profiler_doc.json +375 -0
  101. package/fixtures/defold-1.13.0/render_doc.json +1381 -0
  102. package/fixtures/defold-1.13.0/resource_doc.json +762 -0
  103. package/fixtures/defold-1.13.0/socket_doc.json +2194 -0
  104. package/fixtures/defold-1.13.0/sound_doc.json +582 -0
  105. package/fixtures/defold-1.13.0/sprite_doc.json +335 -0
  106. package/fixtures/defold-1.13.0/string_doc.json +412 -0
  107. package/fixtures/defold-1.13.0/sys_doc.json +1142 -0
  108. package/fixtures/defold-1.13.0/table_doc.json +166 -0
  109. package/fixtures/defold-1.13.0/tilemap_doc.json +402 -0
  110. package/fixtures/defold-1.13.0/timer_doc.json +153 -0
  111. package/fixtures/defold-1.13.0/types_doc.json +212 -0
  112. package/fixtures/defold-1.13.0/vmath_doc.json +1814 -0
  113. package/fixtures/defold-1.13.0/window_doc.json +388 -0
  114. package/fixtures/defold-1.13.0/zlib_doc.json +70 -0
  115. package/fixtures/defold-1.13.1/b2d_body_doc.json +2428 -0
  116. package/fixtures/defold-1.13.1/b2d_chain_doc.json +394 -0
  117. package/fixtures/defold-1.13.1/b2d_doc.json +128 -0
  118. package/fixtures/defold-1.13.1/b2d_fixture_doc.json +594 -0
  119. package/fixtures/defold-1.13.1/b2d_joint_doc.json +3315 -0
  120. package/fixtures/defold-1.13.1/b2d_shape_doc.json +802 -0
  121. package/fixtures/defold-1.13.1/b2d_world_doc.json +1314 -0
  122. package/fixtures/defold-1.13.1/base_doc.json +758 -0
  123. package/fixtures/defold-1.13.1/bit_doc.json +404 -0
  124. package/fixtures/defold-1.13.1/buffer_doc.json +422 -0
  125. package/fixtures/defold-1.13.1/camera_doc.json +900 -0
  126. package/fixtures/defold-1.13.1/collectionfactory_doc.json +219 -0
  127. package/fixtures/defold-1.13.1/collectionproxy_doc.json +323 -0
  128. package/fixtures/defold-1.13.1/compute_doc.json +182 -0
  129. package/fixtures/defold-1.13.1/coroutine_doc.json +151 -0
  130. package/fixtures/defold-1.13.1/crash_doc.json +497 -0
  131. package/fixtures/defold-1.13.1/debug_doc.json +410 -0
  132. package/fixtures/defold-1.13.1/editor_doc.json +3880 -0
  133. package/fixtures/defold-1.13.1/editor_http_doc.json +273 -0
  134. package/fixtures/defold-1.13.1/editor_image_doc.json +128 -0
  135. package/fixtures/defold-1.13.1/editor_json_doc.json +59 -0
  136. package/fixtures/defold-1.13.1/editor_localization_doc.json +138 -0
  137. package/fixtures/defold-1.13.1/editor_pprint_doc.json +36 -0
  138. package/fixtures/defold-1.13.1/editor_tilemap_tiles_doc.json +235 -0
  139. package/fixtures/defold-1.13.1/editor_zip_doc.json +163 -0
  140. package/fixtures/defold-1.13.1/editor_zlib_doc.json +48 -0
  141. package/fixtures/defold-1.13.1/factory_doc.json +219 -0
  142. package/fixtures/defold-1.13.1/font_doc.json +141 -0
  143. package/fixtures/defold-1.13.1/globals_doc.json +42 -0
  144. package/fixtures/defold-1.13.1/go-instance-functions.json +102 -0
  145. package/fixtures/defold-1.13.1/go_doc.json +1989 -0
  146. package/fixtures/defold-1.13.1/graphics_doc.json +1886 -0
  147. package/fixtures/defold-1.13.1/gui_doc.json +5277 -0
  148. package/fixtures/defold-1.13.1/html5_doc.json +64 -0
  149. package/fixtures/defold-1.13.1/http_doc.json +66 -0
  150. package/fixtures/defold-1.13.1/image_doc.json +170 -0
  151. package/fixtures/defold-1.13.1/import-manifest.json +10091 -0
  152. package/fixtures/defold-1.13.1/io_doc.json +399 -0
  153. package/fixtures/defold-1.13.1/json_doc.json +97 -0
  154. package/fixtures/defold-1.13.1/label_doc.json +220 -0
  155. package/fixtures/defold-1.13.1/liveupdate_doc.json +330 -0
  156. package/fixtures/defold-1.13.1/material_doc.json +238 -0
  157. package/fixtures/defold-1.13.1/math_doc.json +702 -0
  158. package/fixtures/defold-1.13.1/model_doc.json +412 -0
  159. package/fixtures/defold-1.13.1/msg_doc.json +137 -0
  160. package/fixtures/defold-1.13.1/os_doc.json +266 -0
  161. package/fixtures/defold-1.13.1/package_doc.json +139 -0
  162. package/fixtures/defold-1.13.1/particlefx_doc.json +249 -0
  163. package/fixtures/defold-1.13.1/physics_doc.json +1492 -0
  164. package/fixtures/defold-1.13.1/profiler_doc.json +375 -0
  165. package/fixtures/defold-1.13.1/render_doc.json +1381 -0
  166. package/fixtures/defold-1.13.1/resource_doc.json +762 -0
  167. package/fixtures/defold-1.13.1/socket_doc.json +2194 -0
  168. package/fixtures/defold-1.13.1/sound_doc.json +582 -0
  169. package/fixtures/defold-1.13.1/sprite_doc.json +335 -0
  170. package/fixtures/defold-1.13.1/string_doc.json +412 -0
  171. package/fixtures/defold-1.13.1/sys_doc.json +1142 -0
  172. package/fixtures/defold-1.13.1/table_doc.json +166 -0
  173. package/fixtures/defold-1.13.1/tilemap_doc.json +402 -0
  174. package/fixtures/defold-1.13.1/timer_doc.json +153 -0
  175. package/fixtures/defold-1.13.1/types_doc.json +212 -0
  176. package/fixtures/defold-1.13.1/vmath_doc.json +1814 -0
  177. package/fixtures/defold-1.13.1/window_doc.json +388 -0
  178. package/fixtures/defold-1.13.1/zlib_doc.json +70 -0
  179. package/fixtures/defold-1.13.2/b2d_body_doc.json +2359 -0
  180. package/fixtures/defold-1.13.2/b2d_chain_doc.json +395 -0
  181. package/fixtures/defold-1.13.2/b2d_doc.json +1945 -0
  182. package/fixtures/defold-1.13.2/b2d_fixture_doc.json +595 -0
  183. package/fixtures/defold-1.13.2/b2d_joint_doc.json +3178 -0
  184. package/fixtures/defold-1.13.2/b2d_shape_doc.json +767 -0
  185. package/fixtures/defold-1.13.2/b2d_world_doc.json +1315 -0
  186. package/fixtures/defold-1.13.2/base_doc.json +759 -0
  187. package/fixtures/defold-1.13.2/bit_doc.json +405 -0
  188. package/fixtures/defold-1.13.2/buffer_doc.json +393 -0
  189. package/fixtures/defold-1.13.2/bullet3d_collision_object_doc.json +1206 -0
  190. package/fixtures/defold-1.13.2/bullet3d_constraint_doc.json +2455 -0
  191. package/fixtures/defold-1.13.2/bullet3d_doc.json +215 -0
  192. package/fixtures/defold-1.13.2/bullet3d_rigid_body_doc.json +1376 -0
  193. package/fixtures/defold-1.13.2/bullet3d_shape_doc.json +430 -0
  194. package/fixtures/defold-1.13.2/bullet3d_world_doc.json +855 -0
  195. package/fixtures/defold-1.13.2/camera_doc.json +887 -0
  196. package/fixtures/defold-1.13.2/collectionfactory_doc.json +206 -0
  197. package/fixtures/defold-1.13.2/collectionproxy_doc.json +397 -0
  198. package/fixtures/defold-1.13.2/compute_doc.json +183 -0
  199. package/fixtures/defold-1.13.2/coroutine_doc.json +152 -0
  200. package/fixtures/defold-1.13.2/crash_doc.json +483 -0
  201. package/fixtures/defold-1.13.2/debug_doc.json +411 -0
  202. package/fixtures/defold-1.13.2/editor_doc.json +6320 -0
  203. package/fixtures/defold-1.13.2/editor_http_doc.json +476 -0
  204. package/fixtures/defold-1.13.2/editor_image_doc.json +129 -0
  205. package/fixtures/defold-1.13.2/editor_json_doc.json +81 -0
  206. package/fixtures/defold-1.13.2/editor_localization_doc.json +139 -0
  207. package/fixtures/defold-1.13.2/editor_pprint_doc.json +37 -0
  208. package/fixtures/defold-1.13.2/editor_tilemap_tiles_doc.json +292 -0
  209. package/fixtures/defold-1.13.2/editor_zip_doc.json +237 -0
  210. package/fixtures/defold-1.13.2/editor_zlib_doc.json +49 -0
  211. package/fixtures/defold-1.13.2/factory_doc.json +206 -0
  212. package/fixtures/defold-1.13.2/font_doc.json +230 -0
  213. package/fixtures/defold-1.13.2/globals_doc.json +64 -0
  214. package/fixtures/defold-1.13.2/go-instance-functions.json +106 -0
  215. package/fixtures/defold-1.13.2/go_doc.json +1789 -0
  216. package/fixtures/defold-1.13.2/graphics_doc.json +1211 -0
  217. package/fixtures/defold-1.13.2/gui_doc.json +4735 -0
  218. package/fixtures/defold-1.13.2/html5_doc.json +65 -0
  219. package/fixtures/defold-1.13.2/http_doc.json +174 -0
  220. package/fixtures/defold-1.13.2/image_doc.json +298 -0
  221. package/fixtures/defold-1.13.2/import-manifest.json +10902 -0
  222. package/fixtures/defold-1.13.2/io_doc.json +400 -0
  223. package/fixtures/defold-1.13.2/json_doc.json +140 -0
  224. package/fixtures/defold-1.13.2/label_doc.json +427 -0
  225. package/fixtures/defold-1.13.2/liveupdate_doc.json +221 -0
  226. package/fixtures/defold-1.13.2/material_doc.json +773 -0
  227. package/fixtures/defold-1.13.2/math_doc.json +703 -0
  228. package/fixtures/defold-1.13.2/model_doc.json +472 -0
  229. package/fixtures/defold-1.13.2/msg_doc.json +169 -0
  230. package/fixtures/defold-1.13.2/os_doc.json +269 -0
  231. package/fixtures/defold-1.13.2/package_doc.json +140 -0
  232. package/fixtures/defold-1.13.2/particlefx_doc.json +249 -0
  233. package/fixtures/defold-1.13.2/physics_doc.json +1624 -0
  234. package/fixtures/defold-1.13.2/profiler_doc.json +348 -0
  235. package/fixtures/defold-1.13.2/render_doc.json +1623 -0
  236. package/fixtures/defold-1.13.2/resource_doc.json +1539 -0
  237. package/fixtures/defold-1.13.2/socket_doc.json +2335 -0
  238. package/fixtures/defold-1.13.2/sound_doc.json +673 -0
  239. package/fixtures/defold-1.13.2/sprite_doc.json +364 -0
  240. package/fixtures/defold-1.13.2/string_doc.json +413 -0
  241. package/fixtures/defold-1.13.2/sys_doc.json +1347 -0
  242. package/fixtures/defold-1.13.2/table_doc.json +167 -0
  243. package/fixtures/defold-1.13.2/tilemap_doc.json +369 -0
  244. package/fixtures/defold-1.13.2/timer_doc.json +214 -0
  245. package/fixtures/defold-1.13.2/types_doc.json +213 -0
  246. package/fixtures/defold-1.13.2/vmath_doc.json +2056 -0
  247. package/fixtures/defold-1.13.2/window_doc.json +426 -0
  248. package/fixtures/defold-1.13.2/zlib_doc.json +71 -0
  249. package/fixtures/defold-1.14.0/b2d_body_doc.json +2359 -0
  250. package/fixtures/defold-1.14.0/b2d_chain_doc.json +395 -0
  251. package/fixtures/defold-1.14.0/b2d_doc.json +1973 -0
  252. package/fixtures/defold-1.14.0/b2d_fixture_doc.json +595 -0
  253. package/fixtures/defold-1.14.0/b2d_joint_doc.json +3178 -0
  254. package/fixtures/defold-1.14.0/b2d_shape_doc.json +767 -0
  255. package/fixtures/defold-1.14.0/b2d_world_doc.json +1315 -0
  256. package/fixtures/defold-1.14.0/base_doc.json +759 -0
  257. package/fixtures/defold-1.14.0/bit_doc.json +405 -0
  258. package/fixtures/defold-1.14.0/buffer_doc.json +393 -0
  259. package/fixtures/defold-1.14.0/bullet3d_collision_object_doc.json +1206 -0
  260. package/fixtures/defold-1.14.0/bullet3d_constraint_doc.json +2455 -0
  261. package/fixtures/defold-1.14.0/bullet3d_doc.json +243 -0
  262. package/fixtures/defold-1.14.0/bullet3d_rigid_body_doc.json +1376 -0
  263. package/fixtures/defold-1.14.0/bullet3d_shape_doc.json +430 -0
  264. package/fixtures/defold-1.14.0/bullet3d_world_doc.json +855 -0
  265. package/fixtures/defold-1.14.0/camera_doc.json +887 -0
  266. package/fixtures/defold-1.14.0/collectionfactory_doc.json +206 -0
  267. package/fixtures/defold-1.14.0/collectionproxy_doc.json +397 -0
  268. package/fixtures/defold-1.14.0/compute_doc.json +183 -0
  269. package/fixtures/defold-1.14.0/coroutine_doc.json +152 -0
  270. package/fixtures/defold-1.14.0/crash_doc.json +483 -0
  271. package/fixtures/defold-1.14.0/debug_doc.json +411 -0
  272. package/fixtures/defold-1.14.0/editor_doc.json +6320 -0
  273. package/fixtures/defold-1.14.0/editor_http_doc.json +476 -0
  274. package/fixtures/defold-1.14.0/editor_image_doc.json +129 -0
  275. package/fixtures/defold-1.14.0/editor_json_doc.json +81 -0
  276. package/fixtures/defold-1.14.0/editor_localization_doc.json +139 -0
  277. package/fixtures/defold-1.14.0/editor_pprint_doc.json +37 -0
  278. package/fixtures/defold-1.14.0/editor_tilemap_tiles_doc.json +292 -0
  279. package/fixtures/defold-1.14.0/editor_zip_doc.json +237 -0
  280. package/fixtures/defold-1.14.0/editor_zlib_doc.json +49 -0
  281. package/fixtures/defold-1.14.0/factory_doc.json +206 -0
  282. package/fixtures/defold-1.14.0/font_doc.json +230 -0
  283. package/fixtures/defold-1.14.0/globals_doc.json +64 -0
  284. package/fixtures/defold-1.14.0/go-instance-functions.json +106 -0
  285. package/fixtures/defold-1.14.0/go_doc.json +1789 -0
  286. package/fixtures/defold-1.14.0/graphics_doc.json +1257 -0
  287. package/fixtures/defold-1.14.0/gui_doc.json +4735 -0
  288. package/fixtures/defold-1.14.0/html5_doc.json +65 -0
  289. package/fixtures/defold-1.14.0/http_doc.json +174 -0
  290. package/fixtures/defold-1.14.0/image_doc.json +298 -0
  291. package/fixtures/defold-1.14.0/import-manifest.json +10260 -0
  292. package/fixtures/defold-1.14.0/io_doc.json +400 -0
  293. package/fixtures/defold-1.14.0/json_doc.json +140 -0
  294. package/fixtures/defold-1.14.0/label_doc.json +427 -0
  295. package/fixtures/defold-1.14.0/liveupdate_doc.json +221 -0
  296. package/fixtures/defold-1.14.0/material_doc.json +773 -0
  297. package/fixtures/defold-1.14.0/math_doc.json +703 -0
  298. package/fixtures/defold-1.14.0/model_doc.json +472 -0
  299. package/fixtures/defold-1.14.0/msg_doc.json +169 -0
  300. package/fixtures/defold-1.14.0/os_doc.json +269 -0
  301. package/fixtures/defold-1.14.0/package_doc.json +140 -0
  302. package/fixtures/defold-1.14.0/particlefx_doc.json +249 -0
  303. package/fixtures/defold-1.14.0/physics_doc.json +1624 -0
  304. package/fixtures/defold-1.14.0/profiler_doc.json +348 -0
  305. package/fixtures/defold-1.14.0/render_doc.json +1628 -0
  306. package/fixtures/defold-1.14.0/resource_doc.json +1539 -0
  307. package/fixtures/defold-1.14.0/socket_doc.json +2335 -0
  308. package/fixtures/defold-1.14.0/sound_doc.json +673 -0
  309. package/fixtures/defold-1.14.0/sprite_doc.json +364 -0
  310. package/fixtures/defold-1.14.0/string_doc.json +413 -0
  311. package/fixtures/defold-1.14.0/sys_doc.json +1347 -0
  312. package/fixtures/defold-1.14.0/table_doc.json +167 -0
  313. package/fixtures/defold-1.14.0/tilemap_doc.json +369 -0
  314. package/fixtures/defold-1.14.0/timer_doc.json +214 -0
  315. package/fixtures/defold-1.14.0/types_doc.json +213 -0
  316. package/fixtures/defold-1.14.0/vmath_doc.json +2056 -0
  317. package/fixtures/defold-1.14.0/window_doc.json +426 -0
  318. package/fixtures/defold-1.14.0/zlib_doc.json +71 -0
  319. package/package.json +13 -6
  320. package/scripts/cli-runtime.ts +18 -0
  321. package/scripts/example-store-io.ts +2 -2
  322. package/scripts/extension-goldens.ts +9 -5
  323. package/scripts/generate-api-availability.ts +1 -1
  324. package/scripts/generate-api-signatures.ts +1 -1
  325. package/scripts/import-defold-release.ts +1 -1
  326. package/scripts/regen.ts +35 -9
  327. package/scripts/signature-store-fs.ts +37 -17
  328. package/scripts/sync-api-docs.ts +127 -20
  329. package/src/api-doc.ts +11 -4
  330. package/src/emit-dts.ts +115 -21
  331. package/src/index-slot-classifications.ts +75 -9
  332. package/src/index.ts +3 -1
  333. package/src/publish-dts.ts +16 -0
  334. package/src/script-api.ts +36 -38
  335. package/src/library-index-slot-classifications.ts +0 -332
package/scripts/regen.ts CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  formatFieldCorrectionGaps,
31
31
  } from "../src/field-correction-coverage";
32
32
  import type { IndexBaseSource } from "../src/index-slot-classifications";
33
- import { wrapAsAmbientGlobal, wrapAsModule } from "../src/publish-dts";
33
+ import { wrapAsAmbientGlobal, wrapAsGlobalTableModule, wrapAsModule } from "../src/publish-dts";
34
34
  import type { UrlParameterTable } from "../src/url-parameters";
35
35
  import {
36
36
  type DocSourceProvenance,
@@ -87,8 +87,8 @@ export interface ApiTarget {
87
87
  readonly luaStdlib?: readonly { readonly namespace: string; readonly fixture: string }[];
88
88
  }
89
89
 
90
- const REGISTRY_PATH = resolve(import.meta.dir, "..", "api-targets.json");
91
- const PACKAGE_ROOT = resolve(import.meta.dir, "..");
90
+ const REGISTRY_PATH = resolve(import.meta.dirname, "..", "api-targets.json");
91
+ const PACKAGE_ROOT = resolve(import.meta.dirname, "..");
92
92
 
93
93
  export function loadApiTargets(
94
94
  registryPath: string = REGISTRY_PATH,
@@ -176,6 +176,9 @@ export interface ModuleManifestEntry {
176
176
  // The classification map this entry's index notes read; absent means the
177
177
  // engine map. A library or extension declaration names its page keys.
178
178
  readonly indexBaseSource?: IndexBaseSource;
179
+ // `false` for an extension declaration, which leaves the constant-union
180
+ // aliases of the namespace it shares to the engine module; absent means `true`.
181
+ readonly ownsConstantUnionAliases?: boolean;
179
182
  }
180
183
 
181
184
  export interface ResolveTargetOptions {
@@ -752,10 +755,10 @@ export function assertCommittedFieldCorrectionCoverage(
752
755
  return targets.length;
753
756
  }
754
757
 
755
- export function generateModuleDeclaration(
758
+ function emitModuleBody(
756
759
  entry: ModuleManifestEntry,
757
760
  options?: GenerateOptions,
758
- ): GenerateResult {
761
+ ): { namespace: string; emitted: string; importsFrom: string; dropped: string[] } {
759
762
  const {
760
763
  module,
761
764
  knownConstantFqns,
@@ -780,14 +783,34 @@ export function generateModuleDeclaration(
780
783
  ...(typeLeaves ? { typeLeaves } : {}),
781
784
  ...(declaredTypes ? { declaredTypes } : {}),
782
785
  ...(entry.indexBaseSource ? { indexBaseSource: entry.indexBaseSource } : {}),
786
+ ...(entry.ownsConstantUnionAliases !== undefined
787
+ ? { ownsConstantUnionAliases: entry.ownsConstantUnionAliases }
788
+ : {}),
783
789
  });
784
790
  const importsFrom = entry.importsFrom ?? "../src/core-types";
791
+ return { namespace: module.namespace, emitted, importsFrom, dropped };
792
+ }
793
+
794
+ export function generateModuleDeclaration(
795
+ entry: ModuleManifestEntry,
796
+ options?: GenerateOptions,
797
+ ): GenerateResult {
798
+ const { namespace, emitted, importsFrom, dropped } = emitModuleBody(entry, options);
785
799
  const contents = entry.moduleId
786
- ? wrapAsModule({ namespace: module.namespace, emitted, importsFrom, moduleId: entry.moduleId })
787
- : wrapAsAmbientGlobal({ namespace: module.namespace, emitted, importsFrom });
800
+ ? wrapAsModule({ namespace, emitted, importsFrom, moduleId: entry.moduleId })
801
+ : wrapAsAmbientGlobal({ namespace, emitted, importsFrom });
788
802
  return { contents, dropped };
789
803
  }
790
804
 
805
+ // A `.script_api` namespace as `resolve` writes it: a `@globalTable` module.
806
+ export function generateGlobalTableDeclaration(
807
+ entry: ModuleManifestEntry,
808
+ options?: GenerateOptions,
809
+ ): GenerateResult {
810
+ const { namespace, emitted, importsFrom, dropped } = emitModuleBody(entry, options);
811
+ return { contents: wrapAsGlobalTableModule({ namespace, emitted, importsFrom }), dropped };
812
+ }
813
+
791
814
  // The authoritative per-symbol signatures for a manifest entry, rendered through
792
815
  // the same prepared module (skip filter + constant branding) as
793
816
  // `generateModuleDeclaration`, so every signature corresponds to the committed
@@ -816,6 +839,9 @@ export function generateModuleSignatures(
816
839
  ...(nilRaisingSlots ? { nilRaisingSlots } : {}),
817
840
  ...(typeLeaves ? { typeLeaves } : {}),
818
841
  ...(declaredTypes ? { declaredTypes } : {}),
842
+ ...(entry.ownsConstantUnionAliases !== undefined
843
+ ? { ownsConstantUnionAliases: entry.ownsConstantUnionAliases }
844
+ : {}),
819
845
  });
820
846
  }
821
847
 
@@ -1325,7 +1351,7 @@ export async function regenerate(
1325
1351
  // Imported here rather than at module scope: the vendored engine bindings are
1326
1352
  // not published, and `resolve` loads this module from an installed package.
1327
1353
  const { targetBindingOptions } = await import("./binding-pin");
1328
- const generated = resolve(import.meta.dir, "..", "generated");
1354
+ const generated = resolve(import.meta.dirname, "..", "generated");
1329
1355
  io.mkdir(resolve(generated, "editor-vm"));
1330
1356
  const defaultBinding = targetBindingOptions(DEFAULT_TARGET);
1331
1357
  for (const entry of MODULE_MANIFEST) {
@@ -1356,7 +1382,7 @@ export async function regenerate(
1356
1382
  const goldens = resolve(PACKAGE_ROOT, EXTENSION_GOLDENS_DIR);
1357
1383
  io.mkdir(goldens);
1358
1384
  for (const entry of EXTENSION_GOLDEN_MANIFEST) {
1359
- const { contents, dropped } = generateModuleDeclaration(entry);
1385
+ const { contents, dropped } = generateGlobalTableDeclaration(entry);
1360
1386
  if (dropped.length > 0) {
1361
1387
  io.log(`note: dropped skipped member(s) from ${entry.namespace}: ${dropped.join(", ")}`);
1362
1388
  }
@@ -5,28 +5,48 @@ import type { SignatureStore } from "../src/signature-store";
5
5
  // Build-time only: lives under `scripts/` (never reachable from the shipped
6
6
  // `src/index.ts` graph) so its `node:fs` import cannot leak into a consumer's
7
7
  // typecheck. `src/signature-store.ts` stays pure for exactly that reason.
8
- export const IO_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "io.json");
9
- export const STRING_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "string.json");
10
- export const TABLE_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "table.json");
11
- export const OS_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "os.json");
8
+ export const IO_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "io.json");
9
+ export const STRING_SIGNATURES_PATH = resolve(
10
+ import.meta.dirname,
11
+ "..",
12
+ "signatures",
13
+ "string.json",
14
+ );
15
+ export const TABLE_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "table.json");
16
+ export const OS_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "os.json");
12
17
  export const COROUTINE_SIGNATURES_PATH = resolve(
13
- import.meta.dir,
18
+ import.meta.dirname,
14
19
  "..",
15
20
  "signatures",
16
21
  "coroutine.json",
17
22
  );
18
- export const MATH_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "math.json");
19
- export const BIT_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "bit.json");
20
- export const DEBUG_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "debug.json");
21
- export const PACKAGE_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "package.json");
22
- export const BASE_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "base.json");
23
- export const SOCKET_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "socket.json");
24
- export const VMATH_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "vmath.json");
25
- export const GO_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "go.json");
26
- export const GUI_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "gui.json");
27
- export const MSG_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "msg.json");
28
- export const RENDER_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "render.json");
29
- export const SYS_SIGNATURES_PATH = resolve(import.meta.dir, "..", "signatures", "sys.json");
23
+ export const MATH_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "math.json");
24
+ export const BIT_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "bit.json");
25
+ export const DEBUG_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "debug.json");
26
+ export const PACKAGE_SIGNATURES_PATH = resolve(
27
+ import.meta.dirname,
28
+ "..",
29
+ "signatures",
30
+ "package.json",
31
+ );
32
+ export const BASE_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "base.json");
33
+ export const SOCKET_SIGNATURES_PATH = resolve(
34
+ import.meta.dirname,
35
+ "..",
36
+ "signatures",
37
+ "socket.json",
38
+ );
39
+ export const VMATH_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "vmath.json");
40
+ export const GO_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "go.json");
41
+ export const GUI_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "gui.json");
42
+ export const MSG_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "msg.json");
43
+ export const RENDER_SIGNATURES_PATH = resolve(
44
+ import.meta.dirname,
45
+ "..",
46
+ "signatures",
47
+ "render.json",
48
+ );
49
+ export const SYS_SIGNATURES_PATH = resolve(import.meta.dirname, "..", "signatures", "sys.json");
30
50
 
31
51
  export function loadSignatureFile(path: string): SignatureStore {
32
52
  let raw: string;
@@ -1,6 +1,7 @@
1
1
  import { mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { dirname, join, resolve } from "node:path";
4
+ import { inflateRawSync } from "node:zlib";
4
5
  import { type ApiModule, parseDefoldApiDoc } from "../src/api-doc";
5
6
  import { DEFOLD_TYPE_MAP } from "../src/core-types";
6
7
  import { parseScriptApi } from "../src/script-api";
@@ -234,19 +235,13 @@ export const UPSTREAM_MAPPED_NAMESPACES: ReadonlySet<string> = new Set(
234
235
  [...SYNC_MANIFEST, ...LUA_STDLIB_MANIFEST, ...EDITOR_MANIFEST].map((e) => e.namespace),
235
236
  );
236
237
 
237
- // Convert a raw `.script_api` YAML doc to the core ref-doc JSON string written
238
- // to fixtures/<ns>_doc.json. The result is byte-compared by the same drift
239
- // semantics core fixtures use.
238
+ // Convert a raw `.script_api` YAML doc to the core ref-doc JSON string the
239
+ // Libraries pages, the `script-api` lane and `resolve` all read. The result is
240
+ // byte-compared by the same drift semantics core fixtures use.
240
241
  export function scriptApiToFixtureJson(text: string): string {
241
242
  return JSON.stringify(parseScriptApi(text));
242
243
  }
243
244
 
244
- // The docs-only variant: the same ref-doc JSON with constants kept, for pages
245
- // that render a module's full surface rather than feed the emitter.
246
- export function scriptApiToDocsJson(text: string): string {
247
- return JSON.stringify(parseScriptApi(text, { complete: true }));
248
- }
249
-
250
245
  // The types-api-coverage `What` checklist in vision.md lists every namespace as
251
246
  // a backtick-quoted token on the "Concrete breadth checklist" line. Reading it
252
247
  // here keeps SYNC_MANIFEST + UNMAPPED honest against the source of truth: the
@@ -278,21 +273,133 @@ export interface ZipAccessor {
278
273
  entries(): string[];
279
274
  }
280
275
 
281
- export function readZip(path: string): ZipAccessor {
282
- const list = Bun.spawnSync(["unzip", "-Z1", path]);
283
- if (list.exitCode !== 0) {
284
- throw new Error(`unzip -Z1 failed for ${path}: ${list.stderr.toString()}`);
276
+ const ZIP_LOCAL_HEADER_SIGNATURE = 0x04034b50;
277
+ const ZIP_CENTRAL_HEADER_SIGNATURE = 0x02014b50;
278
+ const ZIP_END_RECORD_SIGNATURE = 0x06054b50;
279
+ const ZIP_END_RECORD_SIZE = 22;
280
+ const ZIP_MAX_COMMENT_SIZE = 0xffff;
281
+ const ZIP_METHOD_STORED = 0;
282
+ const ZIP_METHOD_DEFLATE = 8;
283
+ const ZIP64_MARKER = 0xffffffff;
284
+
285
+ interface ZipDirectoryEntry {
286
+ readonly method: number;
287
+ readonly compressedSize: number;
288
+ readonly localHeaderOffset: number;
289
+ }
290
+
291
+ // The directory an end record names must run exactly up to that record.
292
+ function readCentralDirectory(
293
+ bytes: Buffer,
294
+ endRecord: number,
295
+ path: string,
296
+ ): Map<string, ZipDirectoryEntry> | Error {
297
+ const count = bytes.readUInt16LE(endRecord + 10);
298
+ const directorySize = bytes.readUInt32LE(endRecord + 12);
299
+ const directoryOffset = bytes.readUInt32LE(endRecord + 16);
300
+ if (count === 0xffff || directoryOffset === ZIP64_MARKER) {
301
+ return new Error(`${path}: zip64 archives are not supported`);
302
+ }
303
+ const disagrees = new Error(
304
+ `${path}: central directory disagrees with its end-of-central-directory record`,
305
+ );
306
+ if (directoryOffset + directorySize !== endRecord) {
307
+ return disagrees;
308
+ }
309
+ const entries = new Map<string, ZipDirectoryEntry>();
310
+ let cursor = directoryOffset;
311
+ for (let index = 0; index < count; index++) {
312
+ if (cursor + 46 > endRecord) {
313
+ return disagrees;
314
+ }
315
+ if (bytes.readUInt32LE(cursor) !== ZIP_CENTRAL_HEADER_SIGNATURE) {
316
+ return new Error(`${path}: central directory entry ${index} has no header signature`);
317
+ }
318
+ const method = bytes.readUInt16LE(cursor + 10);
319
+ const compressedSize = bytes.readUInt32LE(cursor + 20);
320
+ const uncompressedSize = bytes.readUInt32LE(cursor + 24);
321
+ const nameLength = bytes.readUInt16LE(cursor + 28);
322
+ const extraLength = bytes.readUInt16LE(cursor + 30);
323
+ const commentLength = bytes.readUInt16LE(cursor + 32);
324
+ const localHeaderOffset = bytes.readUInt32LE(cursor + 42);
325
+ if (
326
+ compressedSize === ZIP64_MARKER ||
327
+ uncompressedSize === ZIP64_MARKER ||
328
+ localHeaderOffset === ZIP64_MARKER
329
+ ) {
330
+ return new Error(`${path}: zip64 archives are not supported`);
331
+ }
332
+ const next = cursor + 46 + nameLength + extraLength + commentLength;
333
+ if (next > endRecord) {
334
+ return disagrees;
335
+ }
336
+ const name = bytes.toString("utf8", cursor + 46, cursor + 46 + nameLength);
337
+ entries.set(name, { method, compressedSize, localHeaderOffset });
338
+ cursor = next;
339
+ }
340
+ if (cursor !== endRecord) {
341
+ return disagrees;
285
342
  }
286
- const entries = new Set(list.stdout.toString().split("\n").filter(Boolean));
343
+ return entries;
344
+ }
345
+
346
+ // Walks the central directory, which is the archive's own index: every entry
347
+ // an archiver listed, directory entries included, in archive order. Found from
348
+ // the end record, which sits in the last 22 bytes unless a comment follows it.
349
+ // A comment may itself contain an end record, so a candidate counts only when
350
+ // its own comment length reaches exactly to the end of the archive and it
351
+ // describes a central directory ending at it. When no candidate does, the
352
+ // nearest one's own defect is reported.
353
+ function readZipDirectory(bytes: Buffer, path: string): Map<string, ZipDirectoryEntry> {
354
+ const earliest = Math.max(0, bytes.length - ZIP_END_RECORD_SIZE - ZIP_MAX_COMMENT_SIZE);
355
+ let nearestDefect: Error | undefined;
356
+ for (let at = bytes.length - ZIP_END_RECORD_SIZE; at >= earliest; at--) {
357
+ if (
358
+ bytes.readUInt32LE(at) === ZIP_END_RECORD_SIGNATURE &&
359
+ at + ZIP_END_RECORD_SIZE + bytes.readUInt16LE(at + 20) === bytes.length
360
+ ) {
361
+ const directory = readCentralDirectory(bytes, at, path);
362
+ if (!(directory instanceof Error)) {
363
+ return directory;
364
+ }
365
+ nearestDefect ??= directory;
366
+ }
367
+ }
368
+ if (nearestDefect !== undefined) {
369
+ throw nearestDefect;
370
+ }
371
+ throw new Error(`${path}: no end-of-central-directory record, not a zip archive`);
372
+ }
373
+
374
+ // Parses the archive itself rather than shelling out to `unzip`, which a stock
375
+ // Windows machine does not have: the CLI opens extension archives through this
376
+ // under Node and Bun on every OS.
377
+ export function readZip(path: string): ZipAccessor {
378
+ const bytes = readFileSync(path);
379
+ const entries = readZipDirectory(bytes, path);
287
380
  return {
288
381
  has: (name) => entries.has(name),
289
- entries: () => [...entries],
382
+ entries: () => [...entries.keys()],
290
383
  read: (name) => {
291
- const out = Bun.spawnSync(["unzip", "-p", path, name]);
292
- if (out.exitCode !== 0) {
293
- throw new Error(`unzip -p failed for ${name} in ${path}: ${out.stderr.toString()}`);
384
+ const entry = entries.get(name);
385
+ if (entry === undefined) {
386
+ throw new Error(`no entry ${name} in ${path}`);
387
+ }
388
+ const { localHeaderOffset, compressedSize, method } = entry;
389
+ if (bytes.readUInt32LE(localHeaderOffset) !== ZIP_LOCAL_HEADER_SIGNATURE) {
390
+ throw new Error(`${path}: local header of ${name} has no signature`);
391
+ }
392
+ const nameLength = bytes.readUInt16LE(localHeaderOffset + 26);
393
+ const extraLength = bytes.readUInt16LE(localHeaderOffset + 28);
394
+ const start = localHeaderOffset + 30 + nameLength + extraLength;
395
+ const data = bytes.subarray(start, start + compressedSize);
396
+ if (method === ZIP_METHOD_STORED) {
397
+ return data.toString("utf8");
398
+ }
399
+ if (method === ZIP_METHOD_DEFLATE) {
400
+ return inflateRawSync(data).toString("utf8");
294
401
  }
295
- return out.stdout.toString();
402
+ throw new Error(`${path}: entry ${name} uses unsupported compression method ${method}`);
296
403
  },
297
404
  };
298
405
  }
@@ -434,7 +541,7 @@ export interface SyncOptions {
434
541
  format?: (raw: string) => string;
435
542
  }
436
543
 
437
- const PACKAGE_ROOT = resolve(import.meta.dir, "..");
544
+ const PACKAGE_ROOT = resolve(import.meta.dirname, "..");
438
545
 
439
546
  function canonicalJson(raw: string): string {
440
547
  return JSON.stringify(JSON.parse(raw));
package/src/api-doc.ts CHANGED
@@ -68,6 +68,8 @@ export interface ApiTypedef {
68
68
  types?: string[];
69
69
  /** The type text of each parent an interface-backed typedef extends. */
70
70
  extends?: string[];
71
+ /** See {@link ApiFunction.generics}. */
72
+ generics?: string;
71
73
  /**
72
74
  * The type an engine ref-doc `TYPEDEF` aliases (`parameters[0].types`): a
73
75
  * handle's `userdata`/`number`, or the arms of a union, literal or record alias.
@@ -89,8 +91,9 @@ export interface ApiConstant {
89
91
  description: string;
90
92
  /**
91
93
  * Present when the constant is a member of an `ENUM` whose value type is
92
- * `string` (`parameters[0].types`); absence means a number, as every
93
- * pre-`ENUM` constant is.
94
+ * `string` (`parameters[0].types`), or a `.script_api` scalar declared
95
+ * `type: string` (the converted `CONSTANT` element's `types`); absence means
96
+ * a number, as every pre-`ENUM` engine constant is.
94
97
  */
95
98
  valueType?: "string";
96
99
  /** Present when an `ENUM` member is typed `<ENUM>|nil`: some platforms leave it unset. */
@@ -110,8 +113,9 @@ export interface ApiFunction {
110
113
  examples?: string;
111
114
  /**
112
115
  * A pre-rendered generic-parameter clause (`<T extends druid_widget>`) inserted
113
- * between the name and the `(` at render time. Present only on LuaLS-lowered
114
- * library functions; engine ref-docs carry no `generics`, so it stays absent.
116
+ * right after the name at render time, before a function's `(` or an alias's
117
+ * `=`. Present only on library functions, type aliases and interfaces; engine
118
+ * ref-docs carry no `generics`, so it stays absent.
115
119
  */
116
120
  generics?: string;
117
121
  /**
@@ -363,6 +367,7 @@ function parseTypedef(element: Record<string, unknown>): ApiTypedef {
363
367
  ...(types.length > 0 ? { types } : {}),
364
368
  ...(parents.length > 0 ? { extends: parents } : {}),
365
369
  ...(aliasOf.length > 0 ? { aliasOf } : {}),
370
+ ...(typeof element.generics === "string" ? { generics: element.generics } : {}),
366
371
  ...globalKey(element),
367
372
  };
368
373
  }
@@ -408,10 +413,12 @@ function parseProperty(element: Record<string, unknown>): ApiProperty {
408
413
  }
409
414
 
410
415
  function parseConstant(element: Record<string, unknown>): ApiConstant {
416
+ const types = parseStringArray(element.types);
411
417
  return {
412
418
  name: stringOr(element.name, ""),
413
419
  brief: stringOr(element.brief, ""),
414
420
  description: stringOr(element.description, ""),
421
+ ...(types.length === 1 && types[0] === "string" ? { valueType: "string" as const } : {}),
415
422
  ...globalKey(element),
416
423
  };
417
424
  }
package/src/emit-dts.ts CHANGED
@@ -74,6 +74,11 @@ export interface EmitOptions {
74
74
  // map; a library or extension declaration passes its page keys (`[]` for one
75
75
  // no page documents), so it never names Defold as the receiver.
76
76
  indexBaseSource?: IndexBaseSource;
77
+ // Whether the module declares the `CONSTANT_UNION_ALIASES` rows homed in its
78
+ // namespace. Defaults to `true`; an extension declaring an engine namespace
79
+ // passes `false`, so it never re-declares an alias the engine module already
80
+ // declares, while its signatures still spell `gui.Playback`.
81
+ ownsConstantUnionAliases?: boolean;
77
82
  // The TS path of each `ENUM`, `STRUCT` and `TYPEDEF` another module declares
78
83
  // (`declaredTypePaths`), so a token naming one resolves instead of widening to
79
84
  // `unknown`. The module's own declarations resolve without it. Read only by the
@@ -205,9 +210,10 @@ export const ARBITRARY_TABLE_SLOTS = new Set([
205
210
  // crash.get_modules is "module table".
206
211
  "crash.get_backtrace",
207
212
  "crash.get_modules",
208
- // platform-specific options: the doc is a dead backtick-prose cross-ref to a
209
- // sibling whose function is absent from the fixture (webview.open is not
210
- // documented), so no machine-readable shape exists.
213
+ // platform-specific options: the doc is a backtick-prose cross-ref to
214
+ // webview.open, whose options are documented as structured `.script_api`
215
+ // fields rather than a prose field list, so the cross-reference resolver (which
216
+ // reads a sibling's prose only) finds no machine-readable shape here.
211
217
  "webview.open_raw",
212
218
  // OS-resolver returns: the shape is set by the host resolver, not Defold's
213
219
  // API contract; each fixture doc reads "a table with all information
@@ -1907,10 +1913,6 @@ export const CONSTANT_SLOT_RESOLUTIONS: ReadonlyMap<string, ConstantSlotResoluti
1907
1913
  ],
1908
1914
  ["gui.new_texture:param:type", { residual: "the doc lists texture type strings only" }],
1909
1915
  ["gui.set_texture_data:param:type", { residual: "the doc lists texture type strings only" }],
1910
- [
1911
- "iap.get_provider_id:return:provider_id",
1912
- { residual: "the doc names iap.PROVIDER_ID_*, which no ref-doc defines as a constant" },
1913
- ],
1914
1916
  ]);
1915
1917
 
1916
1918
  export interface ConstantUnionNamedRow {
@@ -2373,7 +2375,9 @@ export function constantUnionSpelling(row: ConstantUnionAlias): string {
2373
2375
  // declared in its home whether or not that module references it, so a
2374
2376
  // cross-namespace row is reachable from the module whose signatures spell it.
2375
2377
  // A row whose name the module's own `ENUM` already declares is left to that
2376
- // `ENUM`, which carries the reference's member order and nilable arms.
2378
+ // `ENUM`, which carries the reference's member order and nilable arms. An
2379
+ // extension module is never a row's home, even when it declares the engine
2380
+ // namespace (`gui`), so its emit skips this (`ownsConstantUnionAliases`).
2377
2381
  function ownedConstantUnionAliases(
2378
2382
  namespace: string,
2379
2383
  enumDeclared: ReadonlySet<string>,
@@ -2588,9 +2592,9 @@ export const HOMOGENEOUS_ARRAY_SLOTS: ReadonlyMap<string, string | readonly stri
2588
2592
  ["iap.list", "string"],
2589
2593
  // push.register's `notifications` is a prose-only array of push.NOTIFICATION_*
2590
2594
  // bitmask constants (the ref example sums NOTIFICATION_BADGE/SOUND/ALERT). The
2591
- // vendored push_doc.json fixture declares no NOTIFICATION_* constant elements, so
2592
- // no brand exists to reference; `number` is the faithful element token for these
2593
- // numeric constants, mirroring the vmath.vector/buffer.* number entries.
2595
+ // slot's prose names no constant the expansion could read, and a summed bitmask
2596
+ // is a plain number rather than any one brand, so `number` is the faithful
2597
+ // element token, mirroring the vmath.vector/buffer.* number entries.
2594
2598
  ["push.register", "number"],
2595
2599
  // camera.get_cameras returns "a table with all camera URLs" (the ref example
2596
2600
  // iterates it with `pairs`) — a homogeneous list of `url`, emitted `Url[]`.
@@ -5116,11 +5120,13 @@ export function emitDeclarations(documented: ApiModule, options?: EmitOptions):
5116
5120
  lines.push(`declare namespace ${module.namespace} {`);
5117
5121
 
5118
5122
  for (const declaration of typeDeclarations) lines.push(...declaration.lines(INDENT, decl));
5119
- for (const aliasDecl of constantUnionAliasDeclarations(
5120
- module.namespace,
5121
- new Set(enumAliases.all.map((alias) => alias.path)),
5122
- )) {
5123
- lines.push(`${INDENT}${decl}${aliasDecl}`);
5123
+ if (options?.ownsConstantUnionAliases !== false) {
5124
+ for (const aliasDecl of constantUnionAliasDeclarations(
5125
+ module.namespace,
5126
+ new Set(enumAliases.all.map((alias) => alias.path)),
5127
+ )) {
5128
+ lines.push(`${INDENT}${decl}${aliasDecl}`);
5129
+ }
5124
5130
  }
5125
5131
  for (const { declaration } of overloadSlotAliasDeclarations(
5126
5132
  [...module.functions, ...(options?.withheldFunctions ?? [])],
@@ -5668,10 +5674,14 @@ export function emitSymbolSignatures(
5668
5674
  // names one carries no member list of its own, so the docs read the members
5669
5675
  // from here rather than from the emitter's table.
5670
5676
  const enumAliases = collectEnumAliases(module, constants, nestedRoot);
5671
- for (const row of ownedConstantUnionAliases(
5672
- module.namespace,
5673
- new Set(enumAliases.all.map((alias) => alias.path)),
5674
- )) {
5677
+ const ownedAliases =
5678
+ options?.ownsConstantUnionAliases === false
5679
+ ? []
5680
+ : ownedConstantUnionAliases(
5681
+ module.namespace,
5682
+ new Set(enumAliases.all.map((alias) => alias.path)),
5683
+ );
5684
+ for (const row of ownedAliases) {
5675
5685
  const name = engineTypeName(row.name);
5676
5686
  out.push({
5677
5687
  identity: { namespace: module.namespace, kind: "TYPEDEF", name, signature: "" },
@@ -6471,6 +6481,7 @@ function parameterType(
6471
6481
  "param",
6472
6482
  p.name,
6473
6483
  bindingEvidence,
6484
+ p.fields,
6474
6485
  )
6475
6486
  : "unknown";
6476
6487
  const key = tableSlotKey(elementName, "param", p.name);
@@ -6694,6 +6705,7 @@ function emitReturn(
6694
6705
  "return",
6695
6706
  rv.name,
6696
6707
  bindingEvidence,
6708
+ rv.fields,
6697
6709
  )
6698
6710
  : "unknown"),
6699
6711
  };
@@ -6733,6 +6745,7 @@ function emitReturn(
6733
6745
  "return",
6734
6746
  first.name,
6735
6747
  bindingEvidence,
6748
+ first.fields,
6736
6749
  )
6737
6750
  : "unknown";
6738
6751
  // A LuaLS vararg return (`...`) is every value the call returns, however many.
@@ -6846,6 +6859,73 @@ function wrappedInParens(text: string): boolean {
6846
6859
  return false;
6847
6860
  }
6848
6861
 
6862
+ // A ref-doc slot's structured `fields` (a `.script_api` callback's `parameters:`
6863
+ // or a table's `fields:`) as the field list `inlineTableType` renders. A field
6864
+ // flagged `is_optional` keeps that flag so a return-side or callback-argument
6865
+ // table marks only it `?`; a nested table's own fields nest the same way.
6866
+ function refDocTableFields(fields: readonly ApiParameter[]): TableField[] {
6867
+ return fields.map((field) => {
6868
+ const out: TableField = { name: field.name, types: field.types };
6869
+ if (field.fields !== undefined) out.fields = refDocTableFields(field.fields);
6870
+ if (field.isOptional) out.optional = true;
6871
+ return out;
6872
+ });
6873
+ }
6874
+
6875
+ // The TS type of one documented callback argument. The engine supplies these
6876
+ // values, so a table argument's fields are required unless flagged optional; a
6877
+ // `self` argument is the calling script instance, typed `unknown` like the
6878
+ // engine callback corrections type it.
6879
+ // A `constant` argument expands to the brands its own doc names, through the
6880
+ // slot's constant resolver; one whose doc names none keeps the generic brand.
6881
+ function callbackArgumentType(
6882
+ field: ApiParameter,
6883
+ mapType: DefoldTypeMapper,
6884
+ constantsNamed: (doc: string) => readonly string[],
6885
+ ): string {
6886
+ if (field.name === "self") return "unknown";
6887
+ if (field.fields !== undefined && field.fields.length > 0) {
6888
+ if (field.types.includes("function")) {
6889
+ return callbackTypeFromFields(field.fields, mapType, constantsNamed);
6890
+ }
6891
+ if (field.types.includes("table")) {
6892
+ return inlineTableType(refDocTableFields(field.fields), mapType, false);
6893
+ }
6894
+ }
6895
+ if (field.types.includes("constant")) {
6896
+ const fqns = constantsNamed(field.doc);
6897
+ if (fqns.length > 0) {
6898
+ const others = field.types.filter((token) => token !== "constant");
6899
+ return unionFromTokens([...fqns, ...others], mapType);
6900
+ }
6901
+ }
6902
+ return field.types.length > 0 ? unionFromTokens(field.types, mapType) : "unknown";
6903
+ }
6904
+
6905
+ // Renders a `function` slot's documented arguments as `(name: T, ...) => void`.
6906
+ // Optionality follows `emitParameter`: a trailing optional run takes `?`, an
6907
+ // interior optional argument takes `| undefined` because TS forbids a required
6908
+ // parameter after an optional one.
6909
+ function callbackTypeFromFields(
6910
+ fields: readonly ApiParameter[],
6911
+ mapType: DefoldTypeMapper,
6912
+ constantsNamed: (doc: string) => readonly string[],
6913
+ ): string {
6914
+ let trailingOptionalFrom = fields.length;
6915
+ while (trailingOptionalFrom > 0 && fields[trailingOptionalFrom - 1]?.isOptional === true) {
6916
+ trailingOptionalFrom--;
6917
+ }
6918
+ const args = fields.map((field, index) => {
6919
+ const name = safeParamName(field.name, index);
6920
+ const ts = callbackArgumentType(field, mapType, constantsNamed);
6921
+ if (index >= trailingOptionalFrom) return `${name}?: ${ts}`;
6922
+ if (!field.isOptional) return `${name}: ${ts}`;
6923
+ const operand = isFunctionTypeText(ts) ? `(${ts})` : ts;
6924
+ return `${name}: ${operand} | undefined`;
6925
+ });
6926
+ return `(${args.join(", ")}) => void`;
6927
+ }
6928
+
6849
6929
  // Like `unionFromTokens`, but a `table` token whose slot doc carries a parseable
6850
6930
  // `<dl>` field list emits an inline object type instead of the opaque `Record`
6851
6931
  // fallback. Other tokens in the union map unchanged. `optionalFields` marks the
@@ -6853,6 +6933,10 @@ function wrappedInParens(text: string): boolean {
6853
6933
  // optionality and an input option-bag's fields are individually omittable (the
6854
6934
  // old `Record` accepted partial/empty objects), so a parameter's fields are
6855
6935
  // optional while a return's fields (engine-populated, all present) stay required.
6936
+ // A slot carrying structured ref-doc `fields` (a `.script_api` conversion) types
6937
+ // a `table` token from them ahead of the prose parser and the curations, the
6938
+ // precedence `slotFieldNames` applies, and a `function` token from them as a
6939
+ // typed callback signature.
6856
6940
  function mapSlotUnion(
6857
6941
  types: readonly string[],
6858
6942
  doc: string,
@@ -6864,6 +6948,7 @@ function mapSlotUnion(
6864
6948
  slotKind: "param" | "return" | undefined,
6865
6949
  slotName: string | undefined,
6866
6950
  bindingEvidence: ReadonlySet<string>,
6951
+ fields?: readonly ApiParameter[],
6867
6952
  ): string {
6868
6953
  const mapped: string[] = [];
6869
6954
  const seen = new Set<string>();
@@ -6872,6 +6957,7 @@ function mapSlotUnion(
6872
6957
  seen.add(ts);
6873
6958
  mapped.push(ts);
6874
6959
  };
6960
+ const structured = fields !== undefined && fields.length > 0 ? fields : undefined;
6875
6961
  for (const token of types) {
6876
6962
  if (token === "constant" && slotKind !== undefined && slotName !== undefined) {
6877
6963
  const expanded = constantTokens(elementName, slotKind, slotName, doc);
@@ -6885,7 +6971,15 @@ function mapSlotUnion(
6885
6971
  slotKind !== undefined && slotName !== undefined
6886
6972
  ? TABLE_SLOT_CURATIONS.get(tableSlotKey(elementName, slotKind, slotName))
6887
6973
  : undefined;
6888
- if (token === "table" || slotCuration?.retypedUpstream?.includes(token) === true) {
6974
+ if (token === "table" && structured !== undefined) {
6975
+ ts = inlineTableType(refDocTableFields(structured), mapType, optionalFields);
6976
+ } else if (token === "function" && structured !== undefined) {
6977
+ ts = callbackTypeFromFields(structured, mapType, (fieldDoc) =>
6978
+ slotKind !== undefined && slotName !== undefined
6979
+ ? constantTokens(elementName, slotKind, slotName, fieldDoc)
6980
+ : [],
6981
+ );
6982
+ } else if (token === "table" || slotCuration?.retypedUpstream?.includes(token) === true) {
6889
6983
  const curation = slotCuration;
6890
6984
  const mapping =
6891
6985
  curation?.kind === "mapping" ? curation : MAPPING_TABLE_SLOTS.get(elementName);