@windycom/plugin-devtools 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +2 -0
  2. package/package.json +1 -1
  3. package/types/client/BottomSlide.d.ts +3 -0
  4. package/types/client/Calendar.d.ts +101 -71
  5. package/types/client/Color.d.ts +19 -6
  6. package/types/client/DataTiler.d.ts +1 -1
  7. package/types/client/ExternalSveltePlugin.d.ts +6 -1
  8. package/types/client/IDB.d.ts +7 -1
  9. package/types/client/Layer.d.ts +95 -26
  10. package/types/client/LayerClasses.d.ts +5 -0
  11. package/types/client/Metric.d.ts +32 -43
  12. package/types/client/Overlay.d.ts +7 -10
  13. package/types/client/OverlayClasses.d.ts +8 -0
  14. package/types/client/Particles.d.ts +1 -1
  15. package/types/client/Plugin.d.ts +4 -0
  16. package/types/client/Product.d.ts +31 -73
  17. package/types/client/ProductClasses.d.ts +44 -0
  18. package/types/client/Renderer.d.ts +41 -13
  19. package/types/client/SveltePlugin.d.ts +7 -0
  20. package/types/client/TileLayer.d.ts +2 -2
  21. package/types/client/TopoMap.d.ts +2 -3
  22. package/types/client/WindowPlugin.d.ts +9 -5
  23. package/types/client/colorGradients.d.ts +5 -10
  24. package/types/client/colors.d.ts +1 -2
  25. package/types/client/compatibilityCheck.d.ts +1 -0
  26. package/types/client/connection.d.ts +1 -1
  27. package/types/client/d.ts.files/LabelsLayer.d.ts +2 -2
  28. package/types/client/d.ts.files/Metric.d.ts +21 -2
  29. package/types/client/d.ts.files/TileLayerCanvas.d.ts +3 -3
  30. package/types/client/d.ts.files/alerts.d.ts +2 -2
  31. package/types/client/d.ts.files/broadcast.d.ts +17 -12
  32. package/types/client/d.ts.files/dataSpecifications.d.ts +76 -53
  33. package/types/client/d.ts.files/favs.d.ts +18 -30
  34. package/types/client/d.ts.files/http.d.ts +5 -0
  35. package/types/client/d.ts.files/lib.d.ts +5 -8
  36. package/types/client/d.ts.files/plugin-params.d.ts +32 -20
  37. package/types/client/d.ts.files/plugins.d.ts +2 -3
  38. package/types/client/d.ts.files/rootScope.d.ts +14 -12
  39. package/types/client/d.ts.files/startup.d.ts +17 -11
  40. package/types/client/d.ts.files/user.d.ts +3 -0
  41. package/types/client/d.ts.files/{Webcams.d.ts → webcams.d.ts} +9 -2
  42. package/types/client/dataLoader.d.ts +2 -2
  43. package/types/client/device.d.ts +1 -0
  44. package/types/client/embed.d.ts +68 -0
  45. package/types/client/errorLogger.d.ts +28 -3
  46. package/types/client/errors.d.ts +6 -0
  47. package/types/client/externalPlugins.d.ts +2 -0
  48. package/types/client/fetch.d.ts +42 -6
  49. package/types/client/format.d.ts +2 -1
  50. package/types/client/glTileRender.d.ts +1 -7
  51. package/types/client/http.d.ts +0 -6
  52. package/types/client/idbInstances.d.ts +123 -21
  53. package/types/client/imakerMain.d.ts +49 -0
  54. package/types/client/latestBroadcasts.d.ts +1 -1
  55. package/types/client/layers.d.ts +3 -1
  56. package/types/client/legends.d.ts +1 -1
  57. package/types/client/lib.d.ts +1 -10
  58. package/types/client/libHtml.d.ts +1 -1
  59. package/types/client/liveAlerts.d.ts +5 -0
  60. package/types/client/liveAlerts.types.d.ts +28 -0
  61. package/types/client/location.d.ts +5 -0
  62. package/types/client/log.d.ts +3 -1
  63. package/types/client/map.d.ts +7 -1
  64. package/types/client/mobile.d.ts +3 -9
  65. package/types/client/models.d.ts +7 -9
  66. package/types/client/notifications.d.ts +2 -5
  67. package/types/client/overlays.d.ts +2 -1
  68. package/types/client/particleRenderers.d.ts +1 -1
  69. package/types/client/products.d.ts +54 -2
  70. package/types/client/promo.d.ts +28 -5
  71. package/types/client/pushNotifications.d.ts +7 -1
  72. package/types/client/renderCtrl.d.ts +1 -1
  73. package/types/client/renderTile.d.ts +2 -2
  74. package/types/client/renderUtils.d.ts +16 -36
  75. package/types/client/renderers.d.ts +2 -4
  76. package/types/client/reverseName.d.ts +2 -1
  77. package/types/client/rhMessage.d.ts +1 -1
  78. package/types/client/rootScope.d.ts +22 -6
  79. package/types/client/router.d.ts +8 -5
  80. package/types/client/store.d.ts +20 -52
  81. package/types/client/storeLastPosition.d.ts +4 -1
  82. package/types/client/tileInterpolator.d.ts +1 -1
  83. package/types/client/user.d.ts +2 -0
  84. package/types/client/userAlerts.d.ts +0 -4
  85. package/types/client/userFavs.d.ts +12 -0
  86. package/types/client/utils.d.ts +57 -20
  87. package/types/iconfont.d.ts +7 -0
  88. package/types/interfaces.d.ts +339 -81
  89. package/types/lang-files.d.ts +783 -19
  90. package/types/types.d.ts +352 -23
  91. package/types/client/d.ts.files/Calendar.d.ts +0 -96
  92. package/types/client/d.ts.files/Color.d.ts +0 -93
  93. package/types/client/d.ts.files/Layer.d.ts +0 -191
  94. package/types/client/d.ts.files/Renderer.d.ts +0 -44
  95. package/types/client/d.ts.files/errorLogger.d.ts +0 -35
  96. package/types/client/d.ts.files/products.d.ts +0 -61
  97. package/types/offline.d.ts +0 -100
