@windycom/plugin-devtools 1.0.1

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 (137) hide show
  1. package/README.md +3 -0
  2. package/index.mjs +298 -0
  3. package/package.json +9 -0
  4. package/publishExamples.sh +19 -0
  5. package/types/AromeProduct.d.ts +5 -0
  6. package/types/Bar.d.ts +114 -0
  7. package/types/BindedBar.d.ts +51 -0
  8. package/types/BindedCheckbox.d.ts +30 -0
  9. package/types/BindedSwitch.d.ts +35 -0
  10. package/types/BottomSlide.d.ts +53 -0
  11. package/types/BottomTagPlugin.d.ts +8 -0
  12. package/types/Calendar.d.ts +149 -0
  13. package/types/ClickHandler.d.ts +19 -0
  14. package/types/Color.d.ts +175 -0
  15. package/types/DataTiler.d.ts +41 -0
  16. package/types/Drag.d.ts +43 -0
  17. package/types/DraggableDiv.d.ts +21 -0
  18. package/types/DropDown.d.ts +37 -0
  19. package/types/EcmwfAnalysisProduct.d.ts +5 -0
  20. package/types/EcmwfProduct.d.ts +29 -0
  21. package/types/Evented.d.ts +78 -0
  22. package/types/ExternalSveltePlugin.d.ts +29 -0
  23. package/types/Favs.d.ts +83 -0
  24. package/types/GhostBox.d.ts +17 -0
  25. package/types/GlObj.d.ts +252 -0
  26. package/types/HrrrProducts.d.ts +5 -0
  27. package/types/IconProducts.d.ts +5 -0
  28. package/types/LabelsLayer.d.ts +2 -0
  29. package/types/LandMask.d.ts +2 -0
  30. package/types/Layer.d.ts +137 -0
  31. package/types/Legend.d.ts +6 -0
  32. package/types/LongTap.d.ts +21 -0
  33. package/types/Metric.d.ts +132 -0
  34. package/types/MetricClasses.d.ts +37 -0
  35. package/types/MobileCalendar.d.ts +47 -0
  36. package/types/NamProducts.d.ts +5 -0
  37. package/types/OfflineMessagesClasses.d.ts +30 -0
  38. package/types/Overlay.d.ts +150 -0
  39. package/types/OverlayClasses.d.ts +29 -0
  40. package/types/Particles.d.ts +111 -0
  41. package/types/Plugin.d.ts +112 -0
  42. package/types/Product.d.ts +211 -0
  43. package/types/ProductSwitch.d.ts +14 -0
  44. package/types/Renderer.d.ts +69 -0
  45. package/types/SatelliteProduct.d.ts +19 -0
  46. package/types/Scrollable.d.ts +14 -0
  47. package/types/StaticProduct.d.ts +7 -0
  48. package/types/SveltePanePlugin.d.ts +18 -0
  49. package/types/SveltePlugin.d.ts +40 -0
  50. package/types/Swipe.d.ts +34 -0
  51. package/types/Switch.d.ts +24 -0
  52. package/types/TagPlugin.d.ts +6 -0
  53. package/types/TileLayer.d.ts +9 -0
  54. package/types/TileLayerCanvas.d.ts +2 -0
  55. package/types/TileLayerMultiPatch.d.ts +2 -0
  56. package/types/TimestampBar.d.ts +8 -0
  57. package/types/Webcams.d.ts +66 -0
  58. package/types/Window.d.ts +107 -0
  59. package/types/WindowPlugin.d.ts +171 -0
  60. package/types/baseMap.d.ts +10 -0
  61. package/types/broadcast.d.ts +14 -0
  62. package/types/cityLabels.d.ts +2 -0
  63. package/types/cloudSync.d.ts +12 -0
  64. package/types/colors.d.ts +4 -0
  65. package/types/connection.d.ts +4 -0
  66. package/types/css.d.ts +25 -0
  67. package/types/dataLoader.d.ts +26 -0
  68. package/types/dataSpecifications.d.ts +12 -0
  69. package/types/detectDevice.d.ts +6 -0
  70. package/types/device.d.ts +19 -0
  71. package/types/deviceLogging.d.ts +13 -0
  72. package/types/fetch.d.ts +88 -0
  73. package/types/format.d.ts +102 -0
  74. package/types/ga.d.ts +1 -0
  75. package/types/geolocation.d.ts +30 -0
  76. package/types/glTileRender.d.ts +178 -0
  77. package/types/glsl-modules.d.ts +26 -0
  78. package/types/hp.d.ts +15 -0
  79. package/types/http.d.ts +62 -0
  80. package/types/iconfont.d.ts +196 -0
  81. package/types/index.d.ts +1 -0
  82. package/types/interfaces.d.ts +1727 -0
  83. package/types/interpolator.d.ts +19 -0
  84. package/types/lang-files.d.ts +5116 -0
  85. package/types/latestBroadcasts.d.ts +14 -0
  86. package/types/layers.d.ts +78 -0
  87. package/types/leaflet.d.ts +1919 -0
  88. package/types/legends.d.ts +6 -0
  89. package/types/levelUtils.d.ts +2 -0
  90. package/types/libGuard.d.ts +1 -0
  91. package/types/location.d.ts +72 -0
  92. package/types/log.d.ts +2 -0
  93. package/types/lruCache.d.ts +69 -0
  94. package/types/map.d.ts +80 -0
  95. package/types/metrics.d.ts +3 -0
  96. package/types/mobileUtils.d.ts +7 -0
  97. package/types/models.d.ts +42 -0
  98. package/types/node-modules.d.ts +16 -0
  99. package/types/notifications.d.ts +66 -0
  100. package/types/offlineController.d.ts +20 -0
  101. package/types/overlays.d.ts +67 -0
  102. package/types/particleRenderers.d.ts +4 -0
  103. package/types/permanentPromos.d.ts +2 -0
  104. package/types/picker.d.ts +66 -0
  105. package/types/plugins.d.ts +3 -0
  106. package/types/pois.d.ts +16 -0
  107. package/types/products.d.ts +3 -0
  108. package/types/promo.d.ts +37 -0
  109. package/types/query.d.ts +19 -0
  110. package/types/queryString.d.ts +2 -0
  111. package/types/renderCtrl.d.ts +8 -0
  112. package/types/renderTile.d.ts +6 -0
  113. package/types/renderUtils.d.ts +107 -0
  114. package/types/renderers.d.ts +20 -0
  115. package/types/reverseName.d.ts +10 -0
  116. package/types/rhMessage.d.ts +3 -0
  117. package/types/rootScope.d.ts +152 -0
  118. package/types/router.d.ts +30 -0
  119. package/types/seoParser.d.ts +19 -0
  120. package/types/share.d.ts +1 -0
  121. package/types/showableErrorsService.d.ts +31 -0
  122. package/types/singleclick.d.ts +52 -0
  123. package/types/storage.d.ts +3 -0
  124. package/types/store.d.ts +148 -0
  125. package/types/subscription.d.ts +65 -0
  126. package/types/tileInterpolator.d.ts +27 -0
  127. package/types/tileLayerInstance.d.ts +2 -0
  128. package/types/timestampUtils.d.ts +5 -0
  129. package/types/trans.d.ts +68 -0
  130. package/types/ts-interfaces.d.ts +66 -0
  131. package/types/ts-types.d.ts +43 -0
  132. package/types/types.d.ts +308 -0
  133. package/types/user.d.ts +54 -0
  134. package/types/userFavs.d.ts +129 -0
  135. package/types/utils.d.ts +424 -0
  136. package/types/variables.d.ts +238 -0
  137. package/types/windy-modules.d.ts +7 -0
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Object containing timestamps and methods for given weather product
3
+ */
4
+ import type { CalendarDay, MinifestObject, Weekday } from '@windy/Calendar.d';
5
+ import type { TimeFormatFunction } from '@windy/format.d';
6
+ import type { Products } from '@windy/rootScope.d';
7
+ import type { ISODateString, Path, Timestamp } from '@windy/types.d';
8
+ export type CalendarInitParams = Pick<Calendar, 'numOfHours' | 'minifestFile'> & {
9
+ /**
10
+ * Ident of product that this calendar is for
11
+ */
12
+ product: Products;
13
+ /**
14
+ * Optional latest timestamp (for use for offline mode for example)
15
+ */
16
+ lastTimestamp?: Timestamp;
17
+ };
18
+ export declare class Calendar {
19
+ /**
20
+ * Time formatting function
21
+ */
22
+ static readonly localeHours: TimeFormatFunction;
23
+ static readonly weekdays: Weekday[];
24
+ /**
25
+ * Number of hours covered by this calendar
26
+ */
27
+ numOfHours: number;
28
+ /**
29
+ * Type of the calendare
30
+ */
31
+ type: 'historical' | 'mixed' | 'forecast';
32
+ calendarHours: number;
33
+ /**
34
+ * Today midnigh in LT of user's computer
35
+ */
36
+ midnight: Date;
37
+ /**
38
+ * This midnight of other defined start of timeline
39
+ */
40
+ startOfTimeline: Date;
41
+ /**
42
+ * startOfTimeline in the form of timestamp
43
+ */
44
+ start: Timestamp;
45
+ /**
46
+ * startOfPremiumTimeline in the form of timestamp; null if it is free in whole range
47
+ */
48
+ premiumStart: Timestamp | null;
49
+ /**
50
+ * End of calendar timeline
51
+ */
52
+ endOfcalendar: Date;
53
+ /**
54
+ * endOfcalendar as timestamp
55
+ */
56
+ endOfCal: Timestamp;
57
+ /**
58
+ * endOfCal or latest timestamp, whiever is smaller
59
+ */
60
+ end: Timestamp;
61
+ /**
62
+ * Max timestamp value, usually same as end (should be updated later on basis of minifest)
63
+ */
64
+ maxTimestamp: Timestamp;
65
+ /**
66
+ * Array of calendayr days to be used in UI
67
+ */
68
+ days: CalendarDay[];
69
+ /**
70
+ * Array of timestamps that contain valid forecast
71
+ */
72
+ timestamps: Timestamp[];
73
+ /**
74
+ * Array of URL paths that equal to timestamps in a form of "2021/05/27/19"
75
+ */
76
+ paths: string[];
77
+ /**
78
+ * Minifest that led to construction of this instance
79
+ */
80
+ minifestFile: MinifestObject;
81
+ /**
82
+ * Is the minifest valid or emergency, created out of the air?
83
+ */
84
+ minifestValid: boolean;
85
+ /**
86
+ * Minifests's reference time is some non stndard format
87
+ */
88
+ refTime: string;
89
+ /**
90
+ * Minifests's reference time
91
+ */
92
+ refTimeTs: Timestamp;
93
+ /**
94
+ * Minifests's reference time
95
+ */
96
+ refTimeTxt: ISODateString;
97
+ /**
98
+ * Forecast update time
99
+ */
100
+ updateTs: Timestamp;
101
+ /**
102
+ * Forecast update time
103
+ */
104
+ updateTxt: ISODateString;
105
+ constructor(params: CalendarInitParams);
106
+ initProperties(): void;
107
+ /**
108
+ * Bound ts to be be within limit of calendar
109
+ */
110
+ boundTs(ts: Timestamp): Timestamp;
111
+ /**
112
+ * Finds closes valid path on the basis of timestamp
113
+ */
114
+ ts2path(ts: Timestamp): Path;
115
+ /**
116
+ * Creates timestamps out of the air, with 3h interval (fixed)
117
+ */
118
+ createTimestamps(): void;
119
+ prepareTimesFromMinifest(minifest: MinifestObject): boolean;
120
+ /**
121
+ * Creates timestamps & paths arrays from minifest
122
+ */
123
+ createTimestampsFromMinifest(minifest: MinifestObject): boolean;
124
+ /**
125
+ * Return YYYY/MM/DD/HH or YYYYMMDDHH on a basis of provided date
126
+ * we do not CHECK existence of path in minifest
127
+ */
128
+ static date2path(date: Date): Path;
129
+ /**
130
+ * Returns JavaScript date object corresponding
131
+ * to provided path in a form YYYY/MM/DD/HH or YYYYMMDDHH
132
+ */
133
+ static path2date(path: string): Date;
134
+ /**
135
+ * Returns nice, human readable date string out of ts
136
+ */
137
+ static ts2string(ts: string | number): string;
138
+ /**
139
+ * Adds hours or days to date
140
+ *
141
+ * @example
142
+ * date = this.add( new Date(), 13, 'days' )
143
+ */
144
+ static add(date: Date, x: number, what?: 'days' | 'hours' | undefined): Date;
145
+ /**
146
+ * Return nearest midnight
147
+ */
148
+ static getMidnight(): Date;
149
+ }
@@ -0,0 +1,19 @@
1
+ export type ClickHandlerInitParams<T> = {
2
+ el: HTMLElement;
3
+ stopPropagation?: boolean;
4
+ click?(_command: string, _value?: T, _noEmit?: boolean): void;
5
+ };
6
+ export declare class ClickHandler<T> {
7
+ protected stopPropagation: boolean;
8
+ el: HTMLElement;
9
+ constructor(params: ClickHandlerInitParams<T>);
10
+ initProperties(): void;
11
+ /**
12
+ * Called after default handlers ale rulled out
13
+ */
14
+ protected click(_command: string, _value?: T, _noEmit?: boolean): void;
15
+ /**
16
+ * Initial click event
17
+ */
18
+ private onevent;
19
+ }
@@ -0,0 +1,175 @@
1
+ import type { ColorGradient, ColorIdent, PluginColorIdent, RGBA, RGBString } from '@windy/Color.d';
2
+ import type { StoreOptions } from '@windy/store.d';
3
+ import type { NumValue } from '@windy/types.d';
4
+ export type ColorInitParams = Pick<Color, 'ident'> & Partial<Pick<Color, 'qualitative' | 'save'>> & {
5
+ steps: number;
6
+ default?: ColorGradient | null;
7
+ opaque?: boolean;
8
+ defaultKey?: string;
9
+ sync?: boolean;
10
+ prepare?: boolean;
11
+ };
12
+ export declare class Color {
13
+ /**
14
+ * Should be color table prepared in advance without calling getColor()
15
+ * DO NOT MISUSE THIS PROPERTY. Use only for few colors that are used
16
+ * for initial rendering and overall app
17
+ */
18
+ private prepare?;
19
+ /**
20
+ * Sync color to the cloud. By default is set true
21
+ */
22
+ private sync?;
23
+ /**
24
+ * set all alpha values to 255. By default is set true
25
+ */
26
+ private opaque?;
27
+ private maxIndex;
28
+ private step;
29
+ /**
30
+ * Index of neutral gray color
31
+ */
32
+ private neutralGrayIndex;
33
+ /**
34
+ * Initial gradient
35
+ */
36
+ private default?;
37
+ /**
38
+ * Ident of color
39
+ */
40
+ ident: ColorIdent | PluginColorIdent | 'pressureIsolines' | 'temporary' | 'direction';
41
+ /**
42
+ * Store key
43
+ */
44
+ key: `color2_${string}`;
45
+ /**
46
+ * For color loaded from info,json
47
+ */
48
+ defaultKey?: string;
49
+ /**
50
+ * globe: use discrete palette (not blending between colors)
51
+ */
52
+ qualitative?: boolean;
53
+ /**
54
+ * Numebr of steps for colors table
55
+ */
56
+ steps: number;
57
+ /**
58
+ * Actually used gradient (can be sifferent than default)
59
+ */
60
+ gradient: ColorGradient;
61
+ /**
62
+ * Big interpolated RGBA Type array color table
63
+ * If defined mean someone already used the color
64
+ */
65
+ colors?: Uint8Array | null;
66
+ /**
67
+ * Save color to lcal storage. By default is set true
68
+ */
69
+ save?: boolean;
70
+ /**
71
+ * Min value
72
+ */
73
+ min: NumValue;
74
+ /**
75
+ * Max value
76
+ */
77
+ max: NumValue;
78
+ constructor(params: ColorInitParams);
79
+ /**
80
+ * Inserts the color to the store & prepares it
81
+ *
82
+ * @param defaultColors Default color
83
+ */
84
+ defineColor(defaultColors: ColorGradient): void;
85
+ /**
86
+ * Saves new color gradient to data store
87
+ */
88
+ changeColor(gradient: ColorGradient, storeOpts?: StoreOptions): void;
89
+ /**
90
+ * Back to default settings
91
+ */
92
+ toDefault(): void;
93
+ /**
94
+ * Same as getColor, but forces to generate new col tables
95
+ */
96
+ forceGetColor(): this;
97
+ /**
98
+ * Returns a color based 'rgb()' string on provided value
99
+ */
100
+ color(value: NumValue): RGBString;
101
+ /**
102
+ * Returns darkened or lightened cersion of original color. Uses the
103
+ * most primitive method of darkening/lightening by substracting or
104
+ * adding vale to RGB components
105
+ *
106
+ * @param value Original numerical value
107
+ * @param amount Amount of darkening or lightening in a range -255 to 255
108
+ */
109
+ colorDark(value: NumValue, amount: number): RGBString;
110
+ /**
111
+ * Returns RGB array based on value
112
+ */
113
+ RGBA(value: NumValue): RGBA;
114
+ /**
115
+ * create gradient array usable for both WebGL texture and getColor() function
116
+ * bOpaque .. set alpha to 255
117
+ * bPremultiply .. mul RGB by A
118
+ * valueScale .. optional scale used for WebGL texture data (coef 0.5 means half step - gradient size is doubled)
119
+ * return .. output Uint8Array with color data
120
+ */
121
+ createGradientArray(bOpaque?: boolean, bPremultiply?: boolean, valueScale?: number): Uint8Array;
122
+ createSteppedArray(sourceSmoothArray: Uint8Array, step: number, firstStep?: number): Uint8Array;
123
+ /**
124
+ * Returns color instance and creates color table (if not yet created)
125
+ */
126
+ getColor(): this;
127
+ /**
128
+ * Returns index to the color table based on value
129
+ */
130
+ value2index(value: NumValue): number;
131
+ getColorTable(): ColorGradient | null | undefined;
132
+ /**
133
+ * Checks validity of a gradient that it adheres to type ColorGradient
134
+ */
135
+ private checkValidity;
136
+ /**
137
+ * Forces to generate new color table
138
+ */
139
+ private colorChanged;
140
+ /**
141
+ * Sets max, min values
142
+ */
143
+ private setMinMax;
144
+ /**
145
+ * return array multiplied by mul coef
146
+ */
147
+ private getMulArray;
148
+ /**
149
+ * linear interpolation between array components, factor = <0.0,1.0>;
150
+ */
151
+ private lerpArray;
152
+ /**
153
+ * color = [ r01, g01, b01, ? ]; components in interval <0.0; 1.0>
154
+ */
155
+ private rgba2yuva;
156
+ /**
157
+ * color = [ y, u, v, ? ]; y = <0.0; 1.0>, u, v = <-0.5; 0.5>
158
+ */
159
+ private yuva2rgba;
160
+ /**
161
+ * preserveSaturation .. (maintain |UV| size)
162
+ */
163
+ private gradYuva;
164
+ private vec2size;
165
+ /**
166
+ * interpolation between 2 colors in selected space (type)
167
+ * type .. color space / interpolation type: 'RGB' - linear in RGB space (default)
168
+ * col1, col2 .. [r, g, b, a]; factor = <0.0,1.0>;
169
+ */
170
+ private getGradientColorYUVA;
171
+ /**
172
+ * rgbaArray .. [r, g, b, a]; componnents in interval <0;255>
173
+ */
174
+ private makePremultiplied;
175
+ }
@@ -0,0 +1,41 @@
1
+ import { dataLoader } from '@windy/dataLoader';
2
+ import type { FullRenderParameters } from '@windy/Layer.d';
3
+ import type { DataTile } from '@windy/dataLoader';
4
+ import type { ExtendedTileParams } from './DataTiler.d';
5
+ export interface TilePoint {
6
+ x: number;
7
+ y: number;
8
+ z: number;
9
+ }
10
+ export type DataTilerInitParams = Partial<Pick<DataTiler, 'loader'>>;
11
+ export declare class DataTiler {
12
+ /**
13
+ * Incrementing counter, that keeps getTiles and tilesReady in sync
14
+ */
15
+ protected syncCounter: number;
16
+ /**
17
+ * Major coeficients (defined after tilesReady)
18
+ */
19
+ protected trans: number;
20
+ protected shift: number;
21
+ protected lShift: number;
22
+ protected offsetX: number;
23
+ protected offsetY: number;
24
+ protected offset: number;
25
+ protected width: number;
26
+ protected height: number;
27
+ protected w: Uint16Array | null;
28
+ /**
29
+ * Just shortcut do datLoader
30
+ */
31
+ loader: typeof dataLoader;
32
+ constructor(params?: DataTilerInitParams);
33
+ /**
34
+ * This method will be called when tiles are loaded and ready to be processed
35
+ */
36
+ protected tilesReady(_dataTiles: DataTile[][], _mapParams: ExtendedTileParams, _params: FullRenderParameters): void;
37
+ protected getTiles(params: FullRenderParameters): void;
38
+ private processTile;
39
+ private postProcess;
40
+ private sortTiles;
41
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Drag: Basic draggable Class
3
+ *
4
+ * @module Drag
5
+ */
6
+ export type DragInitParams = Pick<Drag, 'el'> & {
7
+ supportTouch?: boolean;
8
+ preventDefault?: boolean;
9
+ passiveListener?: boolean;
10
+ ondrag?(x: number, y: number, e: MouseEvent | TouchEvent): void;
11
+ ondragstart?(startXY: [number, number]): void;
12
+ ondragend?(e: MouseEvent | TouchEvent): void;
13
+ bindedDrag?: (e: MouseEvent | TouchEvent) => void;
14
+ bindedEndDrag?: (ev: MouseEvent | TouchEvent) => void;
15
+ bindedStart?: (e: MouseEvent | TouchEvent) => void;
16
+ startDrag?(e: MouseEvent | TouchEvent): void;
17
+ endDrag?(ev: MouseEvent | TouchEvent): void;
18
+ };
19
+ export declare class Drag {
20
+ protected supportTouch: boolean;
21
+ protected preventDefault: boolean;
22
+ /**
23
+ * Use false to disable passive listener for 'touchmove'
24
+ */
25
+ protected passiveListener: boolean;
26
+ private startXY;
27
+ private bindedDrag;
28
+ private bindedEndDrag;
29
+ private bindedStart;
30
+ offsetX: number;
31
+ offsetY: number;
32
+ dragging: boolean;
33
+ el: HTMLElement;
34
+ constructor(params: DragInitParams);
35
+ ondragend?(e: MouseEvent | TouchEvent): void;
36
+ destroy(): void;
37
+ ondragstart?(startXY: [number, number]): void;
38
+ ondrag?(x: number, y: number, e: MouseEvent | TouchEvent): void;
39
+ startDrag(e: MouseEvent | TouchEvent): void;
40
+ protected endDrag(ev: MouseEvent | TouchEvent): void;
41
+ private getXY;
42
+ private _drag;
43
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Enables Scrollable DIV to be dragged left/right with mouse on non touch devices
3
+ */
4
+ export type DraggableDivInitParams = {
5
+ scrollEl: HTMLElement;
6
+ };
7
+ export declare class DraggableDiv {
8
+ /**
9
+ * Major element
10
+ */
11
+ private scrollEl;
12
+ private inertiaAnim;
13
+ constructor(params: DraggableDivInitParams);
14
+ private getX;
15
+ /**
16
+ * Scrolling the table on a basis of dragging with a mouse (non-touch devices)
17
+ * -- touch should be supported naturally by scrolling the DIV
18
+ * https://ariya.io/2013/11/javascript-kinetic-scrolling-part-2
19
+ */
20
+ private startDrag;
21
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @module DropDown
3
+ * @example
4
+ *
5
+ * ```
6
+ * <div ref="ddMenu" class="drop-down-menu noselect">
7
+ * <ul class="animation">
8
+ * <li data-do="set,one">First item</li>
9
+ * <li data-do="set,two">Second item</li>
10
+ * <li data-do="set,three">Third item</li>
11
+ * <li data-do="set,four">Fourht item</li>
12
+ * <li data-do="set,five">Last item</li>
13
+ * </ul>
14
+ * </div>
15
+ *
16
+ * new DropDown({
17
+ * el: refs.ddMenu,
18
+ * initValue: 'three'
19
+ * })
20
+ * ```
21
+ */
22
+ import { Switch } from '@windy/Switch';
23
+ import type { SwitchInitParams } from '@windy/Switch';
24
+ export type DropDownInitParams<T> = SwitchInitParams<T> & {
25
+ fill?(): void;
26
+ };
27
+ export declare class DropDown<T> extends Switch<T> {
28
+ private opened;
29
+ private switch;
30
+ protected bindedClose: () => void;
31
+ constructor(params: DropDownInitParams<T>);
32
+ set(value: T, noEmit?: boolean): void;
33
+ fill(): void;
34
+ protected toggle(): void;
35
+ protected open(): void;
36
+ protected close(): void;
37
+ }
@@ -0,0 +1,5 @@
1
+ import { Product } from './Product';
2
+ import type { ProductInitParams } from '@windy/Product';
3
+ export declare class EcmwfAnalysisProduct extends Product {
4
+ constructor(params: Partial<ProductInitParams>);
5
+ }
@@ -0,0 +1,29 @@
1
+ import { Calendar } from '@windy/Calendar';
2
+ import { Product } from '@windy/Product';
3
+ import type { ProductInitParams } from '@windy/Product';
4
+ /**
5
+ * Common product params for ECMWF products.
6
+ */
7
+ export declare const EcmwfProductParams: {
8
+ modelName: string;
9
+ modelResolution: number;
10
+ provider: string;
11
+ interval: number;
12
+ intervalPremium: number;
13
+ maxTileZoom: {
14
+ free: number;
15
+ premium: number;
16
+ };
17
+ dataQuality: "normal";
18
+ };
19
+ export declare class EcmwfProduct extends Product {
20
+ calendar: Calendar;
21
+ constructor(params: Partial<ProductInitParams>);
22
+ /**
23
+ * Create fake minifest file for ECMWF product to use it during rendering of
24
+ * UI before real minifest is loaded.
25
+ *
26
+ * DO NOT TRY TO USE THIS CALENDAR FOR FETCHING DATA FROM SERVER!!!!
27
+ */
28
+ static createVirtualCalendar(this: EcmwfProduct): Calendar;
29
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export type EventedInitParams = {
5
+ ident: string;
6
+ };
7
+ /**
8
+ * # @windy/Evented
9
+ *
10
+ * Major Windy.com even emitter class. Used in @windy/broadcast, @windy/store and other parts of Windy.com
11
+ * where publish / subscribe pattern is used.
12
+ *
13
+ * Enjoy, widely known methods like `on`, `off`, `once` and `emit`
14
+ * (if you are used to, you can also use `trigger` or `fire`).
15
+ */
16
+ export declare class Evented<T> {
17
+ /**
18
+ * Unique ID of each event subscription (incremental)
19
+ */
20
+ private latestId;
21
+ /**
22
+ * Store of all active subscriptions. It holds all needed data for trigger listeners for any event.
23
+ */
24
+ private _eventedCache;
25
+ /**
26
+ * For purpose of developer mode
27
+ */
28
+ private listenAllMethod?;
29
+ /**
30
+ * Only for DEBUG purposes. Color for console.log printing
31
+ */
32
+ private terminalColor?;
33
+ /**
34
+ * Identificator of event instance
35
+ */
36
+ private ident;
37
+ /**
38
+ * Same as `emit` method, just someone, who likes to use it.
39
+ */
40
+ trigger?: (typeof this)['emit'];
41
+ /**
42
+ * Same as `emit` method, just someone, who likes to use it.
43
+ */
44
+ fire?: (typeof this)['emit'];
45
+ constructor(params: EventedInitParams);
46
+ /**
47
+ * Emits a message accompanied from one to four arguments.
48
+ *
49
+ * @param topic Topic to emit
50
+ * @param data Optional data
51
+ */
52
+ emit<K extends keyof T, Q extends T[K]>(topic: keyof T, ...data: TrimUndefinedFromRight<Arrayify<Q>>): void;
53
+ /**
54
+ * Hooks a callback, that will be triggerd on specified message.
55
+ *
56
+ * @param topic Topic to subscribe
57
+ * @param callback Callback called when topic is emitted
58
+ * @param context Optional context to change this binding
59
+ * @param once Optional if callback should be fired only once or at every time
60
+ * @returns Unsubscribe id
61
+ */
62
+ on<K extends keyof T, Q extends T[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>, once?: boolean): number;
63
+ /**
64
+ * Hooks a callback, that will be triggerd just once on specified message.
65
+ *
66
+ * @param topic Topic to subscribe
67
+ * @param callback Callback called when topic is emitted
68
+ * @param context Optional context to change this binding
69
+ * @returns Unsubscribe id
70
+ */
71
+ once<K extends keyof T, Q extends T[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>): number;
72
+ off(id: number): void;
73
+ off<K extends keyof T, Q extends T[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>): void;
74
+ /**
75
+ * @ignore
76
+ */
77
+ listenAll(callback: (topic: keyof T, ...args: unknown[]) => void): void;
78
+ }
@@ -0,0 +1,29 @@
1
+ import { SveltePlugin, type ExternalSvelteApp } from '@windy/SveltePlugin';
2
+ import type { WindowPluginInitParams } from '@windy/WindowPlugin';
3
+ import type { SveltePanePlugins, SveltePlugins } from '@windy/plugins.d';
4
+ import type { CompiledExternalPluginConfig, ExternalPluginConfig, InstalledExternalPluginConfig } from '@windy/interfaces';
5
+ import type { PluginPane } from './Plugin';
6
+ /** Allowed params to SveltePlugin constructor (private and protected props are omitted by default) */
7
+ export type ExternalSveltePluginInitParams<P extends keyof SveltePlugins | keyof SveltePanePlugins> = Omit<WindowPluginInitParams<P>, 'ident'> & Pick<SveltePlugin<P>, 'ident'> & Partial<SveltePlugin<P>>;
8
+ export type LoadeExternalSveltePlugin = {
9
+ default: ExternalSvelteApp;
10
+ } & AdditionalSvelteAssets & {
11
+ __pluginConfig: CompiledExternalPluginConfig;
12
+ };
13
+ type Config2config = {
14
+ className: string;
15
+ attachPoint?: string;
16
+ pane?: PluginPane;
17
+ };
18
+ export declare class ExternalSveltePlugin extends SveltePlugin<'windy-external-plugin'> {
19
+ ident: 'windy-external-plugin';
20
+ plugin: WPluginModules[`@plugins/windy-external-plugin`] & AdditionalSvelteAssets;
21
+ mobileConfig: Record<InstalledExternalPluginConfig['mobileUI'], Config2config>;
22
+ desktopConfig: Record<InstalledExternalPluginConfig['desktopUI'], Config2config>;
23
+ widthOfRhPane: number;
24
+ listenToSingleclick: ExternalPluginConfig['listenToSingleclick'];
25
+ addToContextmenu: ExternalPluginConfig['addToContextmenu'];
26
+ constructor(params: WindowPluginInitParams<'windy-external-plugin'>, { desktopUI, title, mobileUI, desktopWidth, routerPath, listenToSingleclick, addToContextmenu, url, }: InstalledExternalPluginConfig);
27
+ getCss(): string;
28
+ }
29
+ export {};