@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
package/README.md CHANGED
@@ -4,6 +4,8 @@ Check out https://docs.windy-plugins.com for more information.
4
4
 
5
5
  # CHANGELOG
6
6
 
7
+ - 3.0.2 - TS declarations for client v47.0.2
8
+ - 3.0.1 - TS declarations for client v46.1.0
7
9
  - 3.0.0 - TS declarations for client v45.0.0
8
10
  - 2.0.2 - Support Windows in file path regex
9
11
  - 2.0.1 - Remove less-autoprefixer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windycom/plugin-devtools",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Developer tools and TS declarations for developers of Windy Plugins.",
5
5
  "main": "index.mjs",
6
6
  "module": "index.mjs",
@@ -48,6 +48,9 @@ export declare class BottomSlide extends Drag {
48
48
  ondrag(_x: number, y: number, e: Event): void;
49
49
  ondragend(): void;
50
50
  startDrag(e: TouchEvent): void;
51
+ release(): void;
51
52
  private initCloseOnSwipeDown;
53
+ private setHalfOpen;
52
54
  private updatePosition;
55
+ private onRqstPluginHalfOpen;
53
56
  }
@@ -1,139 +1,169 @@
1
+ import type { Products } from '@windy/rootScope.d';
2
+ import type { ISODateString, Path, Timestamp, LoadedTranslations } from '@windy/types.d';
1
3
  /**
2
- * Object containing timestamps and methods for given weather product
4
+ * Main minifest object received from backend
3
5
  */