@@ -9,7 +9,7 @@ export declare const version: string;
9
9
  * Target
10
10
  * @ignore
11
11
  */
12
- export declare const target: "mobile" | "index" | "lib" | "embed2";
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
  */
@@ -114,10 +118,18 @@ export declare const isMobile: boolean;
114
118
  * Indicates that browsing device is tablet
115
119
  */
116
120
  export declare const isTablet: boolean;
121
+ /**
122
+ * Indicates that that browsing device is desktop
123
+ */
124
+ export declare const isDesktop: boolean;
117
125
  /**
118
126
  * Indicates that browsing device is mobile or tablet
119
127
  */
120
128
  export declare const isMobileOrTablet: boolean;
129
+ /**
130
+ * Indicates that browsing device is tablet or desktop
131
+ */
132
+ export declare const isDesktopOrTablet: boolean;
121
133
  /**
122
134
  * Indicates that browsing device has retina display
123
135
  * @ignore
@@ -138,7 +150,7 @@ export declare const maxFavPoisDesktop = 7;
138
150
  * Valid POI layers, their name and icon
139
151
  * @ignore this will crash Markdown parser
140
152
  */
141
- export declare const pois: Record<string, [keyof LoadedTranslations | string, Iconfont]>;
153
+ export declare const pois: Record<string, [keyof LoadedTranslations, Iconfont]>;
142
154
  /**
143
155
  * List of valid isoline identifiers
144
156
  * @ignore this will crash Markdown parser
@@ -149,3 +161,7 @@ export declare const isolinesType: readonly ["pressure", "gh", "temp", "deg0"];
149
161
  * TODO: Mobile apps have probably different location
150
162
  */
151
163
  export declare const pluginsLocation: string;
164
+ export declare const pollenProducts: Record<string, [
165
+ longTranslation: keyof LoadedTranslations,
166
+ shortTranslation: keyof LoadedTranslations
167
+ ]>;
@@ -1,20 +1,23 @@
1
- import { type ParsedQueryString } from '../utils/queryString';
2
1
  import type { PluginIdent } from '@windy/Plugin';
3
2
  import type { Coords, PickerCoords } from '@windy/interfaces.d';
4
3
  import type { Overlays, Products } from '@windy/rootScope.d';
5
- import type { ExternalPluginIdent } from '@windy/types';
4
+ import type { ExternalPluginIdent, ParsedQueryString } from '@windy/types';
6
5
  export type ParsedStartupValues = {
7
6
  sharedCoords: Coords | null;
8
7
  pickerCoords: PickerCoords | null;
9
8
  overlay: Overlays | null;
10
9
  product: Products | null;
10
+ hideStartupWeather?: boolean;
11
11
  };
