@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,37 @@
1
+ import { Metric } from '@windy/Metric';
2
+ import type { MetricItem, MetricInitParams } from '@windy/Metric.d';
3
+ import type { NumValue } from '@windy/types.d';
4
+ export declare class NumberedMetric extends Metric<number> {
5
+ /**
6
+ * produces converted number value without label
7
+ */
8
+ convertNumber(value: NumValue, forcedPrecision?: number, metric?: MetricItem): number;
9
+ }
10
+ export declare class CapAlertMetric extends Metric<number> {
11
+ /**
12
+ * Can be called by accident by some part of code
13
+ */
14
+ convertNumber(_value: NumValue): number;
15
+ }
16
+ export declare class PtypeMetric extends Metric<string> {
17
+ convertNumber(i: number): string;
18
+ }
19
+ export declare class UVIndexMetric extends Metric<string> {
20
+ convertNumber(i: number): string;
21
+ convertValue(i: number): string;
22
+ }
23
+ export declare class FogMetric extends Metric<string> {
24
+ convertNumber(i: number): string;
25
+ convertValue(i: number): string;
26
+ }
27
+ export declare class SatelliteMetric extends NumberedMetric {
28
+ constructor(params: MetricInitParams);
29
+ /**
30
+ * Dynamic update from minifest/info.json
31
+ * @param pars various pars depending on concrete instance
32
+ */
33
+ updateLines(pars: [number, number]): void;
34
+ }
35
+ export declare class PrecipMetric extends NumberedMetric {
36
+ initProperties(): void;
37
+ }
@@ -0,0 +1,47 @@
1
+ import { Scrollable } from '@windy/Scrollable';
2
+ import type { Calendar } from '@windy/Calendar';
3
+ import type { ScrollableInitParams } from '@windy/Scrollable';
4
+ import type { TimeFormatFunction } from '@windy/format.d';
5
+ import type { Timestamp } from '@windy/types.d';
6
+ export type MobileCalendarInitParams = {
7
+ boxEl: HTMLDivElement;
8
+ wrapperEl: HTMLDivElement;
9
+ scrolling: boolean;
10
+ noAnimation: boolean;
11
+ tsPx: number;
12
+ calExpandedTimeout: ReturnType<typeof setTimeout> | null;
13
+ UIident: string;
14
+ bindedStore?: 'timestamp';
15
+ } & ScrollableInitParams;
16
+ export declare class MobileCalendar extends Scrollable {
17
+ private scrolling;
18
+ private noAnimation;
19
+ private wrapperEl;
20
+ /**
21
+ * timestamp per pixel ratio - must be in sync with CSS
22
+ * 3 hour = 20px
23
+ */
24
+ private tsPx;
25
+ /**
26
+ * Handle of a timeout that controls the `mobile-calendar-expanded` class
27
+ */
28
+ private calExpandedTimeout;
29
+ private bindedStore;
30
+ localeHours: TimeFormatFunction;
31
+ zuluMode: boolean;
32
+ boxEl: HTMLDivElement;
33
+ UIident: string;
34
+ timestamp: Timestamp;
35
+ calendar: Calendar | null;
36
+ constructor(params: MobileCalendarInitParams);
37
+ unmount(): void;
38
+ onscroll(ev: Event): void;
39
+ render(): void;
40
+ renderBox(): void;
41
+ /**
42
+ * Scrolls to selected ts
43
+ */
44
+ set(ts: Timestamp, UIident?: string): void;
45
+ protected onscrollend(): void;
46
+ private slideUp;
47
+ }
@@ -0,0 +1,5 @@
1
+ import { Product } from '@windy/Product';
2
+ import type { ProductInitParams } from '@windy/Product';
3
+ export declare class NamProducts extends Product {
4
+ constructor(params: Partial<ProductInitParams>);
5
+ }
@@ -0,0 +1,30 @@
1
+ import { Window } from '@windy/Window';
2
+ import type { DownloadProgress } from '@plugins/offline/offline.d';
3
+ import type { Timestamp } from '@windy/types';
4
+ export declare class OfflineModeTopMessage extends Window {
5
+ lastTimeDownloaded: Timestamp;
6
+ timer: ReturnType<typeof setInterval> | null;
7
+ constructor(lastTimeDownloaded: Timestamp);
8
+ onclose(): void;
9
+ onopen(): void;
10
+ }
11
+ export declare class DownloadingProgressTopMessage extends Window {
12
+ bindedOnProgress: ({ data }: {
13
+ data: DownloadProgress;
14
+ }) => void;
15
+ progressEl: HTMLDivElement;
16
+ progressBarEl: HTMLDivElement;
17
+ constructor();
18
+ onProgress({ data }: {
19
+ data: DownloadProgress;
20
+ }): void;
21
+ onclose(): void;
22
+ onopen(): void;
23
+ }
24
+ export declare class GoOfflineModeTopMessage extends Window {
25
+ expires: Timestamp;
26
+ timer: ReturnType<typeof setInterval> | null;
27
+ constructor(expires: Timestamp);
28
+ onclose(): void;
29
+ onopen(): void;
30
+ }
@@ -0,0 +1,150 @@
1
+ import type { Layer } from '@windy/Layer';
2
+ import type { LayerMetricType, Layers } from '@windy/Layer.d';
3
+ import type { Metric } from '@windy/Metric';
4
+ import type { DirectionFunction } from '@windy/format.d';
5
+ import type { Iconfont } from '@windy/iconfont.d';
6
+ import type { Overlays } from '@windy/rootScope.d';
7
+ import type { RGBNumValues } from '@windy/tileInterpolator.d';
8
+ import type { LoadedTranslations } from '@windy/trans.d';
9
+ import type { HTMLString } from '@windy/types';
10
+ export type UsedOverlays = Overlays | 'gh' | 'swell' | 'satelliteIRBT';
11
+ export type OverlayInitParams = Pick<Overlay, 'ident'> & Partial<Overlay>;
12
+ type LayerProperty<L extends Layer | undefined, P extends keyof Layer> = L extends Layer ? L[P] : undefined;
13
+ type MetricProperty<M extends Metric | undefined, P extends keyof Metric> = M extends Metric ? M[P] : undefined;
14
+ export declare class Overlay<I extends Overlays | 'gh' = Overlays | 'gh', M extends I extends Layers ? LayerMetricType[I] : undefined = I extends Layers ? LayerMetricType[I] : undefined, L extends Layer<M> | undefined = I extends Layers ? Layer<M> : undefined> {
15
+ /**
16
+ * Main ident
17
+ */
18
+ ident: I;
19
+ /**
20
+ * Translation string
21
+ */
22
+ trans: keyof LoadedTranslations;
23
+ /**
24
+ * Shortened version of translation string
25
+ *
26
+ * Used only on fav overlays in desktop. It is worth to
27
+ * fill only for overlays with long names, that are used
28
+ * as a default fav overlay in desktop.
29
+ */
30
+ transShort?: keyof LoadedTranslations;
31
+ /**
32
+ * Overlay has more levels
33
+ */
34
+ hasMoreLevels?: boolean;
35
+ /**
36
+ * Icon used in menus and such
37
+ */
38
+ icon: Iconfont;
39
+ /**
40
+ * Layers used
41
+ */
42
+ layers: I extends Layers ? [...Layers[], I] | [I, ...Layers[]] : undefined;
43
+ /**
44
+ * Is the overlay supported in globe mode. Default: false
45
+ */
46
+ globeNotSupported: boolean;
47
+ /**
48
+ * Show interpolated weather value over cities, when user switches to POI cities
49
+ * TODO: Unify property with hideWxLabels
50
+ */
51
+ poiInCities: boolean;
52
+ /**
53
+ * Hide interpolated weather value over cities, when user switches to POI cities
54
+ */
55
+ hideWxLabels?: boolean;
56
+ /**
57
+ * Eg. in day-switcher we need as short name as possible
58
+ */
59
+ shortname?: string;
60
+ /**
61
+ * Eg. in overlays gallery it is needed to have more specific name of the layer
62
+ */
63
+ fullname?: string;
64
+ /**
65
+ * When overlay represents group of other layers, this can be used to get the whole group menu icon independently from the layer
66
+ */
67
+ menuIcon?: Iconfont;
68
+ /**
69
+ * When overlay represents group of other layers, this can be used to name the whole group in menu independently from the layer
70
+ */
71
+ menuTrans?: keyof LoadedTranslations;
72
+ /**
73
+ * Hide overlay from listing in all the menus
74
+ */
75
+ partOf?: Overlays;
76
+ /**
77
+ * Applies class 'hide-particles' to the body
78
+ */
79
+ hideParticles?: boolean;
80
+ /**
81
+ * Given overlay display accumulation
82
+ */
83
+ isAccu?: boolean;
84
+ /**
85
+ * allwaysOn
86
+ */
87
+ allwaysOn?: boolean;
88
+ /**
89
+ * Programatically injected properties from particulat Metric instance
90
+ */
91
+ m: M;
92
+ convertValue: MetricProperty<M, 'convertValue'>;
93
+ convertNumber: MetricProperty<M, 'convertNumber'>;
94
+ setMetric: MetricProperty<M, 'setMetric'>;
95
+ cycleMetric: MetricProperty<M, 'cycleMetric'>;
96
+ listMetrics: MetricProperty<M, 'listMetrics'>;
97
+ /**
98
+ * Programatically injected properties from particulat Layer instance
99
+ */
100
+ c: LayerProperty<L, 'c'>;
101
+ l: LayerProperty<L, 'l'>;
102
+ cm: LayerProperty<L, 'cm'>;
103
+ constructor(params: OverlayInitParams);
104
+ /**
105
+ * Render's overlay's legend inside el
106
+ */
107
+ paintLegend(el: HTMLDivElement): void;
108
+ /**
109
+ * Return translated description of overlay
110
+ *
111
+ * @param short If true, return shortened version of description if avail
112
+ */
113
+ getName(short?: boolean): string;
114
+ /**
115
+ * Get menu title
116
+ *
117
+ * @param short If true, return shortened version of description if avail
118
+ */
119
+ getMenuName(short?: boolean): string;
120
+ /**
121
+ * Return ident of menu item (usualy `ident` but some inner overlays has `partOf` and are not directly in menu)
122
+ */
123
+ getMenuIdent(): Overlays;
124
+ /**
125
+ * Custom onopen methods, currently unused
126
+ */
127
+ onopen?(): void;
128
+ onclose?(): void;
129
+ /**
130
+ * Create part of inner text of picker
131
+ * @param values Interpolated values
132
+ */
133
+ createPickerHTML(values: RGBNumValues, _directionFormattingFunction: DirectionFunction): HTMLString;
134
+ /**
135
+ * In case of picker interpolator returns null value, this method is called
136
+ * (is consumed by PickerMobile only so far)
137
+ */
138
+ createPickerInvalidHTML(): HTMLString;
139
+ /**
140
+ * Create title for picker content
141
+ * @param alternativeContent Alternative text inside title
142
+ */
143
+ createPickerTitle(alternativeContent?: string): HTMLString;
144
+ /**
145
+ * Just proxy to the Metric's metric property
146
+ */
147
+ get metric(): "" | import("./Metric").MetricItem;
148
+ protected initProperties(): void;
149
+ }
150
+ export {};
@@ -0,0 +1,29 @@
1
+ import { Overlay } from '@windy/Overlay';
2
+ import type { DirectionFunction } from '@windy/format.d';
3
+ import type { Overlays } from '@windy/rootScope.d';
4
+ import type { RGBNumValues } from '@windy/tileInterpolator.d';
5
+ import type { LoadedTranslations } from '@windy/trans.d';
6
+ export declare class CurrentOverlay<I extends Overlays | 'gh' = Overlays | 'gh'> extends Overlay<I> {
7
+ createPickerHTML(values: RGBNumValues, formatDir: DirectionFunction): string;
8
+ }
9
+ export declare class WaveOverlay<I extends Overlays | 'gh' = Overlays | 'gh'> extends Overlay<I> {
10
+ createPickerHTML(values: RGBNumValues, formatDir: DirectionFunction): string;
11
+ }
12
+ export declare class AwpOverlay<I extends Overlays | 'gh' = Overlays | 'gh'> extends Overlay<I> {
13
+ labels: {
14
+ [value: number]: keyof LoadedTranslations;
15
+ };
16
+ createPickerHTML(values: RGBNumValues): string;
17
+ }
18
+ export declare class FwiOverlay<I extends Overlays | 'gh' = Overlays | 'gh'> extends Overlay<I> {
19
+ labels: {
20
+ [value: number]: keyof LoadedTranslations;
21
+ };
22
+ createPickerHTML(values: RGBNumValues): string;
23
+ }
24
+ export declare class RainPtypeOverlay<I extends Overlays | 'gh' = Overlays | 'gh'> extends Overlay<I> {
25
+ createPickerHTML(values: RGBNumValues): string;
26
+ }
27
+ export declare class CloudsOverlay<I extends Overlays | 'gh' = Overlays | 'gh'> extends Overlay<I> {
28
+ createPickerHTML(values: RGBNumValues): string;
29
+ }
@@ -0,0 +1,111 @@
1
+ import type { RGBAString, RGBA } from '@windy/Color.d';
2
+ import type { Levels } from '@windy/rootScope.d';
3
+ import type { ExtendedRenderParams } from '@windy/interfaces.d';
4
+ import type { CustomParticles } from '@windy/dataSpecifications.d';
5
+ export type ParticlesInitParams = Pick<Particles, 'multiplier' | 'velocity' | 'glMinSpeedParam' | 'glSpeedCurvePowParam' | 'glMaxSpeedParam' | 'glParticleWidth' | 'glParticleLengthEx' | 'glSpeedPx' | 'glCountMul'> & Partial<Pick<Particles, 'configurable' | 'glVelocity' | 'glOpacity' | 'glBlending' | 'getBlendingAlpha' | 'animation' | 'styles' | 'lineWidth' | 'getIntensityFun' | 'getStyles'>>;
6
+ export declare class Particles {
7
+ /**
8
+ * Parameters below are configurable via particlesConfig
9
+ */
10
+ configurable: boolean;
11
+ /**
12
+ * Custom user particles configuration
13
+ */
14
+ config: CustomParticles;
15
+ /**
16
+ * Type of animation
17
+ */
18
+ animation: 'dot' | 'wavecle';
19
+ /**
20
+ * Blue particles on detailed map
21
+ */
22
+ stylesBlue: RGBAString[];
23
+ /**
24
+ * Holder for alternative styles
25
+ */
26
+ styles?: RGBAString[];
27
+ /**
28
+ * width of particle based on zoom level
29
+ */
30
+ lineWidth: number[];
31
+ /**
32
+ * Speed reduction based on zoom level
33
+ */
34
+ zoom2speed: number[];
35
+ /**
36
+ * Reducing velocity of particles based on level (considering high winds up there)
37
+ */
38
+ level2reduce: Record<Levels, number>;
39
+ /**
40
+ * For particles.config.opacity values 0..1 we change only opacity
41
+ * For vlauer 1..2 we change also color
42
+ */
43
+ colors: RGBA[];
44
+ /**
45
+ * amount and speedof patricles on screen as a function of zoom
46
+ * value = 1 / ( constant * Math.pow(pow, (mapZoom - zoom)))
47
+ */
48
+ multiplier: {
49
+ constant: number;
50
+ pow: number;
51
+ zoom: number;
52
+ };
53
+ velocity: {
54
+ max: number;
55
+ damper: number;
56
+ };
57
+ /**
58
+ * webGL config
59
+ */
60
+ glSpeedCurvePowParam: number;
61
+ glMinSpeedParam: number;
62
+ glMaxSpeedParam: number;
63
+ glParticleWidth: number;
64
+ glParticleLengthEx: number;
65
+ glSpeedPx: number;
66
+ glVelocity: number;
67
+ glOpacity: number;
68
+ glBlending: number;
69
+ glCountMul: number;
70
+ constructor(params: ParticlesInitParams);
71
+ /**
72
+ * Return function that, will create intensity number
73
+ * based on particle force and location
74
+ */
75
+ getIntensityFun(): (force: number) => number;
76
+ /**
77
+ * Returns magnitude 2 screen velocity fun
78
+ *
79
+ * screenSpeed = c * ( 1 - 1 / ( a * c * magnitude - 1) )
80
+ *
81
+ * c = velocity.max * userConfig * level2reduce
82
+ * a = velocity.damper
83
+ *
84
+ * `a`, `c` jsou koeficienty. Pricemz `c` je max. obrazovkova
85
+ * rychlost a tim `a` si doladis prubeh te funkce. Cim vyssi bude `a`,
86
+ * tim rychleji to poroste k tomu `c` a naopak cim bude `a` blize k nule,
87
+ * tim pomaleji to poroste.
88
+ *
89
+ * Both a,c coefs are multiplied by user (0.5 - 1.5) and zoom level (0.6 - 1)
90
+ */
91
+ getVelocityFun(params: ExtendedRenderParams): (mag: number) => number;
92
+ getAmountMultiplier(): number;
93
+ /**
94
+ * Returns amount of particles for given wscreen size, based on zoom
95
+ * and speed2pixel ratio. If speed2pixel is lower than 1, we multiply amount by
96
+ * 1 + 1.5 * ( 1 - speed2pixel )
97
+ */
98
+ getAmount(params: ExtendedRenderParams): number;
99
+ getLineWidth(params: ExtendedRenderParams): number;
100
+ /**
101
+ * resulting table looks like this for opacity 1
102
+ * ['rgba(200,200,200,1)','rgba(215,215,215,1)','rgba(235,235,235,
103
+ */
104
+ getStyles(params?: ExtendedRenderParams): RGBAString[] | undefined;
105
+ getMaxAge(): number;
106
+ /**
107
+ * Blending opacity, for 'repainting' new canvas and letting particles to
108
+ * fade. If speed2pixel ratio is low we increase lengt of particles
109
+ */
110
+ getBlendingAlpha(params?: ExtendedRenderParams): string | number;
111
+ }
@@ -0,0 +1,112 @@
1
+ import type { WindowClosingOptions } from '@windy/interfaces.d';
2
+ import type { SupportedLangFiles } from '@windy/lang-files.d';
3
+ import type { Plugins } from '@windy/plugins.d';
4
+ type LangFileKey = keyof SupportedLangFiles;
5
+ export type PluginIdent = keyof Plugins;
6
+ export type PluginPane =
7
+ /** Right Hand pane */
8
+ 'rhpane'
9
+ /** Small bottom location (like radar control) that can adjust its size and coexist with LH,RHpane */
10
+ | 'small-bottom'
11
+ /** Big bottom location, that cant coexist with LH, RH panes like detail/station/rplanner */
12
+ | 'bottom'
13
+ /** Pop up window in the middle of the page like subscription */
14
+ | 'center'
15
+ /** Top location on mobile devices like picker-mobile, distance etc */
16
+ | 'top'
17
+ /** Plugin is embedded into detail as nearest webcam/station/airq */
18
+ | 'nearest'
19
+ /** Bottom plugin that ducks under mobile time controls (use only in exception) */
20
+ | 'small-bottom-bottom'
21
+ /** External plugin embedded to HP */
22
+ | 'embedded';
23
+ /** Allowed params to Plugin constructor (private and protected props are omited by default) */
24
+ export type PluginInitParams<P extends PluginIdent> = Pick<Plugin<P>, 'ident'> & Partial<Omit<Plugin<P>, 'isLoaded' | 'isOpen' | 'load' | 'open'>>;
25
+ export declare class Plugin<P extends PluginIdent> {
26
+ protected static iAm: "plugin";
27
+ /**
28
+ * Status of the plugin (is being loaded right now)
29
+ */
30
+ protected loading: boolean;
31
+ /**
32
+ * Main promise of plugin being loaded
33
+ */
34
+ protected promise?: Promise<void | boolean>;
35
+ /**
36
+ * Plugin ident, witohout any prefix, just id
37
+ */
38
+ ident: P;
39
+ /**
40
+ * FQDN URL of plugin .js file
41
+ */
42
+ location: string;
43
+ /**
44
+ * Required language files
45
+ */
46
+ langFiles?: LangFileKey[];
47
+ /**
48
+ * Status of the plugin (is loaded or not)
49
+ */
50
+ isLoaded: boolean;
51
+ /**
52
+ * Into which pane is plugin opened. This property is used by pluginCtrl only
53
+ * and should prevent opening several overlapping plugins at the same location
54
+ * especially on desktop or tablet devices.
55
+ *
56
+ * On mobile phones, most of the plugins (expecially LH, RH pane) become
57
+ * fullsctreen plugins.
58
+ */
59
+ pane?: PluginPane;
60
+ /**
61
+ * Is the tag currentlly open?
62
+ */
63
+ isOpen?: boolean;
64
+ /**
65
+ * After opening, plugin is not closed automatically by pluginCtrl
66
+ *
67
+ * Other methods of closing are possible
68
+ */
69
+ neverClose?: boolean;
70
+ /**
71
+ * After loading, plugin is automatically resolved with require
72
+ * should replace previous AutoOpenPlugin class.
73
+ *
74
+ * NOTE: autoPen plugins do not use parametr passe to open method
75
+ * Is the plugin resolved by require?
76
+ */
77
+ isResolved?: boolean;
78
+ /**
79
+ * Resolved plugin after calling require
80
+ */
81
+ plugin?: WPluginModules[`@plugins/${P}`] & AdditionalPluginAssets;
82
+ /**
83
+ * Whenever set, this plugin (when opened) disables opening
84
+ * of mobile picker on map interaction. Shoul be used with
85
+ * bottm, top pane plugins and plugins, that can be opened
86
+ * in half
87
+ */
88
+ disableMobilePicker?: boolean;
89
+ constructor(params: PluginInitParams<P>);
90
+ /**
91
+ * Loads the plugin
92
+ */
93
+ load(): Promise<void | boolean>;
94
+ /**
95
+ * Opens the plugin (note, that opening args are ignored)
96
+ */
97
+ open(..._args: unknown[]): Promise<void | boolean>;
98
+ /**
99
+ * Ready to be overloaded
100
+ */
101
+ close(_opts?: WindowClosingOptions): void;
102
+ /**
103
+ * Ready to be overloaded
104
+ */
105
+ redraw(..._args: unknown[]): void;
106
+ /**
107
+ * Ready to be overloaded
108
+ */
109
+ paramsChanged(..._args: unknown[]): void;
110
+ protected initProperties(): void;
111
+ }
112
+ export {};