maplibre-gl 2.0.0-pre.5 → 2.0.2

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 (903) hide show
  1. package/CHANGELOG.md +39 -4
  2. package/README.md +41 -9
  3. package/build/generate-struct-arrays.ts +439 -0
  4. package/build/generate-style-code.ts +275 -0
  5. package/build/generate-style-spec.ts +209 -0
  6. package/build/glsl_to_js.js +12 -0
  7. package/build/post-ts-build.js +52 -0
  8. package/build/readme.md +62 -0
  9. package/build/release-notes.js +6 -5
  10. package/build/rollup_plugins.js +24 -2
  11. package/build/web_worker_replacement.js +1 -1
  12. package/dist/maplibre-gl.css +1 -1
  13. package/dist/maplibre-gl.d.ts +10696 -0
  14. package/dist/maplibre-gl.js +6 -6
  15. package/dist/maplibre-gl.js.map +1 -1
  16. package/dist/package.json +1 -0
  17. package/package.json +50 -38
  18. package/src/css/maplibre-gl.css +1 -1
  19. package/src/data/array_types.ts +22 -21
  20. package/src/data/bucket/circle_bucket.ts +1 -0
  21. package/src/data/bucket/fill_bucket.test.ts +94 -0
  22. package/src/data/bucket/fill_bucket.ts +1 -0
  23. package/src/data/bucket/fill_extrusion_bucket.ts +1 -0
  24. package/src/data/bucket/line_bucket.test.ts +142 -0
  25. package/src/data/bucket/line_bucket.ts +1 -0
  26. package/src/data/bucket/symbol_bucket.test.ts +229 -0
  27. package/src/data/bucket/symbol_bucket.ts +1 -0
  28. package/src/data/bucket.ts +1 -0
  29. package/src/data/dem_data.test.ts +269 -0
  30. package/src/data/evaluation_feature.ts +1 -0
  31. package/src/data/feature_index.ts +9 -8
  32. package/src/data/feature_position_map.test.ts +33 -0
  33. package/src/data/load_geometry.test.ts +49 -0
  34. package/src/data/load_geometry.ts +1 -0
  35. package/src/data/program_configuration.ts +1 -0
  36. package/src/geo/edge_insets.test.ts +83 -0
  37. package/src/geo/edge_insets.ts +34 -4
  38. package/src/geo/lng_lat.test.ts +75 -0
  39. package/src/geo/lng_lat.ts +2 -2
  40. package/src/geo/lng_lat_bounds.test.ts +204 -0
  41. package/src/geo/mercator_coordinate.test.ts +34 -0
  42. package/src/geo/transform.test.ts +341 -0
  43. package/src/geo/transform.ts +1 -1
  44. package/src/gl/context.ts +3 -3
  45. package/src/gl/state.test.ts +191 -0
  46. package/src/gl/stencil_mode.ts +3 -3
  47. package/src/gl/types.ts +1 -1
  48. package/src/gl/value.ts +3 -3
  49. package/src/gl/vertex_buffer.test.ts +52 -0
  50. package/src/index.test.ts +7 -0
  51. package/src/index.ts +12 -15
  52. package/src/render/glyph_manager.test.ts +170 -0
  53. package/src/render/glyph_manager.ts +15 -15
  54. package/src/render/image_atlas.ts +1 -7
  55. package/src/render/image_manager.ts +2 -2
  56. package/src/render/line_atlas.test.ts +38 -0
  57. package/src/render/painter.ts +1 -1
  58. package/src/render/uniform_binding.test.ts +122 -0
  59. package/src/shaders/encode_attribute.test.ts +11 -0
  60. package/src/shaders/fill_pattern.fragment.glsl +3 -0
  61. package/src/shaders/line_pattern.fragment.glsl +3 -0
  62. package/src/source/canvas_source.test.ts +180 -0
  63. package/src/source/geojson_source.test.ts +353 -0
  64. package/src/source/geojson_source.ts +34 -47
  65. package/src/source/geojson_worker_source.test.ts +277 -0
  66. package/src/source/geojson_wrapper.test.ts +32 -0
  67. package/src/source/geojson_wrapper.ts +2 -1
  68. package/src/source/image_source.ts +4 -4
  69. package/src/source/query_features.test.ts +36 -0
  70. package/src/source/query_features.ts +5 -1
  71. package/src/source/raster_dem_tile_source.test.ts +152 -0
  72. package/src/source/raster_dem_tile_worker_source.test.ts +38 -0
  73. package/src/source/raster_tile_source.test.ts +141 -0
  74. package/src/source/source.ts +3 -3
  75. package/src/source/source_cache.test.ts +1594 -0
  76. package/src/source/tile.test.ts +290 -0
  77. package/src/source/tile.ts +6 -1
  78. package/src/source/tile_cache.test.ts +131 -0
  79. package/src/source/tile_id.test.ts +114 -0
  80. package/src/source/tile_id.ts +1 -0
  81. package/src/source/vector_tile_source.test.ts +345 -0
  82. package/src/source/vector_tile_source.ts +4 -4
  83. package/src/source/vector_tile_worker_source.ts +1 -0
  84. package/src/source/video_source.test.ts +64 -0
  85. package/src/source/video_source.ts +1 -1
  86. package/src/source/worker.test.ts +152 -0
  87. package/src/source/worker_tile.test.ts +102 -0
  88. package/src/source/worker_tile.ts +1 -0
  89. package/src/style/format_section_override.test.ts +64 -0
  90. package/src/style/light.test.ts +88 -0
  91. package/src/style/load_glyph_range.test.ts +45 -0
  92. package/src/style/load_glyph_range.ts +1 -1
  93. package/src/style/style.test.ts +2119 -0
  94. package/src/style/style.ts +21 -21
  95. package/src/style/style_image.ts +62 -60
  96. package/src/style/style_layer/background_style_layer.ts +5 -5
  97. package/src/style/style_layer/background_style_layer_properties.ts +13 -16
  98. package/src/style/style_layer/circle_style_layer.ts +8 -7
  99. package/src/style/style_layer/circle_style_layer_properties.ts +37 -36
  100. package/src/style/style_layer/custom_style_layer.ts +82 -79
  101. package/src/style/style_layer/fill_extrusion_style_layer.ts +9 -6
  102. package/src/style/style_layer/fill_extrusion_style_layer_properties.ts +27 -26
  103. package/src/style/style_layer/fill_style_layer.test.ts +37 -0
  104. package/src/style/style_layer/fill_style_layer.ts +8 -7
  105. package/src/style/style_layer/fill_style_layer_properties.ts +29 -28
  106. package/src/style/style_layer/heatmap_style_layer.ts +5 -5
  107. package/src/style/style_layer/heatmap_style_layer_properties.ts +19 -21
  108. package/src/style/style_layer/hillshade_style_layer.ts +5 -5
  109. package/src/style/style_layer/hillshade_style_layer_properties.ts +22 -23
  110. package/src/style/style_layer/line_style_layer.ts +8 -7
  111. package/src/style/style_layer/line_style_layer_properties.ts +43 -43
  112. package/src/style/style_layer/raster_style_layer.ts +5 -5
  113. package/src/style/style_layer/raster_style_layer_properties.ts +28 -26
  114. package/src/style/style_layer/symbol_style_layer.ts +9 -9
  115. package/src/style/style_layer/symbol_style_layer_properties.ts +124 -124
  116. package/src/style/style_layer.test.ts +373 -0
  117. package/src/style/style_layer.ts +18 -20
  118. package/src/style/style_layer_index.test.ts +99 -0
  119. package/src/style-spec/CHANGELOG.md +11 -0
  120. package/src/style-spec/composite.test.ts +106 -0
  121. package/src/style-spec/declass.test.ts +118 -0
  122. package/src/style-spec/deref.test.ts +47 -0
  123. package/src/style-spec/diff.test.ts +413 -0
  124. package/src/style-spec/empty.test.ts +14 -0
  125. package/src/style-spec/expression/expression.test.ts +64 -0
  126. package/src/style-spec/expression/stops.test.ts +23 -0
  127. package/src/style-spec/feature_filter/convert.ts +11 -11
  128. package/src/style-spec/feature_filter/feature_filter.test.ts +624 -0
  129. package/src/style-spec/format.test.ts +30 -0
  130. package/src/style-spec/format.ts +2 -2
  131. package/src/style-spec/function/index.test.ts +988 -0
  132. package/src/style-spec/group_by_layout.test.ts +64 -0
  133. package/src/style-spec/migrate/v8.test.ts +507 -0
  134. package/src/style-spec/migrate/v9.test.ts +76 -0
  135. package/src/style-spec/package.json +2 -1
  136. package/src/style-spec/reference/v8.json +11 -11
  137. package/src/style-spec/style-spec.test.ts +201 -0
  138. package/src/style-spec/types.ts +376 -364
  139. package/src/style-spec/util/color.test.ts +18 -0
  140. package/src/style-spec/util/color_spaces.test.ts +28 -0
  141. package/src/style-spec/util/interpolate.test.ts +16 -0
  142. package/src/style-spec/validate_style.min.ts +1 -1
  143. package/src/symbol/anchor.test.ts +14 -0
  144. package/src/symbol/check_max_angle.test.ts +48 -0
  145. package/src/symbol/clip_line.test.ts +154 -0
  146. package/src/symbol/collision_feature.test.ts +81 -0
  147. package/src/symbol/collision_index.ts +13 -7
  148. package/src/symbol/cross_tile_symbol_index.test.ts +238 -0
  149. package/src/symbol/get_anchors.test.ts +113 -0
  150. package/src/symbol/grid_index.test.ts +52 -0
  151. package/src/symbol/grid_index.ts +113 -69
  152. package/src/symbol/mergelines.test.ts +30 -0
  153. package/src/symbol/path_interpolator.test.ts +134 -0
  154. package/src/symbol/placement.ts +29 -24
  155. package/src/symbol/quads.test.ts +157 -0
  156. package/src/symbol/shaping.test.ts +392 -0
  157. package/src/symbol/symbol_layout.ts +26 -19
  158. package/src/symbol/symbol_style_layer.test.ts +103 -0
  159. package/src/types/packages-types/vector-tile/index.d.ts +27 -0
  160. package/src/ui/anchor.ts +3 -3
  161. package/src/ui/camera.test.ts +1883 -0
  162. package/src/ui/camera.ts +69 -61
  163. package/src/ui/control/attribution_control.test.ts +448 -0
  164. package/src/ui/control/attribution_control.ts +24 -26
  165. package/src/ui/control/control.ts +90 -0
  166. package/src/ui/control/fullscreen_control.test.ts +54 -0
  167. package/src/ui/control/fullscreen_control.ts +3 -3
  168. package/src/ui/control/geolocate_control.test.ts +452 -0
  169. package/src/ui/control/geolocate_control.ts +8 -8
  170. package/src/ui/control/logo_control.test.ts +134 -0
  171. package/src/ui/control/logo_control.ts +1 -1
  172. package/src/ui/control/navigation_control.ts +4 -4
  173. package/src/ui/control/scale_control.test.ts +53 -0
  174. package/src/ui/control/scale_control.ts +5 -5
  175. package/src/ui/events.ts +128 -15
  176. package/src/ui/handler/box_zoom.test.ts +165 -0
  177. package/src/ui/handler/dblclick_zoom.test.ts +181 -0
  178. package/src/ui/handler/drag_pan.test.ts +488 -0
  179. package/src/ui/handler/drag_rotate.test.ts +861 -0
  180. package/src/ui/handler/keyboard.test.ts +237 -0
  181. package/src/ui/handler/map_event.test.ts +96 -0
  182. package/src/ui/handler/map_event.ts +3 -1
  183. package/src/ui/handler/mouse_rotate.test.ts +64 -0
  184. package/src/ui/handler/scroll_zoom.test.ts +275 -0
  185. package/src/ui/handler/touch_zoom_rotate.test.ts +285 -0
  186. package/src/ui/hash.test.ts +293 -0
  187. package/src/ui/map/isMoving.test.ts +166 -0
  188. package/src/ui/map/isRotating.test.ts +64 -0
  189. package/src/ui/map/isZooming.test.ts +89 -0
  190. package/src/ui/map/requestRenderFrame.test.ts +41 -0
  191. package/src/ui/map.test.ts +2063 -0
  192. package/src/ui/map.ts +129 -235
  193. package/src/ui/map_events.test.ts +617 -0
  194. package/src/ui/marker.test.ts +774 -0
  195. package/src/ui/marker.ts +6 -6
  196. package/src/ui/popup.test.ts +739 -0
  197. package/src/ui/popup.ts +7 -7
  198. package/src/util/actor.test.ts +73 -0
  199. package/src/util/ajax.ts +10 -6
  200. package/src/util/browser.test.ts +26 -0
  201. package/src/util/browser.ts +1 -1
  202. package/src/util/classify_rings.test.ts +147 -0
  203. package/src/util/color_ramp.test.ts +106 -0
  204. package/src/util/dispatcher.test.ts +54 -0
  205. package/src/util/dom.ts +97 -120
  206. package/src/util/evented.test.ts +222 -0
  207. package/src/util/evented.ts +1 -1
  208. package/src/util/find_pole_of_inaccessibility.test.ts +21 -0
  209. package/src/util/image.ts +4 -4
  210. package/src/util/point.ts +10 -3
  211. package/src/util/primitives.test.ts +140 -0
  212. package/src/util/request_manager.test.ts +21 -0
  213. package/src/util/request_manager.ts +1 -1
  214. package/src/util/resolve_tokens.test.ts +41 -0
  215. package/src/util/struct_array.test.ts +101 -0
  216. package/src/util/task_queue.test.ts +114 -0
  217. package/src/util/test/util.ts +101 -0
  218. package/src/util/throttle.test.ts +45 -0
  219. package/src/util/tile_request_cache.test.ts +101 -0
  220. package/src/util/transferable_grid_index.test.ts +56 -0
  221. package/src/util/transferable_grid_index.ts +216 -0
  222. package/src/util/util.test.ts +309 -0
  223. package/src/util/vectortile_to_geojson.ts +4 -2
  224. package/src/util/web_worker.ts +2 -2
  225. package/src/util/web_worker_transfer.test.ts +80 -0
  226. package/src/util/web_worker_transfer.ts +2 -18
  227. package/src/util/worker_pool.test.ts +43 -0
  228. package/build/diff-tarball.js +0 -28
  229. package/build/generate-flow-typed-style-spec.js +0 -188
  230. package/build/generate-release-list.js +0 -21
  231. package/build/generate-struct-arrays.js +0 -243
  232. package/build/generate-style-code.js +0 -159
  233. package/build/print-release-url.js +0 -6
  234. package/dist/maplibre-gl-csp-worker.js +0 -2
  235. package/dist/maplibre-gl-csp-worker.js.map +0 -1
  236. package/dist/maplibre-gl-csp.js +0 -2
  237. package/dist/maplibre-gl-csp.js.map +0 -1
  238. package/dist/maplibre-gl-dev.js +0 -54948
  239. package/dist/maplibre-gl-unminified.js +0 -39602
  240. package/dist/maplibre-gl-unminified.js.map +0 -1
  241. package/dist/style-spec/index.es.js +0 -14930
  242. package/dist/style-spec/index.es.js.map +0 -1
  243. package/dist/style-spec/index.js +0 -14955
  244. package/dist/style-spec/index.js.map +0 -1
  245. package/src/style/style_layer/layer_properties.js.ejs +0 -69
  246. package/src/types/non-typed-modules.d.ts +0 -124
  247. package/src/ui/control/control.d.ts +0 -8
  248. package/src/util/struct_array.js.ejs +0 -112
  249. package/src/util/struct_array_layout.js.ejs +0 -98
  250. package/types/data/array_types.d.ts +0 -459
  251. package/types/data/array_types.d.ts.map +0 -1
  252. package/types/data/bucket/circle_attributes.d.ts +0 -4
  253. package/types/data/bucket/circle_attributes.d.ts.map +0 -1
  254. package/types/data/bucket/circle_bucket.d.ts +0 -50
  255. package/types/data/bucket/circle_bucket.d.ts.map +0 -1
  256. package/types/data/bucket/fill_attributes.d.ts +0 -4
  257. package/types/data/bucket/fill_attributes.d.ts.map +0 -1
  258. package/types/data/bucket/fill_bucket.d.ts +0 -51
  259. package/types/data/bucket/fill_bucket.d.ts.map +0 -1
  260. package/types/data/bucket/fill_extrusion_attributes.d.ts +0 -4
  261. package/types/data/bucket/fill_extrusion_attributes.d.ts.map +0 -1
  262. package/types/data/bucket/fill_extrusion_bucket.d.ts +0 -48
  263. package/types/data/bucket/fill_extrusion_bucket.d.ts.map +0 -1
  264. package/types/data/bucket/heatmap_bucket.d.ts +0 -7
  265. package/types/data/bucket/heatmap_bucket.d.ts.map +0 -1
  266. package/types/data/bucket/line_attributes.d.ts +0 -4
  267. package/types/data/bucket/line_attributes.d.ts.map +0 -1
  268. package/types/data/bucket/line_attributes_ext.d.ts +0 -4
  269. package/types/data/bucket/line_attributes_ext.d.ts.map +0 -1
  270. package/types/data/bucket/line_bucket.d.ts +0 -93
  271. package/types/data/bucket/line_bucket.d.ts.map +0 -1
  272. package/types/data/bucket/pattern_attributes.d.ts +0 -3
  273. package/types/data/bucket/pattern_attributes.d.ts.map +0 -1
  274. package/types/data/bucket/pattern_bucket_features.d.ts +0 -9
  275. package/types/data/bucket/pattern_bucket_features.d.ts.map +0 -1
  276. package/types/data/bucket/symbol_attributes.d.ts +0 -13
  277. package/types/data/bucket/symbol_attributes.d.ts.map +0 -1
  278. package/types/data/bucket/symbol_bucket.d.ts +0 -213
  279. package/types/data/bucket/symbol_bucket.d.ts.map +0 -1
  280. package/types/data/bucket.d.ts +0 -97
  281. package/types/data/bucket.d.ts.map +0 -1
  282. package/types/data/dem_data.d.ts +0 -17
  283. package/types/data/dem_data.d.ts.map +0 -1
  284. package/types/data/evaluation_feature.d.ts +0 -26
  285. package/types/data/evaluation_feature.d.ts.map +0 -1
  286. package/types/data/extent.d.ts +0 -18
  287. package/types/data/extent.d.ts.map +0 -1
  288. package/types/data/feature_index.d.ts +0 -77
  289. package/types/data/feature_index.d.ts.map +0 -1
  290. package/types/data/feature_position_map.d.ts +0 -21
  291. package/types/data/feature_position_map.d.ts.map +0 -1
  292. package/types/data/index_array_type.d.ts +0 -10
  293. package/types/data/index_array_type.d.ts.map +0 -1
  294. package/types/data/load_geometry.d.ts +0 -9
  295. package/types/data/load_geometry.d.ts.map +0 -1
  296. package/types/data/pos_attributes.d.ts +0 -3
  297. package/types/data/pos_attributes.d.ts.map +0 -1
  298. package/types/data/program_configuration.d.ts +0 -125
  299. package/types/data/program_configuration.d.ts.map +0 -1
  300. package/types/data/raster_bounds_attributes.d.ts +0 -3
  301. package/types/data/raster_bounds_attributes.d.ts.map +0 -1
  302. package/types/data/segment.d.ts +0 -23
  303. package/types/data/segment.d.ts.map +0 -1
  304. package/types/geo/edge_insets.d.ts +0 -56
  305. package/types/geo/edge_insets.d.ts.map +0 -1
  306. package/types/geo/lng_lat.d.ts +0 -110
  307. package/types/geo/lng_lat.d.ts.map +0 -1
  308. package/types/geo/lng_lat_bounds.d.ts +0 -175
  309. package/types/geo/lng_lat_bounds.d.ts.map +0 -1
  310. package/types/geo/mercator_coordinate.d.ts +0 -87
  311. package/types/geo/mercator_coordinate.d.ts.map +0 -1
  312. package/types/geo/transform.d.ts +0 -221
  313. package/types/geo/transform.d.ts.map +0 -1
  314. package/types/gl/color_mode.d.ts +0 -14
  315. package/types/gl/color_mode.d.ts.map +0 -1
  316. package/types/gl/context.d.ts +0 -73
  317. package/types/gl/context.d.ts.map +0 -1
  318. package/types/gl/cull_face_mode.d.ts +0 -11
  319. package/types/gl/cull_face_mode.d.ts.map +0 -1
  320. package/types/gl/depth_mode.d.ts +0 -12
  321. package/types/gl/depth_mode.d.ts.map +0 -1
  322. package/types/gl/framebuffer.d.ts +0 -14
  323. package/types/gl/framebuffer.d.ts.map +0 -1
  324. package/types/gl/index_buffer.d.ts +0 -14
  325. package/types/gl/index_buffer.d.ts.map +0 -1
  326. package/types/gl/stencil_mode.d.ts +0 -13
  327. package/types/gl/stencil_mode.d.ts.map +0 -1
  328. package/types/gl/types.d.ts +0 -46
  329. package/types/gl/types.d.ts.map +0 -1
  330. package/types/gl/value.d.ts +0 -163
  331. package/types/gl/value.d.ts.map +0 -1
  332. package/types/gl/vertex_buffer.d.ts +0 -37
  333. package/types/gl/vertex_buffer.d.ts.map +0 -1
  334. package/types/index.d.ts +0 -200
  335. package/types/index.d.ts.map +0 -1
  336. package/types/render/draw_background.d.ts +0 -6
  337. package/types/render/draw_background.d.ts.map +0 -1
  338. package/types/render/draw_circle.d.ts +0 -7
  339. package/types/render/draw_circle.d.ts.map +0 -1
  340. package/types/render/draw_collision_debug.d.ts +0 -7
  341. package/types/render/draw_collision_debug.d.ts.map +0 -1
  342. package/types/render/draw_custom.d.ts +0 -6
  343. package/types/render/draw_custom.d.ts.map +0 -1
  344. package/types/render/draw_debug.d.ts +0 -7
  345. package/types/render/draw_debug.d.ts.map +0 -1
  346. package/types/render/draw_fill.d.ts +0 -7
  347. package/types/render/draw_fill.d.ts.map +0 -1
  348. package/types/render/draw_fill_extrusion.d.ts +0 -7
  349. package/types/render/draw_fill_extrusion.d.ts.map +0 -1
  350. package/types/render/draw_heatmap.d.ts +0 -7
  351. package/types/render/draw_heatmap.d.ts.map +0 -1
  352. package/types/render/draw_hillshade.d.ts +0 -7
  353. package/types/render/draw_hillshade.d.ts.map +0 -1
  354. package/types/render/draw_line.d.ts +0 -6
  355. package/types/render/draw_line.d.ts.map +0 -1
  356. package/types/render/draw_raster.d.ts +0 -7
  357. package/types/render/draw_raster.d.ts.map +0 -1
  358. package/types/render/draw_symbol.d.ts +0 -10
  359. package/types/render/draw_symbol.d.ts.map +0 -1
  360. package/types/render/glyph_atlas.d.ts +0 -27
  361. package/types/render/glyph_atlas.d.ts.map +0 -1
  362. package/types/render/glyph_manager.d.ts +0 -44
  363. package/types/render/glyph_manager.d.ts.map +0 -1
  364. package/types/render/image_atlas.d.ts +0 -49
  365. package/types/render/image_atlas.d.ts.map +0 -1
  366. package/types/render/image_manager.d.ts +0 -64
  367. package/types/render/image_manager.d.ts.map +0 -1
  368. package/types/render/line_atlas.d.ts +0 -43
  369. package/types/render/line_atlas.d.ts.map +0 -1
  370. package/types/render/painter.d.ts +0 -140
  371. package/types/render/painter.d.ts.map +0 -1
  372. package/types/render/program/background_program.d.ts +0 -42
  373. package/types/render/program/background_program.d.ts.map +0 -1
  374. package/types/render/program/circle_program.d.ts +0 -19
  375. package/types/render/program/circle_program.d.ts.map +0 -1
  376. package/types/render/program/clipping_mask_program.d.ts +0 -11
  377. package/types/render/program/clipping_mask_program.d.ts.map +0 -1
  378. package/types/render/program/collision_program.d.ts +0 -25
  379. package/types/render/program/collision_program.d.ts.map +0 -1
  380. package/types/render/program/debug_program.d.ts +0 -15
  381. package/types/render/program/debug_program.d.ts.map +0 -1
  382. package/types/render/program/fill_extrusion_program.d.ts +0 -37
  383. package/types/render/program/fill_extrusion_program.d.ts.map +0 -1
  384. package/types/render/program/fill_program.d.ts +0 -43
  385. package/types/render/program/fill_program.d.ts.map +0 -1
  386. package/types/render/program/heatmap_program.d.ts +0 -25
  387. package/types/render/program/heatmap_program.d.ts.map +0 -1
  388. package/types/render/program/hillshade_program.d.ts +0 -30
  389. package/types/render/program/hillshade_program.d.ts.map +0 -1
  390. package/types/render/program/line_program.d.ts +0 -55
  391. package/types/render/program/line_program.d.ts.map +0 -1
  392. package/types/render/program/pattern.d.ts +0 -39
  393. package/types/render/program/pattern.d.ts.map +0 -1
  394. package/types/render/program/program_uniforms.d.ts +0 -28
  395. package/types/render/program/program_uniforms.d.ts.map +0 -1
  396. package/types/render/program/raster_program.d.ts +0 -27
  397. package/types/render/program/raster_program.d.ts.map +0 -1
  398. package/types/render/program/symbol_program.d.ts +0 -84
  399. package/types/render/program/symbol_program.d.ts.map +0 -1
  400. package/types/render/program.d.ts +0 -31
  401. package/types/render/program.d.ts.map +0 -1
  402. package/types/render/texture.d.ts +0 -37
  403. package/types/render/texture.d.ts.map +0 -1
  404. package/types/render/uniform_binding.d.ts +0 -50
  405. package/types/render/uniform_binding.d.ts.map +0 -1
  406. package/types/render/vertex_array_object.d.ts +0 -21
  407. package/types/render/vertex_array_object.d.ts.map +0 -1
  408. package/types/shaders/encode_attribute.d.ts +0 -9
  409. package/types/shaders/encode_attribute.d.ts.map +0 -1
  410. package/types/shaders/shaders.d.ts +0 -160
  411. package/types/shaders/shaders.d.ts.map +0 -1
  412. package/types/source/canvas_source.d.ts +0 -88
  413. package/types/source/canvas_source.d.ts.map +0 -1
  414. package/types/source/geojson_source.d.ts +0 -142
  415. package/types/source/geojson_source.d.ts.map +0 -1
  416. package/types/source/geojson_worker_source.d.ts +0 -143
  417. package/types/source/geojson_worker_source.d.ts.map +0 -1
  418. package/types/source/geojson_wrapper.d.ts +0 -28
  419. package/types/source/geojson_wrapper.d.ts.map +0 -1
  420. package/types/source/image_source.d.ts +0 -123
  421. package/types/source/image_source.d.ts.map +0 -1
  422. package/types/source/load_tilejson.d.ts +0 -6
  423. package/types/source/load_tilejson.d.ts.map +0 -1
  424. package/types/source/pixels_to_tile_units.d.ts +0 -18
  425. package/types/source/pixels_to_tile_units.d.ts.map +0 -1
  426. package/types/source/query_features.d.ts +0 -31
  427. package/types/source/query_features.d.ts.map +0 -1
  428. package/types/source/raster_dem_tile_source.d.ts +0 -26
  429. package/types/source/raster_dem_tile_source.d.ts.map +0 -1
  430. package/types/source/raster_dem_tile_worker_source.d.ts +0 -19
  431. package/types/source/raster_dem_tile_worker_source.d.ts.map +0 -1
  432. package/types/source/raster_tile_source.d.ts +0 -41
  433. package/types/source/raster_tile_source.d.ts.map +0 -1
  434. package/types/source/rtl_text_plugin.d.ts +0 -34
  435. package/types/source/rtl_text_plugin.d.ts.map +0 -1
  436. package/types/source/source.d.ts +0 -81
  437. package/types/source/source.d.ts.map +0 -1
  438. package/types/source/source_cache.d.ts +0 -194
  439. package/types/source/source_cache.d.ts.map +0 -1
  440. package/types/source/source_state.d.ts +0 -32
  441. package/types/source/source_state.d.ts.map +0 -1
  442. package/types/source/tile.d.ts +0 -135
  443. package/types/source/tile.d.ts.map +0 -1
  444. package/types/source/tile_bounds.d.ts +0 -12
  445. package/types/source/tile_bounds.d.ts.map +0 -1
  446. package/types/source/tile_cache.d.ts +0 -100
  447. package/types/source/tile_cache.d.ts.map +0 -1
  448. package/types/source/tile_id.d.ts +0 -41
  449. package/types/source/tile_id.d.ts.map +0 -1
  450. package/types/source/vector_tile_source.d.ts +0 -87
  451. package/types/source/vector_tile_source.d.ts.map +0 -1
  452. package/types/source/vector_tile_worker_source.d.ts +0 -80
  453. package/types/source/vector_tile_worker_source.d.ts.map +0 -1
  454. package/types/source/video_source.d.ts +0 -85
  455. package/types/source/video_source.d.ts.map +0 -1
  456. package/types/source/worker.d.ts +0 -82
  457. package/types/source/worker.d.ts.map +0 -1
  458. package/types/source/worker_source.d.ts +0 -103
  459. package/types/source/worker_source.d.ts.map +0 -1
  460. package/types/source/worker_tile.d.ts +0 -29
  461. package/types/source/worker_tile.d.ts.map +0 -1
  462. package/types/style/create_style_layer.d.ts +0 -14
  463. package/types/style/create_style_layer.d.ts.map +0 -1
  464. package/types/style/evaluation_parameters.d.ts +0 -20
  465. package/types/style/evaluation_parameters.d.ts.map +0 -1
  466. package/types/style/format_section_override.d.ts +0 -14
  467. package/types/style/format_section_override.d.ts.map +0 -1
  468. package/types/style/light.d.ts +0 -47
  469. package/types/style/light.d.ts.map +0 -1
  470. package/types/style/load_glyph_range.d.ts +0 -7
  471. package/types/style/load_glyph_range.d.ts.map +0 -1
  472. package/types/style/load_sprite.d.ts +0 -8
  473. package/types/style/load_sprite.d.ts.map +0 -1
  474. package/types/style/parse_glyph_pbf.d.ts +0 -4
  475. package/types/style/parse_glyph_pbf.d.ts.map +0 -1
  476. package/types/style/pauseable_placement.d.ts +0 -35
  477. package/types/style/pauseable_placement.d.ts.map +0 -1
  478. package/types/style/properties.d.ts +0 -327
  479. package/types/style/properties.d.ts.map +0 -1
  480. package/types/style/query_utils.d.ts +0 -8
  481. package/types/style/query_utils.d.ts.map +0 -1
  482. package/types/style/style.d.ts +0 -259
  483. package/types/style/style.d.ts.map +0 -1
  484. package/types/style/style_glyph.d.ts +0 -14
  485. package/types/style/style_glyph.d.ts.map +0 -1
  486. package/types/style/style_image.d.ts +0 -116
  487. package/types/style/style_image.d.ts.map +0 -1
  488. package/types/style/style_layer/background_style_layer.d.ts +0 -13
  489. package/types/style/style_layer/background_style_layer.d.ts.map +0 -1
  490. package/types/style/style_layer/background_style_layer_properties.d.ts +0 -18
  491. package/types/style/style_layer/background_style_layer_properties.d.ts.map +0 -1
  492. package/types/style/style_layer/circle_style_layer.d.ts +0 -24
  493. package/types/style/style_layer/circle_style_layer.d.ts.map +0 -1
  494. package/types/style/style_layer/circle_style_layer_properties.d.ts +0 -40
  495. package/types/style/style_layer/circle_style_layer_properties.d.ts.map +0 -1
  496. package/types/style/style_layer/custom_style_layer.d.ts +0 -163
  497. package/types/style/style_layer/custom_style_layer.d.ts.map +0 -1
  498. package/types/style/style_layer/fill_extrusion_style_layer.d.ts +0 -27
  499. package/types/style/style_layer/fill_extrusion_style_layer.d.ts.map +0 -1
  500. package/types/style/style_layer/fill_extrusion_style_layer_properties.d.ts +0 -28
  501. package/types/style/style_layer/fill_extrusion_style_layer_properties.d.ts.map +0 -1
  502. package/types/style/style_layer/fill_style_layer.d.ts +0 -26
  503. package/types/style/style_layer/fill_style_layer.d.ts.map +0 -1
  504. package/types/style/style_layer/fill_style_layer_properties.d.ts +0 -33
  505. package/types/style/style_layer/fill_style_layer_properties.d.ts.map +0 -1
  506. package/types/style/style_layer/heatmap_style_layer.d.ts +0 -27
  507. package/types/style/style_layer/heatmap_style_layer.d.ts.map +0 -1
  508. package/types/style/style_layer/heatmap_style_layer_properties.d.ts +0 -20
  509. package/types/style/style_layer/heatmap_style_layer_properties.d.ts.map +0 -1
  510. package/types/style/style_layer/hillshade_style_layer.d.ts +0 -14
  511. package/types/style/style_layer/hillshade_style_layer.d.ts.map +0 -1
  512. package/types/style/style_layer/hillshade_style_layer_properties.d.ts +0 -23
  513. package/types/style/style_layer/hillshade_style_layer_properties.d.ts.map +0 -1
  514. package/types/style/style_layer/line_style_layer.d.ts +0 -30
  515. package/types/style/style_layer/line_style_layer.d.ts.map +0 -1
  516. package/types/style/style_layer/line_style_layer_properties.d.ts +0 -49
  517. package/types/style/style_layer/line_style_layer_properties.d.ts.map +0 -1
  518. package/types/style/style_layer/raster_style_layer.d.ts +0 -13
  519. package/types/style/style_layer/raster_style_layer.d.ts.map +0 -1
  520. package/types/style/style_layer/raster_style_layer_properties.d.ts +0 -26
  521. package/types/style/style_layer/raster_style_layer_properties.d.ts.map +0 -1
  522. package/types/style/style_layer/symbol_style_layer.d.ts +0 -28
  523. package/types/style/style_layer/symbol_style_layer.d.ts.map +0 -1
  524. package/types/style/style_layer/symbol_style_layer_properties.d.ts +0 -128
  525. package/types/style/style_layer/symbol_style_layer_properties.d.ts.map +0 -1
  526. package/types/style/style_layer/typed_style_layer.d.ts +0 -9
  527. package/types/style/style_layer/typed_style_layer.d.ts.map +0 -1
  528. package/types/style/style_layer.d.ts +0 -63
  529. package/types/style/style_layer.d.ts.map +0 -1
  530. package/types/style/style_layer_index.d.ts +0 -26
  531. package/types/style/style_layer_index.d.ts.map +0 -1
  532. package/types/style/validate_style.d.ts +0 -28
  533. package/types/style/validate_style.d.ts.map +0 -1
  534. package/types/style/zoom_history.d.ts +0 -11
  535. package/types/style/zoom_history.d.ts.map +0 -1
  536. package/types/style-spec/composite.d.ts +0 -2
  537. package/types/style-spec/composite.d.ts.map +0 -1
  538. package/types/style-spec/declass.d.ts +0 -18
  539. package/types/style-spec/declass.d.ts.map +0 -1
  540. package/types/style-spec/deref.d.ts +0 -16
  541. package/types/style-spec/deref.d.ts.map +0 -1
  542. package/types/style-spec/diff.d.ts +0 -43
  543. package/types/style-spec/diff.d.ts.map +0 -1
  544. package/types/style-spec/empty.d.ts +0 -2
  545. package/types/style-spec/empty.d.ts.map +0 -1
  546. package/types/style-spec/error/parsing_error.d.ts +0 -7
  547. package/types/style-spec/error/parsing_error.d.ts.map +0 -1
  548. package/types/style-spec/error/validation_error.d.ts +0 -9
  549. package/types/style-spec/error/validation_error.d.ts.map +0 -1
  550. package/types/style-spec/expression/compound_expression.d.ts +0 -34
  551. package/types/style-spec/expression/compound_expression.d.ts.map +0 -1
  552. package/types/style-spec/expression/definitions/assertion.d.ts +0 -16
  553. package/types/style-spec/expression/definitions/assertion.d.ts.map +0 -1
  554. package/types/style-spec/expression/definitions/at.d.ts +0 -18
  555. package/types/style-spec/expression/definitions/at.d.ts.map +0 -1
  556. package/types/style-spec/expression/definitions/case.d.ts +0 -18
  557. package/types/style-spec/expression/definitions/case.d.ts.map +0 -1
  558. package/types/style-spec/expression/definitions/coalesce.d.ts +0 -16
  559. package/types/style-spec/expression/definitions/coalesce.d.ts.map +0 -1
  560. package/types/style-spec/expression/definitions/coercion.d.ts +0 -26
  561. package/types/style-spec/expression/definitions/coercion.d.ts.map +0 -1
  562. package/types/style-spec/expression/definitions/collator.d.ts +0 -18
  563. package/types/style-spec/expression/definitions/collator.d.ts.map +0 -1
  564. package/types/style-spec/expression/definitions/comparison.d.ts +0 -89
  565. package/types/style-spec/expression/definitions/comparison.d.ts.map +0 -1
  566. package/types/style-spec/expression/definitions/format.d.ts +0 -23
  567. package/types/style-spec/expression/definitions/format.d.ts.map +0 -1
  568. package/types/style-spec/expression/definitions/image.d.ts +0 -16
  569. package/types/style-spec/expression/definitions/image.d.ts.map +0 -1
  570. package/types/style-spec/expression/definitions/in.d.ts +0 -17
  571. package/types/style-spec/expression/definitions/in.d.ts.map +0 -1
  572. package/types/style-spec/expression/definitions/index.d.ts +0 -4
  573. package/types/style-spec/expression/definitions/index.d.ts.map +0 -1
  574. package/types/style-spec/expression/definitions/index_of.d.ts +0 -18
  575. package/types/style-spec/expression/definitions/index_of.d.ts.map +0 -1
  576. package/types/style-spec/expression/definitions/interpolate.d.ts +0 -31
  577. package/types/style-spec/expression/definitions/interpolate.d.ts.map +0 -1
  578. package/types/style-spec/expression/definitions/length.d.ts +0 -16
  579. package/types/style-spec/expression/definitions/length.d.ts.map +0 -1
  580. package/types/style-spec/expression/definitions/let.d.ts +0 -17
  581. package/types/style-spec/expression/definitions/let.d.ts.map +0 -1
  582. package/types/style-spec/expression/definitions/literal.d.ts +0 -16
  583. package/types/style-spec/expression/definitions/literal.d.ts.map +0 -1
  584. package/types/style-spec/expression/definitions/match.d.ts +0 -23
  585. package/types/style-spec/expression/definitions/match.d.ts.map +0 -1
  586. package/types/style-spec/expression/definitions/number_format.d.ts +0 -19
  587. package/types/style-spec/expression/definitions/number_format.d.ts.map +0 -1
  588. package/types/style-spec/expression/definitions/slice.d.ts +0 -18
  589. package/types/style-spec/expression/definitions/slice.d.ts.map +0 -1
  590. package/types/style-spec/expression/definitions/step.d.ts +0 -19
  591. package/types/style-spec/expression/definitions/step.d.ts.map +0 -1
  592. package/types/style-spec/expression/definitions/var.d.ts +0 -17
  593. package/types/style-spec/expression/definitions/var.d.ts.map +0 -1
  594. package/types/style-spec/expression/definitions/within.d.ts +0 -18
  595. package/types/style-spec/expression/definitions/within.d.ts.map +0 -1
  596. package/types/style-spec/expression/evaluation_context.d.ts +0 -26
  597. package/types/style-spec/expression/evaluation_context.d.ts.map +0 -1
  598. package/types/style-spec/expression/expression.d.ts +0 -26
  599. package/types/style-spec/expression/expression.d.ts.map +0 -1
  600. package/types/style-spec/expression/index.d.ts +0 -126
  601. package/types/style-spec/expression/index.d.ts.map +0 -1
  602. package/types/style-spec/expression/is_constant.d.ts +0 -6
  603. package/types/style-spec/expression/is_constant.d.ts.map +0 -1
  604. package/types/style-spec/expression/parsing_context.d.ts +0 -54
  605. package/types/style-spec/expression/parsing_context.d.ts.map +0 -1
  606. package/types/style-spec/expression/parsing_error.d.ts +0 -7
  607. package/types/style-spec/expression/parsing_error.d.ts.map +0 -1
  608. package/types/style-spec/expression/runtime_error.d.ts +0 -8
  609. package/types/style-spec/expression/runtime_error.d.ts.map +0 -1
  610. package/types/style-spec/expression/scope.d.ts +0 -17
  611. package/types/style-spec/expression/scope.d.ts.map +0 -1
  612. package/types/style-spec/expression/stops.d.ts +0 -8
  613. package/types/style-spec/expression/stops.d.ts.map +0 -1
  614. package/types/style-spec/expression/types/collator.d.ts +0 -23
  615. package/types/style-spec/expression/types/collator.d.ts.map +0 -1
  616. package/types/style-spec/expression/types/formatted.d.ts +0 -20
  617. package/types/style-spec/expression/types/formatted.d.ts.map +0 -1
  618. package/types/style-spec/expression/types/resolved_image.d.ts +0 -13
  619. package/types/style-spec/expression/types/resolved_image.d.ts.map +0 -1
  620. package/types/style-spec/expression/types.d.ts +0 -64
  621. package/types/style-spec/expression/types.d.ts.map +0 -1
  622. package/types/style-spec/expression/values.d.ts +0 -14
  623. package/types/style-spec/expression/values.d.ts.map +0 -1
  624. package/types/style-spec/feature_filter/convert.d.ts +0 -8
  625. package/types/style-spec/feature_filter/convert.d.ts.map +0 -1
  626. package/types/style-spec/feature_filter/index.d.ts +0 -21
  627. package/types/style-spec/feature_filter/index.d.ts.map +0 -1
  628. package/types/style-spec/format.d.ts +0 -24
  629. package/types/style-spec/format.d.ts.map +0 -1
  630. package/types/style-spec/function/convert.d.ts +0 -5
  631. package/types/style-spec/function/convert.d.ts.map +0 -1
  632. package/types/style-spec/function/index.d.ts +0 -30
  633. package/types/style-spec/function/index.d.ts.map +0 -1
  634. package/types/style-spec/group_by_layout.d.ts +0 -18
  635. package/types/style-spec/group_by_layout.d.ts.map +0 -1
  636. package/types/style-spec/migrate/expressions.d.ts +0 -8
  637. package/types/style-spec/migrate/expressions.d.ts.map +0 -1
  638. package/types/style-spec/migrate/v8.d.ts +0 -2
  639. package/types/style-spec/migrate/v8.d.ts.map +0 -1
  640. package/types/style-spec/migrate/v9.d.ts +0 -2
  641. package/types/style-spec/migrate/v9.d.ts.map +0 -1
  642. package/types/style-spec/migrate.d.ts +0 -15
  643. package/types/style-spec/migrate.d.ts.map +0 -1
  644. package/types/style-spec/read_style.d.ts +0 -2
  645. package/types/style-spec/read_style.d.ts.map +0 -1
  646. package/types/style-spec/reference/latest.d.ts +0 -3
  647. package/types/style-spec/reference/latest.d.ts.map +0 -1
  648. package/types/style-spec/style-spec.d.ts +0 -98
  649. package/types/style-spec/style-spec.d.ts.map +0 -1
  650. package/types/style-spec/types.d.ts +0 -417
  651. package/types/style-spec/types.d.ts.map +0 -1
  652. package/types/style-spec/util/color.d.ts +0 -41
  653. package/types/style-spec/util/color.d.ts.map +0 -1
  654. package/types/style-spec/util/color_spaces.d.ts +0 -41
  655. package/types/style-spec/util/color_spaces.d.ts.map +0 -1
  656. package/types/style-spec/util/deep_equal.d.ts +0 -8
  657. package/types/style-spec/util/deep_equal.d.ts.map +0 -1
  658. package/types/style-spec/util/extend.d.ts +0 -2
  659. package/types/style-spec/util/extend.d.ts.map +0 -1
  660. package/types/style-spec/util/get_type.d.ts +0 -2
  661. package/types/style-spec/util/get_type.d.ts.map +0 -1
  662. package/types/style-spec/util/interpolate.d.ts +0 -5
  663. package/types/style-spec/util/interpolate.d.ts.map +0 -1
  664. package/types/style-spec/util/properties.d.ts +0 -5
  665. package/types/style-spec/util/properties.d.ts.map +0 -1
  666. package/types/style-spec/util/ref_properties.d.ts +0 -3
  667. package/types/style-spec/util/ref_properties.d.ts.map +0 -1
  668. package/types/style-spec/util/result.d.ts +0 -16
  669. package/types/style-spec/util/result.d.ts.map +0 -1
  670. package/types/style-spec/util/unbundle_jsonlint.d.ts +0 -3
  671. package/types/style-spec/util/unbundle_jsonlint.d.ts.map +0 -1
  672. package/types/style-spec/validate/latest.d.ts +0 -3
  673. package/types/style-spec/validate/latest.d.ts.map +0 -1
  674. package/types/style-spec/validate/validate.d.ts +0 -2
  675. package/types/style-spec/validate/validate.d.ts.map +0 -1
  676. package/types/style-spec/validate/validate_array.d.ts +0 -2
  677. package/types/style-spec/validate/validate_array.d.ts.map +0 -1
  678. package/types/style-spec/validate/validate_boolean.d.ts +0 -3
  679. package/types/style-spec/validate/validate_boolean.d.ts.map +0 -1
  680. package/types/style-spec/validate/validate_color.d.ts +0 -3
  681. package/types/style-spec/validate/validate_color.d.ts.map +0 -1
  682. package/types/style-spec/validate/validate_constants.d.ts +0 -3
  683. package/types/style-spec/validate/validate_constants.d.ts.map +0 -1
  684. package/types/style-spec/validate/validate_enum.d.ts +0 -2
  685. package/types/style-spec/validate/validate_enum.d.ts.map +0 -1
  686. package/types/style-spec/validate/validate_expression.d.ts +0 -3
  687. package/types/style-spec/validate/validate_expression.d.ts.map +0 -1
  688. package/types/style-spec/validate/validate_filter.d.ts +0 -2
  689. package/types/style-spec/validate/validate_filter.d.ts.map +0 -1
  690. package/types/style-spec/validate/validate_formatted.d.ts +0 -2
  691. package/types/style-spec/validate/validate_formatted.d.ts.map +0 -1
  692. package/types/style-spec/validate/validate_function.d.ts +0 -2
  693. package/types/style-spec/validate/validate_function.d.ts.map +0 -1
  694. package/types/style-spec/validate/validate_glyphs_url.d.ts +0 -3
  695. package/types/style-spec/validate/validate_glyphs_url.d.ts.map +0 -1
  696. package/types/style-spec/validate/validate_image.d.ts +0 -2
  697. package/types/style-spec/validate/validate_image.d.ts.map +0 -1
  698. package/types/style-spec/validate/validate_layer.d.ts +0 -2
  699. package/types/style-spec/validate/validate_layer.d.ts.map +0 -1
  700. package/types/style-spec/validate/validate_layout_property.d.ts +0 -2
  701. package/types/style-spec/validate/validate_layout_property.d.ts.map +0 -1
  702. package/types/style-spec/validate/validate_light.d.ts +0 -2
  703. package/types/style-spec/validate/validate_light.d.ts.map +0 -1
  704. package/types/style-spec/validate/validate_number.d.ts +0 -3
  705. package/types/style-spec/validate/validate_number.d.ts.map +0 -1
  706. package/types/style-spec/validate/validate_object.d.ts +0 -2
  707. package/types/style-spec/validate/validate_object.d.ts.map +0 -1
  708. package/types/style-spec/validate/validate_paint_property.d.ts +0 -2
  709. package/types/style-spec/validate/validate_paint_property.d.ts.map +0 -1
  710. package/types/style-spec/validate/validate_property.d.ts +0 -2
  711. package/types/style-spec/validate/validate_property.d.ts.map +0 -1
  712. package/types/style-spec/validate/validate_source.d.ts +0 -2
  713. package/types/style-spec/validate/validate_source.d.ts.map +0 -1
  714. package/types/style-spec/validate/validate_string.d.ts +0 -3
  715. package/types/style-spec/validate/validate_string.d.ts.map +0 -1
  716. package/types/style-spec/validate_style.d.ts +0 -5333
  717. package/types/style-spec/validate_style.d.ts.map +0 -1
  718. package/types/style-spec/validate_style.min.d.ts +0 -5336
  719. package/types/style-spec/validate_style.min.d.ts.map +0 -1
  720. package/types/style-spec/visit.d.ts +0 -17
  721. package/types/style-spec/visit.d.ts.map +0 -1
  722. package/types/symbol/anchor.d.ts +0 -9
  723. package/types/symbol/anchor.d.ts.map +0 -1
  724. package/types/symbol/check_max_angle.d.ts +0 -18
  725. package/types/symbol/check_max_angle.d.ts.map +0 -1
  726. package/types/symbol/clip_line.d.ts +0 -15
  727. package/types/symbol/clip_line.d.ts.map +0 -1
  728. package/types/symbol/collision_feature.d.ts +0 -29
  729. package/types/symbol/collision_feature.d.ts.map +0 -1
  730. package/types/symbol/collision_index.d.ts +0 -57
  731. package/types/symbol/collision_index.d.ts.map +0 -1
  732. package/types/symbol/cross_tile_symbol_index.d.ts +0 -67
  733. package/types/symbol/cross_tile_symbol_index.d.ts.map +0 -1
  734. package/types/symbol/get_anchors.d.ts +0 -7
  735. package/types/symbol/get_anchors.d.ts.map +0 -1
  736. package/types/symbol/grid_index.d.ts +0 -49
  737. package/types/symbol/grid_index.d.ts.map +0 -1
  738. package/types/symbol/mergelines.d.ts +0 -3
  739. package/types/symbol/mergelines.d.ts.map +0 -1
  740. package/types/symbol/one_em.d.ts +0 -3
  741. package/types/symbol/one_em.d.ts.map +0 -1
  742. package/types/symbol/opacity_state.d.ts +0 -9
  743. package/types/symbol/opacity_state.d.ts.map +0 -1
  744. package/types/symbol/path_interpolator.d.ts +0 -13
  745. package/types/symbol/path_interpolator.d.ts.map +0 -1
  746. package/types/symbol/placement.d.ts +0 -141
  747. package/types/symbol/placement.d.ts.map +0 -1
  748. package/types/symbol/projection.d.ts +0 -37
  749. package/types/symbol/projection.d.ts.map +0 -1
  750. package/types/symbol/quads.d.ts +0 -52
  751. package/types/symbol/quads.d.ts.map +0 -1
  752. package/types/symbol/shaping.d.ts +0 -67
  753. package/types/symbol/shaping.d.ts.map +0 -1
  754. package/types/symbol/symbol_layout.d.ts +0 -26
  755. package/types/symbol/symbol_layout.d.ts.map +0 -1
  756. package/types/symbol/symbol_size.d.ts +0 -35
  757. package/types/symbol/symbol_size.d.ts.map +0 -1
  758. package/types/symbol/transform_text.d.ts +0 -5
  759. package/types/symbol/transform_text.d.ts.map +0 -1
  760. package/types/types/callback.d.ts +0 -2
  761. package/types/types/callback.d.ts.map +0 -1
  762. package/types/types/cancelable.d.ts +0 -4
  763. package/types/types/cancelable.d.ts.map +0 -1
  764. package/types/types/tilejson.d.ts +0 -16
  765. package/types/types/tilejson.d.ts.map +0 -1
  766. package/types/types/transferable.d.ts +0 -2
  767. package/types/types/transferable.d.ts.map +0 -1
  768. package/types/ui/anchor.d.ts +0 -6
  769. package/types/ui/anchor.d.ts.map +0 -1
  770. package/types/ui/camera.d.ts +0 -628
  771. package/types/ui/camera.d.ts.map +0 -1
  772. package/types/ui/control/attribution_control.d.ts +0 -41
  773. package/types/ui/control/attribution_control.d.ts.map +0 -1
  774. package/types/ui/control/fullscreen_control.d.ts +0 -36
  775. package/types/ui/control/fullscreen_control.d.ts.map +0 -1
  776. package/types/ui/control/geolocate_control.d.ts +0 -242
  777. package/types/ui/control/geolocate_control.d.ts.map +0 -1
  778. package/types/ui/control/logo_control.d.ts +0 -21
  779. package/types/ui/control/logo_control.d.ts.map +0 -1
  780. package/types/ui/control/navigation_control.d.ts +0 -63
  781. package/types/ui/control/navigation_control.d.ts.map +0 -1
  782. package/types/ui/control/scale_control.d.ts +0 -41
  783. package/types/ui/control/scale_control.d.ts.map +0 -1
  784. package/types/ui/default_locale.d.ts +0 -19
  785. package/types/ui/default_locale.d.ts.map +0 -1
  786. package/types/ui/events.d.ts +0 -1117
  787. package/types/ui/events.d.ts.map +0 -1
  788. package/types/ui/handler/box_zoom.d.ts +0 -59
  789. package/types/ui/handler/box_zoom.d.ts.map +0 -1
  790. package/types/ui/handler/click_zoom.d.ts +0 -16
  791. package/types/ui/handler/click_zoom.d.ts.map +0 -1
  792. package/types/ui/handler/handler_util.d.ts +0 -3
  793. package/types/ui/handler/handler_util.d.ts.map +0 -1
  794. package/types/ui/handler/keyboard.d.ts +0 -79
  795. package/types/ui/handler/keyboard.d.ts.map +0 -1
  796. package/types/ui/handler/map_event.d.ts +0 -44
  797. package/types/ui/handler/map_event.d.ts.map +0 -1
  798. package/types/ui/handler/mouse.d.ts +0 -46
  799. package/types/ui/handler/mouse.d.ts.map +0 -1
  800. package/types/ui/handler/scroll_zoom.d.ts +0 -97
  801. package/types/ui/handler/scroll_zoom.d.ts.map +0 -1
  802. package/types/ui/handler/shim/dblclick_zoom.d.ts +0 -41
  803. package/types/ui/handler/shim/dblclick_zoom.d.ts.map +0 -1
  804. package/types/ui/handler/shim/drag_pan.d.ts +0 -62
  805. package/types/ui/handler/shim/drag_pan.d.ts.map +0 -1
  806. package/types/ui/handler/shim/drag_rotate.d.ts +0 -47
  807. package/types/ui/handler/shim/drag_rotate.d.ts.map +0 -1
  808. package/types/ui/handler/shim/touch_zoom_rotate.d.ts +0 -71
  809. package/types/ui/handler/shim/touch_zoom_rotate.d.ts.map +0 -1
  810. package/types/ui/handler/tap_drag_zoom.d.ts +0 -23
  811. package/types/ui/handler/tap_drag_zoom.d.ts.map +0 -1
  812. package/types/ui/handler/tap_recognizer.d.ts +0 -34
  813. package/types/ui/handler/tap_recognizer.d.ts.map +0 -1
  814. package/types/ui/handler/tap_zoom.d.ts +0 -22
  815. package/types/ui/handler/tap_zoom.d.ts.map +0 -1
  816. package/types/ui/handler/touch_pan.d.ts +0 -34
  817. package/types/ui/handler/touch_pan.d.ts.map +0 -1
  818. package/types/ui/handler/touch_zoom_rotate.d.ts +0 -59
  819. package/types/ui/handler/touch_zoom_rotate.d.ts.map +0 -1
  820. package/types/ui/handler_inertia.d.ts +0 -22
  821. package/types/ui/handler_inertia.d.ts.map +0 -1
  822. package/types/ui/handler_manager.d.ts +0 -95
  823. package/types/ui/handler_manager.d.ts.map +0 -1
  824. package/types/ui/hash.d.ts +0 -15
  825. package/types/ui/hash.d.ts.map +0 -1
  826. package/types/ui/map.d.ts +0 -1758
  827. package/types/ui/map.d.ts.map +0 -1
  828. package/types/ui/marker.d.ts +0 -225
  829. package/types/ui/marker.d.ts.map +0 -1
  830. package/types/ui/popup.d.ts +0 -265
  831. package/types/ui/popup.d.ts.map +0 -1
  832. package/types/util/actor.d.ts +0 -47
  833. package/types/util/actor.d.ts.map +0 -1
  834. package/types/util/ajax.d.ts +0 -62
  835. package/types/util/ajax.d.ts.map +0 -1
  836. package/types/util/browser.d.ts +0 -18
  837. package/types/util/browser.d.ts.map +0 -1
  838. package/types/util/classify_rings.d.ts +0 -3
  839. package/types/util/classify_rings.d.ts.map +0 -1
  840. package/types/util/color_ramp.d.ts +0 -17
  841. package/types/util/color_ramp.d.ts.map +0 -1
  842. package/types/util/config.d.ts +0 -9
  843. package/types/util/config.d.ts.map +0 -1
  844. package/types/util/debug.d.ts +0 -12
  845. package/types/util/debug.d.ts.map +0 -1
  846. package/types/util/dictionary_coder.d.ts +0 -11
  847. package/types/util/dictionary_coder.d.ts.map +0 -1
  848. package/types/util/dispatcher.d.ts +0 -31
  849. package/types/util/dispatcher.d.ts.map +0 -1
  850. package/types/util/dom.d.ts +0 -23
  851. package/types/util/dom.d.ts.map +0 -1
  852. package/types/util/evented.d.ts +0 -73
  853. package/types/util/evented.d.ts.map +0 -1
  854. package/types/util/find_pole_of_inaccessibility.d.ts +0 -13
  855. package/types/util/find_pole_of_inaccessibility.d.ts.map +0 -1
  856. package/types/util/global_worker_pool.d.ts +0 -9
  857. package/types/util/global_worker_pool.d.ts.map +0 -1
  858. package/types/util/image.d.ts +0 -29
  859. package/types/util/image.d.ts.map +0 -1
  860. package/types/util/intersection_tests.d.ts +0 -14
  861. package/types/util/intersection_tests.d.ts.map +0 -1
  862. package/types/util/is_char_in_unicode_block.d.ts +0 -6
  863. package/types/util/is_char_in_unicode_block.d.ts.map +0 -1
  864. package/types/util/offscreen_canvas_supported.d.ts +0 -2
  865. package/types/util/offscreen_canvas_supported.d.ts.map +0 -1
  866. package/types/util/performance.d.ts +0 -35
  867. package/types/util/performance.d.ts.map +0 -1
  868. package/types/util/point.d.ts +0 -184
  869. package/types/util/point.d.ts.map +0 -1
  870. package/types/util/primitives.d.ts +0 -19
  871. package/types/util/primitives.d.ts.map +0 -1
  872. package/types/util/request_manager.d.ts +0 -13
  873. package/types/util/request_manager.d.ts.map +0 -1
  874. package/types/util/resolve_tokens.d.ts +0 -13
  875. package/types/util/resolve_tokens.d.ts.map +0 -1
  876. package/types/util/script_detection.d.ts +0 -47
  877. package/types/util/script_detection.d.ts.map +0 -1
  878. package/types/util/smart_wrap.d.ts +0 -20
  879. package/types/util/smart_wrap.d.ts.map +0 -1
  880. package/types/util/struct_array.d.ts +0 -124
  881. package/types/util/struct_array.d.ts.map +0 -1
  882. package/types/util/task_queue.d.ts +0 -19
  883. package/types/util/task_queue.d.ts.map +0 -1
  884. package/types/util/throttle.d.ts +0 -6
  885. package/types/util/throttle.d.ts.map +0 -1
  886. package/types/util/throttled_invoker.d.ts +0 -16
  887. package/types/util/throttled_invoker.d.ts.map +0 -1
  888. package/types/util/tile_request_cache.d.ts +0 -14
  889. package/types/util/tile_request_cache.d.ts.map +0 -1
  890. package/types/util/util.d.ts +0 -222
  891. package/types/util/util.d.ts.map +0 -1
  892. package/types/util/vectortile_to_geojson.d.ts +0 -13
  893. package/types/util/vectortile_to_geojson.d.ts.map +0 -1
  894. package/types/util/verticalize_punctuation.d.ts +0 -87
  895. package/types/util/verticalize_punctuation.d.ts.map +0 -1
  896. package/types/util/web_worker.d.ts +0 -25
  897. package/types/util/web_worker.d.ts.map +0 -1
  898. package/types/util/web_worker_transfer.d.ts +0 -39
  899. package/types/util/web_worker_transfer.d.ts.map +0 -1
  900. package/types/util/webp_supported.d.ts +0 -7
  901. package/types/util/webp_supported.d.ts.map +0 -1
  902. package/types/util/worker_pool.d.ts +0 -19
  903. package/types/util/worker_pool.d.ts.map +0 -1
