@windycom/plugin-devtools 3.0.0 → 3.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 (97) hide show
  1. package/README.md +2 -0
  2. package/package.json +1 -1
  3. package/types/client/BottomSlide.d.ts +3 -0
  4. package/types/client/Calendar.d.ts +101 -71
  5. package/types/client/Color.d.ts +19 -6
  6. package/types/client/DataTiler.d.ts +1 -1
  7. package/types/client/ExternalSveltePlugin.d.ts +6 -1
  8. package/types/client/IDB.d.ts +7 -1
  9. package/types/client/Layer.d.ts +95 -26
  10. package/types/client/LayerClasses.d.ts +5 -0
  11. package/types/client/Metric.d.ts +32 -43
  12. package/types/client/Overlay.d.ts +7 -10
  13. package/types/client/OverlayClasses.d.ts +8 -0
  14. package/types/client/Particles.d.ts +1 -1
  15. package/types/client/Plugin.d.ts +4 -0
  16. package/types/client/Product.d.ts +31 -73
  17. package/types/client/ProductClasses.d.ts +44 -0
  18. package/types/client/Renderer.d.ts +41 -13
  19. package/types/client/SveltePlugin.d.ts +7 -0
  20. package/types/client/TileLayer.d.ts +2 -2
  21. package/types/client/TopoMap.d.ts +2 -3
  22. package/types/client/WindowPlugin.d.ts +9 -5
  23. package/types/client/colorGradients.d.ts +5 -10
  24. package/types/client/colors.d.ts +1 -2
  25. package/types/client/compatibilityCheck.d.ts +1 -0
  26. package/types/client/connection.d.ts +1 -1
  27. package/types/client/d.ts.files/LabelsLayer.d.ts +2 -2
  28. package/types/client/d.ts.files/Metric.d.ts +21 -2
  29. package/types/client/d.ts.files/TileLayerCanvas.d.ts +3 -3
  30. package/types/client/d.ts.files/alerts.d.ts +2 -2
  31. package/types/client/d.ts.files/broadcast.d.ts +17 -12
  32. package/types/client/d.ts.files/dataSpecifications.d.ts +76 -53
  33. package/types/client/d.ts.files/favs.d.ts +18 -30
  34. package/types/client/d.ts.files/http.d.ts +5 -0
  35. package/types/client/d.ts.files/lib.d.ts +5 -8
  36. package/types/client/d.ts.files/plugin-params.d.ts +32 -20
  37. package/types/client/d.ts.files/plugins.d.ts +2 -3
  38. package/types/client/d.ts.files/rootScope.d.ts +14 -12
  39. package/types/client/d.ts.files/startup.d.ts +17 -11
  40. package/types/client/d.ts.files/user.d.ts +3 -0
  41. package/types/client/d.ts.files/{Webcams.d.ts → webcams.d.ts} +9 -2
  42. package/types/client/dataLoader.d.ts +2 -2
  43. package/types/client/device.d.ts +1 -0
  44. package/types/client/embed.d.ts +68 -0
  45. package/types/client/errorLogger.d.ts +28 -3
  46. package/types/client/errors.d.ts +6 -0
  47. package/types/client/externalPlugins.d.ts +2 -0
  48. package/types/client/fetch.d.ts +42 -6
  49. package/types/client/format.d.ts +2 -1
  50. package/types/client/glTileRender.d.ts +1 -7
  51. package/types/client/http.d.ts +0 -6
  52. package/types/client/idbInstances.d.ts +123 -21
  53. package/types/client/imakerMain.d.ts +49 -0
  54. package/types/client/latestBroadcasts.d.ts +1 -1
  55. package/types/client/layers.d.ts +3 -1
  56. package/types/client/legends.d.ts +1 -1
  57. package/types/client/lib.d.ts +1 -10
  58. package/types/client/libHtml.d.ts +1 -1
  59. package/types/client/liveAlerts.d.ts +5 -0
  60. package/types/client/liveAlerts.types.d.ts +28 -0
  61. package/types/client/location.d.ts +5 -0
  62. package/types/client/log.d.ts +3 -1
  63. package/types/client/map.d.ts +7 -1
  64. package/types/client/mobile.d.ts +3 -9
  65. package/types/client/models.d.ts +7 -9
  66. package/types/client/notifications.d.ts +2 -5
  67. package/types/client/overlays.d.ts +2 -1
  68. package/types/client/particleRenderers.d.ts +1 -1
  69. package/types/client/products.d.ts +54 -2
  70. package/types/client/promo.d.ts +28 -5
  71. package/types/client/pushNotifications.d.ts +7 -1
  72. package/types/client/renderCtrl.d.ts +1 -1
  73. package/types/client/renderTile.d.ts +2 -2
  74. package/types/client/renderUtils.d.ts +16 -36
  75. package/types/client/renderers.d.ts +2 -4
  76. package/types/client/reverseName.d.ts +2 -1
  77. package/types/client/rhMessage.d.ts +1 -1
  78. package/types/client/rootScope.d.ts +22 -6
  79. package/types/client/router.d.ts +8 -5
  80. package/types/client/store.d.ts +20 -52
  81. package/types/client/storeLastPosition.d.ts +4 -1
  82. package/types/client/tileInterpolator.d.ts +1 -1
  83. package/types/client/user.d.ts +2 -0
  84. package/types/client/userAlerts.d.ts +0 -4
  85. package/types/client/userFavs.d.ts +12 -0
  86. package/types/client/utils.d.ts +57 -20
  87. package/types/iconfont.d.ts +7 -0
  88. package/types/interfaces.d.ts +339 -81
  89. package/types/lang-files.d.ts +783 -19
  90. package/types/types.d.ts +352 -23
  91. package/types/client/d.ts.files/Calendar.d.ts +0 -96
  92. package/types/client/d.ts.files/Color.d.ts +0 -93
  93. package/types/client/d.ts.files/Layer.d.ts +0 -191
  94. package/types/client/d.ts.files/Renderer.d.ts +0 -44
  95. package/types/client/d.ts.files/errorLogger.d.ts +0 -35
  96. package/types/client/d.ts.files/products.d.ts +0 -61
  97. package/types/offline.d.ts +0 -100
