@windycom/plugin-devtools 1.0.2-beta.2 → 1.0.5

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 (199) hide show
  1. package/README.md +5 -0
  2. package/index.mjs +3 -2
  3. package/package.json +1 -1
  4. package/publishExamples.sh +1 -1
  5. package/types/client/BindedDropDown.d.ts +14 -0
  6. package/types/{Calendar.d.ts → client/Calendar.d.ts} +4 -4
  7. package/types/client/CanvasLayer.d.ts +1 -0
  8. package/types/{Color.d.ts → client/Color.d.ts} +3 -3
  9. package/types/{DataTiler.d.ts → client/DataTiler.d.ts} +2 -2
  10. package/types/client/Detail1hCheckbox.d.ts +4 -0
  11. package/types/{ExternalSveltePlugin.d.ts → client/ExternalSveltePlugin.d.ts} +2 -1
  12. package/types/{GlObj.d.ts → client/GlObj.d.ts} +1 -1
  13. package/types/{Layer.d.ts → client/Layer.d.ts} +11 -11
  14. package/types/{Metric.d.ts → client/Metric.d.ts} +5 -5
  15. package/types/{Plugin.d.ts → client/Plugin.d.ts} +4 -2
  16. package/types/{Product.d.ts → client/Product.d.ts} +8 -8
  17. package/types/{ProductSwitch.d.ts → client/ProductSwitch.d.ts} +1 -1
  18. package/types/{Renderer.d.ts → client/Renderer.d.ts} +4 -4
  19. package/types/{Webcams.d.ts → client/Webcams.d.ts} +4 -4
  20. package/types/client/components.d.ts +1 -0
  21. package/types/client/d.ts.files/Calendar.d.ts +87 -0
  22. package/types/client/d.ts.files/CanvasLayer.d.ts +70 -0
  23. package/types/client/d.ts.files/Color.d.ts +82 -0
  24. package/types/client/d.ts.files/DataTiler.d.ts +45 -0
  25. package/types/client/d.ts.files/GlObj.d.ts +92 -0
  26. package/types/client/d.ts.files/LabelsLayer.d.ts +51 -0
  27. package/types/client/d.ts.files/LandMask.d.ts +17 -0
  28. package/types/client/d.ts.files/Layer.d.ts +184 -0
  29. package/types/client/d.ts.files/Metric.d.ts +192 -0
  30. package/types/client/d.ts.files/PoisOverlay.d.ts +27 -0
  31. package/types/client/d.ts.files/Product.d.ts +37 -0
  32. package/types/client/d.ts.files/Renderer.d.ts +23 -0
  33. package/types/client/d.ts.files/TileLayerCanvas.d.ts +78 -0
  34. package/types/client/d.ts.files/TileLayerMultiPatch.d.ts +13 -0
  35. package/types/client/d.ts.files/Webcams.d.ts +160 -0
  36. package/types/client/d.ts.files/broadcast.d.ts +177 -0
  37. package/types/client/d.ts.files/dataSpecifications.d.ts +943 -0
  38. package/types/client/d.ts.files/errorLogger.d.ts +35 -0
  39. package/types/client/d.ts.files/format.d.ts +48 -0
  40. package/types/client/d.ts.files/http.d.ts +87 -0
  41. package/types/client/d.ts.files/incomingMessages.d.ts +88 -0
  42. package/types/client/d.ts.files/lib.d.ts +74 -0
  43. package/types/client/d.ts.files/notifications.d.ts +39 -0
  44. package/types/client/d.ts.files/outgoingMessages.d.ts +75 -0
  45. package/types/client/d.ts.files/plugin-params.d.ts +236 -0
  46. package/types/client/d.ts.files/plugins.d.ts +132 -0
  47. package/types/client/d.ts.files/pois.d.ts +11 -0
  48. package/types/client/d.ts.files/products.d.ts +44 -0
  49. package/types/client/d.ts.files/rootScope.d.ts +43 -0
  50. package/types/client/d.ts.files/satellite.d.ts +50 -0
  51. package/types/client/d.ts.files/singleclick.d.ts +31 -0
  52. package/types/client/d.ts.files/storage.d.ts +120 -0
  53. package/types/client/d.ts.files/store.d.ts +61 -0
  54. package/types/client/d.ts.files/tileInterpolator.d.ts +35 -0
  55. package/types/client/d.ts.files/trans.d.ts +55 -0
  56. package/types/client/d.ts.files/user.d.ts +58 -0
  57. package/types/{dataSpecifications.d.ts → client/dataSpecifications.d.ts} +1 -1
  58. package/types/client/debugPremiumIssues.d.ts +22 -0
  59. package/types/client/embed2.d.ts +92 -0
  60. package/types/client/errorLogger.d.ts +11 -0
  61. package/types/client/externalPlugins.d.ts +6 -0
  62. package/types/{fetch.d.ts → client/fetch.d.ts} +30 -3
  63. package/types/{format.d.ts → client/format.d.ts} +2 -2
  64. package/types/{geolocation.d.ts → client/geolocation.d.ts} +11 -3
  65. package/types/client/globals.d.ts +3 -0
  66. package/types/{http.d.ts → client/http.d.ts} +2 -2
  67. package/types/client/index.d.ts +1 -0
  68. package/types/client/keyboard.d.ts +1 -0
  69. package/types/client/lib.d.ts +112 -0
  70. package/types/client/libHtml.d.ts +2 -0
  71. package/types/client/loadersUI.d.ts +1 -0
  72. package/types/client/mapGlobeCtrl.d.ts +1 -0
  73. package/types/client/mobile.d.ts +138 -0
  74. package/types/{models.d.ts → client/models.d.ts} +1 -1
  75. package/types/client/nativeStorage.d.ts +17 -0
  76. package/types/{notifications.d.ts → client/notifications.d.ts} +6 -5
  77. package/types/client/ogTags.d.ts +22 -0
  78. package/types/client/params.d.ts +2 -0
  79. package/types/{plugins.d.ts → client/plugins.d.ts} +1 -1
  80. package/types/client/pluginsCtrl.d.ts +7 -0
  81. package/types/{pois.d.ts → client/pois.d.ts} +1 -1
  82. package/types/client/products.d.ts +3 -0
  83. package/types/client/pushNotifications.d.ts +1 -0
  84. package/types/{renderers.d.ts → client/renderers.d.ts} +5 -5
  85. package/types/{reverseName.d.ts → client/reverseName.d.ts} +12 -0
  86. package/types/{rootScope.d.ts → client/rootScope.d.ts} +4 -4
  87. package/types/client/serviceWorker.d.ts +1 -0
  88. package/types/{singleclick.d.ts → client/singleclick.d.ts} +2 -2
  89. package/types/{storage.d.ts → client/storage.d.ts} +1 -1
  90. package/types/{store.d.ts → client/store.d.ts} +2 -2
  91. package/types/client/swDownloader.d.ts +16 -0
  92. package/types/client/swProxy.d.ts +4 -0
  93. package/types/client/swUtils.d.ts +16 -0
  94. package/types/{tileInterpolator.d.ts → client/tileInterpolator.d.ts} +3 -3
  95. package/types/client/timeAnimation.d.ts +1 -0
  96. package/types/{trans.d.ts → client/trans.d.ts} +3 -3
  97. package/types/client/typeGuards.d.ts +2 -0
  98. package/types/{user.d.ts → client/user.d.ts} +3 -3
  99. package/types/{utils.d.ts → client/utils.d.ts} +1 -1
  100. package/types/client/visibility.d.ts +5 -0
  101. package/types/interfaces.d.ts +54 -10
  102. package/types/leaflet.d.ts +2 -15
  103. package/types/glsl-modules.d.ts +0 -26
  104. package/types/index.d.ts +0 -1
  105. package/types/node-modules.d.ts +0 -16
  106. package/types/products.d.ts +0 -3
  107. package/types/ts-interfaces.d.ts +0 -66
  108. package/types/ts-types.d.ts +0 -43
  109. package/types/variables.d.ts +0 -238
  110. package/types/windy-modules.d.ts +0 -7
  111. /package/types/{AromeProduct.d.ts → client/AromeProduct.d.ts} +0 -0
  112. /package/types/{Bar.d.ts → client/Bar.d.ts} +0 -0
  113. /package/types/{BindedBar.d.ts → client/BindedBar.d.ts} +0 -0
  114. /package/types/{BindedCheckbox.d.ts → client/BindedCheckbox.d.ts} +0 -0
  115. /package/types/{BindedSwitch.d.ts → client/BindedSwitch.d.ts} +0 -0
  116. /package/types/{BottomSlide.d.ts → client/BottomSlide.d.ts} +0 -0
  117. /package/types/{BottomTagPlugin.d.ts → client/BottomTagPlugin.d.ts} +0 -0
  118. /package/types/{ClickHandler.d.ts → client/ClickHandler.d.ts} +0 -0
  119. /package/types/{Drag.d.ts → client/Drag.d.ts} +0 -0
  120. /package/types/{DraggableDiv.d.ts → client/DraggableDiv.d.ts} +0 -0
  121. /package/types/{DropDown.d.ts → client/DropDown.d.ts} +0 -0
  122. /package/types/{EcmwfAnalysisProduct.d.ts → client/EcmwfAnalysisProduct.d.ts} +0 -0
  123. /package/types/{EcmwfProduct.d.ts → client/EcmwfProduct.d.ts} +0 -0
  124. /package/types/{Evented.d.ts → client/Evented.d.ts} +0 -0
  125. /package/types/{GhostBox.d.ts → client/GhostBox.d.ts} +0 -0
  126. /package/types/{HrrrProducts.d.ts → client/HrrrProducts.d.ts} +0 -0
  127. /package/types/{IconProducts.d.ts → client/IconProducts.d.ts} +0 -0
  128. /package/types/{LabelsLayer.d.ts → client/LabelsLayer.d.ts} +0 -0
  129. /package/types/{LandMask.d.ts → client/LandMask.d.ts} +0 -0
  130. /package/types/{Legend.d.ts → client/Legend.d.ts} +0 -0
  131. /package/types/{LongTap.d.ts → client/LongTap.d.ts} +0 -0
  132. /package/types/{MetricClasses.d.ts → client/MetricClasses.d.ts} +0 -0
  133. /package/types/{MobileCalendar.d.ts → client/MobileCalendar.d.ts} +0 -0
  134. /package/types/{NamProducts.d.ts → client/NamProducts.d.ts} +0 -0
  135. /package/types/{OfflineMessagesClasses.d.ts → client/OfflineMessagesClasses.d.ts} +0 -0
  136. /package/types/{Overlay.d.ts → client/Overlay.d.ts} +0 -0
  137. /package/types/{OverlayClasses.d.ts → client/OverlayClasses.d.ts} +0 -0
  138. /package/types/{Particles.d.ts → client/Particles.d.ts} +0 -0
  139. /package/types/{SatelliteProduct.d.ts → client/SatelliteProduct.d.ts} +0 -0
  140. /package/types/{Scrollable.d.ts → client/Scrollable.d.ts} +0 -0
  141. /package/types/{StaticProduct.d.ts → client/StaticProduct.d.ts} +0 -0
  142. /package/types/{SveltePanePlugin.d.ts → client/SveltePanePlugin.d.ts} +0 -0
  143. /package/types/{SveltePlugin.d.ts → client/SveltePlugin.d.ts} +0 -0
  144. /package/types/{Swipe.d.ts → client/Swipe.d.ts} +0 -0
  145. /package/types/{Switch.d.ts → client/Switch.d.ts} +0 -0
  146. /package/types/{TagPlugin.d.ts → client/TagPlugin.d.ts} +0 -0
  147. /package/types/{TileLayer.d.ts → client/TileLayer.d.ts} +0 -0
  148. /package/types/{TileLayerCanvas.d.ts → client/TileLayerCanvas.d.ts} +0 -0
  149. /package/types/{TileLayerMultiPatch.d.ts → client/TileLayerMultiPatch.d.ts} +0 -0
  150. /package/types/{TimestampBar.d.ts → client/TimestampBar.d.ts} +0 -0
  151. /package/types/{Window.d.ts → client/Window.d.ts} +0 -0
  152. /package/types/{WindowPlugin.d.ts → client/WindowPlugin.d.ts} +0 -0
  153. /package/types/{baseMap.d.ts → client/baseMap.d.ts} +0 -0
  154. /package/types/{broadcast.d.ts → client/broadcast.d.ts} +0 -0
  155. /package/types/{cityLabels.d.ts → client/cityLabels.d.ts} +0 -0
  156. /package/types/{cloudSync.d.ts → client/cloudSync.d.ts} +0 -0
  157. /package/types/{colors.d.ts → client/colors.d.ts} +0 -0
  158. /package/types/{connection.d.ts → client/connection.d.ts} +0 -0
  159. /package/types/{css.d.ts → client/css.d.ts} +0 -0
  160. /package/types/{dataLoader.d.ts → client/dataLoader.d.ts} +0 -0
  161. /package/types/{detectDevice.d.ts → client/detectDevice.d.ts} +0 -0
  162. /package/types/{device.d.ts → client/device.d.ts} +0 -0
  163. /package/types/{deviceLogging.d.ts → client/deviceLogging.d.ts} +0 -0
  164. /package/types/{Favs.d.ts → client/favs.d.ts} +0 -0
  165. /package/types/{ga.d.ts → client/ga.d.ts} +0 -0
  166. /package/types/{glTileRender.d.ts → client/glTileRender.d.ts} +0 -0
  167. /package/types/{hp.d.ts → client/hp.d.ts} +0 -0
  168. /package/types/{interpolator.d.ts → client/interpolator.d.ts} +0 -0
  169. /package/types/{latestBroadcasts.d.ts → client/latestBroadcasts.d.ts} +0 -0
  170. /package/types/{layers.d.ts → client/layers.d.ts} +0 -0
  171. /package/types/{legends.d.ts → client/legends.d.ts} +0 -0
  172. /package/types/{levelUtils.d.ts → client/levelUtils.d.ts} +0 -0
  173. /package/types/{libGuard.d.ts → client/libGuard.d.ts} +0 -0
  174. /package/types/{location.d.ts → client/location.d.ts} +0 -0
  175. /package/types/{log.d.ts → client/log.d.ts} +0 -0
  176. /package/types/{lruCache.d.ts → client/lruCache.d.ts} +0 -0
  177. /package/types/{map.d.ts → client/map.d.ts} +0 -0
  178. /package/types/{metrics.d.ts → client/metrics.d.ts} +0 -0
  179. /package/types/{mobileUtils.d.ts → client/mobileUtils.d.ts} +0 -0
  180. /package/types/{offlineController.d.ts → client/offlineController.d.ts} +0 -0
  181. /package/types/{overlays.d.ts → client/overlays.d.ts} +0 -0
  182. /package/types/{particleRenderers.d.ts → client/particleRenderers.d.ts} +0 -0
  183. /package/types/{permanentPromos.d.ts → client/permanentPromos.d.ts} +0 -0
  184. /package/types/{picker.d.ts → client/picker.d.ts} +0 -0
  185. /package/types/{promo.d.ts → client/promo.d.ts} +0 -0
  186. /package/types/{query.d.ts → client/query.d.ts} +0 -0
  187. /package/types/{queryString.d.ts → client/queryString.d.ts} +0 -0
  188. /package/types/{renderCtrl.d.ts → client/renderCtrl.d.ts} +0 -0
  189. /package/types/{renderTile.d.ts → client/renderTile.d.ts} +0 -0
  190. /package/types/{renderUtils.d.ts → client/renderUtils.d.ts} +0 -0
  191. /package/types/{rhMessage.d.ts → client/rhMessage.d.ts} +0 -0
  192. /package/types/{router.d.ts → client/router.d.ts} +0 -0
  193. /package/types/{seoParser.d.ts → client/seoParser.d.ts} +0 -0
  194. /package/types/{share.d.ts → client/share.d.ts} +0 -0
  195. /package/types/{showableErrorsService.d.ts → client/showableErrorsService.d.ts} +0 -0
  196. /package/types/{subscription.d.ts → client/subscription.d.ts} +0 -0
  197. /package/types/{tileLayerInstance.d.ts → client/tileLayerInstance.d.ts} +0 -0
  198. /package/types/{timestampUtils.d.ts → client/timestampUtils.d.ts} +0 -0
  199. /package/types/{userFavs.d.ts → client/userFavs.d.ts} +0 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @module ogTags Tools to change og:tags & twitter:tags in header
