@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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Iconfont } from './d.ts.files/iconfont';
|
|
2
|
-
import type {
|
|
3
|
-
import type { LoadedTranslations } from './d.ts.files/trans.d';
|
|
2
|
+
import type { LoadedTranslations } from './d.ts.files/types';
|
|
4
3
|
/**
|
|
5
4
|
* Version of Windy.com client (as taken from package.json)
|
|
6
5
|
* @ignore
|
|
@@ -15,12 +14,12 @@ export declare const target: "mobile" | "index" | "lib" | "embed2";
|
|
|
15
14
|
* Platform
|
|
16
15
|
* @ignore
|
|
17
16
|
*/
|
|
18
|
-
export declare const platform: import("
|
|
17
|
+
export declare const platform: import("@windy/types").Platform;
|
|
19
18
|
/**
|
|
20
19
|
* Device
|
|
21
20
|
* @ignore
|
|
22
21
|
*/
|
|
23
|
-
export declare const device: import("
|
|
22
|
+
export declare const device: import("@windy/types").Device;
|
|
24
23
|
/**
|
|
25
24
|
* List of Windy's supported languages
|
|
26
25
|
*/
|
|
@@ -62,36 +61,31 @@ export declare const assets: string;
|
|
|
62
61
|
* Supported list of weather levels
|
|
63
62
|
*/
|
|
64
63
|
export declare const levels: readonly ["surface", "100m", "975h", "950h", "925h", "900h", "850h", "800h", "700h", "600h", "500h", "400h", "300h", "250h", "200h", "150h", "10h"];
|
|
65
|
-
/**
|
|
66
|
-
* Point forecast API endpoint prefix
|
|
67
|
-
* @ignore
|
|
68
|
-
*/
|
|
69
|
-
export declare const pointForecast = "v2.7";
|
|
70
64
|
/**
|
|
71
65
|
* Directory containing latest weather icons
|
|
72
66
|
* @ignore
|
|
73
67
|
*/
|
|
74
|
-
export declare const iconsDir = "<!-- @echo IMG_RELATIVE_PATH -->/
|
|
68
|
+
export declare const iconsDir = "<!-- @echo IMG_RELATIVE_PATH -->/icons7";
|
|
75
69
|
/**
|
|
76
70
|
* List of valid overlay identifiers
|
|
77
71
|
*/
|
|
78
|
-
export declare const overlays: readonly ["radar", "satellite", "wind", "gust", "gustAccu", "turbulence", "icing", "rain", "rainAccu", "snowAccu", "snowcover", "ptype", "thunder", "temp", "dewpoint", "rh", "deg0", "wetbulbtemp", "solarpower", "uvindex", "clouds", "hclouds", "mclouds", "lclouds", "fog", "cloudtop", "cbase", "visibility", "cape", "ccl", "waves", "swell1", "swell2", "swell3", "wwaves", "sst", "currents", "currentsTide", "no2", "pm2p5", "aod550", "gtco3", "tcso2", "go3", "cosc", "dustsm", "pressure", "efiTemp", "efiWind", "efiRain", "capAlerts", "soilMoisture40", "soilMoisture100", "moistureAnom40", "moistureAnom100", "drought40", "drought100", "fwi", "dfm10h"];
|
|
79
|
-
/**
|
|
80
|
-
* List of valid accumulation times
|
|
81
|
-
*/
|
|
82
|
-
export declare const acTimes: readonly ["next12h", "next24h", "next36h", "next2d", "next48h", "next60h", "next3d", "next5d", "next10d"];
|
|
72
|
+
export declare const overlays: readonly ["radar", "satellite", "radarPlus", "wind", "gust", "gustAccu", "turbulence", "icing", "rain", "rainAccu", "snowAccu", "snowcover", "ptype", "thunder", "temp", "dewpoint", "rh", "deg0", "wetbulbtemp", "solarpower", "uvindex", "clouds", "hclouds", "mclouds", "lclouds", "fog", "cloudtop", "cbase", "visibility", "cape", "ccl", "waves", "swell1", "swell2", "swell3", "wwaves", "sst", "currents", "currentsTide", "no2", "pm2p5", "aod550", "gtco3", "tcso2", "go3", "cosc", "dustsm", "pressure", "efiTemp", "efiWind", "efiRain", "capAlerts", "soilMoisture40", "soilMoisture100", "moistureAnom40", "moistureAnom100", "drought40", "drought100", "fwi", "dfm10h", "heatmaps", "topoMap", "hurricanes"];
|
|
83
73
|
/**
|
|
84
74
|
* Identifier of products that cover only certain area
|
|
85
75
|
*/
|
|
86
|
-
export declare const localProducts: readonly ["nems", "namConus", "namHawaii", "namAlaska", "iconEu", "iconD2", "arome", "aromeAntilles", "aromeReunion", "camsEu", "iconEuWaves", "hrrrAlaska", "hrrrConus", "bomAccess", "ukv"];
|
|
76
|
+
export declare const localProducts: readonly ["nems", "namConus", "namHawaii", "namAlaska", "iconEu", "iconD2", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "camsEu", "czeAladin", "iconEuWaves", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves"];
|
|
87
77
|
/**
|
|
88
78
|
* Identifiers of global products
|
|
89
79
|
*/
|
|
90
|
-
export declare const globalProducts: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "
|
|
80
|
+
export declare const globalProducts: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "capAlerts", "cams", "efi", "satellite", "radarPlus", "cmems", "drought", "fireDanger", "activeFires", "topoMap"];
|
|
91
81
|
/**
|
|
92
82
|
* Identifiers of sea products
|
|
93
83
|
*/
|
|
94
|
-
export declare const seaProducts: readonly ["ecmwfWaves", "gfsWaves", "
|
|
84
|
+
export declare const seaProducts: readonly ["ecmwfWaves", "gfsWaves", "iconEuWaves", "canRdwpsWaves", "cmems", "jmaCwmWaves"];
|
|
85
|
+
/**
|
|
86
|
+
* Identifiers of wave products, if product is not here, it will be considered as air product
|
|
87
|
+
*/
|
|
88
|
+
export declare const waveProducts: readonly ["ecmwfWaves", "gfsWaves", "iconEuWaves", "jmaCwmWaves", "canRdwpsWaves"];
|
|
95
89
|
/**
|
|
96
90
|
* identifiers of air quality product
|
|
97
91
|
*/
|
|
@@ -99,7 +93,7 @@ export declare const airQualityProducts: readonly ["cams", "camsEu"];
|
|
|
99
93
|
/**
|
|
100
94
|
* identifiers of local products, that have point forecast
|
|
101
95
|
*/
|
|
102
|
-
export declare const localPointProducts: readonly ["namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeReunion", "hrrrAlaska", "hrrrConus", "bomAccess", "ukv"];
|
|
96
|
+
export declare const localPointProducts: readonly ["namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "czeAladin", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves"];
|
|
103
97
|
/**
|
|
104
98
|
* Identifiers of global products, that have point forecast
|
|
105
99
|
*/
|
|
@@ -107,11 +101,11 @@ export declare const globalPointProducts: readonly ["gfs", "ecmwf", "icon", "mbl
|
|
|
107
101
|
/**
|
|
108
102
|
* Identifiers of all land products combined
|
|
109
103
|
*/
|
|
110
|
-
export declare const products: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "
|
|
104
|
+
export declare const products: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "capAlerts", "cams", "efi", "satellite", "radarPlus", "cmems", "drought", "fireDanger", "activeFires", "topoMap", "nems", "namConus", "namHawaii", "namAlaska", "iconEu", "iconD2", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "camsEu", "czeAladin", "iconEuWaves", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves", "cams", "camsEu", "mblue"];
|
|
111
105
|
/**
|
|
112
106
|
* Identifiers of all point products combines
|
|
113
107
|
*/
|
|
114
|
-
export declare const pointProducts: readonly ["gfs", "ecmwf", "icon", "mblue", "namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeReunion", "hrrrAlaska", "hrrrConus", "bomAccess", "ukv"];
|
|
108
|
+
export declare const pointProducts: readonly ["gfs", "ecmwf", "icon", "mblue", "namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "czeAladin", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves"];
|
|
115
109
|
/**
|
|
116
110
|
* IndicatesIndicates that that browsing device is mobile
|
|
117
111
|
*/
|
|
@@ -129,10 +123,6 @@ export declare const isMobileOrTablet: boolean;
|
|
|
129
123
|
* @ignore
|
|
130
124
|
*/
|
|
131
125
|
export declare const isRetina: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Preferred browsers' language (not the used one). Can contain language that is not supported by Windy
|
|
134
|
-
*/
|
|
135
|
-
export declare const prefLang: string;
|
|
136
126
|
/**
|
|
137
127
|
* Valid levels, their identifier and display string
|
|
138
128
|
* @ignore this will crash Markdown parser
|
|
@@ -148,9 +138,14 @@ export declare const maxFavPoisDesktop = 7;
|
|
|
148
138
|
* Valid POI layers, their name and icon
|
|
149
139
|
* @ignore this will crash Markdown parser
|
|
150
140
|
*/
|
|
151
|
-
export declare const pois: Record<
|
|
141
|
+
export declare const pois: Record<string, [keyof LoadedTranslations | string, Iconfont]>;
|
|
152
142
|
/**
|
|
153
143
|
* List of valid isoline identifiers
|
|
154
144
|
* @ignore this will crash Markdown parser
|
|
155
145
|
*/
|
|
156
|
-
export declare const
|
|
146
|
+
export declare const isolinesType: readonly ["pressure", "gh", "temp", "deg0"];
|
|
147
|
+
/**
|
|
148
|
+
* Location of internal Windy plugins
|
|
149
|
+
* TODO: Mobile apps have probably different location
|
|
150
|
+
*/
|
|
151
|
+
export declare const pluginsLocation: string;
|
package/types/client/router.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type ParsedQueryString } from '../utils/queryString';
|
|
2
|
+
import type { PluginIdent } from '@windy/Plugin';
|
|
2
3
|
import type { Coords, PickerCoords } from '@windy/interfaces.d';
|
|
4
|
+
import type { Overlays, Products } from '@windy/rootScope.d';
|
|
3
5
|
import type { ExternalPluginIdent } from '@windy/types';
|
|
4
|
-
|
|
5
|
-
type StartupCoords = {
|
|
6
|
+
export type ParsedStartupValues = {
|
|
6
7
|
sharedCoords: Coords | null;
|
|
7
8
|
pickerCoords: PickerCoords | null;
|
|
9
|
+
overlay: Overlays | null;
|
|
10
|
+
product: Products | null;
|
|
8
11
|
};
|
|
9
12
|
/**
|
|
10
13
|
* Parse URL to plugin and its parameters (if any)
|
|
@@ -14,7 +17,7 @@ type StartupCoords = {
|
|
|
14
17
|
export declare function resolveRoute(purl: string, source: 'url' | 'back-button', parsedQs?: ParsedQueryString): ExternalPluginIdent | PluginIdent | void;
|
|
15
18
|
/**
|
|
16
19
|
* Parse search part of the URL
|
|
17
|
-
* eg: https://www.windy.com/?overlay,level,
|
|
20
|
+
* eg: https://www.windy.com/?overlay,level,lat,lon,zoom,marker
|
|
18
21
|
* lat,lon,zoom are obligatory and must go always together
|
|
19
22
|
* All other params are optional and can be in any order
|
|
20
23
|
* WARNING: This method has thousands of side effects!!
|
|
@@ -22,9 +25,10 @@ export declare function resolveRoute(purl: string, source: 'url' | 'back-button'
|
|
|
22
25
|
* @param searchQuery Search part of the URL, eg: lat,lon,zoom,marker
|
|
23
26
|
* @returns Coordinates from the URL (if any) and coordinates of the picker (if any)
|
|
24
27
|
*/
|
|
25
|
-
export declare function parseSearch(searchQuery: string | undefined
|
|
28
|
+
export declare function parseSearch(searchQuery: string | undefined): ParsedStartupValues | undefined;
|
|
26
29
|
/**
|
|
27
|
-
* Parsed
|
|
30
|
+
* Parsed items from URL
|
|
28
31
|
*/
|
|
29
32
|
export declare const sharedCoords: Coords;
|
|
30
|
-
export
|
|
33
|
+
export declare const parsedOverlay: "visibility" | "radar" | "satellite" | "radarPlus" | "wind" | "gust" | "gustAccu" | "turbulence" | "icing" | "rain" | "rainAccu" | "snowAccu" | "snowcover" | "ptype" | "thunder" | "temp" | "dewpoint" | "rh" | "deg0" | "wetbulbtemp" | "solarpower" | "uvindex" | "clouds" | "hclouds" | "mclouds" | "lclouds" | "fog" | "cloudtop" | "cbase" | "cape" | "ccl" | "waves" | "swell1" | "swell2" | "swell3" | "wwaves" | "sst" | "currents" | "currentsTide" | "no2" | "pm2p5" | "aod550" | "gtco3" | "tcso2" | "go3" | "cosc" | "dustsm" | "pressure" | "efiTemp" | "efiWind" | "efiRain" | "capAlerts" | "soilMoisture40" | "soilMoisture100" | "moistureAnom40" | "moistureAnom100" | "drought40" | "drought100" | "fwi" | "dfm10h" | "heatmaps" | "topoMap" | "hurricanes";
|
|
34
|
+
export declare const parsedProduct: "icon" | "radar" | "satellite" | "radarPlus" | "capAlerts" | "topoMap" | "nems" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeFrance" | "aromeReunion" | "canHrdps" | "canRdwpsWaves" | "camsEu" | "czeAladin" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "bomAccessAd" | "bomAccessBn" | "bomAccessDn" | "bomAccessNq" | "bomAccessPh" | "bomAccessSy" | "bomAccessVt" | "ukv" | "jmaMsm" | "jmaCwmWaves" | "gfs" | "ecmwf" | "ecmwfAnalysis" | "ecmwfWaves" | "gfsWaves" | "cams" | "efi" | "cmems" | "drought" | "fireDanger" | "activeFires" | "mblue";
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # seoParser
|
|
3
|
+
*
|
|
4
|
+
* The main purpose of this module is to parse the SEO related part of URL.
|
|
5
|
+
*
|
|
6
|
+
* Examples of SEO URLs:
|
|
7
|
+
*
|
|
8
|
+
* ## https://www.windy.com/cs/... (case [1])
|
|
9
|
+
* SEO language, used in @module trans Must be followed by string
|
|
10
|
+
*
|
|
11
|
+
* ## https://www.windy.com/-Name-Whatever-overlay (case [2])
|
|
12
|
+
* SEO Name of Overlay
|
|
13
|
+
*
|
|
14
|
+
* ## https://www.windy.com/-Name-Whatever/... (case [3])
|
|
15
|
+
* SEO NAME of plugin name, followed by any other string
|
|
16
|
+
*
|
|
17
|
+
* Remember that numbers are not allowed at the beginning of the URL, to distinguish
|
|
18
|
+
* any URL from detail.
|
|
19
|
+
*
|
|
20
|
+
* @module seoParser
|
|
21
|
+
*/
|
|
1
22
|
declare const _default: {
|
|
2
23
|
/**
|
|
3
24
|
* Language parsed from startupUrl, null if cannot be parsed
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ClientMessage } from '../../types/offline';
|
|
2
|
+
/**
|
|
3
|
+
* Sends message to service worker
|
|
4
|
+
*/
|
|
5
|
+
export declare const sendMessageToServiceWorker: (message: ClientMessage) => void;
|
|
6
|
+
export declare const installServiceWorker: () => void;
|
|
7
|
+
export declare const isServiceWorkerSupported: () => boolean;
|
|
8
|
+
export declare const getServiceWorkerError: () => string | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* # @windy/startupWeather
|
|
4
|
+
*
|
|
5
|
+
* Controls display & hiding of 4 days weather on Windy after startup
|
|
6
|
+
*
|
|
7
|
+
* GUI on desktop works in two different modes:
|
|
8
|
+
*
|
|
9
|
+
* 1. Default mode - user has NO pinned favs on HP or has any, but do not want to see them permanently
|
|
10
|
+
*
|
|
11
|
+
* 2. Persistent mode (desktop only) - user has pinned favs on HP and wants to see them permanently
|
|
12
|
+
*
|
|
13
|
+
* Both modes use completely different set of listeners that handle hide / show of HP weather
|
|
14
|
+
*
|
|
15
|
+
* @module startupWeather
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Hides, the weather DIV
|
|
19
|
+
*
|
|
20
|
+
* @param ev Event that initiated hiding
|
|
21
|
+
*/
|
|
22
|
+
export declare function hide(ev?: MouseEvent | KeyboardEvent | TouchEvent): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Click on title or home button
|
|
25
|
+
*/
|
|
26
|
+
export declare function back2home(): Promise<void>;
|
|
27
|
+
export declare const getCancelShow: () => boolean;
|
package/types/client/store.d.ts
CHANGED
|
@@ -71,7 +71,6 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
71
71
|
* @returns True if property exists
|
|
72
72
|
*/
|
|
73
73
|
hasProperty: <T extends keyof DataSpecifications>(name: T) => boolean;
|
|
74
|
-
_set<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, item: Item, opts: StoreOptions, value: Item['def'] | null): void;
|
|
75
74
|
/**
|
|
76
75
|
* Sets a value in key, value store. If succesfull,a nd value has been changed, store will brodcast message with name and value.
|
|
77
76
|
* Limitation:** Our store is quite primitive so it can not compare Arrays and Objects. Always create new one or use `forceChange` * option.
|
|
@@ -137,6 +136,7 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
137
136
|
forceGet: boolean;
|
|
138
137
|
}): Item['def'];
|
|
139
138
|
isValid<T>(item: DataSpecificationsObject<T>, value: T): boolean;
|
|
139
|
+
private setFinally;
|
|
140
140
|
}
|
|
141
141
|
declare const store: Store;
|
|
142
142
|
export declare const getAll: () => void, getAllowed: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T) => string | Item["allowed"], getDefault: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T) => Item["def"], get: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, options?: {
|
|
@@ -144,5 +144,5 @@ export declare const getAll: () => void, getAllowed: <T extends keyof DataSpecif
|
|
|
144
144
|
}) => Item["def"], on: <K extends keyof StoreTypes, Q extends StoreTypes[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>, once?: boolean) => number, off: {
|
|
145
145
|
(id: number): void;
|
|
146
146
|
<K extends keyof StoreTypes, Q extends StoreTypes[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>): void;
|
|
147
|
-
}, once: <K extends keyof StoreTypes, Q extends StoreTypes[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>) => number, set: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, value: Item["def"], opts?: StoreOptions) => SetReturnType<T
|
|
147
|
+
}, once: <K extends keyof StoreTypes, Q extends StoreTypes[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>) => number, set: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, value: Item["def"], opts?: StoreOptions) => SetReturnType<T>, defineProperty: <T extends keyof DataSpecifications, Prop extends keyof DataSpecifications[T], Value extends DataSpecifications[T][Prop]>(name: T, prop: Prop, value: Value) => void, setDefault: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, value: Item["def"]) => void;
|
|
148
148
|
export default store;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -62,4 +62,5 @@ export declare const checkPendingSubscription: () => void;
|
|
|
62
62
|
* It is used only as a gateway to solving the whole issue. It must be short and clear.
|
|
63
63
|
*/
|
|
64
64
|
export declare const getBaitTitle: (issue: SubscriptionIssue | null) => string;
|
|
65
|
+
export declare const checkAndRenderSubsIssue: () => void;
|
|
65
66
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { DownloadPayload, DownloadedInfo } from '../../
|
|
2
|
-
export declare const cacheUrl: (cache: Cache, url: string, testIfUrlIsInCache?: boolean, tryTwice2DownloadFiles?: boolean) => Promise<boolean>;
|
|
1
|
+
import type { DownloadPayload, DownloadedInfo, FileInfo } from '../../types/offline';
|
|
2
|
+
export declare const cacheUrl: (cache: Cache, url: string, originalUrl: string, testIfUrlIsInCache?: boolean, tryTwice2DownloadFiles?: boolean) => Promise<boolean>;
|
|
3
3
|
export declare const cancelOngoingDownloads: () => boolean;
|
|
4
4
|
/**
|
|
5
5
|
* Download all files in parallel
|
|
6
6
|
* @param cache instance of Cache
|
|
7
7
|
* @param urls list of rqrd URLs
|
|
8
|
-
* @param checkIfUrlIsInCache Should we check if
|
|
9
|
-
* @param
|
|
10
|
-
* @returns all
|
|
8
|
+
* @param checkIfUrlIsInCache Should we check if URL is in cache before attempting to download it?
|
|
9
|
+
* @param calledOnDownloadedOneFile callback that is called each time one file is downloaded
|
|
10
|
+
* @returns all Errored urls or null if task was cancelled
|
|
11
11
|
*/
|
|
12
|
-
export declare const downloadFilesInParallel: (cache: Cache, urls:
|
|
12
|
+
export declare const downloadFilesInParallel: (cache: Cache, urls: FileInfo[], checkIfUrlIsInCache: boolean, tryTwice2DownloadFiles: boolean, calledOnDownloadedOneFile: () => void) => Promise<{
|
|
13
13
|
result: 'downloadingCanceled' | 'ok';
|
|
14
14
|
errors?: string[];
|
|
15
15
|
}>;
|
|
16
|
-
export declare function download({ numberOfFiles, batches,
|
|
16
|
+
export declare function download({ numberOfFiles, batches, assets, mainEntryPoint, }: DownloadPayload): Promise<DownloadedInfo | void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export {};
|
|
2
2
|
export declare const putInCache: (request: Request, response: Response) => Promise<void>;
|
|
3
3
|
export declare const getFallbackResponse: () => Promise<Response>;
|
|
4
|
-
export declare const cacheFirst: (request: Request
|
|
4
|
+
export declare const cacheFirst: (request: Request) => Promise<Response>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Timestamp } from '@windy/types.d';
|
|
2
|
-
import type { DownloadProgress, ServiceWorkerMessage } from '
|
|
2
|
+
import type { DownloadProgress, ServiceWorkerMessage } from '../../types/offline';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The reason why we are using this function to wrap postMessage is that
|
|
5
5
|
* we can use TS to check typings of the message
|
|
6
6
|
*/
|
|
7
7
|
export declare const sendMessageToClient: (message: ServiceWorkerMessage['data'] | DownloadProgress) => Promise<void>;
|
|
@@ -9,7 +9,7 @@ export declare const storeData: <T extends Object>(key: string, data: T) => Prom
|
|
|
9
9
|
export declare const getData: <T extends Object>(key: string) => Promise<void | T>;
|
|
10
10
|
export declare const deleteData: (key: string) => Promise<void>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Stores mainEntryPoint as /index.html so it will be always available on this URL
|
|
13
13
|
* This is basically symlink in serviceWorker cache
|
|
14
14
|
*/
|
|
15
15
|
export declare const storeMainEntryPoint: (mainEntryPoint: string) => Promise<void>;
|
package/types/client/trans.d.ts
CHANGED
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
import type { SupportedLangFiles, Translations } from './d.ts.files/lang-files.d';
|
|
2
|
-
import type { LoadedTranslations, LoadingOptions, TransFileInfo } from './d.ts.files/trans.d';
|
|
3
|
-
export declare const files: Record<keyof SupportedLangFiles, TransFileInfo>;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
declare const trans: LoadedTranslations;
|
|
8
|
-
/**
|
|
9
|
-
* Preferred language which does not existed in translations (for statistics purposes)
|
|
10
|
-
*/
|
|
11
|
-
declare let missingLang: string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Get file from storage, checks it version number and if
|
|
14
|
-
* fits current version returns it. If file is not in storage downloads a file
|
|
15
|
-
* and stores it in storage.
|
|
2
|
+
* # @windy/trans
|
|
16
3
|
*
|
|
17
|
-
*
|
|
4
|
+
* This module handles all i18n tasks, including detecting the desired language,
|
|
5
|
+
* lazy loading language files, translating parts of the DOM, and returning
|
|
6
|
+
* translated strings for later use in the app.
|
|
18
7
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
8
|
+
* English language stings from `main` file are hardcoded in the core by default,
|
|
9
|
+
* to avoid any undefined strings in DOM. Other languages are loaded on demand.
|
|
21
10
|
*
|
|
22
|
-
*
|
|
11
|
+
* WARNING: Contrary to previous version, Windy does not support changing language
|
|
12
|
+
* during a runtime. Once user opts to change the language, whole app must be reloaded.
|
|
23
13
|
*
|
|
24
|
-
* @
|
|
25
|
-
* @param {Object} options Optionally custom options
|
|
26
|
-
* @returns Resolves with contents of loaded file (key-value pairs)
|
|
14
|
+
* @module trans
|
|
27
15
|
*/
|
|
28
|
-
|
|
16
|
+
import type { SupportedLangFiles } from '@windy/lang-files.d';
|
|
17
|
+
import type { LoadedTranslations } from '@windy/types';
|
|
18
|
+
export declare const supportedLangFiles: string[];
|
|
29
19
|
/**
|
|
30
|
-
*
|
|
20
|
+
* key-value pairs with all loaded lang strings
|
|
21
|
+
* WARNING: Typing here is not true... lang files are loaded step-by-step on demand, but it is useless to use `!` everywhere
|
|
22
|
+
*/
|
|
23
|
+
export declare const t: LoadedTranslations;
|
|
24
|
+
/**
|
|
25
|
+
* Preferred browsers' language (not the used one). Can contain language that is not supported by Windy
|
|
26
|
+
*/
|
|
27
|
+
export declare const navigatorPreferredLang: string;
|
|
28
|
+
export declare const getUrlOfLangFile: (id: keyof SupportedLangFiles) => string;
|
|
29
|
+
/**
|
|
30
|
+
*english lang.
|
|
31
31
|
* It does nothing in case of english, as it is already loaded by default.
|
|
32
32
|
*
|
|
33
33
|
* @param id Id of translation file
|
|
34
|
-
* @param lang Optionally forced language, client lang is used by default
|
|
35
34
|
* @returns Translations in key-pair object. Missing translations are presented in default english lang.
|
|
36
35
|
*/
|
|
37
|
-
declare const loadLangFile: (id: keyof SupportedLangFiles
|
|
36
|
+
export declare const loadLangFile: (id: keyof SupportedLangFiles) => Promise<void>;
|
|
38
37
|
/**
|
|
39
|
-
* Replace
|
|
38
|
+
* Replace. It overrides its innerHTML
|
|
40
39
|
* Supported data suffixes: 'title', 'placeholder', 't', 'afterbegin', 'beforeend', 'tooltipsrc'
|
|
41
40
|
*
|
|
42
41
|
* @param element HTML element where tags should be replaced
|
|
@@ -55,14 +54,4 @@ declare const loadLangFile: (id: keyof SupportedLangFiles, lang?: "en" | "zh-TW"
|
|
|
55
54
|
* </p>
|
|
56
55
|
* ```
|
|
57
56
|
*/
|
|
58
|
-
declare const translateDocument: <T extends HTMLElement>(element: T) => void;
|
|
59
|
-
/**
|
|
60
|
-
* @module trans
|
|
61
|
-
*
|
|
62
|
-
* - handles all i18n tasks
|
|
63
|
-
* - detects desired language
|
|
64
|
-
* - lazy loads language file
|
|
65
|
-
* - translates required part of a DOM (with many limitations)
|
|
66
|
-
* - returns translated strings for later use in app
|
|
67
|
-
*/
|
|
68
|
-
export { getFile, loadLangFile, missingLang, trans as t, translateDocument };
|
|
57
|
+
export declare const translateDocument: <T extends HTMLElement>(element: T) => void;
|
package/types/client/user.d.ts
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* # @windy/user
|
|
3
3
|
*
|
|
4
4
|
* 1) Wrapper for the user store object.
|
|
5
5
|
* 2) Loads user info from the server.
|
|
6
6
|
* 3) Handles user authentication.
|
|
7
|
-
* 4) Renders user avatar.
|
|
8
7
|
*
|
|
9
|
-
* data-user='logged-in' or 'logged-out' attr is added to the body tag when we know the state of the user (a CSS way of isUserLoggedIn function).
|
|
10
8
|
* it's to avoid unnecessary render of "login" button when the user is logged in, but we still wait for the server response
|
|
9
|
+
*
|
|
10
|
+
* @module user
|
|
11
11
|
*/
|
|
12
|
+
import type { HttpPayload } from './d.ts.files/http.d';
|
|
13
|
+
import type { AccountLoginResponse, UserInfo, User, LoginAndFinishAction } from './d.ts.files/user.d';
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Quick check is user is loggedIn.
|
|
14
16
|
*/
|
|
15
|
-
import type { User } from './d.ts.files/dataSpecifications.d';
|
|
16
|
-
import type { HttpPayload } from './d.ts.files/http.d';
|
|
17
|
-
import type { AccountLoginResponse, UserInfo } from './d.ts.files/user.d';
|
|
18
17
|
export declare const isLoggedIn: () => boolean;
|
|
19
|
-
export declare const isPublisher: () => boolean;
|
|
20
18
|
export declare const getInfo: () => User | null;
|
|
21
19
|
/**
|
|
22
20
|
* Safe way how to retrieve use avatar
|
|
@@ -29,21 +27,20 @@ export declare const getUserId: () => number;
|
|
|
29
27
|
/**
|
|
30
28
|
* Open login plugin so that user can log in
|
|
31
29
|
*/
|
|
32
|
-
export declare const login: () => void;
|
|
30
|
+
export declare const login: (finishAction?: LoginAndFinishAction) => void;
|
|
33
31
|
export declare const register: () => void;
|
|
34
32
|
/**
|
|
35
33
|
* Log out the user - remove credentials and reload all things that depends on logged-in user
|
|
36
34
|
*/
|
|
37
|
-
export declare const logout: () => void
|
|
38
|
-
export declare const setExplicitConsent: (analytics: boolean) => void;
|
|
39
|
-
export declare const setImplicitConsent: () => void;
|
|
35
|
+
export declare const logout: () => Promise<void>;
|
|
40
36
|
/**
|
|
41
37
|
* Check if we have received valid auth object and if yes, save it and open user plugin
|
|
42
38
|
*
|
|
43
39
|
* @param userInfo user info from account or node users
|
|
40
|
+
* @param handleConsent should we handle analytics consent (api/info endpoint)
|
|
44
41
|
* @returns true if user is authenticated
|
|
45
42
|
*/
|
|
46
|
-
export declare const checkAuth: (
|
|
43
|
+
export declare const checkAuth: (userInfoPayload: UserInfo, handleConsent: boolean) => Promise<boolean>;
|
|
47
44
|
/**
|
|
48
45
|
* Get info about current user from account
|
|
49
46
|
*
|
|
@@ -51,4 +48,4 @@ export declare const checkAuth: (userInfo: UserInfo) => boolean;
|
|
|
51
48
|
* @throws An exception when HTTP request fails
|
|
52
49
|
*/
|
|
53
50
|
export declare const reloadInfo: () => Promise<HttpPayload<UserInfo> | null>;
|
|
54
|
-
export declare const handleLoginResponse: (response: HttpPayload<AccountLoginResponse
|
|
51
|
+
export declare const handleLoginResponse: (response: HttpPayload<AccountLoginResponse>, provider: string) => Promise<void>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { AlertRequest, AlertResponse, AlertCheckResponse } from '@windy/alerts.d';
|
|
2
|
+
import type { Fav } from '@windy/favs.d';
|
|
3
|
+
import type { LatLon } from '@windy/interfaces';
|
|
4
|
+
export declare enum AlertStatus {
|
|
5
|
+
Triggered = "triggered",
|
|
6
|
+
Normal = "normal",
|
|
7
|
+
Suspended = "suspended"
|
|
8
|
+
}
|
|
9
|
+
export declare enum AlertConditionType {
|
|
10
|
+
Cloudiness = "cloudiness",
|
|
11
|
+
FreshSnow = "freshSnow",
|
|
12
|
+
Rainfall = "rainfall",
|
|
13
|
+
Swell = "swell",
|
|
14
|
+
Temperature = "temperature",
|
|
15
|
+
Time = "time",
|
|
16
|
+
Wind = "wind"
|
|
17
|
+
}
|
|
18
|
+
export declare enum Direction {
|
|
19
|
+
N = "N",
|
|
20
|
+
NE = "NE",
|
|
21
|
+
E = "E",
|
|
22
|
+
SE = "SE",
|
|
23
|
+
S = "S",
|
|
24
|
+
SW = "SW",
|
|
25
|
+
W = "W",
|
|
26
|
+
NW = "NW"
|
|
27
|
+
}
|
|
28
|
+
export declare enum Weekday {
|
|
29
|
+
Monday = "mon",
|
|
30
|
+
Tuesday = "tue",
|
|
31
|
+
Wednesday = "wed",
|
|
32
|
+
Thursday = "thu",
|
|
33
|
+
Friday = "fri",
|
|
34
|
+
Saturday = "sat",
|
|
35
|
+
Sunday = "sun"
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* https://www.eoas.ubc.ca/courses/atsc113/flying/met_concepts/01-met_concepts/01c-cloud_coverage/index.html
|
|
39
|
+
*
|
|
40
|
+
* Values are meteorological convention.
|
|
41
|
+
*/
|
|
42
|
+
export declare enum CloudCoverage {
|
|
43
|
+
/** No clouds */
|
|
44
|
+
SkyClear = "SKC",
|
|
45
|
+
/** 1/8 to 2/8 cloud cover */
|
|
46
|
+
Few = "FEW",
|
|
47
|
+
/** 3/8 to 4/8 cloud cover */
|
|
48
|
+
Scattered = "SCT",
|
|
49
|
+
/** 5/8 to 7/8 cloud cover */
|
|
50
|
+
Broken = "BKN",
|
|
51
|
+
/** 8/8 cloud cover */
|
|
52
|
+
Overcast = "OVC"
|
|
53
|
+
}
|
|
54
|
+
export declare function getAlertTimestamps(alertId: string): Promise<AlertCheckResponse>;
|
|
55
|
+
export declare function getAlertV3(alertId: string): Promise<Fav & {
|
|
56
|
+
type: 'alert';
|
|
57
|
+
}>;
|
|
58
|
+
export declare function getAlerts(): Promise<AlertResponse[]>;
|
|
59
|
+
export declare function getAlert(alertId: string): Promise<AlertResponse | null>;
|
|
60
|
+
export declare function createAlert(data: AlertRequest): Promise<void>;
|
|
61
|
+
export declare function updateAlert(data: AlertResponse): Promise<AlertResponse>;
|
|
62
|
+
export declare function deleteAlert(alertId: string): Promise<void>;
|
|
63
|
+
export declare function getNearAlert(location: LatLon): Promise<AlertResponse | undefined>;
|
|
64
|
+
export declare function getNearAlerts(location: LatLon): Promise<AlertResponse[]>;
|
|
65
|
+
export declare function add(latLonAndName: LatLon & {
|
|
66
|
+
locationName?: string;
|
|
67
|
+
}): void;
|
|
68
|
+
export declare function userHasAnyAlerts(): Promise<boolean>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const launchConsentWindow: () => void;
|
|
2
|
+
export declare const setExplicitConsent: (analytics: boolean) => void;
|
|
3
|
+
export declare const setImplicitConsent: () => void;
|
|
4
|
+
export declare const checkConsent: (userInfo?: {
|
|
5
|
+
requiresCookieConsent: boolean;
|
|
6
|
+
}) => void;
|