@windycom/plugin-devtools 1.0.9 → 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.
- package/README.md +4 -0
- package/index.mjs +2 -2
- package/package.json +2 -3
- package/types/client/AccessProducts.d.ts +8 -0
- package/types/client/BottomSveltePlugins.d.ts +8 -0
- package/types/client/Calendar.d.ts +9 -17
- package/types/client/Color.d.ts +43 -90
- package/types/client/Drag.d.ts +8 -1
- package/types/client/Evented.d.ts +4 -0
- package/types/client/ExternalSveltePlugin.d.ts +2 -1
- package/types/client/IDB.d.ts +63 -0
- package/types/client/IconProducts.d.ts +2 -0
- package/types/client/Layer.d.ts +1 -2
- package/types/client/Metric.d.ts +8 -8
- package/types/client/MetricClasses.d.ts +4 -3
- package/types/client/Overlay.d.ts +30 -15
- package/types/client/OverlayClasses.d.ts +11 -7
- package/types/client/Plugin.d.ts +2 -2
- package/types/client/Product.d.ts +53 -30
- package/types/client/RadarPlusProduct.d.ts +19 -0
- package/types/client/Renderer.d.ts +2 -10
- package/types/client/SveltePanePlugin.d.ts +4 -3
- package/types/client/SveltePlugin.d.ts +9 -5
- package/types/client/TileLayer.d.ts +1 -2
- package/types/client/TopoMap.d.ts +10 -0
- package/types/client/Window.d.ts +0 -4
- package/types/client/WindowPlugin.d.ts +15 -10
- package/types/client/appsFlyer.d.ts +3 -0
- package/types/client/baseMap.d.ts +8 -5
- package/types/client/cityLabels.d.ts +10 -2
- package/types/client/cloudSync.d.ts +3 -1
- package/types/client/colorGradients.d.ts +13 -0
- package/types/client/d.ts.files/Calendar.d.ts +11 -2
- package/types/client/d.ts.files/Color.d.ts +16 -5
- package/types/client/d.ts.files/LabelsLayer.d.ts +1 -18
- package/types/client/d.ts.files/Layer.d.ts +8 -1
- package/types/client/d.ts.files/Metric.d.ts +1 -0
- package/types/client/d.ts.files/Renderer.d.ts +22 -1
- package/types/client/d.ts.files/alerts.d.ts +120 -0
- package/types/client/d.ts.files/broadcast.d.ts +44 -17
- package/types/client/d.ts.files/dataSpecifications.d.ts +94 -137
- package/types/client/d.ts.files/favs.d.ts +69 -0
- package/types/client/d.ts.files/incomingMessages.d.ts +0 -4
- package/types/client/d.ts.files/notifications.d.ts +2 -2
- package/types/client/d.ts.files/plugin-params.d.ts +44 -58
- package/types/client/d.ts.files/plugins.d.ts +37 -52
- package/types/client/d.ts.files/pois.d.ts +1 -1
- package/types/client/d.ts.files/products.d.ts +19 -2
- package/types/client/d.ts.files/rootScope.d.ts +3 -21
- package/types/client/d.ts.files/satellite.d.ts +1 -0
- package/types/client/d.ts.files/startup.d.ts +59 -0
- package/types/client/d.ts.files/storage.d.ts +12 -35
- package/types/client/d.ts.files/user.d.ts +79 -24
- package/types/client/device.d.ts +0 -1
- package/types/client/deviceLogging.d.ts +2 -1
- package/types/client/embed2.d.ts +15 -35
- package/types/client/fetch.d.ts +31 -24
- package/types/client/ga.d.ts +4 -0
- package/types/client/geolocation.d.ts +14 -7
- package/types/client/globals.d.ts +1 -0
- package/types/client/http.d.ts +17 -0
- package/types/client/idbInstances.d.ts +45 -0
- package/types/client/interpolator.d.ts +2 -1
- package/types/client/langFiles.d.ts +2 -0
- package/types/client/layers.d.ts +2 -0
- package/types/client/lib.d.ts +7 -25
- package/types/client/libHtml.d.ts +1 -1
- package/types/client/loadArticlesOrWhatsNew.d.ts +1 -0
- package/types/client/log.d.ts +1 -0
- package/types/client/lruCache.d.ts +6 -0
- package/types/client/map.d.ts +17 -6
- package/types/client/mobile.d.ts +33 -27
- package/types/client/models.d.ts +1 -1
- package/types/client/nativeStorage.d.ts +0 -14
- package/types/client/notifications.d.ts +32 -67
- package/types/client/overlays.d.ts +4 -1
- package/types/client/params.d.ts +0 -1
- package/types/client/patchAndPromoCtrl.d.ts +13 -0
- package/types/client/permanentPromos.d.ts +1 -2
- package/types/client/persistentStorage.d.ts +8 -0
- package/types/client/picker.d.ts +1 -1
- package/types/client/pois.d.ts +1 -2
- package/types/client/promo.d.ts +16 -32
- package/types/client/pushNotifications.d.ts +13 -1
- package/types/client/queryString.d.ts +1 -1
- package/types/client/renderUtils.d.ts +1 -1
- package/types/client/renderers.d.ts +7 -3
- package/types/client/rootScope.d.ts +22 -27
- package/types/client/router.d.ts +10 -6
- package/types/client/seoParser.d.ts +21 -0
- package/types/client/serviceWorkerCtrl.d.ts +8 -0
- package/types/client/startupWeather.d.ts +27 -0
- package/types/client/store.d.ts +2 -2
- package/types/client/storeLastPosition.d.ts +1 -0
- package/types/client/subscription.d.ts +1 -0
- package/types/client/swDownloader.d.ts +7 -7
- package/types/client/swProxy.d.ts +1 -1
- package/types/client/swUtils.d.ts +3 -3
- package/types/client/trans.d.ts +26 -37
- package/types/client/user.d.ts +11 -14
- package/types/client/userAlerts.d.ts +68 -0
- package/types/client/userConsent.d.ts +6 -0
- package/types/client/userFavs.d.ts +46 -128
- package/types/client/utils.d.ts +46 -10
- package/types/iconfont.d.ts +6 -4
- package/types/interfaces.d.ts +199 -348
- package/types/lang-files.d.ts +736 -128
- package/types/offline.d.ts +100 -0
- package/types/types.d.ts +116 -29
- package/types/client/Bar.d.ts +0 -114
- package/types/client/BindedBar.d.ts +0 -51
- package/types/client/BindedCheckbox.d.ts +0 -30
- package/types/client/BindedDropDown.d.ts +0 -14
- package/types/client/BindedSwitch.d.ts +0 -35
- package/types/client/BottomTagPlugin.d.ts +0 -8
- package/types/client/Detail1hCheckbox.d.ts +0 -4
- package/types/client/DraggableDiv.d.ts +0 -21
- package/types/client/DropDown.d.ts +0 -37
- package/types/client/GhostBox.d.ts +0 -17
- package/types/client/Legend.d.ts +0 -6
- package/types/client/LongTap.d.ts +0 -21
- package/types/client/MobileCalendar.d.ts +0 -47
- package/types/client/OfflineMessagesClasses.d.ts +0 -30
- package/types/client/ProductSwitch.d.ts +0 -14
- package/types/client/Scrollable.d.ts +0 -14
- package/types/client/Switch.d.ts +0 -24
- package/types/client/TimestampBar.d.ts +0 -8
- package/types/client/Webcams.d.ts +0 -66
- package/types/client/d.ts.files/Product.d.ts +0 -37
- package/types/client/d.ts.files/trans.d.ts +0 -55
- package/types/client/favs.d.ts +0 -83
- package/types/client/hp.d.ts +0 -15
- package/types/client/offlineController.d.ts +0 -20
- /package/types/client/{loadersUI.d.ts → customColors.d.ts} +0 -0
package/types/client/Plugin.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare class Plugin<P extends PluginIdent> {
|
|
|
45
45
|
/**
|
|
46
46
|
* Required language files
|
|
47
47
|
*/
|
|
48
|
-
langFiles
|
|
48
|
+
langFiles: LangFileKey[];
|
|
49
49
|
/**
|
|
50
50
|
* Status of the plugin (is loaded or not)
|
|
51
51
|
*/
|
|
@@ -60,7 +60,7 @@ export declare class Plugin<P extends PluginIdent> {
|
|
|
60
60
|
*/
|
|
61
61
|
pane?: PluginPane;
|
|
62
62
|
/**
|
|
63
|
-
* Is the tag
|
|
63
|
+
* Is the tag currently open?
|
|
64
64
|
*/
|
|
65
65
|
isOpen?: boolean;
|
|
66
66
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Calendar } from '@windy/Calendar';
|
|
2
2
|
import * as http from '@windy/http';
|
|
3
|
-
import type { MinifestObject } from '
|
|
4
|
-
import type { Layers } from '
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
export type
|
|
10
|
-
|
|
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
|
-
*
|
|
45
|
+
* Noneffective, but simple refTime solutions for data that are updated once a day
|
|
46
46
|
*/
|
|
47
47
|
protected dailyCache?: string;
|
|
48
48
|
/**
|
|
@@ -140,15 +140,26 @@ export declare class Product {
|
|
|
140
140
|
* List of avail levels
|
|
141
141
|
*/
|
|
142
142
|
levels?: Levels[];
|
|
143
|
+
/**
|
|
144
|
+
* Override for when some has different levels from rest of model
|
|
145
|
+
*/
|
|
146
|
+
levelsOverride?: Partial<Record<Layers, Levels[]>>;
|
|
143
147
|
/**
|
|
144
148
|
* List of avail isolines
|
|
145
149
|
*/
|
|
146
150
|
isolines: Isolines[];
|
|
147
|
-
requiresInfoJson: boolean;
|
|
148
151
|
/**
|
|
149
152
|
* If we drag out of bounds, which product we should use (must be global air product)
|
|
150
153
|
*/
|
|
151
|
-
|
|
154
|
+
preferredProduct: 'ecmwf' | 'gfs' | 'icon' | 'iconEu';
|
|
155
|
+
/**
|
|
156
|
+
* Preferred product when switching to wave layers
|
|
157
|
+
*/
|
|
158
|
+
preferredWaveProduct: Products;
|
|
159
|
+
/**
|
|
160
|
+
* Preferred product when switching to air layers
|
|
161
|
+
*/
|
|
162
|
+
preferredAirProduct: Products;
|
|
152
163
|
/**
|
|
153
164
|
* Holder of the latest minifest
|
|
154
165
|
*/
|
|
@@ -158,54 +169,66 @@ export declare class Product {
|
|
|
158
169
|
*/
|
|
159
170
|
pathGenerator: string;
|
|
160
171
|
/**
|
|
161
|
-
*
|
|
162
|
-
*/
|
|
163
|
-
acTimes?: AcTimes[];
|
|
164
|
-
/**
|
|
165
|
-
* Alternative server, where the data are loaded from
|
|
172
|
+
* Alternative servers, where the data are loaded from
|
|
166
173
|
*/
|
|
167
174
|
server?: string;
|
|
175
|
+
metadataServer?: string;
|
|
168
176
|
/**
|
|
169
177
|
* Some product (f.ex. StaticProduct) doesn't have meaningful
|
|
170
178
|
* information about the model and time of the next update.
|
|
171
179
|
* Set this to false to hide the info where not relevant (f.ex. Info plugin)
|
|
172
180
|
*/
|
|
173
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;
|
|
174
194
|
constructor(params: ProductInitParams);
|
|
175
|
-
refTime():
|
|
195
|
+
refTime(): YYYYMMDDHH | '';
|
|
176
196
|
getUpdateTimes(): {
|
|
177
|
-
refTime:
|
|
178
|
-
minUpdate:
|
|
179
|
-
} |
|
|
180
|
-
refTime?: undefined;
|
|
181
|
-
minUpdate?: undefined;
|
|
182
|
-
};
|
|
197
|
+
refTime: ISODateString;
|
|
198
|
+
minUpdate: Timestamp;
|
|
199
|
+
} | null;
|
|
183
200
|
moveTs(moveRight: boolean, isAccu?: boolean): boolean | void;
|
|
184
201
|
getMinifestUrl(): string;
|
|
185
202
|
loadMinifest(): Promise<http.HttpPayload<MinifestObject>>;
|
|
203
|
+
loadAndGetReftime(): Promise<ISODateString | undefined>;
|
|
186
204
|
open(): Promise<void | Calendar>;
|
|
187
205
|
close(): void;
|
|
188
206
|
/**
|
|
189
207
|
* Checks if lat,lon is within bounds
|
|
190
208
|
*/
|
|
191
209
|
pointIsInBounds<T extends LatLon>(this: this, paramsMap: T): boolean;
|
|
210
|
+
boundsAreInViewport(map: L.Map): boolean;
|
|
192
211
|
printLogo(): void;
|
|
193
|
-
getInfoFileUrl(): string;
|
|
194
212
|
getCalendar(): Promise<Calendar>;
|
|
195
213
|
protected expire(): void;
|
|
196
|
-
|
|
197
|
-
|
|
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>;
|
|
198
222
|
protected setExpireTime(): void;
|
|
199
223
|
/**
|
|
200
224
|
* Major reason for this error is user's bad connection, which is handled
|
|
201
|
-
* by standard no
|
|
225
|
+
* by standard no connection red message
|
|
202
226
|
*
|
|
203
|
-
* We delay 0.3 sec to test
|
|
227
|
+
* We delay 0.3 sec to test properly connection
|
|
204
228
|
*/
|
|
205
229
|
protected showErrorMessage(err: string): void;
|
|
206
230
|
protected loadAndProcessMinifest(forced?: boolean): Promise<void>;
|
|
207
|
-
protected loadAndProcessInfo(): Promise<void>;
|
|
208
|
-
private loadInfo;
|
|
209
231
|
private checkNewMinifest;
|
|
232
|
+
private isPointInsidePolygon;
|
|
210
233
|
private removeLogo;
|
|
211
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?:
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import { SveltePlugin } from '@windy/SveltePlugin';
|
|
2
2
|
import type { WindowPluginInitParams } from '@windy/WindowPlugin';
|
|
3
3
|
import type { SveltePanePlugins } from '@windy/plugins.d';
|
|
4
|
-
export type SveltePanePluginInitParams<P extends keyof SveltePanePlugins> = Omit<WindowPluginInitParams<P>, 'ident'> & Pick<SveltePanePlugin<P>, 'ident'
|
|
4
|
+
export type SveltePanePluginInitParams<P extends keyof SveltePanePlugins> = Omit<WindowPluginInitParams<P>, 'ident'> & Pick<SveltePanePlugin<P>, 'ident'> & Partial<SveltePanePlugin<P>>;
|
|
5
5
|
/**
|
|
6
6
|
* Common pane plugin, that appear in LH Pane on desktop, RH pane in tablet
|
|
7
7
|
* and appears from bottom on mobile devices
|
|
@@ -11,8 +11,9 @@ export type SveltePanePluginInitParams<P extends keyof SveltePanePlugins> = Omit
|
|
|
11
11
|
export declare class SveltePanePlugin<P extends keyof SveltePanePlugins> extends SveltePlugin<P> {
|
|
12
12
|
ident: P;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* By default all SveltePanePlugins uses dark content
|
|
15
|
+
* Use this property fo enforce light content
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
usesLightContent?: boolean;
|
|
17
18
|
constructor(params: SveltePanePluginInitParams<P>);
|
|
18
19
|
}
|
|
@@ -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
|
-
|
|
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
|
+
}
|
package/types/client/Window.d.ts
CHANGED
|
@@ -31,10 +31,6 @@ export declare class Window {
|
|
|
31
31
|
* Should the item be closed on click somewhere else? True for any click, false ignores everything (default), 'outside' closes Window only when clicking outside the window
|
|
32
32
|
*/
|
|
33
33
|
closeOnClick: boolean | 'outside';
|
|
34
|
-
/**
|
|
35
|
-
* Uses el.style.display = block to hide/display el on page
|
|
36
|
-
*/
|
|
37
|
-
displayBlock: boolean;
|
|
38
34
|
/**
|
|
39
35
|
* How long should closing of the Window last?
|
|
40
36
|
*/
|
|
@@ -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 {
|
|
9
|
-
import type { LoadedTranslations } from '@windy/trans.d';
|
|
8
|
+
import type { BottomSveltePlugins, SveltePanePlugins, SveltePlugins, TagPlugins } from '@windy/plugins.d';
|
|
10
9
|
import type { ParsedQueryString } from '@windy/queryString';
|
|
11
10
|
import type { ListeningPriority } from '@windy/singleclick.d';
|
|
12
|
-
|
|
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'>>;
|
|
@@ -88,10 +88,6 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
|
|
|
88
88
|
* Should the item be closed on click somewhere else? True for any click, false ignores everything (default), 'outside' closes Window only when clicking outside the window
|
|
89
89
|
*/
|
|
90
90
|
closeOnClick: boolean | 'outside';
|
|
91
|
-
/**
|
|
92
|
-
* Uses el.style.display = block to hide/display el on page
|
|
93
|
-
*/
|
|
94
|
-
displayBlock: boolean;
|
|
95
91
|
/**
|
|
96
92
|
* Opening of this plugin logs analytical data to GA (if allowed by user)
|
|
97
93
|
* By default is set to true
|
|
@@ -116,6 +112,15 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
|
|
|
116
112
|
* when opened and at which priority
|
|
117
113
|
*/
|
|
118
114
|
singleclickPriority: ListeningPriority | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Although is standard rhpane or fullscreen plugin, it does not have
|
|
117
|
+
* header with title (adds .no-header class to the plugin container)
|
|
118
|
+
*/
|
|
119
|
+
noHeader?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* While plugin was being opened, closing was requested
|
|
122
|
+
*/
|
|
123
|
+
closingRequested?: boolean;
|
|
119
124
|
constructor(params: WindowPluginInitParams<P>);
|
|
120
125
|
/**
|
|
121
126
|
* Check if plugin is loaded and decides if load or open. Params are passed to onopen fun
|
|
@@ -133,9 +138,9 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
|
|
|
133
138
|
/**
|
|
134
139
|
* Ready to be overloaded: Will be called before unmounting
|
|
135
140
|
*/
|
|
136
|
-
ondestroy(
|
|
141
|
+
ondestroy(): void;
|
|
137
142
|
/**
|
|
138
|
-
* Ready to be overloaded: Will be called before plugin is loaded, sync action called
|
|
143
|
+
* Ready to be overloaded: Will be called before plugin is loaded, sync action called immediately after rqstOpen is fired
|
|
139
144
|
*/
|
|
140
145
|
beforeLoad(..._args: unknown[]): void;
|
|
141
146
|
/**
|
|
@@ -143,7 +148,7 @@ export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extend
|
|
|
143
148
|
*/
|
|
144
149
|
onRouteMatch({ groups }: string[] & {
|
|
145
150
|
groups: PluginsOpenParams[P];
|
|
146
|
-
}, _qs?: ParsedQueryString): PluginsOpenParams[P] |
|
|
151
|
+
}, _qs?: ParsedQueryString): PluginsOpenParams[P] | undefined;
|
|
147
152
|
/**
|
|
148
153
|
* When called with params, it will create valid URL for plugin
|
|
149
154
|
* as defined in router property.
|
|
@@ -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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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<
|
|
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;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LoadedTranslations } from '@windy/
|
|
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
|
-
| '
|
|
62
|
-
| '
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -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
|
+
}
|