3
+ */
4
+ type AllowedTags = 'title' | 'type' | 'url' | 'description' | 'published' | 'image' | 'imageWidth' | 'imageHeight';
5
+ type OGTags = {
6
+ [K in AllowedTags]?: string | number;
7
+ };
8
+ /**
9
+ * Set og:tags values content. Empty string is used if no value is presented for passed key
10
+ *
11
+ * @param params Tags to set
12
+ */
13
+ export declare const save: () => void;
14
+ /**
15
+ * Saves current OG tags values in HEAD to be restored later
16
+ */
17
+ export declare const set: (params: OGTags) => void;
18
+ /**
19
+ * Restore OG tags to previous values
20
+ */
21
+ export declare const restore: () => void;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ import '@windy/renderCtrl';
2
+ import '@windy/router';
@@ -1,3 +1,3 @@
1
- import type { Plugins } from '@windy/plugins.d';
1
+ import type { Plugins } from './d.ts.files/plugins.d';
2
2
  declare const plugins: Plugins;
3
3
  export default plugins;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @module pluginsCtrl
3
+ *
4
+ * Handles opening and closing of plugins. Can be used from other modules
5
+ * just by emitting `rqstOpen`, `rqstClose` or `closeAllPlugins` events.
6
+ */
7
+ export {};
@@ -2,7 +2,7 @@
2
2
  * @module pois