12
12
  /**
13
13
  * Parse URL to plugin and its parameters (if any)
14
14
  *
15
- * @returns true if some of the plugins was matched, false otherwise
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
16
19
  */
17
- export declare function resolveRoute(purl: string, source: 'url' | 'back-button', parsedQs?: ParsedQueryString): ExternalPluginIdent | PluginIdent | void;
20
+ export declare function resolveRoute(purl: string, source: 'url' | 'back-button', parsedQs?: ParsedQueryString): Promise<PluginIdent | ExternalPluginIdent | void>;
18
21
  /**
19
22
  * Parse search part of the URL
20
23
  * eg: https://www.windy.com/?overlay,level,lat,lon,zoom,marker
@@ -30,5 +33,5 @@ export declare function parseSearch(searchQuery: string | undefined): ParsedStar
30
33
  * Parsed items from URL
31
34
  */
32
35
  export declare const sharedCoords: Coords;
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";
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";
34
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";
@@ -38,7 +38,7 @@
38
38
  * @module store
39
39
  */
40
40
  import { Evented } from '@windy/Evented';
41
- import type { DataSpecifications, DataSpecificationsObject } from './d.ts.files/dataSpecifications.d';
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 for example for
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 keyof DataSpecifications[T], Value extends DataSpecifications[T][Prop]>(name: T, prop: Prop, value: Value) => void;
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
- * Retrieves property from dataSpecifications
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
- * @param name Name
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
- isValid<T>(item: DataSpecificationsObject<T>, value: T): boolean;
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;
@@ -1 +1,4 @@
1
- export {};
1
+ /**
2
+ * Stores timezone offset for node-notif to know when to send notifications.
3
+ */
4
+ export declare const storeLastTimezoneOffset: () => void;
@@ -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/Layer.d';
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;
@@ -9,6 +9,7 @@
9
9
  *
10
10
  * @module user
11
11
  */
12
+ import '@windy/liveAlerts';
12
13
  import type { HttpPayload } from './d.ts.files/http.d';
13
14
  import type { AccountLoginResponse, UserInfo, User, LoginAndFinishAction } from './d.ts.files/user.d';
14
15
  /**
@@ -16,6 +17,7 @@ import type { AccountLoginResponse, UserInfo, User, LoginAndFinishAction } from
16
17
  */
17
18
  export declare const isLoggedIn: () => boolean;
18
19
  export declare const getInfo: () => User | null;
20
+ export declare const emptyAvatar = "<!-- @echo IMG_ABSOLUTE_PATH -->/avatar.jpg";
19
21
  /**
20
22
  * Safe way how to retrieve use avatar
21
23
  * @returns link to user avatar or default avatar
@@ -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>;
@@ -17,6 +17,10 @@ export declare const remove: (id: FavId) => Promise<void>;
17
17
  * Toggle pinning fav to top or to homepage
18
18
  */
19
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>;
20
24
  /**
21
25
  * Find all favs that match given criteria
22
26
  */
@@ -41,6 +45,14 @@ export declare const toggle: (query: Partial<FavFragment>, item: FavFragment) =>
41
45
  * Checks if fav exists
42
46
  */
43
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>;
44
56
  /**
45
57
  * Removes all favs from the device TODO: Call after logging out
46
58
  */
@@ -1,32 +1,25 @@
1
+ import { HttpError } from './errors';
1
2
  import type { RegistrationError } from '@capacitor/push-notifications';
2
- import type { RGBA } from '@windy/Color.d';
3
- import type { HttpError } from '@windy/http';
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 } 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: Timestamp;
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: Timestamp;
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: Timestamp;
18
+ export declare const tsDay: TimeRangeMs;
26
19
  /**
27
- * Long press time in ms. to be used everywhere
20
+ * Long press time duration in ms.
28
21
  */
29
- export declare const longPressTime: Timestamp;
22
+ export declare const longPressTime: TimeRangeMs;
30
23
  /**
31
24
  * Converts number to char
32
25
  *
@@ -128,7 +121,11 @@ export declare const radToDeg = 57.2957795;
128
121
  */
129
122
  export declare const debounce: <Args extends unknown[], F extends (...args: Args) => void>(func: (this: ThisParameterType<F>, ...args: Args & Parameters<F>) => void, waitTill: number, immediate?: boolean) => (this: ThisParameterType<F>, ...args: Args & Parameters<F>) => void;
