@windycom/plugin-devtools 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +3 -0
  2. package/index.mjs +2 -2
  3. package/package.json +2 -3
  4. package/types/client/AccessProducts.d.ts +8 -0
  5. package/types/client/BottomSveltePlugins.d.ts +8 -0
  6. package/types/client/Calendar.d.ts +9 -17
  7. package/types/client/Color.d.ts +43 -90
  8. package/types/client/Evented.d.ts +4 -0
  9. package/types/client/ExternalSveltePlugin.d.ts +2 -1
  10. package/types/client/IDB.d.ts +63 -0
  11. package/types/client/IconProducts.d.ts +2 -0
  12. package/types/client/Layer.d.ts +1 -2
  13. package/types/client/Metric.d.ts +8 -8
  14. package/types/client/MetricClasses.d.ts +4 -3
  15. package/types/client/Overlay.d.ts +30 -15
  16. package/types/client/OverlayClasses.d.ts +11 -7
  17. package/types/client/Plugin.d.ts +2 -2
  18. package/types/client/Product.d.ts +40 -29
  19. package/types/client/RadarPlusProduct.d.ts +19 -0
  20. package/types/client/Renderer.d.ts +2 -10
  21. package/types/client/SveltePlugin.d.ts +9 -5
  22. package/types/client/TileLayer.d.ts +1 -2
  23. package/types/client/TopoMap.d.ts +10 -0
  24. package/types/client/WindowPlugin.d.ts +7 -3
  25. package/types/client/appsFlyer.d.ts +3 -0
  26. package/types/client/baseMap.d.ts +8 -5
  27. package/types/client/cityLabels.d.ts +10 -2
  28. package/types/client/cloudSync.d.ts +3 -1
  29. package/types/client/colorGradients.d.ts +13 -0
  30. package/types/client/customColors.d.ts +1 -0
  31. package/types/client/d.ts.files/Calendar.d.ts +11 -2
  32. package/types/client/d.ts.files/Color.d.ts +16 -5
  33. package/types/client/d.ts.files/LabelsLayer.d.ts +1 -18
  34. package/types/client/d.ts.files/Layer.d.ts +8 -1
  35. package/types/client/d.ts.files/Metric.d.ts +1 -0
  36. package/types/client/d.ts.files/Renderer.d.ts +22 -1
  37. package/types/client/d.ts.files/alerts.d.ts +120 -0
  38. package/types/client/d.ts.files/broadcast.d.ts +38 -10
  39. package/types/client/d.ts.files/dataSpecifications.d.ts +81 -122
  40. package/types/client/d.ts.files/favs.d.ts +69 -0
  41. package/types/client/d.ts.files/incomingMessages.d.ts +0 -4
  42. package/types/client/d.ts.files/notifications.d.ts +2 -2
  43. package/types/client/d.ts.files/plugin-params.d.ts +35 -47
  44. package/types/client/d.ts.files/plugins.d.ts +30 -42
  45. package/types/client/d.ts.files/pois.d.ts +1 -1
  46. package/types/client/d.ts.files/products.d.ts +15 -3
  47. package/types/client/d.ts.files/rootScope.d.ts +3 -21
  48. package/types/client/d.ts.files/startup.d.ts +59 -0
  49. package/types/client/d.ts.files/storage.d.ts +12 -35
  50. package/types/client/d.ts.files/user.d.ts +79 -24
  51. package/types/client/deviceLogging.d.ts +2 -1
  52. package/types/client/embed2.d.ts +14 -31
  53. package/types/client/fetch.d.ts +29 -16
  54. package/types/client/ga.d.ts +1 -1
  55. package/types/client/geolocation.d.ts +15 -7
  56. package/types/client/globals.d.ts +1 -0
  57. package/types/client/http.d.ts +17 -0
  58. package/types/client/idbInstances.d.ts +45 -0
  59. package/types/client/langFiles.d.ts +2 -0
  60. package/types/client/layers.d.ts +2 -0
  61. package/types/client/lib.d.ts +7 -21
  62. package/types/client/loadArticlesOrWhatsNew.d.ts +1 -0
  63. package/types/client/log.d.ts +1 -0
  64. package/types/client/lruCache.d.ts +6 -0
  65. package/types/client/map.d.ts +17 -6
  66. package/types/client/mobile.d.ts +28 -20
  67. package/types/client/models.d.ts +1 -1
  68. package/types/client/notifications.d.ts +32 -67
  69. package/types/client/overlays.d.ts +4 -1
  70. package/types/client/params.d.ts +0 -1
  71. package/types/client/permanentPromos.d.ts +1 -1
  72. package/types/client/persistentStorage.d.ts +8 -0
  73. package/types/client/picker.d.ts +1 -1
  74. package/types/client/pois.d.ts +1 -2
  75. package/types/client/promo.d.ts +6 -16
  76. package/types/client/pushNotifications.d.ts +13 -1
  77. package/types/client/queryString.d.ts +1 -1
  78. package/types/client/renderUtils.d.ts +1 -1
  79. package/types/client/renderers.d.ts +7 -3
  80. package/types/client/rootScope.d.ts +14 -23
  81. package/types/client/router.d.ts +9 -5
  82. package/types/client/seoParser.d.ts +21 -0
  83. package/types/client/serviceWorkerCtrl.d.ts +8 -0
  84. package/types/client/startupWeather.d.ts +13 -9
  85. package/types/client/store.d.ts +2 -2
  86. package/types/client/storeLastPosition.d.ts +1 -0
  87. package/types/client/subscription.d.ts +1 -0
  88. package/types/client/swDownloader.d.ts +7 -7
  89. package/types/client/swProxy.d.ts +1 -1
  90. package/types/client/swUtils.d.ts +3 -3
  91. package/types/client/trans.d.ts +26 -37
  92. package/types/client/user.d.ts +5 -13
  93. package/types/client/userAlerts.d.ts +68 -0
  94. package/types/client/userConsent.d.ts +6 -0
  95. package/types/client/userFavs.d.ts +46 -121
  96. package/types/client/utils.d.ts +28 -6
  97. package/types/iconfont.d.ts +1 -0
  98. package/types/interfaces.d.ts +90 -225
  99. package/types/lang-files.d.ts +687 -119
  100. package/types/offline.d.ts +100 -0
  101. package/types/types.d.ts +59 -24
  102. package/types/client/Bar.d.ts +0 -114
  103. package/types/client/BindedBar.d.ts +0 -51
  104. package/types/client/BindedCheckbox.d.ts +0 -30
  105. package/types/client/BindedSwitch.d.ts +0 -35
  106. package/types/client/BottomTagPlugin.d.ts +0 -8
  107. package/types/client/DraggableDiv.d.ts +0 -21
  108. package/types/client/GhostBox.d.ts +0 -17
  109. package/types/client/Legend.d.ts +0 -6
  110. package/types/client/LongTap.d.ts +0 -21
  111. package/types/client/MobileCalendar.d.ts +0 -51
  112. package/types/client/OfflineMessagesClasses.d.ts +0 -30
  113. package/types/client/ProductSwitch.d.ts +0 -14
  114. package/types/client/Scrollable.d.ts +0 -14
  115. package/types/client/Switch.d.ts +0 -24
  116. package/types/client/TimestampBar.d.ts +0 -8
  117. package/types/client/d.ts.files/Product.d.ts +0 -37
  118. package/types/client/d.ts.files/trans.d.ts +0 -55
  119. package/types/client/favs.d.ts +0 -83
  120. package/types/client/offlineController.d.ts +0 -20