3
3
  * Single purpose of this module is to load `poi-libs` plugin whenever user selects non-empty poi or has/adds alert/favourite
4
4
  */
5
- import type { PoisCheckboxes } from '@windy/pois.d';
5
+ import type { PoisCheckboxes } from './d.ts.files/pois.d';
6
6
  /**
7
7
  * Config for checkboxes of specified poi
8
8
  *
@@ -0,0 +1,3 @@
1
+ import type { products as Iproducts } from './d.ts.files/products.d';
2
+ declare const products: Iproducts;
3
+ export default products;
@@ -0,0 +1 @@
1
+ export declare function registerDevice(): Promise<string | unknown>;
@@ -8,11 +8,11 @@ declare const renderers: {
8
8
  */
9
9
  tileLayer: TileLayer;
10
10
  noUserControl: TileLayer;
11
- radar: Renderer<"radar", typeof import("@plugins/_radar/radar")>;
12
- satellite: Renderer<"satellite", typeof import("@plugins/satellite/satellite")>;
13
- capAlerts: Renderer<"cap-alerts", typeof import("@plugins/cap-alerts/cap-alerts")>;
14
- isolines: Renderer<"isolines", typeof import("@plugins/isolines/isolines")>;
15
- particles: Renderer<"gl-particles", typeof import("@plugins/gl-particles/gl-particles")> | Renderer<"particles", typeof import("@plugins/particles/particles")>;
11
+ radar: Renderer<"radar", typeof import("../../plugins/_radar/radar")>;
12
+ satellite: Renderer<"satellite", typeof import("../../plugins/satellite/satellite")>;
13
+ capAlerts: Renderer<"cap-alerts", typeof import("../../plugins/cap-alerts/cap-alerts")>;
14
+ isolines: Renderer<"isolines", typeof import("../../plugins/isolines/isolines")>;
15
+ particles: Renderer<"gl-particles", typeof import("../../plugins/gl-particles/gl-particles")> | Renderer<"particles", typeof import("../../plugins/particles/particles")>;
16
16
  /** Extreme forecast and intersucho layers */