@@ -0,0 +1,275 @@
1
+ 'use strict';
2
+
3
+ import * as fs from 'fs';
4
+
5
+ import spec from '../src/style-spec/reference/v8.json';
6
+
7
+ function camelCase(str: string): string {
8
+ return str.replace(/-(.)/g, function (_, x) {
9
+ return x.toUpperCase();
10
+ });
11
+ }
12
+
13
+ function pascalCase(str: string): string {
14
+ let almostCamelized = camelCase(str);
15
+ return almostCamelized[0].toUpperCase() + almostCamelized.slice(1);
16
+ }
17
+
18
+ function nativeType(property) {
19
+ switch (property.type) {
20
+ case 'boolean':
21
+ return 'boolean';
22
+ case 'number':
23
+ return 'number';
24
+ case 'string':
25
+ return 'string';
26
+ case 'enum':
27
+ return Object.keys(property.values).map(v => JSON.stringify(v)).join(' | ');
28
+ case 'color':
29
+ return 'Color';
30
+ case 'formatted':
31
+ return 'Formatted';
32
+ case 'resolvedImage':
33
+ return 'ResolvedImage';
34
+ case 'array':
35
+ if (property.length) {
36
+ return `[${new Array(property.length).fill(nativeType({type: property.value})).join(', ')}]`;
37
+ } else {
38
+ return `Array<${nativeType({type: property.value, values: property.values})}>`;
39
+ }
40
+ default: throw new Error(`unknown type for ${property.name}`)
41
+ }
42
+ }
43
+
44
+ function possiblyEvaluatedType(property) {
45
+ const propType = nativeType(property);
46
+
47
+ switch (property['property-type']) {
48
+ case 'color-ramp':
49
+ return 'ColorRampProperty';
50
+ case 'cross-faded':
51
+ return `CrossFaded<${propType}>`;
52
+ case 'cross-faded-data-driven':
53
+ return `PossiblyEvaluatedPropertyValue<CrossFaded<${propType}>>`;
54
+ case 'data-driven':
55
+ return `PossiblyEvaluatedPropertyValue<${propType}>`;
56
+ }
57
+
58
+ return propType;
59
+ }
60
+
61
+ function propertyType(property) {
62
+ switch (property['property-type']) {
63
+ case 'data-driven':
64
+ return `DataDrivenProperty<${nativeType(property)}>`;
65
+ case 'cross-faded':
66
+ return `CrossFadedProperty<${nativeType(property)}>`;
67
+ case 'cross-faded-data-driven':
68
+ return `CrossFadedDataDrivenProperty<${nativeType(property)}>`;
69
+ case 'color-ramp':
70
+ return 'ColorRampProperty';
71
+ case 'data-constant':
72
+ case 'constant':
73
+ return `DataConstantProperty<${nativeType(property)}>`;
74
+ default:
75
+ throw new Error(`unknown property-type "${property['property-type']}" for ${property.name}`);
76
+ }
77
+ }
78
+
79
+ function runtimeType(property) {
80
+ switch (property.type) {
81
+ case 'boolean':
82
+ return 'BooleanType';
83
+ case 'number':
84
+ return 'NumberType';
85
+ case 'string':
86
+ case 'enum':
87
+ return 'StringType';
88
+ case 'color':
89
+ return 'ColorType';
90
+ case 'formatted':
91
+ return 'FormattedType';
92
+ case 'Image':
93
+ return 'ImageType';
94
+ case 'array':
95
+ if (property.length) {
96
+ return `array(${runtimeType({type: property.value})}, ${property.length})`;
97
+ } else {
98
+ return `array(${runtimeType({type: property.value})})`;
99
+ }
100
+ default: throw new Error(`unknown type for ${property.name}`)
101
+ }
102
+ }
103
+
104
+ function overrides(property) {
105
+ return `{ runtimeType: ${runtimeType(property)}, getOverride: (o) => o.${camelCase(property.name)}, hasOverride: (o) => !!o.${camelCase(property.name)} }`;
106
+ }
107
+
108
+ function propertyValue(property, type) {
109
+ const propertyAsSpec = `styleSpec["${type}_${property.layerType}"]["${property.name}"] as any as StylePropertySpecification`;
110
+
111
+ switch (property['property-type']) {
112
+ case 'data-driven':
113
+ if (property.overridable) {
114
+ return `new DataDrivenProperty(${propertyAsSpec}, ${overrides(property)})`;
115
+ } else {
116
+ return `new DataDrivenProperty(${propertyAsSpec})`;
117
+ }
118
+ case 'cross-faded':
119
+ return `new CrossFadedProperty(${propertyAsSpec})`;
120
+ case 'cross-faded-data-driven':
121
+ return `new CrossFadedDataDrivenProperty(${propertyAsSpec})`;
122
+ case 'color-ramp':
123
+ return `new ColorRampProperty(${propertyAsSpec})`;
124
+ case 'data-constant':
125
+ case 'constant':
126
+ return `new DataConstantProperty(${propertyAsSpec})`;
127
+ default:
128
+ throw new Error(`unknown property-type "${property['property-type']}" for ${property.name}`);
129
+ }
130
+ }
131
+
132
+ const layers = Object.keys(spec.layer.type.values).map((type) => {
133
+ const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
134
+ if (name !== 'visibility') {
135
+ spec[`layout_${type}`][name].name = name;
136
+ spec[`layout_${type}`][name].layerType = type;
137
+ memo.push(spec[`layout_${type}`][name]);
138
+ }
139
+ return memo;
140
+ }, []);
141
+
142
+ const paintProperties = Object.keys(spec[`paint_${type}`]).reduce((memo, name) => {
143
+ spec[`paint_${type}`][name].name = name;
144
+ spec[`paint_${type}`][name].layerType = type;
145
+ memo.push(spec[`paint_${type}`][name]);
146
+ return memo;
147
+ }, []);
148
+
149
+ return { type, layoutProperties, paintProperties };
150
+ });
151
+
152
+ function emitlayerProperties(locals) {
153
+ const output = [];
154
+ const layerType = pascalCase(locals.type);
155
+ const {
156
+ layoutProperties,
157
+ paintProperties
158
+ } = locals;
159
+
160
+ output.push(
161
+ `// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.
162
+ /* eslint-disable */
163
+
164
+ import styleSpec from '../../style-spec/reference/latest';
165
+
166
+ import {
167
+ Properties,
168
+ DataConstantProperty,
169
+ DataDrivenProperty,
170
+ CrossFadedDataDrivenProperty,
171
+ CrossFadedProperty,
172
+ ColorRampProperty,
173
+ PossiblyEvaluatedPropertyValue,
174
+ CrossFaded
175
+ } from '../properties';
176
+
177
+ import type Color from '../../style-spec/util/color';
178
+
179
+ import type Formatted from '../../style-spec/expression/types/formatted';
180
+
181
+ import type ResolvedImage from '../../style-spec/expression/types/resolved_image';
182
+ import {StylePropertySpecification} from '../../style-spec/style-spec';
183
+ `);
184
+
185
+ const overridables = paintProperties.filter(p => p.overridable);
186
+ if (overridables.length) {
187
+ output.push(
188
+ `import {
189
+ ${overridables.reduce((imports, prop) => { imports.push(runtimeType(prop)); return imports; }, []).join(',\n ')}
190
+ } from '../../style-spec/expression/types';
191
+ `);
192
+ }
193
+
194
+ if (layoutProperties.length) {
195
+ output.push(
196
+ `export type ${layerType}LayoutProps = {`);
197
+
198
+ for (const property of layoutProperties) {
199
+ output.push(
200
+ ` "${property.name}": ${propertyType(property)},`);
201
+ }
202
+
203
+ output.push(
204
+ `};
205
+
206
+ export type ${layerType}LayoutPropsPossiblyEvaluated = {`);
207
+
208
+ for (const property of layoutProperties) {
209
+ output.push(
210
+ ` "${property.name}": ${possiblyEvaluatedType(property)},`);
211
+ }
212
+
213
+ output.push(
214
+ `};
215
+
216
+ const layout: Properties<${layerType}LayoutProps> = new Properties({`);
217
+
218
+ for (const property of layoutProperties) {
219
+ output.push(
220
+ ` "${property.name}": ${propertyValue(property, 'layout')},`);
221
+ }
222
+
223
+ output.push(
224
+ '});');
225
+ }
226
+
227
+ if (paintProperties.length) {
228
+ output.push(
229
+ `
230
+ export type ${layerType}PaintProps = {`);
231
+
232
+ for (const property of paintProperties) {
233
+ output.push(
234
+ ` "${property.name}": ${propertyType(property)},`);
235
+ }
236
+
237
+ output.push(
238
+ `};
239
+
240
+ export type ${layerType}PaintPropsPossiblyEvaluated = {`);
241
+
242
+ for (const property of paintProperties) {
243
+ output.push(
244
+ ` "${property.name}": ${possiblyEvaluatedType(property)},`);
245
+ }
246
+
247
+ output.push(
248
+ '};');
249
+ } else {
250
+ output.push(
251
+ `export type ${layerType}PaintProps = {};`);
252
+ }
253
+
254
+ output.push(
255
+ `
256
+ const paint: Properties<${layerType}PaintProps> = new Properties({`);
257
+
258
+ for (const property of paintProperties) {
259
+ output.push(
260
+ ` "${property.name}": ${propertyValue(property, 'paint')},`);
261
+ }
262
+
263
+ output.push(
264
+ `});
265
+
266
+ export default ({ paint${layoutProperties.length ? ', layout' : ''} } as {
267
+ paint: Properties<${layerType}PaintProps>${layoutProperties.length ? ',\n layout: Properties<' + layerType + 'LayoutProps>' : ''}
268
+ });`);
269
+
270
+ return output.join('\n');
271
+ }
272
+
273
+ for (const layer of layers) {
274
+ fs.writeFileSync(`src/style/style_layer/${layer.type.replace('-', '_')}_style_layer_properties.ts`, emitlayerProperties(layer))
275
+ }
@@ -0,0 +1,209 @@
1
+ import * as fs from 'fs';
2
+ import * as properties from '../src/style-spec/util/properties';
3
+
4
+ import spec from '../src/style-spec/reference/v8.json';
5
+
6
+ function unionType(values) {
7
+ if (Array.isArray(values)) {
8
+ return values.map(v => JSON.stringify(v)).join(' | ');
9
+ } else {
10
+ return Object.keys(values).map(v => JSON.stringify(v)).join(' | ');
11
+ }
12
+ }
13
+
14
+ function propertyType(property) {
15
+ if (typeof property.type === 'function') {
16
+ return property.type();
17
+ }
18
+
19
+ const baseType = (() => {
20
+ switch (property.type) {
21
+ case 'string':
22
+ case 'number':
23
+ case 'boolean':
24
+ return property.type;
25
+ case 'enum':
26
+ return unionType(property.values);
27
+ case 'array':
28
+ const elementType = propertyType(typeof property.value === 'string' ? {type: property.value, values: property.values} : property.value)
29
+ if (property.length) {
30
+ return `[${Array(property.length).fill(elementType).join(', ')}]`;
31
+ } else {
32
+ return `Array<${elementType}>`;
33
+ }
34
+ case 'light':
35
+ return 'LightSpecification';
36
+ case 'sources':
37
+ return '{[_: string]: SourceSpecification}';
38
+ case '*':
39
+ return 'unknown';
40
+ default:
41
+ return `${property.type.slice(0, 1).toUpperCase()}${property.type.slice(1)}Specification`;
42
+ }
43
+ })();
44
+
45
+ if (properties.supportsPropertyExpression(property)) {
46
+ return `DataDrivenPropertyValueSpecification<${baseType}>`;
47
+ } else if (properties.supportsZoomExpression(property)) {
48
+ return `PropertyValueSpecification<${baseType}>`;
49
+ } else if (property.expression) {
50
+ return 'ExpressionSpecificationArray';
51
+ } else {
52
+ return baseType;
53
+ }
54
+ }
55
+
56
+ function propertyDeclaration(key, property) {
57
+ return `"${key}"${property.required ? '' : '?'}: ${propertyType(property)}`;
58
+ }
59
+
60
+ function objectDeclaration(key, properties) {
61
+ return `export type ${key} = ${objectType(properties, '')};`;
62
+ }
63
+
64
+ function objectType(properties, indent) {
65
+ return `{
66
+ ${Object.keys(properties)
67
+ .filter(k => k !== '*')
68
+ .map(k => ` ${indent}${propertyDeclaration(k, properties[k])}`)
69
+ .join(',\n')}
70
+ ${indent}}`
71
+ }
72
+
73
+ function sourceTypeName(key) {
74
+ return key.replace(/source_(.)(.*)/, (_, _1, _2) => `${_1.toUpperCase()}${_2}SourceSpecification`)
75
+ .replace(/_dem/, 'DEM')
76
+ .replace(/Geojson/, 'GeoJSON');
77
+ }
78
+
79
+ function layerTypeName(key) {
80
+ return key.split('-').map(k => k.replace(/(.)(.*)/, (_, _1, _2) => `${_1.toUpperCase()}${_2}`)).concat('LayerSpecification').join('');
81
+ }
82
+
83
+ function layerType(key) {
84
+ const layer = spec.layer as any;
85
+
86
+ layer.type = {
87
+ type: 'enum',
88
+ values: [key],
89
+ required: true
90
+ };
91
+
92
+ delete layer.ref;
93
+ delete layer['paint.*'];
94
+
95
+ layer.paint.type = () => {
96
+ return objectType(spec[`paint_${key}`], ' ');
97
+ };
98
+
99
+ layer.layout.type = () => {
100
+ return objectType(spec[`layout_${key}`], ' ');
101
+ };
102
+
103
+ if (key === 'background') {
104
+ delete layer.source;
105
+ delete layer['source-layer'];
106
+ delete layer.filter;
107
+ } else {
108
+ layer.source.required = true;
109
+ }
110
+
111
+ return objectDeclaration(layerTypeName(key), layer);
112
+ }
113
+
114
+ const layerTypes = Object.keys(spec.layer.type.values);
115
+
116
+ fs.writeFileSync('src/style-spec/types.ts',
117
+ `// Generated code; do not edit. Edit build/generate-style-spec.ts instead.
118
+ /* eslint-disable */
119
+
120
+ export type ColorSpecification = string;
121
+
122
+ export type FormattedSpecification = string;
123
+
124
+ export type ResolvedImageSpecification = string;
125
+
126
+ export type PromoteIdSpecification = {[_: string]: string} | string;
127
+
128
+ export type FilterSpecificationInputType = string | number | boolean;
129
+ export type FilterSpecification =
130
+ // Lookup
131
+ | ['at', number, (number |string)[]]
132
+ | ['get', string, Record<string, unknown>?]
133
+ | ['has', string, Record<string, unknown>?]
134
+ | ['in', ...FilterSpecificationInputType[], FilterSpecificationInputType | FilterSpecificationInputType[]]
135
+ | ['index-of', FilterSpecificationInputType, FilterSpecificationInputType | FilterSpecificationInputType[]]
136
+ | ['length', string | string[]]
137
+ | ['slice', string | string[], number]
138
+ // Decision
139
+ | ['!', FilterSpecification]
140
+ | ['!=', string | FilterSpecification, FilterSpecificationInputType]
141
+ | ['<', string | FilterSpecification, FilterSpecificationInputType]
142
+ | ['<=', string | FilterSpecification, FilterSpecificationInputType]
143
+ | ['==', string | FilterSpecification, FilterSpecificationInputType]
144
+ | ['>', string | FilterSpecification, FilterSpecificationInputType]
145
+ | ['>=', string | FilterSpecification, FilterSpecificationInputType]
146
+ | ["all", ...FilterSpecification[], FilterSpecificationInputType]
147
+ | ["any", ...FilterSpecification[], FilterSpecificationInputType]
148
+ | ["case", ...FilterSpecification[], FilterSpecificationInputType]
149
+ | ["coalesce", ...FilterSpecification[], FilterSpecificationInputType]
150
+ | ["match", ...FilterSpecification[], FilterSpecificationInputType]
151
+ | ["within", ...FilterSpecification[], FilterSpecificationInputType]
152
+ // Used in convert.ts
153
+ | ["!in", ...FilterSpecification[], FilterSpecificationInputType]
154
+ | ["!has", ...FilterSpecification[], FilterSpecificationInputType]
155
+ | ["none", ...FilterSpecification[], FilterSpecificationInputType]
156
+ // Fallbak for others
157
+ | Array<string | FilterSpecification>
158
+
159
+ export type TransitionSpecification = {
160
+ duration?: number,
161
+ delay?: number
162
+ };
163
+
164
+ // Note: doesn't capture interpolatable vs. non-interpolatable types.
165
+
166
+ export type CameraFunctionSpecification<T> =
167
+ { type: 'exponential', stops: Array<[number, T]> }
168
+ | { type: 'interval', stops: Array<[number, T]> };
169
+
170
+ export type SourceFunctionSpecification<T> =
171
+ { type: 'exponential', stops: Array<[number, T]>, property: string, default?: T }
172
+ | { type: 'interval', stops: Array<[number, T]>, property: string, default?: T }
173
+ | { type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T }
174
+ | { type: 'identity', property: string, default?: T };
175
+
176
+ export type CompositeFunctionSpecification<T> =
177
+ { type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
178
+ | { type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
179
+ | { type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T };
180
+
181
+ export type ExpressionSpecificationArray = Array<unknown>;
182
+
183
+ export type PropertyValueSpecification<T> =
184
+ T
185
+ | CameraFunctionSpecification<T>
186
+ | ExpressionSpecificationArray;
187
+
188
+ export type DataDrivenPropertyValueSpecification<T> =
189
+ T
190
+ | CameraFunctionSpecification<T>
191
+ | SourceFunctionSpecification<T>
192
+ | CompositeFunctionSpecification<T>
193
+ | ExpressionSpecificationArray;
194
+
195
+ ${objectDeclaration('StyleSpecification', spec.$root)}
196
+
197
+ ${objectDeclaration('LightSpecification', spec.light)}
198
+
199
+ ${spec.source.map(key => objectDeclaration(sourceTypeName(key), spec[key])).join('\n\n')}
200
+
201
+ export type SourceSpecification =
202
+ ${spec.source.map(key => ` | ${sourceTypeName(key)}`).join('\n')}
203
+
204
+ ${layerTypes.map(key => layerType(key)).join('\n\n')}
205
+
206
+ export type LayerSpecification =
207
+ ${layerTypes.map(key => ` | ${layerTypeName(key)}`).join('\n')};
208
+
209
+ `);
@@ -0,0 +1,12 @@
1
+ export default function glsl_to_js(code, minify) {
2
+ if (minify) {
3
+ code = code.trim() // strip whitespace at the start/end
4
+ .replace(/\s*\/\/[^\n]*\n/g, '\n') // strip double-slash comments
5
+ .replace(/\n+/g, '\n') // collapse multi line breaks
6
+ .replace(/\n\s+/g, '\n') // strip identation
7
+ .replace(/\s?([+-\/*=,])\s?/g, '$1') // strip whitespace around operators
8
+ .replace(/([;\(\),\{\}])\n(?=[^#])/g, '$1'); // strip more line breaks
9
+
10
+ }
11
+ return `export default ${JSON.stringify(code)};`;
12
+ }
@@ -0,0 +1,52 @@
1
+ import fs from 'fs';
2
+ import glob from 'glob';
3
+ import child_process from 'child_process';
4
+ import glsl_to_js from './glsl_to_js.js';
5
+
6
+ let args = process.argv.slice(2);
7
+ let outputBaseDir = args[0];
8
+ let minify = args[1];
9
+
10
+ console.log(`Copying glsl files to ${outputBaseDir}, minify: ${minify}`);
11
+
12
+ /**
13
+ * This script is intended to copy the glsl file to the compilation output folder,
14
+ * change their extension to .js and export the shaders as strings in javascript.
15
+ * It will also minify them a bit if needed and change the extension to .js
16
+ * After that it will create a combined typescript definition file and manipulate it a bit
17
+ * It will also create a simple package.json file to allow importing this package in webpack
18
+ */
19
+
20
+ glob("./src/**/*.glsl", null, (err, files) => {
21
+ for (let file of files) {
22
+ let code = fs.readFileSync(file, 'utf8');
23
+ let content = glsl_to_js(code, minify);
24
+ let fileName = outputBaseDir + '/' + file.split('/').splice(-1) + ".js";
25
+ fs.writeFileSync(fileName, content);
26
+ }
27
+ console.log(`Finished converting ${files.length} glsl files`);
28
+ });
29
+
30
+ if (!fs.existsSync("dist")) {
31
+ fs.mkdirSync("dist");
32
+ }
33
+
34
+ console.log(`Starting bundling types`);
35
+ const outputFile = "./dist/maplibre-gl.d.ts";
36
+ child_process.execSync(`dts-bundle-generator --no-check --umd-module-name=maplibregl -o ${outputFile} ./src/index.ts`);
37
+ let types = fs.readFileSync(outputFile, 'utf8');
38
+ // Classes are not exported but should be since this is exported as UMD - fixing...
39
+ types = types.replace(/declare class/g, "export declare class");
40
+ // Missing vector-tile types that are added to this file too
41
+ let file = fs.readFileSync("./src/types/packages-types/vector-tile/index.d.ts", 'utf8');
42
+ let lines = file.split("\n").filter(Boolean);
43
+ lines.pop(); // last } is removed too.
44
+ types = lines.join("\n") + "\n" + types;
45
+ // remove imports of vector-tile and declare module lines
46
+ types = types.split("\n")
47
+ .filter(l => !l.includes("@mapbox/vector-tile"))
48
+ .join("\n");
49
+ fs.writeFileSync(outputFile, types);
50
+ console.log(`Finished bundling types`);
51
+
52
+ fs.writeFileSync("./dist/package.json", '{ "type": "commonjs" }');
@@ -0,0 +1,62 @@
1
+ # Build Scripts
2
+ This folder holds common build scripts accessed via the various `npm run` commands.
3
+
4
+ ## Bundeling all the code
5
+
6
+ The bundeling process can be split into several steps:
7
+
8
+ `npx run tsc`
9
+ This command will transpile all the typescript files into javascript files and place them in the `rollup/build` folder.
10
+
11
+ `npm run build-glsl`
12
+ This command will copy all the shader files to the build output and convert the shaders into strings that can be imported to javascript.
13
+
14
+ `npm run build-css`
15
+ This command will compile the css code and create the css file.
16
+
17
+ `npm run build-prod` or `npm run build-prod-min` or `npm run build-dev`
18
+ These commands will use rollup to bundle the code. This is where the magic happens and uses some files in this folder.
19
+
20
+ `banner.js` is used to create a banner at the beginning of the output file
21
+
22
+ `rollup_plugins.js` is used to define common plugins for rollup configurations
23
+
24
+ `rollup_plugin_minify_style_spec.js` is used to specify the plugin used in style spec bundeling
25
+
26
+ In the `rollup` folder there are some files that are used as linking files as they link to other files for rollup to pick when bundling.
27
+ Rollup also has a configuration in the `package.json` file to signal which files it needs to replace when bundling for the browser, this is where `web_worker_replacement.js` is used - as it replaces the node mocking of web worker that is present in the source code.
28
+
29
+ Rollup is generating 3 files throughout the process of bundling:
30
+
31
+ `index.js` a file containing all the code that will run in the main thread.
32
+
33
+ `shared.js` a file containing all the code shared between the main and worker code.
34
+
35
+ `worker.js` a file containing all the code the will run in the worker threads.
36
+
37
+ These 3 files are then referenced and used by the `bundle_prelude.js` file. It allows loading the web wroker code automatically in web workers without any extra effort from someone who would like to use the library, i.e. it simply works.
38
+
39
+ ### check-bundle-size.js
40
+ This file is used by CI to make sure the bundle size is kept constant
41
+
42
+ <hr>
43
+
44
+ ### `npm run codegen`
45
+ The `codegen` command runs the following three scripts, to update the corresponding code files based on the `v8.json` style source, and other data files. Contributers should run this command manually when the underlying style data is modified. The generated code files are then commited to the repo.
46
+ #### generate-struct-arrays.ts
47
+ Generates `data/array_types.ts`, which consists of:
48
+ - `StructArrayLayout_*` subclasses, one for each underlying memory layout
49
+ - Named exports mapping each conceptual array type (e.g., `CircleLayoutArray`) to its corresponding `StructArrayLayout` class
50
+ - Specific named `StructArray` subclasses, when type-specific struct accessors are needed (e.g., `CollisionBoxArray`)
51
+ #### generate-style-code.ts
52
+ Generates the various `style/style_layer/[layer type]_style_layer_properties.ts` code files based on the content of `v8.json`. These files provide the type signatures for the paint and layout properties for each type of style layer.
53
+ #### generate-style-spec.ts
54
+ Generates `style-spec/types.ts` based on the content of `v8.json`. This provides the type signatures for a style specification (sources, layers, etc.).
55
+ <hr>
56
+
57
+ ### Generate Release Nodes
58
+ The following files are being used to generate release notes:
59
+
60
+ `release-notes.js` Used to generate release notes when releasing a new version
61
+
62
+ `release-notes.md.ejs` Used for the generation as a template file
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const fs = require('fs');
4
- const execSync = require('child_process').execSync;
5
- const ejs = require('ejs');
6
- const _ = require('lodash');
7
- const semver = require('semver');
3
+ import * as fs from 'fs';
4
+ import {execSync} from 'child_process';
5
+ import * as ejs from 'ejs';
6
+ import _ from 'lodash';
7
+ import semver from 'semver';
8
8
 
9
9
  const changelogPath = 'CHANGELOG.md';
10
10
  const changelog = fs.readFileSync(changelogPath, 'utf8');
@@ -36,6 +36,7 @@ let previousVersion = semver.maxSatisfying(gitTags, "<" + currentVersion, { incl
36
36
  const regex = /^## (\d+\.\d+\.\d+).*?\n(.+?)(?=\n^## \d+\.\d+\.\d+.*?\n)/gms;
37
37
 
38
38
  let releaseNotes = [];
39
+ let match;
39
40
  // eslint-disable-next-line no-cond-assign
40
41
  while (match = regex.exec(changelog)) {
41
42
  releaseNotes.push({