130
123
  /**
131
- * Retun throttling function
124
+ * Returns a throttled variant of the input function, using a timer to limit calls of the input function.
125
+ * If the throttled function is called and the timer is not running, the input function is executed immediatelly and a timer is started.
126
+ * If the throttled function is called again before the timer runs out, the input function is not executed, but the call arguments are stored
127
+ * and the input function is called once the timer runs out.
128
+ * If the throttled function is called multiple times while the timer is running, only the latest call arguments are used once the timer runs out.
132
129
  *
133
130
  * @param this NOT USED, it is only TS explicit this annotation build-time parameter. Consider it as the first parameter would not exist.
134
131
  * @param fn Function to throttle
@@ -167,7 +164,10 @@ export interface WindObject extends DirObject {
167
164
  * @param v Vector [u,v]
168
165
  * @returns Object { wind, dir }
169
166
  */
170
- export declare const wind2obj: ([u, v]: [number, number] | RGBNumValues) => WindObject;
167
+ export declare const wind2obj: ([u, v]: [
168
+ number,
169
+ number
170
+ ] | RGBNumValues) => WindObject;
171
171
  export interface WaveObject extends DirObject {
172
172
  period: number;
173
173
  size: number;
@@ -213,6 +213,7 @@ export declare const isNear: <T extends LatLon, F extends LatLon>(a: T, b: F) =>
213
213
  * @returns Bounded number
214
214
  */
215
215
  export declare const bound: (num: number, min: number, max: number) => number;
216
+ export declare const clamp: (num: number, min: number, max: number) => number;
216
217
  /**
217
218
  * Smoothstep https://en.wikipedia.org/wiki/Smoothstep
218
219
  *
@@ -284,7 +285,7 @@ export declare const getAdjustedNow: (syncTime?: number) => number;
284
285
  * @param lang Language code
285
286
  * @returns True if language is supported, false otherwise
286
287
  */
287
- 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" | "id" | "th" | "sq" | "pt" | "nb" | "es" | "de" | "bn";
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";
288
289
  /**
289
290
  * Safely joins server name and path
290
291
  *
@@ -458,3 +459,39 @@ export declare const removeDiacritics: (s: string) => string;
458
459
  * This differs from the CSS property which capitalizes the first letter of each word.
459
460
  */
460
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;
466
+ export declare const parseQueryString: (searchQuery: string | undefined) => ParsedQueryString | undefined;
467
+ export declare const seoLangRegex: RegExp;
468
+ /**
469
+ * Examples of SEO URLs:
470
+ *
471
+ * ## https://www.windy.com/cs/... (case [1])
472
+ * SEO language, used in @module trans Must be followed by string
473
+ *
474
+ * ## https://www.windy.com/-Name-Whatever-overlay (case [2])
475
+ * SEO Name of Overlay
476
+ *
477
+ * ## https://www.windy.com/-Name-Whatever/... (case [3])
478
+ * SEO NAME of plugin name, followed by any other string
479
+ *
480
+ * Remember that numbers are not allowed at the beginning of the URL, to distinguish
481
+ * any URL from detail.
482
+ *
483
+ */
484
+ export declare const parseSeoUrl: (url: string) => {
485
+ purl: string;
486
+ overlay: string;
487
+ };
488
+ /**
489
+ * Safely URL decoded startup pathname
490
+ */
491
+ export declare const startupPath: any;
492
+ export declare const generateUuidV4: () => string;
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;
@@ -1,6 +1,8 @@
1
1
  // !!! Automatically generated file by make/iconfont.ts !!!
2
2
 
3
3
  export type Iconfont =
4
+ | '<!-- @echo icon-pictures -->'
5
+ | '<!-- @echo icon-comment-o -->'
4
6
  | '<!-- @echo icon-upload -->'
5
7
  | '<!-- @echo icon-long-tap -->'
6
8
  | '<!-- @echo icon-moving-cloud -->'
@@ -187,6 +189,11 @@ export type Iconfont =
187
189
  | '<!-- @echo icon-bell-plus -->'
188
190
  | '<!-- @echo icon-x -->'
189
191
  | '<!-- @echo icon-twitter -->'
192
+ | '<!-- @echo icon-fire-warning -->'
193
+ | '<!-- @echo icon-fire-match -->'
194
+ | '<!-- @echo icon-fire-wind -->'
195
+ | '<!-- @echo icon-crosshair -->'
196
+ | '<!-- @echo icon-pushpin -->'
190
197
  | '<!-- @echo icon-github -->'
191
198
  | '<!-- @echo icon-link -->'
192
199
  | '<!-- @echo icon-plane-snowflake -->'