@windycom/plugin-devtools 3.0.1 → 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.
- package/README.md +1 -0
- package/package.json +1 -1
- package/types/client/Calendar.d.ts +101 -71
- package/types/client/Color.d.ts +18 -5
- package/types/client/DataTiler.d.ts +1 -1
- package/types/client/EcmwfProduct.d.ts +22 -0
- package/types/client/IDB.d.ts +1 -1
- package/types/client/Layer.d.ts +95 -26
- package/types/client/LayerClasses.d.ts +5 -0
- package/types/client/Metric.d.ts +31 -46
- package/types/client/Overlay.d.ts +8 -11
- package/types/client/OverlayClasses.d.ts +8 -0
- package/types/client/Particles.d.ts +1 -1
- package/types/client/Product.d.ts +31 -65
- package/types/client/ProductClasses.d.ts +44 -0
- package/types/client/RadarPlusProduct.d.ts +1 -1
- package/types/client/Renderer.d.ts +41 -13
- package/types/client/SatelliteProduct.d.ts +1 -1
- package/types/client/SveltePlugin.d.ts +1 -1
- package/types/client/TileLayer.d.ts +2 -2
- package/types/client/TopoMap.d.ts +2 -3
- package/types/client/WindowPlugin.d.ts +6 -3
- package/types/client/appsFlyer.d.ts +2 -1
- package/types/client/colorGradients.d.ts +5 -10
- package/types/client/colors.d.ts +1 -2
- package/types/client/d.ts.files/Metric.d.ts +21 -2
- package/types/client/d.ts.files/TileLayerCanvas.d.ts +3 -3
- package/types/client/d.ts.files/alerts.d.ts +1 -0
- package/types/client/d.ts.files/broadcast.d.ts +3 -3
- package/types/client/d.ts.files/dataSpecifications.d.ts +32 -34
- package/types/client/d.ts.files/favs.d.ts +7 -18
- package/types/client/d.ts.files/http.d.ts +5 -0
- package/types/client/d.ts.files/lib.d.ts +0 -1
- package/types/client/d.ts.files/plugin-params.d.ts +20 -16
- package/types/client/d.ts.files/plugins.d.ts +0 -2
- package/types/client/d.ts.files/rootScope.d.ts +2 -0
- package/types/client/d.ts.files/webcams.d.ts +9 -2
- package/types/client/dataLoader.d.ts +2 -2
- package/types/client/detectDevice.d.ts +3 -0
- package/types/client/embed.d.ts +0 -2
- package/types/client/errorLogger.d.ts +1 -1
- package/types/client/externalPlugins.d.ts +2 -0
- package/types/client/fetch.d.ts +28 -4
- package/types/client/format.d.ts +1 -0
- package/types/client/glTileRender.d.ts +1 -7
- package/types/client/idbInstances.d.ts +115 -4
- package/types/client/layers.d.ts +3 -1
- package/types/client/legends.d.ts +1 -1
- package/types/client/lib.d.ts +0 -7
- package/types/client/map.d.ts +7 -1
- package/types/client/mobile.d.ts +0 -7
- package/types/client/models.d.ts +2 -6
- package/types/client/overlays.d.ts +2 -1
- package/types/client/particleRenderers.d.ts +1 -1
- package/types/client/plugins.d.ts +0 -4
- package/types/client/products.d.ts +54 -2
- package/types/client/promo.d.ts +28 -5
- package/types/client/pushNotifications.d.ts +19 -1
- package/types/client/renderCtrl.d.ts +1 -1
- package/types/client/renderTile.d.ts +2 -2
- package/types/client/renderUtils.d.ts +16 -36
- package/types/client/renderers.d.ts +2 -4
- package/types/client/reverseName.d.ts +2 -1
- package/types/client/rhMessage.d.ts +1 -1
- package/types/client/rootScope.d.ts +14 -6
- package/types/client/router.d.ts +36 -9
- package/types/client/seoParser.d.ts +35 -0
- package/types/client/showableErrorsService.d.ts +10 -6
- package/types/client/store.d.ts +20 -52
- package/types/client/tileInterpolator.d.ts +1 -1
- package/types/client/userAlerts.d.ts +0 -4
- package/types/client/userFavs.d.ts +23 -10
- package/types/client/utils.d.ts +18 -17
- package/types/interfaces.d.ts +197 -16
- package/types/lang-files.d.ts +167 -27
- package/types/types.d.ts +297 -7
- package/types/client/d.ts.files/Calendar.d.ts +0 -96
- package/types/client/d.ts.files/Color.d.ts +0 -94
- package/types/client/d.ts.files/Layer.d.ts +0 -191
- package/types/client/d.ts.files/Renderer.d.ts +0 -44
- package/types/client/d.ts.files/products.d.ts +0 -60
- package/types/client/imaker.d.ts +0 -112
- package/types/offline.d.ts +0 -100
|
@@ -9,7 +9,7 @@ export declare const version: string;
|
|
|
9
9
|
* Target
|
|
10
10
|
* @ignore
|
|
11
11
|
*/
|
|
12
|
-
export declare const target: "
|
|
12
|
+
export declare const target: "index" | "mobile" | "lib" | "embed";
|
|
13
13
|
/**
|
|
14
14
|
* Platform
|
|
15
15
|
* @ignore
|
|
@@ -69,7 +69,7 @@ export declare const iconsDir = "<!-- @echo IMG_RELATIVE_PATH -->/icons7";
|
|
|
69
69
|
/**
|
|
70
70
|
* List of valid overlay identifiers
|
|
71
71
|
*/
|
|
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"];
|
|
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", "aqi", "no2", "pm2p5", "aod550", "gtco3", "tcso2", "go3", "cosc", "dustsm", "pressure", "efiTemp", "efiWind", "efiRain", "capAlerts", "soilMoisture40", "soilMoisture100", "moistureAnom40", "moistureAnom100", "drought40", "drought100", "fwi", "dfm10h", "heatmaps", "topoMap", "hurricanes"];
|
|
73
73
|
/**
|
|
74
74
|
* Identifier of products that cover only certain area
|
|
75
75
|
*/
|
|
@@ -93,11 +93,11 @@ export declare const airQualityProducts: readonly ["cams", "camsEu"];
|
|
|
93
93
|
/**
|
|
94
94
|
* identifiers of local products, that have point forecast
|
|
95
95
|
*/
|
|
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"];
|
|
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", "camsEu"];
|
|
97
97
|
/**
|
|
98
98
|
* Identifiers of global products, that have point forecast
|
|
99
99
|
*/
|
|
100
|
-
export declare const globalPointProducts: readonly ["gfs", "ecmwf", "icon", "mblue"];
|
|
100
|
+
export declare const globalPointProducts: readonly ["gfs", "ecmwf", "icon", "mblue", "cams"];
|
|
101
101
|
/**
|
|
102
102
|
* Identifiers of all land products combined
|
|
103
103
|
*/
|
|
@@ -105,7 +105,11 @@ export declare const products: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar
|
|
|
105
105
|
/**
|
|
106
106
|
* Identifiers of all point products combines
|
|
107
107
|
*/
|
|
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"];
|
|
108
|
+
export declare const pointProducts: readonly ["gfs", "ecmwf", "icon", "mblue", "cams", "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", "camsEu"];
|
|
109
|
+
/**
|
|
110
|
+
* Point products that have air point forecast
|
|
111
|
+
*/
|
|
112
|
+
export declare const airPointProducts: ("icon" | "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" | "cams" | "mblue")[];
|
|
109
113
|
/**
|
|
110
114
|
* IndicatesIndicates that that browsing device is mobile
|
|
111
115
|
*/
|
|
@@ -146,7 +150,7 @@ export declare const maxFavPoisDesktop = 7;
|
|
|
146
150
|
* Valid POI layers, their name and icon
|
|
147
151
|
* @ignore this will crash Markdown parser
|
|
148
152
|
*/
|
|
149
|
-
export declare const pois: Record<string, [keyof LoadedTranslations
|
|
153
|
+
export declare const pois: Record<string, [keyof LoadedTranslations, Iconfont]>;
|
|
150
154
|
/**
|
|
151
155
|
* List of valid isoline identifiers
|
|
152
156
|
* @ignore this will crash Markdown parser
|
|
@@ -157,3 +161,7 @@ export declare const isolinesType: readonly ["pressure", "gh", "temp", "deg0"];
|
|
|
157
161
|
* TODO: Mobile apps have probably different location
|
|
158
162
|
*/
|
|
159
163
|
export declare const pluginsLocation: string;
|
|
164
|
+
export declare const pollenProducts: Record<string, [
|
|
165
|
+
longTranslation: keyof LoadedTranslations,
|
|
166
|
+
shortTranslation: keyof LoadedTranslations
|
|
167
|
+
]>;
|
package/types/client/router.d.ts
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { PluginIdent } from '@windy/Plugin';
|
|
2
|
+
import type { Coords, PickerCoords } from '@windy/interfaces.d';
|
|
3
|
+
import type { Overlays, Products } from '@windy/rootScope.d';
|
|
4
|
+
import type { ExternalPluginIdent, ParsedQueryString } from '@windy/types';
|
|
5
|
+
export type ParsedStartupValues = {
|
|
6
|
+
sharedCoords: Coords | null;
|
|
7
|
+
pickerCoords: PickerCoords | null;
|
|
8
|
+
overlay: Overlays | null;
|
|
9
|
+
product: Products | null;
|
|
10
|
+
hideStartupWeather?: boolean;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Parse URL to plugin and its parameters (if any)
|
|
14
|
+
*
|
|
15
|
+
* While the method is async, for internal plugins it is not awaited, and
|
|
16
|
+
* only external plugins are awaited.
|
|
17
|
+
*
|
|
18
|
+
* @returns ident of matched plugin for purpose of stats
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveRoute(purl: string, source: 'url' | 'back-button', parsedQs?: ParsedQueryString): Promise<PluginIdent | ExternalPluginIdent | void>;
|
|
21
|
+
/**
|
|
22
|
+
* Parse search part of the URL
|
|
23
|
+
* eg: https://www.windy.com/?overlay,level,lat,lon,zoom,marker
|
|
24
|
+
* lat,lon,zoom are obligatory and must go always together
|
|
25
|
+
* All other params are optional and can be in any order
|
|
26
|
+
* WARNING: This method has thousands of side effects!!
|
|
27
|
+
*
|
|
28
|
+
* @param searchQuery Search part of the URL, eg: lat,lon,zoom,marker
|
|
29
|
+
* @returns Coordinates from the URL (if any) and coordinates of the picker (if any)
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseSearch(searchQuery: string | undefined): ParsedStartupValues | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Parsed items from URL
|
|
34
|
+
*/
|
|
35
|
+
export declare const sharedCoords: Coords;
|
|
36
|
+
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" | "aqi" | "no2" | "pm2p5" | "aod550" | "gtco3" | "tcso2" | "go3" | "cosc" | "dustsm" | "pressure" | "efiTemp" | "efiWind" | "efiRain" | "capAlerts" | "soilMoisture40" | "soilMoisture100" | "moistureAnom40" | "moistureAnom100" | "drought40" | "drought100" | "fwi" | "dfm10h" | "heatmaps" | "topoMap" | "hurricanes";
|
|
37
|
+
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,5 +1,40 @@
|
|
|
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: {
|
|
23
|
+
/**
|
|
24
|
+
* Language parsed from startupUrl, null if cannot be parsed
|
|
25
|
+
*/
|
|
26
|
+
lang: string;
|
|
27
|
+
/**
|
|
28
|
+
* Path part of the startup URL without SEO parts
|
|
29
|
+
*/
|
|
2
30
|
purl: string;
|
|
31
|
+
/**
|
|
32
|
+
* Path part of the initial URL when client was open
|
|
33
|
+
*/
|
|
3
34
|
startupUrl: string;
|
|
35
|
+
/**
|
|
36
|
+
* Overlay parsed from startupUrl, null if cannot be parsed
|
|
37
|
+
*/
|
|
38
|
+
overlay: string;
|
|
4
39
|
};
|
|
5
40
|
export default _default;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import type { ErrorCategory, ShowableError } from '@windy/types.d';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Add showableError to local storage
|
|
4
|
+
* @param error
|
|
5
|
+
*/
|
|
6
|
+
export declare const add: (error: ShowableError) => void;
|
|
3
7
|
/**
|
|
4
8
|
* Sets showableError to not be displayed anymore
|
|
5
9
|
* @param errorId
|
|
6
10
|
*/
|
|
7
|
-
export declare const close: (
|
|
11
|
+
export declare const close: (errorId: string) => void;
|
|
8
12
|
/**
|
|
9
13
|
* It return array unresolvedErrors with removed showableError
|
|
10
14
|
* @param errorId
|
|
11
15
|
*/
|
|
12
|
-
export declare const resolve: (
|
|
16
|
+
export declare const resolve: (errorId: string) => void;
|
|
13
17
|
/**
|
|
14
18
|
* It resolve whole category of errors from unresolvedErrors
|
|
15
19
|
* @param category
|
|
16
20
|
*/
|
|
17
|
-
export declare const resolveCategory: (
|
|
21
|
+
export declare const resolveCategory: (category: ErrorCategory) => void;
|
|
18
22
|
/**
|
|
19
23
|
* Returns unresolved errors
|
|
20
24
|
* @returns ShowableError[]
|
|
21
25
|
*/
|
|
22
|
-
export declare const getUnresolvedErrors: () =>
|
|
26
|
+
export declare const getUnresolvedErrors: () => ShowableError[];
|
|
23
27
|
/**
|
|
24
28
|
* Control if error was resolved, based on category of the error
|
|
25
29
|
* @param error
|
|
26
30
|
*/
|
|
27
|
-
export declare function checkError(
|
|
31
|
+
export declare function checkError(error: ShowableError): void;
|
package/types/client/store.d.ts
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
* @module store
|
|
39
39
|
*/
|
|
40
40
|
import { Evented } from '@windy/Evented';
|
|
41
|
-
import type { DataSpecifications
|
|
41
|
+
import type { DataSpecifications } from './d.ts.files/dataSpecifications.d';
|
|
42
42
|
import type { SetReturnType, StoreOptions, StoreTypes } from './d.ts.files/store.d';
|
|
43
43
|
declare class Store extends Evented<StoreTypes> {
|
|
44
44
|
/**
|
|
@@ -49,30 +49,16 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
49
49
|
*/
|
|
50
50
|
setDefault<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, value: Item['def']): void;
|
|
51
51
|
/**
|
|
52
|
-
* Defines property in dataSpecification list. Used
|
|
52
|
+
* Defines property in dataSpecification list. Used only for
|
|
53
53
|
* definition of `syncSet` or `asyncSet`
|
|
54
54
|
*
|
|
55
55
|
* @param name identifier of property in dataSpecification
|
|
56
56
|
* @param prop property
|
|
57
57
|
* @param value Value
|
|
58
58
|
*/
|
|
59
|
-
defineProperty: <T extends keyof DataSpecifications, Prop extends
|
|
59
|
+
defineProperty: <T extends keyof DataSpecifications, Prop extends "asyncSet" | "syncSet", Value extends DataSpecifications[T][Prop]>(name: T, prop: Prop, value: Value) => void;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @param name identifier of property in dataSpecification
|
|
64
|
-
* @returns Stored value
|
|
65
|
-
*/
|
|
66
|
-
getProperty: <T extends keyof DataSpecifications>(name: T) => DataSpecifications[T];
|
|
67
|
-
/**
|
|
68
|
-
* Checks existence of property
|
|
69
|
-
*
|
|
70
|
-
* @param name Name
|
|
71
|
-
* @returns True if property exists
|
|
72
|
-
*/
|
|
73
|
-
hasProperty: <T extends keyof DataSpecifications>(name: T) => boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Sets a value in key, value store. If succesfull,a nd value has been changed, store will brodcast message with name and value.
|
|
61
|
+
* Sets a value in key, value store. If successful, and value has been changed, store will broadcast message with name and value.
|
|
76
62
|
* Limitation:** Our store is quite primitive so it can not compare Arrays and Objects. Always create new one or use `forceChange` * option.
|
|
77
63
|
*
|
|
78
64
|
* @param name Name
|
|
@@ -88,17 +74,6 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
88
74
|
* @param opts Options
|
|
89
75
|
*/
|
|
90
76
|
remove: <T extends keyof DataSpecifications>(name: T, opts?: StoreOptions) => void;
|
|
91
|
-
/**
|
|
92
|
-
* Outputs all allowed properties for give key into console.log
|
|
93
|
-
*/
|
|
94
|
-
getAll: () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Return list of permitted values for given key
|
|
97
|
-
*
|
|
98
|
-
* @param name Name
|
|
99
|
-
* @returns List of allowed values for the name; or string with info it is checked by function
|
|
100
|
-
*/
|
|
101
|
-
getAllowed: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T) => string | Item["allowed"];
|
|
102
77
|
/**
|
|
103
78
|
* Returns default value for given key
|
|
104
79
|
*
|
|
@@ -106,23 +81,10 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
106
81
|
* @returns Data specification type
|
|
107
82
|
*/
|
|
108
83
|
getDefault<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T): Item['def'];
|
|
109
|
-
isAsyncStore<T>(item: DataSpecificationsObject<T>): item is DataSpecificationsObject<T> & Required<Pick<DataSpecificationsObject<T>, 'asyncSet'>>;
|
|
110
|
-
/**
|
|
111
|
-
* Check if value was changed
|
|
112
|
-
* !!!! WARNING: for perfomance reasons check only against hot cache, so can
|
|
113
|
-
* lead to faulty results around default || never used values
|
|
114
|
-
*
|
|
115
|
-
* @param name Name
|
|
116
|
-
* @param item Item
|
|
117
|
-
* @param value Value
|
|
118
|
-
* @returns True if value was changed
|
|
119
|
-
*/
|
|
120
|
-
wasChanged<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, item: Item, value: Item['def']): boolean;
|
|
121
84
|
/**
|
|
122
|
-
* Insert dataSpecifications key (if not present)
|
|
123
|
-
*
|
|
124
|
-
* @
|
|
125
|
-
* @param obj Data specifications object
|
|
85
|
+
* Insert dataSpecifications key (if not present). So far used only for
|
|
86
|
+
* runtime inserting of Metrics
|
|
87
|
+
* @deprecated
|
|
126
88
|
*/
|
|
127
89
|
insert: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, obj: Item) => void;
|
|
128
90
|
/**
|
|
@@ -135,14 +97,20 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
135
97
|
get<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, options?: {
|
|
136
98
|
forceGet: boolean;
|
|
137
99
|
}): Item['def'];
|
|
138
|
-
|
|
100
|
+
private isAsyncStore;
|
|
101
|
+
/**
|
|
102
|
+
* Check if value was changed
|
|
103
|
+
* !!!! WARNING: for performance reasons check only against hot cache, so can
|
|
104
|
+
* lead to faulty results around default || never used values
|
|
105
|
+
*
|
|
106
|
+
* @param name Name
|
|
107
|
+
* @param item Item
|
|
108
|
+
* @param value Value
|
|
109
|
+
* @returns True if value was changed
|
|
110
|
+
*/
|
|
111
|
+
private wasChanged;
|
|
112
|
+
private isValid;
|
|
139
113
|
private setFinally;
|
|
140
114
|
}
|
|
141
115
|
declare const store: Store;
|
|
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?: {
|
|
143
|
-
forceGet: boolean;
|
|
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
|
-
(id: number): void;
|
|
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>, 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
116
|
export default store;
|
|
@@ -12,7 +12,7 @@ import { DataTiler } from '@windy/DataTiler';
|
|
|
12
12
|
import type { PixelInterpolationFun, CoordsInterpolationFun } from '@windy/interpolatorTypes';
|
|
13
13
|
import type { DataTile } from './dataLoader';
|
|
14
14
|
import type { ExtendedTileParams } from '@windy/DataTiler.d';
|
|
15
|
-
import type { FullRenderParameters } from '@windy/
|
|
15
|
+
import type { FullRenderParameters } from '@windy/interfaces';
|
|
16
16
|
export declare class TileInterpolator extends DataTiler {
|
|
17
17
|
cb<T extends true | false>(f1: CoordsInterpolationFun, // async interpolator does not use fakeFun with null return type
|
|
18
18
|
f2: PixelInterpolationFun | (() => null), isAsync?: T & (true | false)): void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AlertRequest, AlertResponse, AlertCheckResponse } from '@windy/alerts.d';
|
|
2
|
-
import type { Fav } from '@windy/favs.d';
|
|
3
2
|
import type { LatLon } from '@windy/interfaces';
|
|
4
3
|
export declare enum AlertStatus {
|
|
5
4
|
Triggered = "triggered",
|
|
@@ -52,9 +51,6 @@ export declare enum CloudCoverage {
|
|
|
52
51
|
Overcast = "OVC"
|
|
53
52
|
}
|
|
54
53
|
export declare function getAlertTimestamps(alertId: string): Promise<AlertCheckResponse>;
|
|
55
|
-
export declare function getAlertV3(alertId: string): Promise<Fav & {
|
|
56
|
-
type: 'alert';
|
|
57
|
-
}>;
|
|
58
54
|
export declare function getAlerts(): Promise<AlertResponse[]>;
|
|
59
55
|
export declare function getAlert(alertId: string): Promise<AlertResponse | null>;
|
|
60
56
|
export declare function createAlert(data: AlertRequest): Promise<void>;
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import type { Fav, FavId } from '@windy/favs';
|
|
1
|
+
import type { FavFragment, Fav, FavId } from '@windy/favs.d';
|
|
2
|
+
import type { Timestamp } from '@windy/types.d';
|
|
2
3
|
export declare const emitChange: () => void;
|
|
3
4
|
/**
|
|
4
5
|
* Adds a fav to the db
|
|
5
6
|
*/
|
|
6
|
-
export declare const add: () => Promise<FavId | null>;
|
|
7
|
+
export declare const add: (item: FavFragment) => Promise<FavId | null>;
|
|
7
8
|
/**
|
|
8
9
|
* Update Fav in the db
|
|
9
10
|
*/
|
|
10
|
-
export declare const update: () => Promise<FavId | null>;
|
|
11
|
+
export declare const update: (id: FavId, properties2update: Partial<Fav>) => Promise<FavId | null>;
|
|
11
12
|
/**
|
|
12
13
|
* Remove fav from db
|
|
13
14
|
*/
|
|
14
|
-
export declare const remove: () => Promise<void>;
|
|
15
|
+
export declare const remove: (id: FavId) => Promise<void>;
|
|
15
16
|
/**
|
|
16
17
|
* Toggle pinning fav to top or to homepage
|
|
17
18
|
*/
|
|
18
|
-
export declare const togglePin: () => Promise<void>;
|
|
19
|
+
export declare const togglePin: (id: FavId, whereToPin: 'pin2top' | 'pin2homepage', forcedTimestamp?: Timestamp) => Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Load favs from cloud
|
|
22
|
+
*/
|
|
23
|
+
export declare const loadFromCloud: () => Promise<void>;
|
|
19
24
|
/**
|
|
20
25
|
* Find all favs that match given criteria
|
|
21
26
|
*/
|
|
22
|
-
export declare const find: () => Promise<Fav[]>;
|
|
27
|
+
export declare const find: (query: Partial<Fav> | ((f: Fav) => boolean)) => Promise<Fav[]>;
|
|
23
28
|
/**
|
|
24
29
|
* Same as find but always returns only the first match
|
|
25
30
|
*/
|
|
26
|
-
export declare const findOne: () => Promise<Fav | undefined>;
|
|
31
|
+
export declare const findOne: (query: Partial<Fav> | ((f: Fav) => boolean)) => Promise<Fav | undefined>;
|
|
27
32
|
/**
|
|
28
33
|
* Returns all favs as array
|
|
29
34
|
*/
|
|
@@ -31,15 +36,23 @@ export declare const getAll: () => Promise<Fav[]>;
|
|
|
31
36
|
/**
|
|
32
37
|
* Quick check if fav with given ids exists
|
|
33
38
|
*/
|
|
34
|
-
export declare const isFav: () => Promise<boolean>;
|
|
39
|
+
export declare const isFav: (query: Partial<FavFragment>) => Promise<boolean>;
|
|
35
40
|
/**
|
|
36
41
|
* Toggles fav (adds or removes) from db
|
|
37
42
|
*/
|
|
38
|
-
export declare const toggle: () => Promise<boolean>;
|
|
43
|
+
export declare const toggle: (query: Partial<FavFragment>, item: FavFragment) => Promise<boolean>;
|
|
39
44
|
/**
|
|
40
45
|
* Checks if fav exists
|
|
41
46
|
*/
|
|
42
|
-
export declare const hasKey: () => Promise<boolean>;
|
|
47
|
+
export declare const hasKey: (key: FavId) => Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Since favs does not contain cc (country code) this enhances the fav with cc
|
|
50
|
+
* so we could make better use of it in the GUI (search, fav list).
|
|
51
|
+
*
|
|
52
|
+
* Once, the fav is enhanced with cc, it will be stored and synced with cloud.
|
|
53
|
+
* Uses try/catch to handle errors gracefully.
|
|
54
|
+
*/
|
|
55
|
+
export declare const enhanceWithCountryCode: (fav: Fav) => Promise<Fav>;
|
|
43
56
|
/**
|
|
44
57
|
* Removes all favs from the device TODO: Call after logging out
|
|
45
58
|
*/
|
package/types/client/utils.d.ts
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import { HttpError } from './errors';
|
|
2
2
|
import type { RegistrationError } from '@capacitor/push-notifications';
|
|
3
|
-
import type { RGBA } from '@windy/Color.d';
|
|
4
3
|
import type { QueryStringSource } from '@windy/http.d';
|
|
5
4
|
import type { LatLon, LinearScale, TilePoint } from '@windy/interfaces.d';
|
|
6
5
|
import type { RGBNumValues } from '@windy/interpolatorTypes';
|
|
7
|
-
import type { ExtendedStationType, HTMLString, NumOrNull, Timestamp, ParsedQueryString } from '@windy/types.d';
|
|
6
|
+
import type { ExtendedStationType, HTMLString, NumOrNull, NumValue, Path, Timestamp, TimeRangeMs, ParsedQueryString, RGBAString, RGBString, ColorGradientString, RGBA } from '@windy/types.d';
|
|
8
7
|
/**
|
|
9
|
-
* One minute in ms.
|
|
10
|
-
*
|
|
11
|
-
* @type {Timestamp}
|
|
8
|
+
* One minute duration in ms.
|
|
12
9
|
*/
|
|
13
|
-
export declare const tsMinute:
|
|
10
|
+
export declare const tsMinute: TimeRangeMs;
|
|
14
11
|
/**
|
|
15
|
-
* One hour in ms.
|
|
16
|
-
*
|
|
17
|
-
* @type {Timestamp}
|
|
12
|
+
* One hour duration in ms.
|
|
18
13
|
*/
|
|
19
|
-
export declare const tsHour:
|
|
14
|
+
export declare const tsHour: TimeRangeMs;
|
|
20
15
|
/**
|
|
21
|
-
* One day in ms.
|
|
22
|
-
*
|
|
23
|
-
* @type {Timestamp}
|
|
16
|
+
* One day duration in ms.
|
|
24
17
|
*/
|
|
25
|
-
export declare const tsDay:
|
|
18
|
+
export declare const tsDay: TimeRangeMs;
|
|
26
19
|
/**
|
|
27
|
-
* Long press time in ms.
|
|
20
|
+
* Long press time duration in ms.
|
|
28
21
|
*/
|
|
29
|
-
export declare const longPressTime:
|
|
22
|
+
export declare const longPressTime: TimeRangeMs;
|
|
30
23
|
/**
|
|
31
24
|
* Converts number to char
|
|
32
25
|
*
|
|
@@ -292,7 +285,7 @@ export declare const getAdjustedNow: (syncTime?: number) => number;
|
|
|
292
285
|
* @param lang Language code
|
|
293
286
|
* @returns True if language is supported, false otherwise
|
|
294
287
|
*/
|
|
295
|
-
export declare const isValidLang: (lang: string) => lang is "en" | "zh-TW" | "zh" | "ja" | "fr" | "ko" | "it" | "ru" | "nl" | "cs" | "tr" | "pl" | "sv" | "fi" | "ro" | "el" | "hu" | "hr" | "ca" | "da" | "ar" | "fa" | "hi" | "ta" | "sk" | "uk" | "bg" | "he" | "is" | "lt" | "et" | "vi" | "sl" | "sr" | "
|
|
288
|
+
export declare const isValidLang: (lang: string) => lang is "es" | "id" | "en" | "zh-TW" | "zh" | "ja" | "fr" | "ko" | "it" | "ru" | "nl" | "cs" | "tr" | "pl" | "sv" | "fi" | "ro" | "el" | "hu" | "hr" | "ca" | "da" | "ar" | "fa" | "hi" | "ta" | "sk" | "uk" | "bg" | "he" | "is" | "lt" | "et" | "vi" | "sl" | "sr" | "th" | "sq" | "pt" | "nb" | "de" | "bn";
|
|
296
289
|
/**
|
|
297
290
|
* Safely joins server name and path
|
|
298
291
|
*
|
|
@@ -466,6 +459,10 @@ export declare const removeDiacritics: (s: string) => string;
|
|
|
466
459
|
* This differs from the CSS property which capitalizes the first letter of each word.
|
|
467
460
|
*/
|
|
468
461
|
export declare const capitalize: (text: string) => string;
|
|
462
|
+
/**
|
|
463
|
+
* Get unified path format out of ts
|
|
464
|
+
*/
|
|
465
|
+
export declare const getPathFromTs: (ts: Timestamp | Date, replacerPattern?: string) => Path;
|
|
469
466
|
export declare const parseQueryString: (searchQuery: string | undefined) => ParsedQueryString | undefined;
|
|
470
467
|
export declare const seoLangRegex: RegExp;
|
|
471
468
|
/**
|
|
@@ -494,3 +491,7 @@ export declare const parseSeoUrl: (url: string) => {
|
|
|
494
491
|
export declare const startupPath: any;
|
|
495
492
|
export declare const generateUuidV4: () => string;
|
|
496
493
|
export declare const getErrorMessage: (error: unknown) => string;
|
|
494
|
+
/**
|
|
495
|
+
* Creates a color gradient from array of prepared ones
|
|
496
|
+
*/
|
|
497
|
+
export declare const createColorGradient: (gradient: (RGBAString | RGBString)[], numValues: NumValue[]) => ColorGradientString;
|