@@ -1,13 +1,13 @@
1
1
  import { Calendar } from '@windy/Calendar';
2
2
  import * as http from '@windy/http';
3
- import type { MinifestObject } from './d.ts.files/Calendar.d';
4
- import type { Layers } from './d.ts.files/Layer.d';
5
- import type { DataQuality, FileSuffix } from './d.ts.files/Product.d';
6
- import type { LatLon } from './d.ts.files/interfaces';
7
- import type { AcTimes, Isolines, Levels, Overlays, Products } from './d.ts.files/rootScope.d';
8
- import type { ProductCategory, ProductIdent } from './d.ts.files/types';
9
- export type ProductInitParams = Pick<Product, 'modelName' | 'provider' | 'interval'> & Partial<Pick<Product, 'provider' | 'ident' | 'maxTileZoom' | 'animationSpeed' | 'animationSpeed1h' | 'fileSuffix' | 'fileSuffixFallback' | 'JPGtransparency' | 'PNGtransparency' | 'dataQuality' | 'betterDataQuality' | 'animation' | 'labelsTemp' | 'overlays' | 'preferredProduct' | 'pathGenerator' | 'isolines' | 'directory' | 'category' | 'modelIdent' | 'intervalPremium' | 'server' | 'modelResolution' | 'levels' | 'levelsOverride' | 'logo' | 'acTimes' | 'preferredWaveProduct' | 'preferredAirProduct'>> & {
10
- requiresInfoJson?: boolean;
3
+ import type { MinifestObject } from '@windy/Calendar.d';
4
+ import type { Layers } from '@windy/Layer.d';
5
+ import type { LatLon } from '@windy/interfaces';
6
+ import type { Isolines, Levels, Overlays, Products } from '@windy/rootScope.d';
7
+ import type { ISODateString, ProductCategory, ProductIdent, Timestamp, YYYYMMDDHH } from '@windy/types';
8
+ export type DataQuality = 'normal' | 'high' | 'low' | 'ultra' | 'extreme';
9
+ export type FileSuffix = 'png' | 'jpg' | 'webp';
10
+ export type ProductInitParams = Pick<Product, 'modelName' | 'provider' | 'interval'> & Partial<Pick<Product, 'provider' | 'ident' | 'maxTileZoom' | 'animationSpeed' | 'animationSpeed1h' | 'fileSuffix' | 'fileSuffixFallback' | 'JPGtransparency' | 'PNGtransparency' | 'dataQuality' | 'betterDataQuality' | 'animation' | 'labelsTemp' | 'overlays' | 'preferredProduct' | 'pathGenerator' | 'isolines' | 'directory' | 'category' | 'modelIdent' | 'intervalPremium' | 'server' | 'metadataServer' | 'modelResolution' | 'levels' | 'levelsOverride' | 'logo' | 'preferredWaveProduct' | 'preferredAirProduct' | 'hasAccumulations' | 'freeProduct' | 'hideProductSwitch'>> & {
11
11
  forecastSize?: number;
12
12
  bounds?: [number, number][][];
13
13
  };
@@ -42,7 +42,7 @@ export declare class Product {
42
42
  */
43
43
  private productExpires;
44
44
  /**
45
- * Unefective, but simple refTime solutions for data that are updated once a day
45
+ * Noneffective, but simple refTime solutions for data that are updated once a day
46
46
  */
47
47
  protected dailyCache?: string;
48
48
  /**
@@ -148,7 +148,6 @@ export declare class Product {
148
148
  * List of avail isolines
149
149
  */
150
150
  isolines: Isolines[];
151
- requiresInfoJson: boolean;
152
151
  /**
153
152
  * If we drag out of bounds, which product we should use (must be global air product)
154
153
  */
@@ -170,54 +169,66 @@ export declare class Product {
170
169
  */
171
170
  pathGenerator: string;
172
171
  /**
173
- * List of available accumulationTime
174
- */
175
- acTimes?: AcTimes[];
176
- /**
177
- * Alternative server, where the data are loaded from
172
+ * Alternative servers, where the data are loaded from
178
173
  */
179
174
  server?: string;
175
+ metadataServer?: string;
180
176
  /**
181
177
  * Some product (f.ex. StaticProduct) doesn't have meaningful
182
178
  * information about the model and time of the next update.
183
179
  * Set this to false to hide the info where not relevant (f.ex. Info plugin)
184
180
  */
185
181
  hasRefTime: boolean;
182
+ /**
183
+ * This product supper accumulations
184
+ */
185
+ hasAccumulations?: boolean;
186
+ /**
187
+ * This product is free for all users during whole timeline
188
+ */
189
+ freeProduct?: boolean;
190
+ /**
191
+ * Hide product switch in GUI, when this product is selected
192
+ */
193
+ hideProductSwitch?: boolean;
186
194
  constructor(params: ProductInitParams);
187
- refTime(): string;
195
+ refTime(): YYYYMMDDHH | '';
188
196
  getUpdateTimes(): {
189
- refTime: string;
190
- minUpdate: number;
191
- } | {
192
- refTime?: undefined;
193
- minUpdate?: undefined;
194
- };
197
+ refTime: ISODateString;
198
+ minUpdate: Timestamp;
199
+ } | null;
195
200
  moveTs(moveRight: boolean, isAccu?: boolean): boolean | void;
196
201
  getMinifestUrl(): string;
197
202
  loadMinifest(): Promise<http.HttpPayload<MinifestObject>>;
203
+ loadAndGetReftime(): Promise<ISODateString | undefined>;
198
204
  open(): Promise<void | Calendar>;
199
205
  close(): void;
200
206
  /**
201
207
  * Checks if lat,lon is within bounds
202
208
  */
203
209
  pointIsInBounds<T extends LatLon>(this: this, paramsMap: T): boolean;
210
+ boundsAreInViewport(map: L.Map): boolean;
204
211
  printLogo(): void;
205
- getInfoFileUrl(): string;
206
212
  getCalendar(): Promise<Calendar>;
207
213
  protected expire(): void;
208
- protected getStoreKey(): `lastMinifest/${string}`;
209
- protected setMinifest(minifest: MinifestObject): void;
214
+ /**
215
+ * Since dissemination of minifests is not instant, and can last for minutes,
216
+ * we have to double check, that incoming minifest
217
+ * is newer than the one we have in store. If not, we keep the old one.
218
+ *
219
+ * @returns Incoming, or stored minifest, which is newer
220
+ */
221
+ protected getUpdatedMinifest(minifest: MinifestObject): Promise<MinifestObject>;
210
222
  protected setExpireTime(): void;
211
223
  /**
212
224
  * Major reason for this error is user's bad connection, which is handled
213
- * by standard no connetion red message
225
+ * by standard no connection red message
214
226
  *
215
- * We delay 0.3 sec to test properlly connection
227
+ * We delay 0.3 sec to test properly connection
216
228
  */
217
229
  protected showErrorMessage(err: string): void;
218
230
  protected loadAndProcessMinifest(forced?: boolean): Promise<void>;
219
- protected loadAndProcessInfo(): Promise<void>;
220
- private loadInfo;
221
231
  private checkNewMinifest;
232
+ private isPointInsidePolygon;
222
233
  private removeLogo;
223
234
  }
@@ -0,0 +1,19 @@
1
+ import { StaticProduct } from './StaticProduct';
2
+ import type { HttpPayload } from '@windy/http.d';
3
+ import type { SatelliteInfoJson } from '@windy/satellite.d';
4
+ import type { ProductInitParams } from './Product';
5
+ export type SatelliteProductInitParams = Pick<RadarPlusProduct, 'urlSuff' | 'urlSuffFlow'> & ProductInitParams;
6
+ export declare class RadarPlusProduct extends StaticProduct {
7
+ urlSuff: string;
8
+ urlSuffFlow: string;
9
+ constructor(params: SatelliteProductInitParams);
10
+ open(): Promise<undefined>;
11
+ /**
12
+ * Return info.json loading promise (https://sat.windy.com/satellite/info.json)
13
+ */
14
+ loadInfoJson(noCache?: boolean): Promise<HttpPayload<SatelliteInfoJson>>;
15
+ /**
16
+ * Handling keyboard shortcuts
17
+ */
18
+ moveTs(moveRight: boolean): boolean | void;
19
+ }
@@ -1,13 +1,6 @@
1
1
  import type { FullRenderParameters } from './d.ts.files/Layer.d';
2
- import type { Renderers } from './d.ts.files/Renderer.d';
2
+ import type { Renderers, AllowedUserControls, AllowedRenderPlugins, RendererInitParams } from './d.ts.files/Renderer.d';
3
3
  import type { InterpolatorFactory } from './d.ts.files/interpolator';
4
- import type { BottomTagPlugins, Plugins } from './d.ts.files/plugins.d';
5
- type AllowedRenderPlugins = Pick<Plugins, 'radar' | 'satellite' | 'cap-alerts' | 'isolines' | 'gl-particles' | 'particles'>;
6
- export interface RendererInitParams {
7
- ident: Renderers;
8
- dependency?: keyof AllowedRenderPlugins;
9
- userControl?: keyof BottomTagPlugins;
10
- }
11
4
  /**
12
5
  * Renderer class act as a proxy between renderController and code, which is responsible to
13
6
  * render particullar layer.
@@ -49,7 +42,7 @@ export declare class Renderer<K extends keyof AllowedRenderPlugins | undefined =
49
42
  *
50
43
  * userControl opening and closing is handles by rndrCtrl
51
44
  */
52
- userControl?: keyof BottomTagPlugins;
45
+ userControl?: AllowedUserControls;
53
46
  /**
54
47
  * Picker ingerpolation factory
55
48
  */
@@ -66,4 +59,3 @@ export declare class Renderer<K extends keyof AllowedRenderPlugins | undefined =
66
59
  paramsChanged(params: FullRenderParameters): void;
67
60
  redraw(): void;
68
61
  }