17
17
  daySwitcher: TileLayer;
18
18
  accumulations: TileLayer;
@@ -1,5 +1,17 @@
1
1
  import type { ReverseResult } from '@windy/dataSpecifications.d';
2
2
  import type { LatLon } from '@windy/interfaces.d';
3
+ export interface ReverseHttpPayload<IncludeIds extends boolean = false> {
4
+ city?: string;
5
+ country?: string;
6
+ country_code?: string;
7
+ county?: string;
8
+ district?: string;
9
+ locality?: string;
10
+ state?: string;
11
+ suburb?: string;
12
+ island?: string;
13
+ ids: IncludeIds extends true ? ReverseHttpPayload : never;
14
+ }
3
15
  /**
4
16
  * Returns reverse data for given lat,lon
5
17
  *
@@ -1,6 +1,6 @@
1
- import type { Iconfont } from '@windy/iconfont';
2
- import type { Isolines, Pois } from '@windy/rootScope.d';
3
- import type { LoadedTranslations } from '@windy/trans.d';
1
+ import type { Iconfont } from './d.ts.files/iconfont';
2
+ import type { Isolines, Pois } from './d.ts.files/rootScope.d';
3
+ import type { LoadedTranslations } from './d.ts.files/trans.d';
4
4
  /**
5
5
  * Version of Windy.com client (as taken from package.json)
6
6
  * @ignore
@@ -10,7 +10,7 @@ export declare const version: string;
10
10
  * Target
11
11
  * @ignore
12
12
  */
13
- export declare const target: "index" | "mobile" | "lib" | "embed2";
13
+ export declare const target: "mobile" | "index" | "lib" | "embed2";
14
14
  /**
15
15
  * Platform
16
16
  * @ignore
@@ -0,0 +1 @@
1
+ export {};
@@ -19,8 +19,8 @@
19
19
  * @module singleclick
20
20
  */