@@ -1,12 +1,10 @@
1
- import type { Layer } from '@windy/Layer';
2
- import type { LayerMetricType, Layers } from '@windy/Layer.d';
1
+ import type { LayerMetricType, Layers, Layer } from '@windy/Layer';
3
2
  import type { Metric } from '@windy/Metric';
4
3
  import type { DirectionFunction } from '@windy/format.d';
5
4
  import type { Iconfont } from '@windy/iconfont.d';
6
5
  import type { Overlays } from '@windy/rootScope.d';
7
6
  import type { RGBNumValues } from '@windy/interpolatorTypes';
8
- import type { LoadedTranslations, HTMLString } from '@windy/types';
9
- import type { RGBAString } from '@windy/Color.d';
7
+ import type { LoadedTranslations, HTMLString, RGBString } from '@windy/types';
10
8
  export type UsedOverlays = Overlays | 'swell' | 'satelliteIRBT';
11
9
  export type OverlayInitParams = Pick<Overlay, 'ident'> & Partial<Overlay>;
12
10
  type LayerProperty<L extends Layer | undefined, P extends keyof Layer> = L extends Layer ? L[P] : undefined;
@@ -81,6 +79,10 @@ export declare class Overlay<I extends Overlays = Overlays, M extends I extends
81
79
  * Hides particle on/off switch in GUI (so far used only in desktop GUI)
82
80
  */
83
81
  hideParticles?: boolean;
82
+ /**
83
+ * Disables isolines on/off switch in GUI
84
+ */
85
+ hideIsolines?: boolean;
84
86
  /**
85
87
  * Given overlay display accumulation
86
88
  */
@@ -112,7 +114,7 @@ export declare class Overlay<I extends Overlays = Overlays, M extends I extends
112
114
  * Optional promo badge to be displayed in GUI
113
115
  */
114
116
  promoBadge?: string;
115
- promoBadgeColor?: RGBAString;
117
+ promoBadgeColor?: RGBString;
116
118
  /**
117
119
  * Optional menu image thumbnail
118
120
  */
@@ -146,11 +148,6 @@ export declare class Overlay<I extends Overlays = Overlays, M extends I extends
146
148
  * Return ident of menu item (usualy `ident` but some inner overlays has `partOf` and are not directly in menu)
147
149
  */
148
150
  getMenuIdent(): Overlays;