69
- export {};
@@ -1,8 +1,8 @@
1
1
  import { WindowPlugin } from '@windy/WindowPlugin';
2
2
  import type { WindowPluginInitParams } from '@windy/WindowPlugin';
3
3
  import type { PluginsOpenParams, PluginsQsParams } from '@windy/plugin-params.d';
4
- import type { SveltePanePlugins, SveltePlugins } from '@windy/plugins.d';
5
- export declare class SvelteApp<P extends keyof SveltePlugins | keyof SveltePanePlugins> {
4
+ import type { BottomSveltePlugins, SveltePanePlugins, SveltePlugins } from '@windy/plugins.d';
5
+ export declare class SvelteApp<P extends keyof SveltePlugins | keyof SveltePanePlugins | keyof BottomSveltePlugins> {
6
6
  constructor(_args: {
7
7
  target: HTMLElement;
8
8
  anchor: HTMLElement;
@@ -25,14 +25,18 @@ export declare class ExternalSvelteApp {
25
25
  $destroy(): void;
26
26
  }
27
27
  /** Allowed params to SveltePlugin constructor (private and protected props are omited by default) */
28
- export type SveltePluginInitParams<P extends keyof SveltePlugins | keyof SveltePanePlugins> = Omit<WindowPluginInitParams<P>, 'ident'> & Pick<SveltePlugin<P>, 'ident'> & Partial<SveltePlugin<P>>;
29
- export declare class SveltePlugin<P extends keyof SveltePlugins | keyof SveltePanePlugins> extends WindowPlugin<P> {
28
+ export type SveltePluginInitParams<P extends keyof SveltePlugins | keyof SveltePanePlugins | keyof BottomSveltePlugins> = Omit<WindowPluginInitParams<P>, 'ident'> & Pick<SveltePlugin<P>, 'ident'> & Partial<SveltePlugin<P>>;
29
+ export declare class SveltePlugin<P extends keyof SveltePlugins | keyof SveltePanePlugins | keyof BottomSveltePlugins> extends WindowPlugin<P> {
30
30
  /**
31
31
  * Holder of SvelteApp
32
32
  */
33
- private svelteApp?;
33
+ svelteApp?: SvelteApp<P> | ExternalSvelteApp | null;
34
+ needsPluginRoot?: boolean;
34
35
  ident: P;
35
36
  plugin: WPluginModules[`@plugins/${P}`] & AdditionalSvelteAssets;
37
+ constructor(params: WindowPluginInitParams<P> & {
38
+ needsPluginRoot?: boolean;
39
+ });
36
40
  onopen(params?: PluginsOpenParams[P], _qs?: PluginsQsParams[P]): void;
37
41
  ondestroy(): void;
38
42
  protected mount(): void;
@@ -1,7 +1,6 @@
1
1
  import { Renderer } from '@windy/Renderer';
2
2
  import type { FullRenderParameters } from '@windy/Layer.d';
3
- import type { RendererInitParams } from '@windy/Renderer';
4
- import type { Renderers } from '@windy/Renderer.d';
3
+ import type { RendererInitParams, Renderers } from '@windy/Renderer.d';
5
4
  export declare class TileLayer extends Renderer {
6
5
  constructor(params: RendererInitParams);
7
6
  onopen(params?: FullRenderParameters): void;
@@ -0,0 +1,10 @@
1
+ import { Renderer } from '@windy/Renderer';
2
+ import type { FullRenderParameters } from '@windy/Layer.d';
3
+ import type { Renderers } from '@windy/Renderer.d';
4
+ export declare class TopoMap extends Renderer {
5
+ baseLayer: L.GridLayer | null;
6
+ open(_params: FullRenderParameters): Promise<void>;
7
+ close(rqrdRenderers: Renderers[]): void;
8
+ addOrUpdateBaseLayer(): void;
9
+ removeBaseLayer(): void;
10
+ }
@@ -5,11 +5,11 @@ import type { WindowInitParams } from '@windy/Window';
5
5
  import type { PluginOpeningOptions, WindowClosingOptions } from '@windy/interfaces.d';
6
6
  import type { InterpolatorFactory } from '@windy/interpolator';
7
7
  import type { PluginsOpenParams, PluginsQsParams } from '@windy/plugin-params.d';
8
- import type { BottomTagPlugins, SveltePanePlugins, SveltePlugins, TagPlugins } from '@windy/plugins.d';
8
+ import type { BottomSveltePlugins, SveltePanePlugins, SveltePlugins, TagPlugins } from '@windy/plugins.d';
9
9
  import type { ParsedQueryString } from '@windy/queryString';
10
10
  import type { ListeningPriority } from '@windy/singleclick.d';
11
- import type { LoadedTranslations } from '@windy/trans.d';
12
- export interface WindowPlugins extends TagPlugins, SveltePlugins, SveltePanePlugins, BottomTagPlugins {
11
+ import type { LoadedTranslations } from '@windy/types';
12
+ export interface WindowPlugins extends TagPlugins, SveltePlugins, SveltePanePlugins, BottomSveltePlugins {
13
13
  }
14
14
  /** Allowed params to WindowPlugin constructor (private and protected props are omited by default) */
15
15
  export type WindowPluginInitParams<P extends keyof WindowPlugins> = PluginInitParams<P> & Omit<WindowInitParams, 'ident' | 'html'> & Partial<Omit<WindowPlugin<P>, 'open' | 'load' | 'refs' | 'node' | 'domEl'>>;
@@ -117,6 +117,10 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
117
117
  * header with title (adds .no-header class to the plugin container)
118
118
  */
119
119
  noHeader?: boolean;
120
+ /**
121
+ * While plugin was being opened, closing was requested
122
+ */
123
+ closingRequested?: boolean;
120
124
  constructor(params: WindowPluginInitParams<P>);
121
125
  /**
122
126
  * Check if plugin is loaded and decides if load or open. Params are passed to onopen fun
@@ -0,0 +1,3 @@
1
+ import type { AppsFlyerPlugin } from 'appsflyer-capacitor-plugin/src/definitions';
2
+ export declare const appsFlyerPromise: Promise<AppsFlyerPlugin | undefined>;
3
+ export declare function logAppsFlyerProductChange(): void;
@@ -1,10 +1,13 @@
1
1
  export type MapTilesKeys = 'graymap' | 'landmaskmap' | 'simplemap' | 'graymapPatch5' | 'graymapPatch11' | 'simplemapPatch5' | 'simplemapPatch9' | 'sznmap' | 'winter' | 'satLocal' | 'sat';
2
- /**
3
- * Leaflet instance of actually used base layer
4
- */
5
- export declare let baseLayer: L.GridLayer;
6
2
  /**
7
3
  * Return just record of different map tilesURLs that we use as basemap
8
4
  */
9
5
  export declare const mapTilesRecord: (patchType?: string | null) => Record<MapTilesKeys, string>;
10
- export declare function updateBasemap(map: L.Map): L.GridLayer;
6
+ /**
7
+ * Adds basemap to Leaflet map or updates source of tiles it if already exists
8
+ */
9
+ export declare function addOrUpdateBasemap(map: L.Map): void;
10
+ /**
11
+ * Remove basemap from Leaflet map
12
+ */
13
+ export declare function removeBasemap(map: L.Map): void;
@@ -1,2 +1,10 @@
1
- declare const _default: any;
2
- export default _default;
1
+ /**
2
+ * Handles adding/removing or disabling/enabling city labels on the map.
3
+ *
4
+ * @module cityLabels.ts
5
+ */
6
+ export declare const labelsLayer: any;
7
+ export declare const add: () => void;
8
+ export declare const remove: () => void;
9
+ export declare const disable: () => void;
10
+ export declare const enable: () => void;
@@ -8,5 +8,7 @@ import '@windy/metrics';
8
8
  export declare function storeSettings(): Promise<boolean>;
9
9
  /**
10
10
  * Loads settings from a cloud and merge them
11
+ *
12
+ * @returns true if there were any data to merge
11
13
  */
12
- export declare function loadAndMergeSettingFromCloud(): Promise<void>;
14
+ export declare function loadAndMergeSettingFromCloud(): Promise<boolean>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Reusable color gradients
3
+ */
4
+ import type { RGBA, ColorGradient } from '@windy/Color.d';
5
+ import type { NumValue } from '@windy/types';
6
+ export declare const moistureAnomaly: RGBA[];
7
+ export declare const airPollutant: RGBA[];
8
+ export declare const cloudBaseAndVisibility: RGBA[];
9
+ export declare const radarGradientAndValues: ColorGradient;
10
+ /**
11
+ * Creates a color gradient from array of prepared ones
12
+ */
13
+ export declare const createColorGradient: (gradient: RGBA[], numValues: NumValue[]) => ColorGradient;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,4 @@
1
- import { LoadedTranslations } from '@windy/trans.d';
2
- import { Timestamp, ISODateString } from '@windy/types.d';
1
+ import { Timestamp, ISODateString, LoadedTranslations } from '@windy/types.d';
3
2
 
4
3
  /**
5
4
  * Main minifest object. Mother of all forecasts
@@ -79,6 +78,16 @@ export interface CalendarDay {
79
78
  * year
80
79
  */
81
80
  year: number;
81
+
82
+ /**
83
+ * Forecast for this day is for Premium users only
84
+ */
85
+ premium: boolean;
86
+
87
+ /**
88
+ * Forecast for this day is available
89
+ */
90
+ hasForecast: boolean;
82
91
  }
83
92
 
84
93
  /**
@@ -39,7 +39,6 @@ export type ColorIdent =
39
39
  | 'rainAccu'
40
40
  | 'waves'
41
41
  | 'currents'
42
- | 'currentsTide'
43
42
  | 'visibility'
44
43
  | 'gtco3'
45
44
  | 'aod550'
@@ -51,6 +50,7 @@ export type ColorIdent =
51
50
  | 'dust'
52
51
  | 'satellite'
53
52
  | 'radar'
53
+ | 'radarPlus'
54
54
  | 'fog'
55
55
  | 'justGray'
56
56
  | 'efiWind'
@@ -58,10 +58,8 @@ export type ColorIdent =
58
58
  | 'efiRain'
59
59
  | 'moistureAnom40'
60
60
  | 'moistureAnom100'
61
- | 'drought40'
62
- | 'drought100'
63
- | 'soilMoisture40'
64
- | 'soilMoisture100'
61
+ | 'drought'
62
+ | 'soilMoisture'
65
63
  | 'fwi'
66
64
  | 'dfm10h'
67
65
  | 'solarpower'
@@ -80,3 +78,16 @@ type PluginColorIdent =
80
78
  | 'dewpointSpreadDetail'
81
79
  | 'blitz'
82
80
  | 'radiation';
81
+
82
+ // pressureIsolines color is dynamically created in @plugins/isolines
83
+ export type AnyColorIdent =
84
+ | ColorIdent
85
+ | PluginColorIdent
86
+ | 'pressureIsolines'
87
+ | 'temporary'
88
+ | 'direction';
89
+
90
+ export interface UserColor {
91
+ id: AnyColorIdent;
92
+ gradient: ColorGradient;
93
+ }
@@ -3,23 +3,6 @@ import { Timestamp } from '@windy/types.d';
3
3
  type CityDivId = string; // `${x}:${y}`
4
4
  type CityLabelId = string; // `${lat}/${lon}`
5
5
 
6
- /** Loaded forecast data from `/citytile/*` URL endpoint */
7
- export type CityForecastData = {
8
- /**
9
- * Forecasted temperatures for cities on the tile
10
- */
11
- forecast: {
12
- /**
13
- * Keys (coordinates) are in "lat/lon" format, value the forecasted temperature
14
- */
15
- [coordinates: string]: number[];
16
- };
17
- /** Reftime */
18
- reftime: Timestamp;
19
- /** Time from reftime in hours for every temperature value in the returned array */
20
- hours: number[];
21
- };
22
-
23
6
  /**
24
7
  * Loaded labels data from tiles.windy.com endpoint
25
8
  * Format of inner arrays is [id, title to show, category of label used for CSS class, lon, lat, width in px, height in px]
@@ -28,7 +11,7 @@ export type CityLabelData = [string, string, string, number, number, number, num
28
11
 
29
12
  /** Represantation of single one HTML label with its temperature data */
30
13
  export interface CityLabel {
31
- /** Id of the label, it is same as a key for CityForecastData, so it is used for pairing label with temperature data */
14
+ /** Id of the label, it is same as a key for `CityTemperaturesDto`, so it is used for pairing label with temperature data */
32
15
  id: CityLabelId;
33
16
 
34
17
  /** HTML element of the label for binding labels and temperature values */
@@ -1,5 +1,5 @@
1
1
  import { NumberedMetric, PrecipMetric, PtypeMetric, UVIndexMetric } from '@windy/MetricClasses';
2
- import { DataQuality, FileSuffix } from '@windy/Product.d';
2
+ import { DataQuality, FileSuffix } from '@windy/Product';
3
3
  import { WeatherParameters } from '@windy/interfaces.d';
4
4
  import { Levels, Overlays } from '@windy/rootScope.d';
5
5
  import { NumValue, Path } from '@windy/types.d';
@@ -71,6 +71,7 @@ export interface LayerMetricType {
71
71
  dustsm: NumberedMetric;
72
72
  radar: NumberedMetric;
73
73
  satellite: NumberedMetric;
74
+ radarPlus: NumberedMetric;
74
75
  gtco3: NumberedMetric;
75
76
  pm2p5: NumberedMetric;
76
77
  no2: NumberedMetric;
@@ -91,6 +92,7 @@ export interface LayerMetricType {
91
92
  dfm10h: NumberedMetric;
92
93
  turbulence: NumberedMetric;
93
94
  icing: NumberedMetric;
95
+ topoMap: undefined;
94
96
  }
95
97
 
96
98
  /**
@@ -181,4 +183,9 @@ interface FullRenderParameters extends WeatherParameters, RenderParams {
181
183
  refTime: string;
182
184
  fullPath: string;
183
185
  path: Path;
186
+
187
+ /**
188
+ * Optional accumulation range in hours
189
+ */
190
+ acRangeInHours?: number;
184
191
  }
@@ -101,6 +101,7 @@ export interface MetricTypes {
101
101
  dust: NumberedMetric;
102
102
  cosc: NumberedMetric;
103
103
  radar: NumberedMetric;
104
+ radsat: SatelliteMetric;
104
105
  satellite: SatelliteMetric;
105
106
  ptype: PtypeMetric;
106
107
  gh: NumberedMetric;
@@ -1,16 +1,25 @@
1
1
  import { TransformFunction } from '@windy/Layer.d';
2
2
  import { TilePoint } from '@windy/interfaces.d';
3
3
 
4
+ import type { BottomSveltePlugins, Plugins, SveltePlugins } from '@windy/plugins.d';
5
+
6
+ export type AllowedRenderPlugins = Pick<
7
+ Plugins,
8
+ 'radar' | 'satellite' | 'radar-plus' | 'cap-alerts' | 'isolines' | 'gl-particles' | 'particles'
9
+ >;
10
+
4
11
  export type Renderers =
5
12
  | 'tileLayer'
6
13
  | 'radar'
7
14
  | 'satellite'
15
+ | 'radarPlus'
8
16
  | 'capAlerts'
9
17
  | 'isolines'
10
18
  | 'particles'
11
19
  | 'accumulations'
12
20
  | 'daySwitcher'
13
- | 'noUserControl';
21
+ | 'noUserControl'
22
+ | 'topoMap';
14
23
 
15
24
  export interface TileParams extends TilePoint {
16
25
  url: string;
@@ -21,3 +30,15 @@ export interface TileParams extends TilePoint {
21
30
  transformG: TransformFunction | null;
22
31
  transformB: TransformFunction | null;
23
32
  }
33
+
34
+ export type AllowedUserControls =
35
+ | keyof BottomSveltePlugins
36
+ | keyof SveltePlugins
37
+ | 'map-selector'
38
+ | 'none';
39
+
40
+ export interface RendererInitParams {
41
+ ident: Renderers;
42
+ dependency?: keyof AllowedRenderPlugins;
43
+ userControl?: AllowedUserControls;
44
+ }
@@ -0,0 +1,120 @@
1
+ import {
2
+ AlertConditionType,
3
+ CloudCoverage,
4
+ AlertStatus,
5
+ Direction,
6
+ Weekday,
7
+ } from '@windy/userAlerts';
8
+ import type { Timestamp, UserInterest } from '@windy/types';
9
+ import type { Products } from '@windy/rootScope.d';
10
+ import type { LatLon } from '@windy/interfaces';
11
+
12
+ export interface AlertRequest {
13
+ conditions: AlertCondition[];
14
+ description: string;
15
+ favToDeleteId?: string;
16
+ lat: number;
17
+ locationName: string;
18
+ lon: number;
19
+ model: GlobalProductWithWaves | null;
20
+ priority?: number;
21
+ suspended: boolean;
22
+ userInterest: UserInterest;
23
+ }
24
+
25
+ type Extends<T, U extends T> = U;
26
+
27
+ export type GlobalProductWithWaves = Extends<Products, 'ecmwf' | 'gfs' | 'icon' | 'mblue'>;
28
+
29
+ export interface AlertCheckResponse {
30
+ /**
31
+ * Array of timestamps when the trigger is triggered
32
+ */
33
+ timestamps: Timestamp[];
34
+ }
35
+
36
+ export interface NumberRange {
37
+ from: number;
38
+ to: number;
39
+ }
40
+
41
+ export interface AlertConditionBase {
42
+ type: AlertConditionType;
43
+ }
44
+
45
+ export interface CloudinessAlertCondition extends AlertConditionBase {
46
+ type: AlertConditionType.Cloudiness;
47
+ cloudCoverage: CloudCoverage[];
48
+ }
49
+
50
+ export interface FreshSnowAlertCondition extends AlertConditionBase {
51
+ rangeCentimeters: NumberRange;
52
+ type: AlertConditionType.FreshSnow;
53
+ }
54
+
55
+ export interface RainfallAlertCondition extends AlertConditionBase {
56
+ hours: number;
57
+ rangeMilliliters: NumberRange;
58
+ type: AlertConditionType.Rainfall;
59
+ }
60
+
61
+ export interface SwellAlertCondition extends AlertConditionBase {
62
+ directions: Direction[];
63
+ rangeSwellMeters: NumberRange;
64
+ type: AlertConditionType.Swell;
65
+ }
66
+
67
+ export interface TemperatureAlertCondition extends AlertConditionBase {
68
+ rangeKelvin: NumberRange;
69
+ type: AlertConditionType.Temperature;
70
+ }
71
+
72
+ export interface TimeAlertCondition extends AlertConditionBase {
73
+ /** Days of the week in which the conditions must be met */
74
+ days: Weekday[];
75
+ /** Hours of the day in which the conditions must be met */
76
+ hours?: NumberRange[];
77
+ /** Minimum duration of meeting the conditions to send the notification */
78
+ minDurationHours: number;
79
+ /** Range of days which will be checked for conditions */
80
+ rangeDays?: NumberRange;
81
+ type: AlertConditionType.Time;
82
+ }
83
+
84
+ export interface WindAlertCondition extends AlertConditionBase {
85
+ directions: Direction[];
86
+ rangeWindMetersPerSecond: NumberRange;
87
+ type: AlertConditionType.Wind;
88
+ }
89
+
90
+ export type AlertCondition =
91
+ | CloudinessAlertCondition
92
+ | FreshSnowAlertCondition
93
+ | RainfallAlertCondition
94
+ | SwellAlertCondition
95
+ | TemperatureAlertCondition
96
+ | TimeAlertCondition
97
+ | WindAlertCondition;
98
+
99
+ /** MongoDb id of the alert */
100
+ export type AlertId = string;
101
+
102
+ export interface AlertResponse extends AlertRequest {
103
+ created: Timestamp;
104
+ updated: Timestamp;
105
+ id: AlertId;
106
+ }
107
+
108
+ /** Group with multiple alerts in it */
109
+ export interface AlertGroupObject extends LatLon {
110
+ key: string;
111
+ locationName: string;
112
+ priority: number;
113
+ alerts: AlertResponse[];
114
+ }
115
+
116
+ /** Enhanced Alert */
117
+ export interface EnhancedAlert extends AlertResponse {
118
+ status: AlertStatus;
119
+ timestamps: Timestamp[];
120
+ }