21
21
  import { Evented } from '@windy/Evented';
22
- import type { PluginIdent } from '@windy/Plugin';
23
- import type { SingleclickTypes, ListeningPriority } from '@windy/singleclick.d';
22
+ import type { PluginIdent } from './d.ts.files/Plugin';
23
+ import type { SingleclickTypes, ListeningPriority } from './d.ts.files/singleclick.d';
24
24
  /**
25
25
  * Main singleclick event emitter (instance of class {@link Evented.Evented | Evented }.)
26
26
  *
@@ -1,3 +1,3 @@
1
- import type { Storage } from '@windy/storage.d';
1
+ import type { Storage } from './d.ts.files/storage.d';
2
2
  declare const _default: Storage;
3
3
  export default _default;
@@ -38,8 +38,8 @@
38
38
  * @module store
39
39
  */
40
40
  import { Evented } from '@windy/Evented';
41
- import type { DataSpecifications, DataSpecificationsObject } from '@windy/dataSpecifications.d';
42
- import type { SetReturnType, StoreOptions, StoreTypes } from '@windy/store.d';
41
+ import type { DataSpecifications, DataSpecificationsObject } from './d.ts.files/dataSpecifications.d';
42
+ import type { SetReturnType, StoreOptions, StoreTypes } from './d.ts.files/store.d';
43
43
  declare class Store extends Evented<StoreTypes> {
44
44
  /**
45
45
  * Set default value for given key
@@ -0,0 +1,16 @@
1
+ import type { DownloadPayload, DownloadedInfo } from '../../plugins/offline/offline';
2
+ export declare const cacheUrl: (cache: Cache, url: string, testIfUrlIsInCache?: boolean, tryTwice2DownloadFiles?: boolean) => Promise<boolean>;
3
+ export declare const cancelOngoingDownloads: () => boolean;
4
+ /**
5
+ * Download all files in parallel
6
+ * @param cache instance of Cache
7
+ * @param urls list of rqrd URLs
8
+ * @param checkIfUrlIsInCache Should we check if URKL is in cache before attempting to doqnload it?
9
+ * @param calledOnDownlodedOneFile callback that is called each time one file is downloaded
10
+ * @returns all Erorred urls or null if task was cenceled
11
+ */
12
+ export declare const downloadFilesInParallel: (cache: Cache, urls: string[], checkIfUrlIsInCache: boolean, tryTwice2DownloadFiles: boolean, calledOnDownlodedOneFile: () => void) => Promise<{
13
+ result: 'downloadingCanceled' | 'ok';
14
+ errors?: string[];
15
+ }>;
16
+ export declare function download({ numberOfFiles, batches, mapBoundaries, overlays, products, daysToLoad, lastTimestamp, assets, mainEntryPoint, }: DownloadPayload): Promise<DownloadedInfo | void>;
@@ -0,0 +1,4 @@
1
+ export {};
2
+ export declare const putInCache: (request: Request, response: Response) => Promise<void>;
3
+ export declare const getFallbackResponse: () => Promise<Response>;
4
+ export declare const cacheFirst: (request: Request, isConnectedToInternet: boolean) => Promise<Response>;
@@ -0,0 +1,16 @@
1
+ import type { Timestamp } from '@windy/types.d';
2
+ import type { DownloadProgress, ServiceWorkerMessage } from '@plugins/offline/offline';
3
+ /**
4
+ * The reson why we are using this function to wrap postMessage is that
5
+ * we can use TS to check typings of the message
6
+ */
7
+ export declare const sendMessageToClient: (message: ServiceWorkerMessage['data'] | DownloadProgress) => Promise<void>;
8
+ export declare const storeData: <T extends Object>(key: string, data: T) => Promise<void>;
9
+ export declare const getData: <T extends Object>(key: string) => Promise<void | T>;
10
+ export declare const deleteData: (key: string) => Promise<void>;
11
+ /**
12
+ * Soteres mainEntryPoint as /index.html so it will be always available on this URL
13
+ * This is basically symlink in serviceWorker cache
14
+ */
15
+ export declare const storeMainEntryPoint: (mainEntryPoint: string) => Promise<void>;
16
+ export declare const isReadyForOfflineMode: () => Promise<void | Timestamp>;
@@ -9,10 +9,10 @@
9
9
  * @module tileInterpolator
10
10
  */
11
11
  import { DataTiler } from '@windy/DataTiler';
12
- import type { PixelInterpolationFun, CoordsInterpolationFun } from '@windy/tileInterpolator.d';
12
+ import type { PixelInterpolationFun, CoordsInterpolationFun } from './d.ts.files/tileInterpolator.d';
13
13
  import type { DataTile } from './dataLoader';
14
- import type { ExtendedTileParams } from '@windy/DataTiler.d';
15
- import type { FullRenderParameters } from '@windy/Layer.d';
14
+ import type { ExtendedTileParams } from './d.ts.files/DataTiler.d';
15
+ import type { FullRenderParameters } from './d.ts.files/Layer.d';
16
16
  export declare class TileInterpolator extends DataTiler {
17
17
  cb<T extends true | false>(f1: CoordsInterpolationFun, // async interpolator does not use fakeFun with null return type
18
18
  f2: PixelInterpolationFun | (() => null), isAsync?: T & (true | false)): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import type { SupportedLangFiles, Translations } from '@windy/lang-files.d';
2
- import type { LoadedTranslations, LoadingOptions, TransFileInfo } from '@windy/trans.d';
1
+ import type { SupportedLangFiles, Translations } from './d.ts.files/lang-files.d';
2
+ import type { LoadedTranslations, LoadingOptions, TransFileInfo } from './d.ts.files/trans.d';
3
3
  export declare const files: Record<keyof SupportedLangFiles, TransFileInfo>;
4
4
  /**
5
5
  * key-value pairs with all loaded lang strings
@@ -34,7 +34,7 @@ declare const getFile: (filename: string, options?: LoadingOptions) => Promise<T
34
34
  * @param lang Optionally forced language, client lang is used by default
35
35
  * @returns Translations in key-pair object. Missing translations are presented in default english lang.
36
36
  */
37
- declare const loadLangFile: (id: keyof SupportedLangFiles, lang?: "id" | "hr" | "th" | "tr" | "en" | "zh-TW" | "zh" | "ja" | "fr" | "ko" | "it" | "ru" | "nl" | "cs" | "pl" | "sv" | "fi" | "ro" | "el" | "hu" | "ca" | "da" | "ar" | "fa" | "hi" | "ta" | "sk" | "uk" | "bg" | "he" | "is" | "lt" | "et" | "vi" | "sl" | "sr" | "sq" | "pt" | "nb" | "es" | "de" | "bn") => Promise<void | Translations>;
37
+ declare const loadLangFile: (id: keyof SupportedLangFiles, lang?: "en" | "zh-TW" | "zh" | "ja" | "fr" | "ko" | "it" | "ru" | "nl" | "cs" | "tr" | "pl" | "sv" | "fi" | "ro" | "el" | "hu" | "hr" | "ca" | "da" | "ar" | "fa" | "hi" | "ta" | "sk" | "uk" | "bg" | "he" | "is" | "lt" | "et" | "vi" | "sl" | "sr" | "id" | "th" | "sq" | "pt" | "nb" | "es" | "de" | "bn") => Promise<void | Translations>;
38
38
  /**
39
39
  * Replace all `[data-*]` translation tags with proper translation in HTML element. It overrides its innerHTML
40
40
  * Supported data suffixes: 'title', 'placeholder', 't', 'afterbegin', 'beforeend', 'tooltipsrc'
@@ -0,0 +1,2 @@
1
+ export declare const isAttributeName: (name: string) => name is `a${string}`;
2
+ export declare const isUniformName: (name: string) => name is `u${string}` | `s${string}`;
@@ -12,9 +12,9 @@
12
12
  /**
13
13
  * We use ./filename to motivate rollup treeshaking
14
14
  */
15
- import type { User } from '@windy/dataSpecifications.d';
16
- import type { HttpPayload } from '@windy/http.d';
17
- import type { AccountLoginResponse, UserInfo } from '@windy/user.d';
15
+ import type { User } from './d.ts.files/dataSpecifications.d';
16
+ import type { HttpPayload } from './d.ts.files/http.d';
17
+ import type { AccountLoginResponse, UserInfo } from './d.ts.files/user.d';
18
18
  export declare const isLoggedIn: () => boolean;
19
19
  export declare const isPublisher: () => boolean;
20
20
  export declare const getInfo: () => User | null;
@@ -271,7 +271,7 @@ export declare const getAdjustedNow: (syncTime?: number) => number;
271
271
  * @param lang Language code
272
272
  * @returns True if language is supported, false otherwise
273
273
  */
274
- export declare const isValidLang: (lang: string) => lang is "id" | "hr" | "th" | "tr" | "en" | "zh-TW" | "zh" | "ja" | "fr" | "ko" | "it" | "ru" | "nl" | "cs" | "pl" | "sv" | "fi" | "ro" | "el" | "hu" | "ca" | "da" | "ar" | "fa" | "hi" | "ta" | "sk" | "uk" | "bg" | "he" | "is" | "lt" | "et" | "vi" | "sl" | "sr" | "sq" | "pt" | "nb" | "es" | "de" | "bn";
274
+ export declare const isValidLang: (lang: string) => lang is "en" | "zh-TW" | "zh" | "ja" | "fr" | "ko" | "it" | "ru" | "nl" | "cs" | "tr" | "pl" | "sv" | "fi" | "ro" | "el" | "hu" | "hr" | "ca" | "da" | "ar" | "fa" | "hi" | "ta" | "sk" | "uk" | "bg" | "he" | "is" | "lt" | "et" | "vi" | "sl" | "sr" | "id" | "th" | "sq" | "pt" | "nb" | "es" | "de" | "bn";
275
275
  /**
276
276
  * Safely joins server name (without trailing / ) and path
277
277
  *
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module visibility
3
+ * Set visibility of a window or a tab into the store
4
+ */
5
+ export {};
@@ -51,22 +51,24 @@ export interface ExportedObj {
51
51
  }
52
52
 
53
53
  /**
54
- * Major LatLon object
54
+ * # LatLon
55
55
  *
56
- * WARNING & TODO: Although lat, lons should be numbers we use them in
57
- * client as string. It is probablly result of URL parmaeters parsing
58
- * or result of @method normalizeLatLon in @module utils.
56
+ * Major LatLon Windy's interface.
59
57
  *
60
- * NOTE: Leaflet uses { lat, lng }, what about unification?
58
+ * Although Leaflet uses `{ lat, lng }` we use `{ lat, lon }`.
61
59
  */
62
60
  export interface LatLon {
63
61
  /**
64
- * Suprisinlly in client we use it as a string sometimes
62
+ * Latitude.
63
+ *
64
+ * While typed as number, due to some parsing, it can be string in some cases.
65
65
  */
66
66
  lat: number;
67
67
 
68
68
  /**
69
- * Suprisinlly in client we use it as a string sometimes
69
+ * Longitude.
70
+ *
71
+ * While typed as number, due to some parsing, it can be string in some cases.
70
72
  */
71
73
  lon: number;
72
74
  }
@@ -85,14 +87,36 @@ export interface BcastHistory {
85
87
  txt: string;
86
88
  }
87
89
 
90
+ /**
91
+ * # GeolocationInfo
92
+ *
93
+ * Represents information about user's location.
94
+ */
88
95
  export interface GeolocationInfo extends LatLon {
96
+ /**
97
+ * Which source was used to get the last location
98
+ */
89
99
  source: 'fallback' | 'gps' | 'ip' | 'meta' | 'api' | 'last';
100
+
101
+ /**
102
+ * Recommended map zoom level based on precision of the location.
103
+ *
104
+ * Higher precision means higher zoom level, we can offer to the user.
105
+ */
90
106
  zoom?: number;
107
+
108
+ /**
109
+ * Optional lowercase 2 letter ISO country code
110
+ */
91
111
  cc?: string;
112
+
113
+ /**
114
+ * Optional name of the place
115
+ */
92
116
  name?: string;
93
117
 
94
118
  /**
95
- * Time of last update
119
+ * Time of the last update of location info
96
120
  */
97
121
  ts: Timestamp;
98
122
  }
@@ -1567,8 +1591,28 @@ export interface WindyOfflinePlugin {
1567
1591
  }
1568
1592
 
1569
1593
  /**
1570
- * Main config interface for external plugins
1571
- * @interface ExternalPluginConfig
1594
+ * # Plugin configuration
1595
+ *
1596
+ * Your plugin's main configuration file is named `pluginConfig.ts` and must adhere to `ExternalPluginConfig` interface.
1597
+ *
1598
+ * Properly configured editor, will help you to edit this file, and will provide you with autocompletion and type checking.
1599
+ *
1600
+ * Just remember, that any external plugin, must have a name, that starts with `windy-plugin-` prefix.
1601
+ *
1602
+ * @example
1603
+ * ```typescript
1604
+ * const config: ExternalPluginConfig = {
1605
+ * name: 'windy-plugin-airspace-example',
1606
+ * version: '1.0.0',
1607
+ * title: 'Airspaces example',
1608
+ * icon: '🚁',
1609
+ * description: 'This plugin demonstrates capabilities...',
1610
+ * author: 'IL (Windy.com)',
1611
+ * repository: 'https://github.com/windycom/windy-plugins',
1612
+ * desktopUI: 'embedded',
1613
+ * mobileUI: 'small',
1614
+ *};
1615
+ *```
1572
1616
  */
1573
1617
  export interface ExternalPluginConfig {
1574
1618
  /**
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable */
2
2
 
3
- // IT IS COPY-PASTED AND MODIFIED @types/leflet 1.4.7
3
+ // IT IS COPY-PASTED AND MODIFIED @types/leaflet 1.4.7
4
4
 
5
5
  /*
6
- We use a lot of Leaflet plugins and leaflet private properties. So we need to extend extisting Leaflet,
6
+ We use a lot of Leaflet plugins and leaflet private properties. So we need to extend existing Leaflet,
7
7
  but leaflet in its typings exports self as a namespace. And it is impossible to change TS namespace declaration.
8
8
 
9
9
  That is why we modified typings and enhance them with our properties (private variables & plugins)
@@ -564,8 +564,6 @@ declare namespace L {
564
564
  _fixTileDef(tileDef: TileDef): TileDef;
565
565
  }
566
566
 
567
- export class CanvasLayer extends (await import('@windy/CanvasLayer.d')).CanvasLayer {}
568
-
569
567
  export interface TileLayerOptions extends GridLayerOptions {
570
568
  minZoom?: number;
571
569
  maxZoom?: number;
@@ -1879,17 +1877,6 @@ declare namespace L {
1879
1877
 
1880
1878
  export function setOptions(thisArgument: any, opts: any): unknown;
1881
1879
 
1882
- export class GPX extends (await import('@plugins/_shared/upload/leaflet-gpx.d')).GPX {}
1883
-
1884
- export class KML extends (await import('@plugins/_shared/upload/leaflet-kml.d')).KML {}
1885
-
1886
- export class KMLIcon extends (await import('@plugins/_shared/upload/leaflet-kml.d')).KMLIcon {}
1887
-
1888
- export class KMLMarker extends (await import('@plugins/_shared/upload/leaflet-kml.d'))
1889
- .KMLMarker {}
1890
- export class RotatedImageOverlay extends (await import('@plugins/_shared/upload/leaflet-kml.d'))
1891
- .RotatedImageOverlay {}
1892
-
1893
1880
  export class MultiPolygon extends Polygon {}
1894
1881
 
1895
1882
  export type DistanceProp = {
@@ -1,26 +0,0 @@
1
- // Definitions for importing GLSL files
2
-
3
- declare module '*.vert' {
4
- const value: string;
5
- export default value;
6
- }
7
-
8
- declare module '*.vs' {
9
- const value: string;
10
- export default value;
11
- }
12
-
13
- declare module '*.frag' {
14
- const value: string;
15
- export default value;
16
- }
17
-
18
- declare module '*.fs' {
19
- const value: string;
20
- export default value;
21
- }
22
-
23
- declare module '*.glsl' {
24
- const value: string;
25
- export default value;
26
- }
package/types/index.d.ts DELETED
@@ -1 +0,0 @@
1
- // empty, the file exists only to satisfy tsc as it is a subfolder of typeRoot folder
@@ -1,16 +0,0 @@
1
- // DEV tools without typings --> for purpose of make.ts
2
-
3
- declare module 'preprocess';
4
- declare module 'tiny-lr';
5
- declare module 'less-plugin-autoprefixer';
6
-
7
- // just shut up svelte-preprocess with its missing dependency
8
- declare module 'sass' {
9
- type LegacyStringOptions<T> = unknown & T;
10
- }
11
-
12
- // Nothing should be imported from svelte/internal as it can break in ANY Svelte update
13
- // TODO Remove all imports of this module before updating to Svelte 5
14
- declare module 'svelte/internal' {
15
- function get_current_component(): import('svelte').SvelteComponent;
16
- }
@@ -1,3 +0,0 @@
1
- import type { products as Iproducts } from '@windy/products.d';
2
- declare const products: Iproducts;
3
- export default products;
@@ -1,66 +0,0 @@
1
- declare interface HTMLCanvasElement extends HTMLElement {
2
- getContext(
3
- contextId: 'experimental-webgl',
4
- options?: WebGLContextAttributes,
5
- ): WebGLRenderingContext | null;
6
- }
7
-
8
- // We use <const> typed arrays (rootScope), but we want to allow `includes` check for all similar types.
9
- // eg. for <const>['rain', 'thunder'] we want to allow `includes('abc'), but still disallow `includes(true)`
10
- // this does the job and retype property if result is true (type guards)
11
- declare interface ReadonlyArray<T> {
12
- includes<U>(
13
- x: U & (T & U extends never ? never : unknown),
14
- ): x is U & (T & U extends never ? never : T);
15
- }
16
-
17
- // And same for Array
18
- declare interface Array<T> {
19
- includes<U>(
20
- x: U & (T & U extends never ? never : unknown),
21
- ): x is U & (T & U extends never ? never : T);
22
- }
23
-
24
- // Make Object.keys generic and do not return the stupid string[] everytime!
25
- /* eslint-disable */
26
- declare interface ObjectConstructor {
27
- keys<T extends object>(o: T): (keyof T)[];
28
- }
29
- /* eslint-enable */
30
-
31
- declare interface Element {
32
- webkitRequestFullscreen(options?: FullscreenOptions): Promise<void> | undefined;
33
- mozRequestFullScreen(options?: FullscreenOptions): Promise<void>;
34
- msRequestFullscreen(options?: FullscreenOptions): Promise<void>;
35
- }
36
-
37
- declare interface Document {
38
- webkitExitFullscreen(): Promise<void> | undefined;
39
- mozCancelFullScreen(): Promise<void>;
40
- msExitFullscreen(): Promise<void>;
41
- }
42
-
43
- declare interface DocumentOrShadowRoot {
44
- readonly webkitFullscreenElement: Element | null;
45
- readonly mozFullScreenElement: Element | null;
46
- readonly msFullscreenElement: Element | null;
47
- }
48
-
49
- // parseInt & parseFloat work great even for number
50
- declare function parseInt(string: string | number, radix?: number): number;
51
- declare function parseFloat(string: string | number): number;
52
-
53
- // isNaN works great even for undefined
54
- declare function isNaN(number?: number): boolean;
55
-
56
- // TS thinks we have nodejs application for some reason... retype timers to the DOM variant
57
- /* eslint-disable */
58
- declare module 'timers' {
59
- global {
60
- function clearInterval(handle?: number): void;
61
- function clearTimeout(handle?: number): void;
62
- function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
63
- function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
64
- }
65
- }
66
- /* eslint-enable */
@@ -1,43 +0,0 @@
1
- // When we need to ensure some interface implements type/interface (strict mode, no property can miss or overstay)
2
- // TS has no support for "interface implements interface" yet, so we need to use this helper
3
- declare type Implements<
4
- T,
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
- R extends T & keyof R extends keyof T ? (keyof T extends keyof R ? any : never) : never,
7
- > = R;
8
-
9
- /**
10
- * Avoid optional parameters from interface/type
11
- *
12
- * @example
13
- * ExcludeOptional<{ a: string; b?: string }> => { a: string }
14
- */
15
- declare type ExcludeOptional<T> = {
16
- [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : never;
17
- };
18
-
19
- /** `key: value[] | undefined` to `key: value | undefined` */
20
- declare type UnwrapArray<T> = T extends (infer U)[] ? U : T;
21
-
22
- /** Trims undefined from tuple.
23
- *
24
- * @example
25
- * [string, undefined] => [string, undefined] | [string]
26
- * [string, string | undefined] => [string, string | undefined] | [string]
27
- * [string, string | undefined, string | undefined] => [string, string | undefined, string | undefined] | [string, string | undefined] | [string]
28
- * [string, string | undefined, string] => [string, string | undefined, string]
29
- **/
30
- declare type TrimUndefinedFromRight<T extends unknown[]> = T extends [...infer R, infer H]
31
- ? undefined extends H
32
- ? TrimUndefinedFromRight<R> | [...R, H]
33
- : [...R, H]
34
- : T;
35
-
36
- /**
37
- * Converts any type to array.
38
- *
39
- * @example
40
- * string => [string];
41
- * string[] => string[]
42
- **/
43
- declare type Arrayify<T> = T extends [...infer R] ? [...R] : [T];