149
- /**
150
- * Custom onopen methods, currently unused
151
- */
152
- onopen?(): void;
153
- onclose?(): void;
154
151
  /**
155
152
  * Create part of inner text of picker
156
153
  * @param values Interpolated values
@@ -31,3 +31,11 @@ export declare class CloudsOverlay<I extends Overlays = Overlays> extends Overla
31
31
  hidePickerElevation: boolean;
32
32
  createPickerHTML(values: RGBNumValues): string;
33
33
  }
34
+ export declare class AqiOverlay<I extends Overlays = Overlays> extends Overlay<I> {
35
+ hidePickerElevation: boolean;
36
+ labels: {
37
+ [value: number]: keyof LoadedTranslations;
38
+ };
39
+ getAirQLabel(aqi: number): string;
40
+ createPickerHTML(values: RGBNumValues): string;
41
+ }
@@ -1,4 +1,4 @@
1
- import type { RGBAString, RGBA } from '@windy/Color.d';
1
+ import type { RGBAString, RGBA } from '@windy/types.d';
2
2
  import type { Levels } from '@windy/rootScope.d';
3
3
  import type { ExtendedRenderParams } from '@windy/interfaces.d';
4
4
  import type { CustomParticles } from '@windy/dataSpecifications.d';
@@ -109,6 +109,10 @@ export declare class Plugin<P extends PluginIdent> {
109
109
  * Ready to be overloaded
110
110
  */
111
111
  paramsChanged(..._args: unknown[]): void;
112
+ /**
113
+ * Ready to be overloaded
114
+ */
115
+ onRenderStart(..._args: unknown[]): void;
112
116
  protected initProperties(): void;
113
117
  }
114
118
  export {};
@@ -1,50 +1,25 @@
1
1
  import { Calendar } from '@windy/Calendar';
2
- import * as http from '@windy/http';
3
- import type { MinifestObject } from '@windy/Calendar.d';
4
- import type { Layers } from '@windy/Layer.d';
2
+ import type { MinifestObject } from '@windy/Calendar';
3
+ import type { Layers } from '@windy/Layer';
5
4
  import type { LatLon } from '@windy/interfaces';
6
5
  import type { Isolines, Levels, Overlays, Products } from '@windy/rootScope.d';
7
- import type { ISODateString, ProductCategory, ProductIdent, Timestamp, YYYYMMDDHH } from '@windy/types';
6
+ import type { ISODateString, ProductCategory, ProductIdent, Timestamp, Path, Minutes } from '@windy/types';
8
7
  export type DataQuality = 'normal' | 'high' | 'low' | 'ultra' | 'extreme';
9
8
  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'>> & {
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' | 'isolines' | 'directory' | 'category' | 'modelIdent' | 'intervalPremium' | 'server' | 'modelResolution' | 'levels' | 'levelsOverride' | 'logo' | 'preferredWaveProduct' | 'preferredAirProduct' | 'hasAccumulations' | 'hasMinifest' | 'freeProduct' | 'hideProductSwitch' | 'modelDescription'>> & {
11
10
  forecastSize?: number;
12
11
  bounds?: [number, number][][];
13
12
  };