4
- import type { CalendarDay, MinifestObject, Weekday } from './d.ts.files/Calendar.d';
5
- import type { TimeFormatFunction } from './d.ts.files/format.d';
6
- import type { Products } from './d.ts.files/rootScope.d';
7
- import type { ISODateString, Path, Timestamp, YYYYMMDDHH } from './d.ts.files/types.d';
8
- export type CalendarInitParams = Pick<Calendar, 'numOfHours' | 'minifestFile'> & {
6
+ export interface MinifestObject {
9
7
  /**
10
- * Ident of product that this calendar is for
8
+ * Version
11
9
  */
12
- product: Products;
10
+ v: string;
13
11
  /**
14
- * This product is a free product
12
+ * Array of hour moments that contain forecast data
15
13
  */
16
- freeProduct?: boolean;
14
+ dst: number[][];
17
15
  /**
18
- * Optional latest timestamp (for use for offline mode for example)
16
+ * Main identifier, identifying the refTime on the backend.
19
17
  */
20
- lastTimestamp?: Timestamp;
21
- };
22
- export declare class Calendar {
18
+ info: string;
23
19
  /**
24
- * Time formatting function
20
+ * Reference time of forecast
25
21
  */
26
- static readonly localeHours: TimeFormatFunction;
27
- static readonly weekdays: Weekday[];
22
+ ref: ISODateString;
28
23
  /**
29
- * Number of hours covered by this calendar
24
+ * Update time of the forecast
30
25
  */
31
- numOfHours: number;
32
- calendarHours: number;
26
+ update: ISODateString;
33
27
  /**
34
- * Today midnigh in LT of user's computer
28
+ * In an emergency case backend can set `force` property at minifest. It breaks minifest client cache and set minifest at any circumstances
35
29
  */
36
- midnight: Date;
30
+ forced?: boolean;
31
+ }
32
+ /**
33
+ * Main Calendar Day Object
34
+ */
35
+ export interface CalendarDay {
37
36
  /**
38
- * This midnight of other defined start of timeline
37
+ * Translation ID for week day abbreviation
39
38
  */
40
- startOfTimeline: Date;
39
+ display: keyof LoadedTranslations;
41
40
  /**
42
- * startOfTimeline in the form of timestamp
41
+ * Translation ID for week day abbreviation
43
42
  */
44
- start: Timestamp;
43
+ displayLong: keyof LoadedTranslations;
45
44
  /**
46
- * startOfPremiumTimeline in the form of timestamp; null if it is free in whole range
45
+ * Start of the day
47
46
  */
48
- premiumStart: Timestamp | null;
47
+ start: Timestamp;
49
48
  /**
50
- * endOfCalendar as timestamp
49
+ * End of the day
51
50
  */
52
- endOfCal: Timestamp;
51
+ end: Timestamp;
53
52
  /**
54
- * endOfCal or latest timestamp, whiever is smaller
53
+ * Midday of the day
55
54
  */
56
- end: Timestamp;
55
+ middayTs: Timestamp;
57
56
  /**
58
- * Array of calendayr days to be used in UI
57
+ * Day of the month
59
58
  */
60
- days: CalendarDay[];
59
+ day: number;
61
60
  /**
62
- * Array of timestamps that contain valid forecast
61
+ * Forecast for this day is for Premium users only
63
62
  */
64
- timestamps: Timestamp[];
63
+ premium: boolean;
65
64
  /**
66
- * Array of URL paths that equal to timestamps in a form of "2021/05/27/19"
65
+ * Forecast for this day is available
67
66
  */
68
- paths: string[];
67
+ hasForecast: boolean;
68
+ }
69
+ /**
70
+ * Valid translation keys
71
+ */
72
+ export type Weekday = 'SUN' | 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT';
73
+ export type CalendarInitParams = {
69
74
  /**
70
75
  * Minifest that led to construction of this instance
71
76
  */
72
- minifestFile: MinifestObject;
77
+ minifest: MinifestObject;
73
78
  /**
74
- * Is the minifest valid or emergency, created out of the air?
79
+ * Ident of product that this calendar is created for
75
80
  */
76
- minifestValid: boolean;
81
+ productIdent: Products;
77
82
  /**
78
- * Minifests's reference time is some non stndard format
83
+ * This product is a free product
79
84
  */
80
- refTime: YYYYMMDDHH;
85
+ freeProduct?: boolean;
81
86
  /**
82
- * Minifests's reference time
87
+ * Minimum number of hours this calendar should cover
83
88
  */
84
- refTimeTs: Timestamp;
89
+ minimumHours: number;
90
+ };
91
+ export declare class Calendar {
92
+ static readonly weekdays: Weekday[];
85
93
  /**
86
- * Minifests's reference time
94
+ * At what day we start premium forecast
87
95
  */
88
- refTimeTxt: ISODateString;
96
+ private premiumStartDay;
89
97
  /**
90
- * Forecast update time
98
+ * Ident of a product that this Calendar is associated with (just for debug purposes)
91
99
  */
92
- updateTs: Timestamp;
100
+ private productIdent;
93
101
  /**
94
- * Forecast update time
102
+ * Number of hours in the calendar
95
103
  */
96
- updateTxt: ISODateString;
97
- constructor(params: CalendarInitParams);
98
- initProperties(): void;
104
+ calendarHours: number;
99
105
  /**
100
- * Bound ts to be be within limit of calendar
106
+ * Today midnight in LT of user's computer
101
107
  */
102
- boundTs(ts: Timestamp): Timestamp;
108
+ midnight: Date;
103
109
  /**
104
- * Finds closes valid path on the basis of timestamp
110
+ * startOfTimeline in the form of timestamp
105
111
  */
106
- ts2path(ts: Timestamp): Path;
112
+ start: Timestamp;
107
113
  /**
108
- * Creates timestamps out of the air, with 3h interval (fixed)
114
+ * startOfPremiumTimeline in the form of timestamp; null if it is free in whole range
109
115
  */
110
- createTimestamps(): void;
111
- prepareTimesFromMinifest(minifest: MinifestObject): boolean;
116
+ premiumStart: Timestamp | null;
112
117
  /**
113
- * Creates timestamps & paths arrays from minifest
118
+ * endOfPremiumTimeline in the form of timestamp; null if it is free in whole range
114
119
  */
115
- createTimestampsFromMinifest(minifest: MinifestObject): boolean;
120
+ premiumEnd: Timestamp | null;
116
121
  /**
117
- * Return YYYY/MM/DD/HH or YYYYMMDDHH on a basis of provided date
118
- * we do not CHECK existence of path in minifest
122
+ * endOfCalendar as timestamp
119
123
  */
120
- static date2path(date: Date): YYYYMMDDHH;
124
+ endOfCal: Timestamp;
121
125
  /**
122
- * Returns JavaScript date object corresponding
123
- * to provided path in a form YYYY/MM/DD/HH or YYYYMMDDHH
126
+ * endOfCal or latest timestamp, whoever is smaller
124
127
  */
125
- static path2date(path: string): Date;
128
+ end: Timestamp;
126
129
  /**
127
- * Returns nice, human readable date string out of ts
130
+ * Array of calendar days to be used in UI
128
131
  */
129
- static ts2string(ts: string | number): string;
132
+ days: CalendarDay[];
133
+ /**
134
+ * Array of timestamps that contain valid forecast
135
+ */
136
+ timestamps: Timestamp[];
137
+ /**
138
+ * Array of URL paths that equal to timestamps in a form of "2021/05/27/19"
139
+ */
140
+ paths: Path[];
141
+ /**
142
+ * Forecast update time
143
+ */
144
+ updateTs: Timestamp;
145
+ /**
146
+ * Minifests's reference time
147
+ */
148
+ refTimeTs: Timestamp;
149
+ constructor({ productIdent, minifest, freeProduct, minimumHours }: CalendarInitParams);
150
+ /**
151
+ * Bound ts to be be within limit of calendar
152
+ */
153
+ boundTs(ts: Timestamp): Timestamp;
154
+ /**
155
+ * Finds closes valid path on the basis of timestamp
156
+ */
157
+ ts2path(ts: Timestamp): Path;
158
+ private createDays;
159
+ private createTimestamps;
130
160
  /**
131
161
  * Adds hours or days to date
132
162
  *
133
163
  * @example
134
164
  * date = this.add( new Date(), 13, 'days' )
135
165
  */
136
- static add(date: Date, x: number, what?: 'days' | 'hours' | undefined): Date;
166
+ private add;
137
167
  /**
138
168
  * Return nearest midnight
139
169
  */
@@ -1,8 +1,14 @@
1
- import type { ColorGradient, AnyColorIdent, RGBA, RGBString } from './d.ts.files/Color.d';
2
- import type { NumValue } from './d.ts.files/types.d';
1
+ import type { RGBA, RGBString, ColorGradient, NumValue, ColorGradientString } from '@windy/types.d';
2
+ export type ColorIdent = 'temp' | 'wind' | 'rh' | 'pressure' | 'cclAltitude' | 'altitude' | 'deg0' | 'levels' | 'rain' | 'ptype' | 'rainClouds' | 'clouds' | 'lclouds' | 'hclouds' | 'mclouds' | 'cape' | 'lightDensity' | 'cbase' | 'snow' | 'rainAccu' | 'waves' | 'currents' | 'visibility' | 'gtco3' | 'aod550' | 'pm2p5' | 'no2' | 'tcso2' | 'go3' | 'cosc' | 'dust' | 'satellite' | 'radar' | 'radarPlus' | 'fog' | 'justGray' | 'efiWind' | 'efiTemp' | 'efiRain' | 'moistureAnom40' | 'moistureAnom100' | 'drought' | 'soilMoisture' | 'fwi' | 'dfm10h' | 'solarpower' | 'uvindex' | 'turbulence' | 'icing' | 'wetbulbtemp' | 'aqi' | 'dewpoint';
3
+ export type PluginColorIdent = 'windDetail' | 'wavesDetail' | 'periodDetail' | 'altitudeDetail' | 'visibilityDetail' | 'dewpointSpreadDetail' | 'blitz' | 'radiation' | 'pmDetail' | 'dustDetail' | 'coscDetail' | 'no2Detail' | 'pollenDetail' | 'so2Detail' | 'aqiGradientDetail';
4
+ export type AnyColorIdent = ColorIdent | PluginColorIdent | 'pressureIsolines' | 'temporary' | 'direction' | 'airgramColor' | 'tempFillColors' | 'tideGraphColors' | 'aqiFillColors';
5
+ export interface UserColor {
6
+ id: AnyColorIdent;
7
+ gradient: ColorGradient;
8
+ }
3
9
  export type ColorInitParams = Pick<Color, 'ident'> & Partial<Pick<Color, 'qualitative'>> & {
4
- steps: number;
5
- default: ColorGradient;
10
+ default: ColorGradientString;
11
+ steps?: number;
6
12
  opaque?: boolean;
7
13
  prepare?: boolean;
8
14
  };
@@ -26,7 +32,9 @@ export declare class Color {
26
32
  /** Index of neutral gray color */
27
33
  private neutralGrayIndex;
28
34
  /** Initial gradient */
29
- private defaultColorGradient;
35
+ private initialColorGradient;
36
+ /** Initial gradient, that was parsed to RGBA arrays from RGBAStrings */
37
+ private defaultColorGradient?;
30
38
  /** Custom modified gradient */
31
39
  private customColorGradient?;
32
40
  /** Big interpolated RGBA Type array color table, generated when color is required */
@@ -75,7 +83,7 @@ export declare class Color {
75
83
  * bOpaque .. set alpha to 255
76
84
  * bPremultiply .. mul RGB by A
77
85
  * valueScale .. optional scale used for WebGL texture data (coef 0.5 means half step - gradient size is doubled)
78
- * return .. output Uint8Array with color data
86
+ * return .. output Uint8Array with color data (NOTE: Uint8ClampedArray NOT SUPPORTED in WebGL!)
79
87
  */
80
88
  createGradientArray(bOpaque?: boolean, bPremultiply?: boolean, valueScale?: number): Uint8Array;
81
89
  /**
@@ -91,6 +99,11 @@ export declare class Color {
91
99
  * Checks validity of a gradient that it adheres to type ColorGradient
92
100
  */
93
101
  static checkValidity(obj: unknown): boolean;
102
+ private parseRGBAString;
103
+ /**
104
+ * Converts ColorGradientString into ColorGradient
105
+ */
106
+ private parseColorGradient;
94
107
  /**
95
108
  * return array multiplied by mul coef
96
109
  */
@@ -1,5 +1,5 @@
1
1
  import { dataLoader } from '@windy/dataLoader';
2
- import type { FullRenderParameters } from './d.ts.files/Layer.d';
2
+ import type { FullRenderParameters } from './d.ts.files/interfaces';
3
3
  import type { DataTile } from './d.ts.files/dataLoader';
4
4
  import type { ExtendedTileParams } from './DataTiler.d';
5
5
  export interface TilePoint {
@@ -22,10 +22,15 @@ export declare class ExternalSveltePlugin extends SveltePlugin<'windy-external-p
22
22
  mobileConfig: Record<InstalledExternalPluginConfig['mobileUI'], Config2config>;
23
23
  desktopConfig: Record<InstalledExternalPluginConfig['desktopUI'], Config2config>;
24
24
  widthOfRhPane: number;
25
+ version: string;
25
26
  listenToSingleclick: ExternalPluginConfig['listenToSingleclick'];
26
27
  addToContextmenu: ExternalPluginConfig['addToContextmenu'];
27
- constructor(params: WindowPluginInitParams<'windy-external-plugin'>, { desktopUI, title, mobileUI, desktopWidth, routerPath, listenToSingleclick, addToContextmenu, url, }: InstalledExternalPluginConfig);
28
+ constructor(params: WindowPluginInitParams<'windy-external-plugin'>, { desktopUI, title, mobileUI, desktopWidth, routerPath, listenToSingleclick, addToContextmenu, url, version, }: InstalledExternalPluginConfig);
28
29
  open({ params, disableOpeningAnimation, qs, }: PluginOpeningOptions<'windy-external-plugin'>): Promise<void | boolean>;
30
+ hasNewerVersion(latestVersion: string): boolean;
31
+ showConfirmationWindow(): Promise<boolean>;
32
+ getDayDiff(timestamp: string): number;
33
+ uninstallPlugin(): Promise<void>;
29
34
  getCss(): string;
30
35
  }
31
36
  export {};
@@ -1,8 +1,14 @@
1
1
  import type { Timestamp } from '@windy/types.d';
2
+ /**
3
+ * List of all collections we will need in our database
4
+ * remember to update this list when adding new collections
5
+ * Collections MUST be created at once
6
+ */
7
+ export declare const allUsedCollections: readonly ["customColors", "installedPlugins", "likedStoryComments", "log", "markedNotams", "popularLocations", "searchRecents2", "seenArticles", "seenPromos", "seenStories", "slidedCapAlerts", "userAlerts", "userFavs"];
2
8
  /**
3
9
  * Allowed data types for storage
4
10
  */
5
- export type DatabaseStore = 'userFavs' | 'userAlerts' | 'customColors' | 'searchRecents' | 'markedNotams' | 'minifests' | 'seenArticles' | 'seenPromos';
11
+ export type DatabaseStore = (typeof allUsedCollections)[number];
6
12
  export type BackendItem<V> = {
7
13
  updated: Timestamp;
8
14
  id: string;
@@ -1,13 +1,97 @@
1
- import type { Color } from './d.ts.files/Color';
2
- import type { FullRenderParameters, Layers, RenderParams, TransformFunction } from './d.ts.files/Layer.d';
3
- import type { Metric } from './d.ts.files/Metric';
4
- import type { Legend } from './d.ts.files/Metric.d';
5
- import type { NumberedMetric } from './d.ts.files/MetricClasses';
6
- import type { DataQuality, FileSuffix, Product } from './d.ts.files/Product';
7
- import type { Renderers } from './d.ts.files/Renderer.d';
8
- import type { WeatherParameters } from './d.ts.files/interfaces.d';
9
- import type { Levels, Products } from './d.ts.files/rootScope.d';
10
- import type { Timestamp } from './d.ts.files/types';
1
+ import type { Color } from '@windy/Color';
2
+ import type { Metric } from '@windy/Metric';
3
+ import type { Legend } from '@windy/Metric.d';
4
+ import type { DataQuality, FileSuffix } from '@windy/Product';
5
+ import type { Renderers } from '@windy/Renderer';
6
+ import type { Levels, Products } from '@windy/rootScope.d';
7
+ import type { NumberedMetric, PrecipMetric, PtypeMetric, UVIndexMetric } from '@windy/MetricClasses';
8
+ import type { TransformFunction } from '@windy/types';
9
+ import type { RenderParams } from '@windy/interfaces';
10
+ /**
11
+ * All available layers and their metric value type
12
+ */
13
+ export interface LayerMetricType {
14
+ capAlerts: undefined;
15
+ pressureIsolines: undefined;
16
+ ghIsolines: undefined;
17
+ tempIsolines: undefined;
18
+ deg0Isolines: undefined;
19
+ windParticles: undefined;
20
+ ecmwfWindParticles: undefined;
21
+ ecmwfWindParticles150h: undefined;
22
+ ecmwfWindParticles500h: undefined;
23
+ ecmwfWindParticles600h: undefined;
24
+ waveParticles: undefined;
25
+ currentParticles: undefined;
26
+ currentsTideParticles: undefined;
27
+ wind: NumberedMetric;
28
+ temp: NumberedMetric;
29
+ wetbulbtemp: NumberedMetric;
30
+ solarpower: NumberedMetric;
31
+ uvindex: UVIndexMetric;
32
+ dewpoint: NumberedMetric;
33
+ gust: NumberedMetric;
34
+ gustAccu: NumberedMetric;
35
+ rh: NumberedMetric;
36
+ pressure: NumberedMetric;
37
+ ccl: NumberedMetric;
38
+ rain: PrecipMetric;
39
+ ptype: PtypeMetric;
40
+ thunder: NumberedMetric;
41
+ clouds: NumberedMetric;
42
+ lclouds: NumberedMetric;
43
+ mclouds: NumberedMetric;
44
+ hclouds: NumberedMetric;
45
+ cape: NumberedMetric;
46
+ cbase: NumberedMetric;
47
+ fog: NumberedMetric;
48
+ snowAccu: NumberedMetric;
49
+ rainAccu: NumberedMetric;
50
+ waves: NumberedMetric;
51
+ wwaves: NumberedMetric;
52
+ swell1: NumberedMetric;
53
+ swell2: NumberedMetric;
54
+ swell3: NumberedMetric;
55
+ swell: NumberedMetric;
56
+ currents: NumberedMetric;
57
+ currentsTide: NumberedMetric;
58
+ sst: NumberedMetric;
59
+ visibility: NumberedMetric;
60
+ snowcover: NumberedMetric;
61
+ cloudtop: NumberedMetric;
62
+ deg0: NumberedMetric;
63
+ cosc: NumberedMetric;
64
+ dustsm: NumberedMetric;
65
+ radar: NumberedMetric;
66
+ satellite: NumberedMetric;
67
+ radarPlus: NumberedMetric;
68
+ gtco3: NumberedMetric;
69
+ pm2p5: NumberedMetric;
70
+ no2: NumberedMetric;
71
+ aod550: NumberedMetric;
72
+ tcso2: NumberedMetric;
73
+ go3: NumberedMetric;
74
+ gh: NumberedMetric;
75
+ efiWind: NumberedMetric;
76
+ efiTemp: NumberedMetric;
77
+ efiRain: NumberedMetric;
78
+ moistureAnom40: PrecipMetric;
79
+ moistureAnom100: PrecipMetric;
80
+ drought40: NumberedMetric;
81
+ drought100: NumberedMetric;
82
+ soilMoisture40: NumberedMetric;
83
+ soilMoisture100: NumberedMetric;
84
+ fwi: NumberedMetric;
85
+ dfm10h: NumberedMetric;
86
+ turbulence: NumberedMetric;
87
+ icing: NumberedMetric;
88
+ topoMap: undefined;
89
+ aqi: NumberedMetric;
90
+ }
91
+ /**
92
+ * All layers available
93
+ */
94
+ export type Layers = keyof LayerMetricType;
11
95
  type LayerInitParams = Pick<Layer, 'ident'> & Partial<Layer>;
12
96
  export declare class Layer<M extends Metric | undefined = Metric | undefined> {
13
97
  /**
@@ -75,7 +159,7 @@ export declare class Layer<M extends Metric | undefined = Metric | undefined> {
75
159
  */
76
160
  levels: Levels[];
77
161
  /**
78
- * Optional quary string that enhances query string
162
+ * Optional query string that enhances query string
79
163
  */
80
164
  query?: string;
81
165
  /**
@@ -91,10 +175,6 @@ export declare class Layer<M extends Metric | undefined = Metric | undefined> {
91
175
  * If users opts to change colors of this layer, use this metrics
92
176
  */
93
177
  cm?: Metric;
94
- /**
95
- * Overwrite's products pathgenerator
96
- */
97
- pathGenerator?: string;
98
178
  /**
99
179
  * Method to transfrom value in R channel
100
180
  */
@@ -116,21 +196,10 @@ export declare class Layer<M extends Metric | undefined = Metric | undefined> {
116
196
  * getColor for layers, with mutliple colors (like rainClouds)
117
197
  */
118
198
  getColor2?(): ReturnType<Color['getColor']>;
119
- /**
120
- * Just call Product's open and return its Calendar
121
- */
122
- getCalendar(prodIdent: Products): ReturnType<Product['open']>;
123
- /**
124
- * Creates RenderingParameters
125
- */
126
- getParams(weatherParams: WeatherParameters, productIdent: Products, timestamp?: Timestamp, refTime?: string): Promise<FullRenderParameters>;
127
199
  /**
128
200
  * Return amounts of dots, based on rain
129
201
  */
130
202
  getAmountByColor?(Rf: number, Gf: number): 0 | 1 | 2 | 3 | 4;
131
203
  protected initProperties(): void;
132
204
  }
133
- export declare class WaveLayer extends Layer<NumberedMetric> {
134
- initProperties(): void;
135
- }
136
205
  export {};
@@ -0,0 +1,5 @@
1
+ import { Layer } from '@windy/Layer';
2
+ import type { NumberedMetric } from '@windy/MetricClasses';
3
+ export declare class WaveLayer extends Layer<NumberedMetric> {
4
+ initProperties(): void;
5
+ }
@@ -1,7 +1,6 @@
1
1
  import type { Color } from './d.ts.files/Color';
2
- import type { RGBString } from './d.ts.files/Color.d';
3
- import type { ConvObj, Legend, LegendDescription, LegendLines, MetricIdent, MetricInitParams, MetricItem, MetricKey } from './d.ts.files/Metric.d';
4
- import type { HTMLString, NumValue, LoadedTranslations } from './d.ts.files/types.d';
2
+ import type { ConvObj, Legend, LegendDescription, LegendLines, MetricIdent, MetricInitParams, MetricItem } from './d.ts.files/Metric.d';
3
+ import type { NumValue, LoadedTranslations, RGBString } from './d.ts.files/types.d';
5
4
  export declare const rtrnSelf: (x: NumValue) => NumValue;
6
5
  /**
7
6
  * # @windy/Metric
@@ -13,26 +12,23 @@ export declare const rtrnSelf: (x: NumValue) => NumValue;
13
12
  * Never ever, change users selected metric without their consent.
14
13
  */
15
14
  export declare abstract class Metric<T extends string | number = string | number> {
16
- /**
17
- * Identifies metric
18
- */
19
- ident: MetricIdent;
20
15
  /**
21
16
  * Store key
22
17
  */
23
- key: MetricKey;
18
+ private key;
24
19
  /**
25
- * Actually selected metric
20
+ * Keeps cohesion in between multiple metric instances. For example setting `in`
21
+ * in rain will set `in` in snow also
26
22
  */
27
- metric: MetricItem;
23
+ cohesion?: {
24
+ [ident in MetricIdent]?: {
25
+ [unit in MetricItem]?: MetricItem;
26
+ };
27
+ };
28
28
  /**
29
29
  * Conversion functions
30
30
  */
31
31
  conv: ConvObj;
32
- /**
33
- * Backward conversion functions
34
- */
35
- backConv?: ConvObj;
36
32
  /**
37
33
  * number ' ' metric separator
38
34
  */
@@ -47,22 +43,25 @@ export declare abstract class Metric<T extends string | number = string | number
47
43
  */
48
44
  nativeSync: boolean;
49
45
  /**
50
- * Legend description
46
+ * Identifies metric
51
47
  */
52
- description: LegendDescription;
48
+ ident: MetricIdent;
49
+ /**
50
+ * Backward conversion functions
51
+ */
52
+ backConv?: ConvObj;
53
53
  /**
54
54
  * Array defining how the legend will look like
55
55
  */
56
56
  lines: LegendLines;
57
57
  /**
58
- * Keeps cohesion in between multiple metric instances. For example setting `in`
59
- * in rain will set `in` in snow also
58
+ * Actually selected metric
60
59
  */
61
- cohesion?: {
62
- [ident in MetricIdent]?: {
63
- [unit in MetricItem]?: MetricItem;
64
- };
65
- };
60
+ metric: MetricItem;
61
+ /**
62
+ * Legend description
63
+ */
64
+ description: LegendDescription;
66
65
  /**
67
66
  * Some metrics have discrete legend.
68
67
  * If so, these labels define it, where NumValue is numerical value, to grab color from color table
@@ -81,18 +80,11 @@ export declare abstract class Metric<T extends string | number = string | number
81
80
  */
82
81
  labels: [keyof LoadedTranslations, RGBString][];
83
82
  };
84
- /**
85
- * Colors used to render discrete legend
86
- * @param params
87
- */
88
83
  constructor(params: MetricInitParams);
89
- onMetricChanged(metric: MetricItem): void;
90
- getDefault(): MetricItem;
91
- setDefault(): void;
92
84
  /**
93
85
  * get value + label on a basis of user selected metric
94
86
  */
95
- convertValue(value: NumValue, separator?: string, suffix?: string): string;
87
+ convertValue(value: NumValue, separator?: string, suffix?: string, forcedPrecision?: number): string;
96
88
  /**
97
89
  * Not available
98
90
  */
@@ -102,7 +94,7 @@ export declare abstract class Metric<T extends string | number = string | number
102
94
  */
103
95
  abstract convertNumber(value: NumValue, forcedPrecision?: number, metric?: MetricItem): T;
104
96
  /**
105
- * List all avail metrics
97
+ * List all avail units
106
98
  */
107
99
  listMetrics(): MetricItem[];
108
100
  /**
@@ -112,21 +104,18 @@ export declare abstract class Metric<T extends string | number = string | number
112
104
  /**
113
105
  * Stores required metric into storage
114
106
  */
115
- setMetric(metric: MetricItem, uiIdent?: string): void;
107
+ setMetric(metric: MetricItem, ignoreCohesion?: boolean): void;
116
108
  /**
117
109
  * Cycles throu different metrics (for example after clicking on a legend)
118
110
  */
119
- cycleMetric(uiIdent?: string): void;
120
- static getGradientLegend: (col: Color | undefined, legend: Legend, metric: MetricItem) => {
121
- background: string;
122
- content: HTMLString;
123
- } | null;
111
+ cycleMetric(): void;
124
112
  /** color object is required for classic gradient metrics, discrete ones do not need it as colors are hardcoded for them */
125
113
  renderLegend(col: Color | undefined, el: HTMLDivElement, legend: Legend): void;
126
- renderDiscreteLegend(): {
127
- background: '';
128
- content: HTMLString;
129
- };
130
114
  protected initProperties(): void;
131
- private _createKey;
115
+ private onMetricChanged;
116
+ private getDefault;
117
+ private setDefault;
118
+ private getGradientLegend;
119
+ private renderDiscreteLegend;
120
+ private createKey;
132
121
  }