14
13
  export declare class Product {
15
- /**
16
- * Minifest loading promise
17
- */
18
- protected loadingPromise?: null | Promise<Calendar | undefined | void>;
19
- /**
20
- * Version of minifest used
21
- */
22
- protected infoVersion?: string;
23
- /**
24
- * minifest loading timer
25
- */
26
- private refreshInterval?;
27
- /**
28
- * Timestamp of last minifest check
29
- */
30
- private minifestTimestamp;
31
14
  /**
32
15
  * Boundaries of the product in a format [[north, west], [north, east], [south, east], [south, west]] or any more accurate polygon
33
16
  */
34
17
  private bounds?;
18
+ private minifestExpirationTime;
35
19
  /**
36
- * Has binded listeners
37
- */
38
- private hasListeners;
39
- private bindedCheckNewMinifest;
40
- /**
41
- * When the product will expire (in ms)
42
- */
43
- private productExpires;
44
- /**
45
- * Noneffective, but simple refTime solutions for data that are updated once a day
20
+ * Minifest loading promise
46
21
  */
47
- protected dailyCache?: string;
22
+ protected loadingPromise?: null | Promise<Calendar | undefined | void>;
48
23
  /**
49
24
  * Must contain ident of self
50
25
  */
@@ -104,11 +79,15 @@ export declare class Product {
104
79
  modelName: string;
105
80
  modelResolution?: number;
106
81
  provider?: string;
82
+ /**
83
+ * Optional model description
84
+ */
85
+ modelDescription?: string;
107
86
  /**
108
87
  * Update interval (in minutes)
109
88
  */
110
- interval: number;
111
- intervalPremium?: number;
89
+ interval: Minutes;
90
+ intervalPremium?: Minutes;
112
91
  /**
113
92
  * Usual length of forecast in hours (used upon creation of backup minifest)
114
93
  */
@@ -164,21 +143,16 @@ export declare class Product {
164
143
  * Holder of the latest minifest
165
144
  */
166
145
  minifest?: MinifestObject | null;
167
- /**
168
- * How the data image path should be constructed
169
- */
170
- pathGenerator: string;
171
146
  /**
172
147
  * Alternative servers, where the data are loaded from
173
148
  */
174
149
  server?: string;
175
- metadataServer?: string;
176
150
  /**
177
- * Some product (f.ex. StaticProduct) doesn't have meaningful
151
+ * Some product doesn't have meaningful
178
152
  * information about the model and time of the next update.
179
153
  * Set this to false to hide the info where not relevant (f.ex. Info plugin)
180
154
  */
181
- hasRefTime: boolean;
155
+ hasMinifest: boolean;
182
156
  /**
183
157
  * This product supper accumulations
184
158
  */
@@ -191,44 +165,28 @@ export declare class Product {
191
165
  * Hide product switch in GUI, when this product is selected
192
166
  */
193
167
  hideProductSwitch?: boolean;
168
+ /**
169
+ * Time when minifest was last updated
170
+ */
171
+ minifestLastUpdate?: Timestamp;
194
172
  constructor(params: ProductInitParams);
195
- refTime(): YYYYMMDDHH | '';
196
- getUpdateTimes(): {
197
- refTime: ISODateString;
198
- minUpdate: Timestamp;
199
- } | null;
200
- moveTs(moveRight: boolean, isAccu?: boolean): boolean | void;
201
- getMinifestUrl(): string;
202
- loadMinifest(): Promise<http.HttpPayload<MinifestObject>>;
203
- loadAndGetReftime(): Promise<ISODateString | undefined>;
204
- open(): Promise<void | Calendar>;
205
- close(): void;
173
+ getRefTimeISOFormat(): Promise<ISODateString | undefined>;
174
+ getRefTime(): Promise<Path | undefined>;
206
175
  /**
207
- * Checks if lat,lon is within bounds
176
+ * Loads & returns a minifest. Since our @windy/http module has its own cache, we don't need to
177
+ * cache ongoing requests promise and simplify the code as much as possible
208
178
  */
209
- pointIsInBounds<T extends LatLon>(this: this, paramsMap: T): boolean;
210
- boundsAreInViewport(map: L.Map): boolean;
211
- printLogo(): void;
212
- getCalendar(): Promise<Calendar>;
213
- protected expire(): void;
179
+ loadMinifest(): Promise<MinifestObject>;
214
180
  /**
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
181
+ * Checks if lat,lon is within bounds
220
182
  */
221
- protected getUpdatedMinifest(minifest: MinifestObject): Promise<MinifestObject>;
222
- protected setExpireTime(): void;
183
+ pointIsInBounds<T extends LatLon>(this: this, paramsMap: T): boolean;
223
184
  /**
224
- * Major reason for this error is user's bad connection, which is handled
225
- * by standard no connection red message
226
- *
227
- * We delay 0.3 sec to test properly connection
185
+ * Detects if the the bounds are in viewport
228
186
  */
229
- protected showErrorMessage(err: string): void;
230
- protected loadAndProcessMinifest(forced?: boolean): Promise<void>;
231
- private checkNewMinifest;
187
+ boundsAreInViewport(map: L.Map): boolean;
188
+ close(): void;
189
+ open(): void;
190
+ getCalendar(): Promise<Calendar | undefined>;
232
191
  private isPointInsidePolygon;
233
- private removeLogo;
234
192
  }
@@ -0,0 +1,44 @@
1
+ import { Calendar } from '@windy/Calendar';
2
+ import { Product } from '@windy/Product';
3
+ import type { ProductInitParams } from '@windy/Product';
4
+ import type { MinifestObject } from '@windy/Calendar';
5
+ import type { Overlays } from '@windy/rootScope.d';
6
+ export declare class EcmwfProduct extends Product {
7
+ calendar: Calendar;
8
+ constructor(params: Partial<ProductInitParams>);
9
+ }
10
+ export declare class EcmwfForecastProduct extends EcmwfProduct {
11
+ /**
12
+ * Main goal for custom loadMInifest method is to speed up loading of default minifest little bit.
13
+ * Default minifests are loaded ASAP in inlined JS code inside (index|mobile).html so they are
14
+ * available faster, then when loaded after parsing all the rest of JS code.
15
+ *
16
+ * After any change in the code, check in DevTools, that this mechanism actually works.
17
+ */
18
+ loadMinifest(): Promise<MinifestObject>;
19
+ }
20
+ export declare class HrrrProducts extends Product {
21
+ constructor(params: Partial<ProductInitParams>);
22
+ }
23
+ export declare const iconOverlays: Overlays[];
24
+ export declare class IconProducts extends Product {
25
+ constructor(params: Pick<ProductInitParams, 'modelName'> & Partial<ProductInitParams>);
26
+ }
27
+ export type SatelliteProductInitParams = Pick<SatAndRadarPlusProduct, 'urlSuff' | 'urlSuffFlow'> & ProductInitParams;
28
+ export declare class SatAndRadarPlusProduct extends Product {
29
+ urlSuff: string;
30
+ urlSuffFlow: string;
31
+ constructor(params: SatelliteProductInitParams);
32
+ }
33
+ export declare class NamProducts extends Product {
34
+ constructor(params: Partial<ProductInitParams>);
35
+ }
36
+ export declare class AccessProduct extends Product {
37
+ constructor(params: Partial<ProductInitParams>);
38
+ }
39
+ export declare class AccessCProduct extends AccessProduct {
40
+ constructor(params: Partial<ProductInitParams>);
41
+ }
42
+ export declare class AromeProduct extends Product {
43
+ constructor(params: Partial<ProductInitParams>);
44
+ }
@@ -1,9 +1,30 @@
1
- import type { FullRenderParameters } from './d.ts.files/Layer.d';
2
- import type { Renderers, AllowedUserControls, AllowedRenderPlugins, RendererInitParams } from './d.ts.files/Renderer.d';
3
- import type { InterpolatorFactory } from './d.ts.files/interpolator';
1
+ import type { FullRenderParameters, WeatherParameters, TilePoint } from '@windy/interfaces';
2
+ import type { Timestamp, TransformFunction } from '@windy/types';
3
+ import type { Layers } from '@windy/Layer';
4
+ import type { InterpolatorFactory } from '@windy/interpolator';
5
+ import type { BottomSveltePlugins, Plugins, SveltePlugins } from '@windy/plugins.d';
6
+ import type { TileLayerCanvas } from '@windy/TileLayerCanvas.d';
7
+ export type AllowedRenderPlugins = Pick<Plugins, 'radar' | 'satellite' | 'radar-plus' | 'cap-alerts' | 'isolines' | 'gl-particles'>;
8
+ export type Renderers = 'tileLayer' | 'radar' | 'satellite' | 'radarPlus' | 'capAlerts' | 'isolines' | 'particles' | 'accumulations' | 'daySwitcher' | 'noUserControl' | 'topoMap';
9
+ export interface TileParams extends TilePoint {
10
+ url: string;
11
+ intX: number;
12
+ intY: number;
13
+ trans: number;
14
+ transformR: TransformFunction | null;
15
+ transformG: TransformFunction | null;
16
+ transformB: TransformFunction | null;
17
+ }
18
+ export type AllowedUserControls = keyof BottomSveltePlugins | keyof SveltePlugins | 'none';
19
+ export interface RendererInitParams {
20
+ ident: Renderers;
21
+ dependency?: keyof AllowedRenderPlugins;
22
+ userControl?: AllowedUserControls;
23
+ requiresFullRenderParams?: boolean;
24
+ }
4
25
  /**
5
- * Renderer class act as a proxy between renderController and code, which is responsible to
6
- * render particullar layer.
26
+ * Renderer class acts as a proxy between renderController and code, which is responsible for
27
+ * rendering a particular layer
7
28
  */
8
29
  export declare class Renderer<K extends keyof AllowedRenderPlugins | undefined = undefined, P extends K extends keyof AllowedRenderPlugins ? WPluginModules[`@plugins/${K}`] : undefined = K extends keyof AllowedRenderPlugins ? WPluginModules[`@plugins/${K}`] : undefined> {
9
30
  isOpen: boolean;
@@ -15,7 +36,7 @@ export declare class Renderer<K extends keyof AllowedRenderPlugins | undefined =
15
36
  /**
16
37
  * Dependency plugin that wil be loaded before renderer is launched
17
38
  *
18
- * Dependency plugin can optinally export these methods:
39
+ * Dependency plugin can optionally export these methods:
19
40
  *
20
41
  * - onRenderStart
21
42
  * - onRenderEnd
@@ -27,7 +48,7 @@ export declare class Renderer<K extends keyof AllowedRenderPlugins | undefined =
27
48
  /**
28
49
  * Loaded version of plugin dependency
29
50
  */
30
- loadedDependency?: P;
51
+ loadedDependency?: P | typeof TileLayerCanvas;
31
52
  /**
32
53
  * ID of plugin, that serve as user control, which can be attached to DOM
33
54
  * usually to #plugin-bottom div.
@@ -44,18 +65,25 @@ export declare class Renderer<K extends keyof AllowedRenderPlugins | undefined =
44
65
  */
45
66
  userControl?: AllowedUserControls;
46
67
  /**
47
- * Picker ingerpolation factory
68
+ * Picker interpolation factory
48
69
  */
49
70
  interpolator?: InterpolatorFactory;
71
+ /**
72
+ * Instance of this renderer requires FullRenderParameters to be passed
73
+ * to renderer methods
74
+ */
75
+ requiresFullRenderParams: boolean;
50
76
  constructor(params: RendererInitParams);
51
- open(params: FullRenderParameters): Promise<void>;
77
+ open(layerIdent: Layers, weatherParams: WeatherParameters, timestamp: Timestamp): Promise<void>;
52
78
  /**
53
- * Called by rndrCtrl
54
- * list of required renderers, so we kno who will replace us
79
+ * Called by rndrCtrl. Requires list of required renderers,
80
+ * so we kno who will replace us. This parameters is here just because of
81
+ * TileLayer, which is just wrapper around Leaflet GridLayer, and we want to
82
+ * keep this Leaflet instance alive.
55
83
  */
56
84
  close(_rqrdRenderers: Renderers[]): void;
57
- onopen(params: FullRenderParameters): void;
85
+ onopen(params?: FullRenderParameters): void;
58
86
  onclose(): void;
59
- paramsChanged(params: FullRenderParameters): void;
87
+ paramsChanged(layerIdent: Layers, weatherParams: WeatherParameters, timestamp: Timestamp): Promise<void>;
60
88
  redraw(): void;
61
89
  }
@@ -2,13 +2,18 @@ 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
4
  import type { BottomSveltePlugins, SveltePanePlugins, SveltePlugins } from '@windy/plugins.d';
5
+ import type { InterpolatorFactory } from '@windy/interpolator';
6
+ import type { FullRenderParameters } from '@windy/interfaces';
5
7
  export declare class SvelteApp<P extends keyof SveltePlugins | keyof SveltePanePlugins | keyof BottomSveltePlugins> {
8
+ interpolator?: InterpolatorFactory;
6
9
  constructor(_args: {
7
10
  target: HTMLElement;
8
11
  anchor: HTMLElement;
9
12
  });
10
13
  onopen(params?: PluginsOpenParams[P], qs?: PluginsQsParams[P]): void;
11
14
  onclose(): void;
15
+ paramsChanged(params?: FullRenderParameters): void;
16
+ onRenderStart(params?: FullRenderParameters): void;
12
17
  $destroy(): void;
13
18
  }
14
19
  /**
@@ -39,6 +44,8 @@ export declare class SveltePlugin<P extends keyof SveltePlugins | keyof SveltePa
39
44
  });
40
45
  onopen(params?: PluginsOpenParams[P], _qs?: PluginsQsParams[P]): void;
41
46
  ondestroy(): void;
47
+ paramsChanged(params?: FullRenderParameters): void;
48
+ onRenderStart: (params?: FullRenderParameters) => void;
42
49
  protected mount(): void;
43
50
  protected unmount(): void;
44
51
  }
@@ -1,6 +1,6 @@
1
1
  import { Renderer } from '@windy/Renderer';
2
- import type { FullRenderParameters } from '@windy/Layer.d';
3
- import type { RendererInitParams, Renderers } from '@windy/Renderer.d';
2
+ import type { FullRenderParameters } from '@windy/interfaces';
3
+ import type { RendererInitParams, Renderers } from '@windy/Renderer';
4
4
  export declare class TileLayer extends Renderer {
5
5
  constructor(params: RendererInitParams);
6
6
  onopen(params?: FullRenderParameters): void;
@@ -1,9 +1,8 @@
1
1
  import { Renderer } from '@windy/Renderer';
2
- import type { FullRenderParameters } from '@windy/Layer.d';
3
- import type { Renderers } from '@windy/Renderer.d';
2
+ import type { Renderers } from '@windy/Renderer';
4
3
  export declare class TopoMap extends Renderer {
5
4
  baseLayer: L.GridLayer | null;
6
- open(_params: FullRenderParameters): Promise<void>;
5
+ open(): Promise<void>;
7
6
  close(rqrdRenderers: Renderers[]): void;
8
7
  addOrUpdateBaseLayer(): void;
9
8
  removeBaseLayer(): void;
@@ -1,3 +1,4 @@
1
+ import { BottomSlide } from '@windy/BottomSlide';
1
2
  import { Plugin } from '@windy/Plugin';
2
3
  import { Window } from '@windy/Window';
3
4
  import type { PluginInitParams } from '@windy/Plugin';
@@ -6,9 +7,8 @@ import type { PluginOpeningOptions, WindowClosingOptions } from '@windy/interfac
6
7
  import type { InterpolatorFactory } from '@windy/interpolator';
7
8
  import type { PluginsOpenParams, PluginsQsParams } from '@windy/plugin-params.d';
8
9
  import type { BottomSveltePlugins, SveltePanePlugins, SveltePlugins, TagPlugins } from '@windy/plugins.d';
9
- import type { ParsedQueryString } from '@windy/queryString';
10
10
  import type { ListeningPriority } from '@windy/singleclick.d';
11
- import type { LoadedTranslations } from '@windy/types';
11
+ import type { LoadedTranslations, ParsedQueryString } from '@windy/types';
12
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) */
@@ -26,6 +26,7 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
26
26
  * ID of CSS style
27
27
  */
28
28
  protected cssID: `plugin-css-${string}`;
29
+ protected bottomSlide?: BottomSlide;
29
30
  /**
30
31
  * Was CSS inserted into the DOM
31
32
  */
@@ -145,10 +146,13 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
145
146
  beforeLoad(..._args: unknown[]): void;
146
147
  /**
147
148
  * Called by router when URL matches plugin's router (feel free to overload it)
149
+ *
150
+ * Typing is difficult here, because captured groups provide just object with string values
151
+ * and we dunno that it adheres to PluginsOpenParams[P] type.
152
+ *
153
+ * Yet the return type MUST BE PluginsOpenParams[P] so it can be used
148
154
  */
149
- onRouteMatch({ groups }: string[] & {
150
- groups: PluginsOpenParams[P];
151
- }, _qs?: ParsedQueryString): PluginsOpenParams[P] | undefined;
155
+ onRouteMatch(regExpGroups: Record<string, string>, _qs?: ParsedQueryString): PluginsOpenParams[P];
152
156
  /**
153
157
  * When called with params, it will create valid URL for plugin
154
158
  * as defined in router property.
@@ -1,13 +1,8 @@
1
1
  /**
2
2
  * Reusable color gradients
3
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;
4
+ import type { RGBString, ColorGradientString } from '@windy/types.d';
5
+ export declare const moistureAnomaly: RGBString[];
6
+ export declare const airPollutant: RGBString[];
7
+ export declare const cloudBaseAndVisibility: RGBString[];
8
+ export declare const radarGradientAndValues: ColorGradientString;
@@ -1,4 +1,3 @@
1
- import { Color } from '@windy/Color';
2
- import type { ColorIdent } from '@windy/Color.d';
1
+ import { Color, type ColorIdent } from '@windy/Color';
3
2
  declare const colors: Record<ColorIdent, Color>;
4
3
  export default colors;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Connection is lost, user is offline
3
3
  */
4
- export declare function testNetworkConnection(): void;
4
+ export declare function testNetworkConnection(): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { Timestamp } from '@windy/types.d';
1
+ import { Timestamp, type NumOrNull } from '@windy/types.d';
2
2
 
3
3
  type CityDivId = string; // `${x}:${y}`
4
4
  type CityLabelId = string; // `${lat}/${lon}`
@@ -18,7 +18,7 @@ export interface CityLabel {
18
18
  el: HTMLDivElement;
19
19
 
20
20
  /** Forecast data with temperature in K, it is lazy loaded with forecast request */
21
- data?: number[];
21
+ data?: NumOrNull[];
22
22
  }
23
23
 
24
24
  /** Representation of one leaflet tile with its CityLabels */
@@ -6,6 +6,7 @@ import {
6
6
  SatelliteMetric,
7
7
  UVIndexMetric,
8
8
  } from '@windy/MetricClasses';
9
+ import { Metric } from '@windy/Metric';
9
10
  import { NumValue } from '@windy/types.d';
10
11
 
11
12
  /*
@@ -53,7 +54,9 @@ export type MetricItem =
53
54
  | 'uvindex'
54
55
  | 'EDR'
55
56
  | 'km²'
56
- | 'acres';
57
+ | 'acres'
58
+ | 'AQI'
59
+ | 'gr./m³';
57
60
 
58
61
  /**
59
62
  * # @windy/metrics
@@ -121,6 +124,8 @@ export interface MetricTypes {
121
124
  turbulence: NumberedMetric;
122
125
  icing: NumberedMetric;
123
126
  area: NumberedMetric;
127
+ aqi: NumberedMetric;
128
+ pollen: NumberedMetric;
124
129
  }
125
130
 
126
131
  /** @ignore */
@@ -190,4 +195,18 @@ export interface Conversion {
190
195
  export type ConvObj = { [K in MetricItem]?: Conversion };
191
196
 
192
197
  /** @ignore */
193
- export type MetricInitParams = Pick<NumberedMetric, 'ident'> & Partial<NumberedMetric>;
198
+ export type MetricInitParams = Pick<Metric, 'ident'> &
199
+ Partial<
200
+ Pick<
201
+ Metric,
202
+ | 'lines'
203
+ | 'conv'
204
+ | 'backConv'
205
+ | 'defaults'
206
+ | 'cohesion'
207
+ | 'nativeSync'
208
+ | 'description'
209
+ | 'separator'
210
+ | 'discreteLegend'
211
+ >
212
+ >;
@@ -1,7 +1,7 @@
1
1
  import { DataTile } from '@windy/dataLoader';
2
2
 
3
- import { FullRenderParameters } from '@windy/Layer.d';
4
- import { TileParams } from '@windy/Renderer.d';
3
+ import { FullRenderParameters } from '@windy/interfaces';
4
+ import { TileParams } from '@windy/Renderer';
5
5
 
6
6
  export type InternalTile = L.InternalTiles[string] & { el: HTMLCanvasElement };
7
7
 
@@ -34,7 +34,7 @@ export class TileLayerCanvas extends L.GridLayer {
34
34
  _tilesToLoad: number;
35
35
 
36
36
  /**
37
- * Owerwriting TileLayer method to disable redrawing layers w/o params
37
+ * Overwriting TileLayer method to disable redrawing layers w/o params
38
38
  */
39
39
  // @ts-expect-error We rape TS with overloading properties with properties of different input and output (TODO fix)
40
40
  onAdd(this: this, map: L.Map): this;
@@ -20,10 +20,9 @@ export interface AlertRequest {
20
20
  priority?: number;
21
21
  suspended: boolean;
22
22
  userInterest: UserInterest;
23
+ hasCustomDescription?: boolean;
23
24
  }
24
25
 
25
- type Extends<T, U extends T> = U;
26
-
27
26
  export type GlobalProductWithWaves = Extends<Products, 'ecmwf' | 'gfs' | 'icon' | 'mblue'>;
28
27
 
29
28
  export interface AlertCheckResponse {
@@ -40,6 +39,7 @@ export interface NumberRange {
40
39
 
41
40
  export interface AlertConditionBase {
42
41
  type: AlertConditionType;
42
+ valid?: boolean;
43
43
  }
44
44
 
45
45
  export interface CloudinessAlertCondition extends AlertConditionBase {