@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.
- package/README.md +3 -0
- package/index.mjs +298 -0
- package/package.json +9 -0
- package/publishExamples.sh +19 -0
- package/types/AromeProduct.d.ts +5 -0
- package/types/Bar.d.ts +114 -0
- package/types/BindedBar.d.ts +51 -0
- package/types/BindedCheckbox.d.ts +30 -0
- package/types/BindedSwitch.d.ts +35 -0
- package/types/BottomSlide.d.ts +53 -0
- package/types/BottomTagPlugin.d.ts +8 -0
- package/types/Calendar.d.ts +149 -0
- package/types/ClickHandler.d.ts +19 -0
- package/types/Color.d.ts +175 -0
- package/types/DataTiler.d.ts +41 -0
- package/types/Drag.d.ts +43 -0
- package/types/DraggableDiv.d.ts +21 -0
- package/types/DropDown.d.ts +37 -0
- package/types/EcmwfAnalysisProduct.d.ts +5 -0
- package/types/EcmwfProduct.d.ts +29 -0
- package/types/Evented.d.ts +78 -0
- package/types/ExternalSveltePlugin.d.ts +29 -0
- package/types/Favs.d.ts +83 -0
- package/types/GhostBox.d.ts +17 -0
- package/types/GlObj.d.ts +252 -0
- package/types/HrrrProducts.d.ts +5 -0
- package/types/IconProducts.d.ts +5 -0
- package/types/LabelsLayer.d.ts +2 -0
- package/types/LandMask.d.ts +2 -0
- package/types/Layer.d.ts +137 -0
- package/types/Legend.d.ts +6 -0
- package/types/LongTap.d.ts +21 -0
- package/types/Metric.d.ts +132 -0
- package/types/MetricClasses.d.ts +37 -0
- package/types/MobileCalendar.d.ts +47 -0
- package/types/NamProducts.d.ts +5 -0
- package/types/OfflineMessagesClasses.d.ts +30 -0
- package/types/Overlay.d.ts +150 -0
- package/types/OverlayClasses.d.ts +29 -0
- package/types/Particles.d.ts +111 -0
- package/types/Plugin.d.ts +112 -0
- package/types/Product.d.ts +211 -0
- package/types/ProductSwitch.d.ts +14 -0
- package/types/Renderer.d.ts +69 -0
- package/types/SatelliteProduct.d.ts +19 -0
- package/types/Scrollable.d.ts +14 -0
- package/types/StaticProduct.d.ts +7 -0
- package/types/SveltePanePlugin.d.ts +18 -0
- package/types/SveltePlugin.d.ts +40 -0
- package/types/Swipe.d.ts +34 -0
- package/types/Switch.d.ts +24 -0
- package/types/TagPlugin.d.ts +6 -0
- package/types/TileLayer.d.ts +9 -0
- package/types/TileLayerCanvas.d.ts +2 -0
- package/types/TileLayerMultiPatch.d.ts +2 -0
- package/types/TimestampBar.d.ts +8 -0
- package/types/Webcams.d.ts +66 -0
- package/types/Window.d.ts +107 -0
- package/types/WindowPlugin.d.ts +171 -0
- package/types/baseMap.d.ts +10 -0
- package/types/broadcast.d.ts +14 -0
- package/types/cityLabels.d.ts +2 -0
- package/types/cloudSync.d.ts +12 -0
- package/types/colors.d.ts +4 -0
- package/types/connection.d.ts +4 -0
- package/types/css.d.ts +25 -0
- package/types/dataLoader.d.ts +26 -0
- package/types/dataSpecifications.d.ts +12 -0
- package/types/detectDevice.d.ts +6 -0
- package/types/device.d.ts +19 -0
- package/types/deviceLogging.d.ts +13 -0
- package/types/fetch.d.ts +88 -0
- package/types/format.d.ts +102 -0
- package/types/ga.d.ts +1 -0
- package/types/geolocation.d.ts +30 -0
- package/types/glTileRender.d.ts +178 -0
- package/types/glsl-modules.d.ts +26 -0
- package/types/hp.d.ts +15 -0
- package/types/http.d.ts +62 -0
- package/types/iconfont.d.ts +196 -0
- package/types/index.d.ts +1 -0
- package/types/interfaces.d.ts +1727 -0
- package/types/interpolator.d.ts +19 -0
- package/types/lang-files.d.ts +5116 -0
- package/types/latestBroadcasts.d.ts +14 -0
- package/types/layers.d.ts +78 -0
- package/types/leaflet.d.ts +1919 -0
- package/types/legends.d.ts +6 -0
- package/types/levelUtils.d.ts +2 -0
- package/types/libGuard.d.ts +1 -0
- package/types/location.d.ts +72 -0
- package/types/log.d.ts +2 -0
- package/types/lruCache.d.ts +69 -0
- package/types/map.d.ts +80 -0
- package/types/metrics.d.ts +3 -0
- package/types/mobileUtils.d.ts +7 -0
- package/types/models.d.ts +42 -0
- package/types/node-modules.d.ts +16 -0
- package/types/notifications.d.ts +66 -0
- package/types/offlineController.d.ts +20 -0
- package/types/overlays.d.ts +67 -0
- package/types/particleRenderers.d.ts +4 -0
- package/types/permanentPromos.d.ts +2 -0
- package/types/picker.d.ts +66 -0
- package/types/plugins.d.ts +3 -0
- package/types/pois.d.ts +16 -0
- package/types/products.d.ts +3 -0
- package/types/promo.d.ts +37 -0
- package/types/query.d.ts +19 -0
- package/types/queryString.d.ts +2 -0
- package/types/renderCtrl.d.ts +8 -0
- package/types/renderTile.d.ts +6 -0
- package/types/renderUtils.d.ts +107 -0
- package/types/renderers.d.ts +20 -0
- package/types/reverseName.d.ts +10 -0
- package/types/rhMessage.d.ts +3 -0
- package/types/rootScope.d.ts +152 -0
- package/types/router.d.ts +30 -0
- package/types/seoParser.d.ts +19 -0
- package/types/share.d.ts +1 -0
- package/types/showableErrorsService.d.ts +31 -0
- package/types/singleclick.d.ts +52 -0
- package/types/storage.d.ts +3 -0
- package/types/store.d.ts +148 -0
- package/types/subscription.d.ts +65 -0
- package/types/tileInterpolator.d.ts +27 -0
- package/types/tileLayerInstance.d.ts +2 -0
- package/types/timestampUtils.d.ts +5 -0
- package/types/trans.d.ts +68 -0
- package/types/ts-interfaces.d.ts +66 -0
- package/types/ts-types.d.ts +43 -0
- package/types/types.d.ts +308 -0
- package/types/user.d.ts +54 -0
- package/types/userFavs.d.ts +129 -0
- package/types/utils.d.ts +424 -0
- package/types/variables.d.ts +238 -0
- package/types/windy-modules.d.ts +7 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { Calendar } from '@windy/Calendar';
|
|
2
|
+
import type { MinifestObject } from '@windy/Calendar.d';
|
|
3
|
+
import type { Layers } from '@windy/Layer.d';
|
|
4
|
+
import type { DataQuality, FileSuffix } from '@windy/Product.d';
|
|
5
|
+
import type { HttpPayload } from '@windy/http.d';
|
|
6
|
+
import type { LatLon } from '@windy/interfaces';
|
|
7
|
+
import type { AcTimes, Isolines, Levels, Overlays, Products } from '@windy/rootScope.d';
|
|
8
|
+
import type { ProductCategory, ProductIdent } from '@windy/types';
|
|
9
|
+
export type ProductInitParams = Pick<Product, 'modelName' | 'provider' | 'interval'> & Partial<Pick<Product, 'provider' | 'ident' | 'maxTileZoom' | 'animationSpeed' | 'animationSpeed1h' | 'fileSuffix' | 'fileSuffixFallback' | 'JPGtransparency' | 'PNGtransparency' | 'dataQuality' | 'betterDataQuality' | 'animation' | 'labelsTemp' | 'overlays' | 'prefferedProduct' | 'pathGenerator' | 'isolines' | 'directory' | 'category' | 'modelIdent' | 'intervalPremium' | 'server' | 'modelResolution' | 'levels' | 'logo' | 'acTimes'>> & {
|
|
10
|
+
requiresInfoJson?: boolean;
|
|
11
|
+
forecastSize?: number;
|
|
12
|
+
bounds?: [number, number][][];
|
|
13
|
+
};
|
|
14
|
+
export declare class Product {
|
|
15
|
+
/**
|
|
16
|
+
* Minifest loading promise
|
|
17
|
+
*/
|
|
18
|
+
protected loadingPromise?: null | Promise<Calendar | undefined | void>;
|
|
19
|
+
/**
|
|
20
|
+
* Version of minifest used
|
|
21
|
+
*/
|
|
22
|
+
protected infoVersion?: string;
|
|
23
|
+
/**
|
|
24
|
+
* minifest loading timer
|
|
25
|
+
*/
|
|
26
|
+
private refreshInterval?;
|
|
27
|
+
/**
|
|
28
|
+
* Timestamp of last minifest check
|
|
29
|
+
*/
|
|
30
|
+
private minifestTimestamp;
|
|
31
|
+
/**
|
|
32
|
+
* Boundaries of the product in a format [[north, west], [north, east], [south, east], [south, west]] or any more accurate polygon
|
|
33
|
+
*/
|
|
34
|
+
private bounds?;
|
|
35
|
+
/**
|
|
36
|
+
* Has binded listeners
|
|
37
|
+
*/
|
|
38
|
+
private hasListeners;
|
|
39
|
+
private bindedCheckNewMinifest;
|
|
40
|
+
/**
|
|
41
|
+
* When the product will expire (in ms)
|
|
42
|
+
*/
|
|
43
|
+
private productExpires;
|
|
44
|
+
/**
|
|
45
|
+
* Unefective, but simple refTime solutions for data that are updated once a day
|
|
46
|
+
*/
|
|
47
|
+
protected dailyCache?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Must contain ident of self
|
|
50
|
+
*/
|
|
51
|
+
ident: Products;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum data tile resolution
|
|
54
|
+
*/
|
|
55
|
+
maxTileZoom?: {
|
|
56
|
+
free: number;
|
|
57
|
+
premium: number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Speed of animation in timestamp seconds per normal second
|
|
61
|
+
*
|
|
62
|
+
* for example 3600 = 1h per 1 second
|
|
63
|
+
*/
|
|
64
|
+
animationSpeed: number;
|
|
65
|
+
animationSpeed1h: number;
|
|
66
|
+
/**
|
|
67
|
+
* Default fileSuffix. Can be overwriten by overlay
|
|
68
|
+
*/
|
|
69
|
+
fileSuffix: FileSuffix;
|
|
70
|
+
/**
|
|
71
|
+
* Backup fileSuffix if fileSuffix not supported (used if webp not supported)
|
|
72
|
+
*/
|
|
73
|
+
fileSuffixFallback?: FileSuffix;
|
|
74
|
+
/**
|
|
75
|
+
* Overlay uses transparency defined in B channel in JPG
|
|
76
|
+
*/
|
|
77
|
+
JPGtransparency: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Overlay uses transparency defined in A channel in PNG
|
|
80
|
+
*/
|
|
81
|
+
PNGtransparency: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Quality of downloaded data for this
|
|
84
|
+
* product. Can be overwritten by overlay
|
|
85
|
+
*/
|
|
86
|
+
dataQuality: DataQuality;
|
|
87
|
+
/**
|
|
88
|
+
* Array of layers, where data quaility is one step
|
|
89
|
+
* better than 'dataQuality'. For instance ['rain','clouds']
|
|
90
|
+
*/
|
|
91
|
+
betterDataQuality: Layers[];
|
|
92
|
+
/**
|
|
93
|
+
* Play/pause animation of this products is possible
|
|
94
|
+
*/
|
|
95
|
+
animation: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Calendar used for this product
|
|
98
|
+
* (created during initialization)
|
|
99
|
+
*/
|
|
100
|
+
calendar?: Calendar;
|
|
101
|
+
/**
|
|
102
|
+
* Description of product for purpose of UI
|
|
103
|
+
*/
|
|
104
|
+
modelName: string;
|
|
105
|
+
modelResolution?: number;
|
|
106
|
+
provider?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Update interval (in minutes)
|
|
109
|
+
*/
|
|
110
|
+
interval: number;
|
|
111
|
+
intervalPremium?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Usual length of forecast in hours (used upon creation of backup minifest)
|
|
114
|
+
*/
|
|
115
|
+
forecastSize: number;
|
|
116
|
+
/** Directory (path in URL) on image server, if not provided, `category/modelIdent` is used */
|
|
117
|
+
directory: string;
|
|
118
|
+
/**
|
|
119
|
+
* Category of the model
|
|
120
|
+
*/
|
|
121
|
+
category?: ProductCategory;
|
|
122
|
+
/**
|
|
123
|
+
* Server side model ident, used by DS and other BE services
|
|
124
|
+
* This should replace `ident` at some point, becasue `ident` is used only on client and BE needs to convert it to `modelIdent`
|
|
125
|
+
*/
|
|
126
|
+
modelIdent?: ProductIdent;
|
|
127
|
+
/**
|
|
128
|
+
* Model can be used for temeperature in labels
|
|
129
|
+
*/
|
|
130
|
+
labelsTemp: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Logo of provider in rh-bottom
|
|
133
|
+
*/
|
|
134
|
+
logo?: string;
|
|
135
|
+
/**
|
|
136
|
+
* List of avail overlays
|
|
137
|
+
*/
|
|
138
|
+
overlays: Overlays[];
|
|
139
|
+
/**
|
|
140
|
+
* List of avail levels
|
|
141
|
+
*/
|
|
142
|
+
levels?: Levels[];
|
|
143
|
+
/**
|
|
144
|
+
* List of avail isolines
|
|
145
|
+
*/
|
|
146
|
+
isolines: Isolines[];
|
|
147
|
+
requiresInfoJson: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* If we drag out of bounds, which product we should use (must be global air product)
|
|
150
|
+
*/
|
|
151
|
+
prefferedProduct: 'ecmwf' | 'gfs' | 'icon' | 'iconEu';
|
|
152
|
+
/**
|
|
153
|
+
* Holder of the latest minifest
|
|
154
|
+
*/
|
|
155
|
+
minifest?: MinifestObject | null;
|
|
156
|
+
/**
|
|
157
|
+
* How the data image path should be constructed
|
|
158
|
+
*/
|
|
159
|
+
pathGenerator: string;
|
|
160
|
+
/**
|
|
161
|
+
* List of available accumulationTime
|
|
162
|
+
*/
|
|
163
|
+
acTimes?: AcTimes[];
|
|
164
|
+
/**
|
|
165
|
+
* Alternative server, where the data are loaded from
|
|
166
|
+
*/
|
|
167
|
+
server?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Some product (f.ex. StaticProduct) doesn't have meaningful
|
|
170
|
+
* information about the model and time of the next update.
|
|
171
|
+
* Set this to false to hide the info where not relevant (f.ex. Info plugin)
|
|
172
|
+
*/
|
|
173
|
+
hasRefTime: boolean;
|
|
174
|
+
constructor(params: ProductInitParams);
|
|
175
|
+
refTime(): string;
|
|
176
|
+
getUpdateTimes(): {
|
|
177
|
+
refTime: string;
|
|
178
|
+
minUpdate: number;
|
|
179
|
+
} | {
|
|
180
|
+
refTime?: undefined;
|
|
181
|
+
minUpdate?: undefined;
|
|
182
|
+
};
|
|
183
|
+
moveTs(moveRight: boolean, isAccu?: boolean): boolean | void;
|
|
184
|
+
getMinifestUrl(): string;
|
|
185
|
+
loadMinifest(): Promise<HttpPayload<MinifestObject>>;
|
|
186
|
+
open(): Promise<void | Calendar>;
|
|
187
|
+
close(): void;
|
|
188
|
+
/**
|
|
189
|
+
* Checks if lat,lon is within bounds
|
|
190
|
+
*/
|
|
191
|
+
pointIsInBounds<T extends LatLon>(this: this, paramsMap: T): boolean;
|
|
192
|
+
printLogo(): void;
|
|
193
|
+
getInfoFileUrl(): string;
|
|
194
|
+
getCalendar(): Promise<Calendar>;
|
|
195
|
+
protected expire(): void;
|
|
196
|
+
protected getStoreKey(): `lastMinifest/${string}`;
|
|
197
|
+
protected setMinifest(minifest: MinifestObject): void;
|
|
198
|
+
protected setExpireTime(): void;
|
|
199
|
+
/**
|
|
200
|
+
* Major reason for this error is user's bad connection, which is handled
|
|
201
|
+
* by standard no connetion red message
|
|
202
|
+
*
|
|
203
|
+
* We delay 0.3 sec to test properlly connection
|
|
204
|
+
*/
|
|
205
|
+
protected showErrorMessage(err: string): void;
|
|
206
|
+
protected loadAndProcessMinifest(forced?: boolean): Promise<void>;
|
|
207
|
+
protected loadAndProcessInfo(): Promise<void>;
|
|
208
|
+
private loadInfo;
|
|
209
|
+
private checkNewMinifest;
|
|
210
|
+
private removeLogo;
|
|
211
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BindedSwitch } from '@windy/BindedSwitch';
|
|
2
|
+
import type { BindedSwitchInitParams } from '@windy/BindedSwitch';
|
|
3
|
+
export type ProductSwitchInitParams = {
|
|
4
|
+
showResolution?: boolean;
|
|
5
|
+
} & Omit<BindedSwitchInitParams<'product'>, 'bindStore'>;
|
|
6
|
+
export declare class ProductSwitch extends BindedSwitch<'product'> {
|
|
7
|
+
showResolution: boolean;
|
|
8
|
+
constructor(params: ProductSwitchInitParams);
|
|
9
|
+
printHTML(prods?: ("radar" | "satellite" | "capAlerts" | "cams" | "icon" | "drought" | "gfs" | "ecmwf" | "ecmwfAnalysis" | "ecmwfWaves" | "gfsWaves" | "iconWaves" | "efi" | "cmems" | "fireDanger" | "activeFires" | "nems" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeReunion" | "camsEu" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "ukv" | "mblue")[]): void;
|
|
10
|
+
/**
|
|
11
|
+
* The menu is already in a DOM since we do not modify products so often
|
|
12
|
+
*/
|
|
13
|
+
protected redraw(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { FullRenderParameters } from '@windy/Layer.d';
|
|
2
|
+
import type { Renderers } from '@windy/Renderer.d';
|
|
3
|
+
import type { InterpolatorFactory } from '@windy/interpolator';
|
|
4
|
+
import type { BottomTagPlugins, Plugins } from '@windy/plugins.d';
|
|
5
|
+
type AllowedRenderPlugins = Pick<Plugins, 'radar' | 'satellite' | 'cap-alerts' | 'isolines' | 'gl-particles' | 'particles'>;
|
|
6
|
+
export interface RendererInitParams {
|
|
7
|
+
ident: Renderers;
|
|
8
|
+
dependency?: keyof AllowedRenderPlugins;
|
|
9
|
+
userControl?: keyof BottomTagPlugins;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renderer class act as a proxy between renderController and code, which is responsible to
|
|
13
|
+
* render particullar layer.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Renderer<K extends keyof AllowedRenderPlugins | undefined = undefined, P extends K extends keyof AllowedRenderPlugins ? WPluginModules[`@plugins/${K}`] : undefined = K extends keyof AllowedRenderPlugins ? WPluginModules[`@plugins/${K}`] : undefined> {
|
|
16
|
+
isOpen: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Ident of renderer. Not used in runtime, but essential for debugging.
|
|
19
|
+
* Do not remove
|
|
20
|
+
*/
|
|
21
|
+
ident: Renderers;
|
|
22
|
+
/**
|
|
23
|
+
* Dependency plugin that wil be loaded before renderer is launched
|
|
24
|
+
*
|
|
25
|
+
* Dependency plugin can optinally export these methods:
|
|
26
|
+
*
|
|
27
|
+
* - onRenderStart
|
|
28
|
+
* - onRenderEnd
|
|
29
|
+
* - paramsChanged
|
|
30
|
+
* - redraw
|
|
31
|
+
* - interpolator
|
|
32
|
+
*/
|
|
33
|
+
dependency?: K;
|
|
34
|
+
/**
|
|
35
|
+
* Loaded version of plugin dependency
|
|
36
|
+
*/
|
|
37
|
+
loadedDependency?: P;
|
|
38
|
+
/**
|
|
39
|
+
* ID of plugin, that serve as user control, which can be attached to DOM
|
|
40
|
+
* usually to #plugin-bottom div.
|
|
41
|
+
*
|
|
42
|
+
* Contrary to dependencies, userControl is loaded after dependencies, thus NOT
|
|
43
|
+
* delaying launch of whole layer.
|
|
44
|
+
*
|
|
45
|
+
* Any single plugin can serve both as renderer and userControl.
|
|
46
|
+
*
|
|
47
|
+
* In this case, make sure, that plugin, that serves as userControl
|
|
48
|
+
* is duplicated as dependency.
|
|
49
|
+
*
|
|
50
|
+
* userControl opening and closing is handles by rndrCtrl
|
|
51
|
+
*/
|
|
52
|
+
userControl?: keyof BottomTagPlugins;
|
|
53
|
+
/**
|
|
54
|
+
* Picker ingerpolation factory
|
|
55
|
+
*/
|
|
56
|
+
interpolator?: InterpolatorFactory;
|
|
57
|
+
constructor(params: RendererInitParams);
|
|
58
|
+
open(params: FullRenderParameters): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Called by rndrCtrl
|
|
61
|
+
* list of required renderers, so we kno who will replace us
|
|
62
|
+
*/
|
|
63
|
+
close(_rqrdRenderers: Renderers[]): void;
|
|
64
|
+
onopen(params: FullRenderParameters): void;
|
|
65
|
+
onclose(): void;
|
|
66
|
+
paramsChanged(params: FullRenderParameters): void;
|
|
67
|
+
redraw(): void;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StaticProduct } from './StaticProduct';
|
|
2
|
+
import type { HttpPayload } from '@windy/http.d';
|
|
3
|
+
import type { SatelliteInfoJson } from '@windy/satellite.d';
|
|
4
|
+
import type { ProductInitParams } from './Product';
|
|
5
|
+
export type SatelliteProductInitParams = Pick<SatelliteProduct, 'urlSuff' | 'urlSuffFlow'> & ProductInitParams;
|
|
6
|
+
export declare class SatelliteProduct extends StaticProduct {
|
|
7
|
+
urlSuff: string;
|
|
8
|
+
urlSuffFlow: string;
|
|
9
|
+
constructor(params: SatelliteProductInitParams);
|
|
10
|
+
open(): Promise<undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Return info.json loading promise (https://sat.windy.com/satellite/info.json)
|
|
13
|
+
*/
|
|
14
|
+
loadInfoJson(noCache?: boolean): Promise<HttpPayload<SatelliteInfoJson>>;
|
|
15
|
+
/**
|
|
16
|
+
* Handling keyboard shortcuts
|
|
17
|
+
*/
|
|
18
|
+
moveTs(moveRight: boolean): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ScrollableInitParams = Pick<Scrollable, 'scrollEl'>;
|
|
2
|
+
export declare class Scrollable {
|
|
3
|
+
scrollTicking: boolean;
|
|
4
|
+
protected scrollEndTimer: ReturnType<typeof setTimeout> | null;
|
|
5
|
+
scrollEl: HTMLElement;
|
|
6
|
+
constructor(params: ScrollableInitParams);
|
|
7
|
+
onscroll(_ev: Event): void;
|
|
8
|
+
/**
|
|
9
|
+
* Forces to scroll table to selected @stop position
|
|
10
|
+
*/
|
|
11
|
+
scrollTo(stop: number): void;
|
|
12
|
+
protected onscrollend(): void;
|
|
13
|
+
private scrollFired;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SveltePlugin } from '@windy/SveltePlugin';
|
|
2
|
+
import type { WindowPluginInitParams } from '@windy/WindowPlugin';
|
|
3
|
+
import type { SveltePanePlugins } from '@windy/plugins.d';
|
|
4
|
+
export type SveltePanePluginInitParams<P extends keyof SveltePanePlugins> = Omit<WindowPluginInitParams<P>, 'ident'> & Pick<SveltePanePlugin<P>, 'ident' | 'additionalClassName'> & Partial<SveltePanePlugin<P>>;
|
|
5
|
+
/**
|
|
6
|
+
* Common pane plugin, that appear in LH Pane on desktop, RH pane in tablet
|
|
7
|
+
* and appears from bottom on mobile devices
|
|
8
|
+
*
|
|
9
|
+
* Please note, that `hasKeyboard` nad `weDisplayURL` property is set true by default
|
|
10
|
+
*/
|
|
11
|
+
export declare class SveltePanePlugin<P extends keyof SveltePanePlugins> extends SveltePlugin<P> {
|
|
12
|
+
ident: P;
|
|
13
|
+
/**
|
|
14
|
+
* Additional class name to add to custom Pane Plugin
|
|
15
|
+
*/
|
|
16
|
+
additionalClassName?: string;
|
|
17
|
+
constructor(params: SveltePanePluginInitParams<P>);
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { WindowPlugin } from '@windy/WindowPlugin';
|
|
2
|
+
import type { WindowPluginInitParams } from '@windy/WindowPlugin';
|
|
3
|
+
import type { PluginsOpenParams, PluginsQsParams } from '@windy/plugin-params.d';
|
|
4
|
+
import type { SveltePanePlugins, SveltePlugins } from '@windy/plugins.d';
|
|
5
|
+
export declare class SvelteApp<P extends keyof SveltePlugins | keyof SveltePanePlugins> {
|
|
6
|
+
constructor(_args: {
|
|
7
|
+
target: HTMLElement;
|
|
8
|
+
anchor: HTMLElement;
|
|
9
|
+
});
|
|
10
|
+
onopen(params?: PluginsOpenParams[P], qs?: PluginsQsParams[P]): void;
|
|
11
|
+
onclose(): void;
|
|
12
|
+
$destroy(): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Same as SvelteApp type, but without any information, about required
|
|
16
|
+
* types for params & qs
|
|
17
|
+
*/
|
|
18
|
+
export declare class ExternalSvelteApp {
|
|
19
|
+
constructor(_args: {
|
|
20
|
+
target: HTMLElement;
|
|
21
|
+
anchor: HTMLElement;
|
|
22
|
+
});
|
|
23
|
+
onopen(params?: unknown, qs?: unknown): void;
|
|
24
|
+
onclose(): void;
|
|
25
|
+
$destroy(): void;
|
|
26
|
+
}
|
|
27
|
+
/** Allowed params to SveltePlugin constructor (private and protected props are omited by default) */
|
|
28
|
+
export type SveltePluginInitParams<P extends keyof SveltePlugins | keyof SveltePanePlugins> = Omit<WindowPluginInitParams<P>, 'ident'> & Pick<SveltePlugin<P>, 'ident'> & Partial<SveltePlugin<P>>;
|
|
29
|
+
export declare class SveltePlugin<P extends keyof SveltePlugins | keyof SveltePanePlugins> extends WindowPlugin<P> {
|
|
30
|
+
/**
|
|
31
|
+
* Holder of SvelteApp
|
|
32
|
+
*/
|
|
33
|
+
private svelteApp?;
|
|
34
|
+
ident: P;
|
|
35
|
+
plugin: WPluginModules[`@plugins/${P}`] & AdditionalSvelteAssets;
|
|
36
|
+
onopen(params?: PluginsOpenParams[P], _qs?: PluginsQsParams[P]): void;
|
|
37
|
+
ondestroy(): void;
|
|
38
|
+
protected mount(): void;
|
|
39
|
+
protected unmount(): void;
|
|
40
|
+
}
|
package/types/Swipe.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type SwipeDirection = null | 'left' | 'right' | 'up' | 'down';
|
|
2
|
+
export type SwipeInitParams = {
|
|
3
|
+
el: HTMLElement;
|
|
4
|
+
onswipe(_dir: SwipeDirection, _distance: number, _evt: TouchEvent): void;
|
|
5
|
+
threshold?: number;
|
|
6
|
+
onswipestart?(_evt: TouchEvent): void;
|
|
7
|
+
};
|
|
8
|
+
export declare class Swipe {
|
|
9
|
+
/**
|
|
10
|
+
* Element to be swiped
|
|
11
|
+
*/
|
|
12
|
+
private el;
|
|
13
|
+
/**
|
|
14
|
+
* Treshold in pixels to consider element to be "swiped"
|
|
15
|
+
*/
|
|
16
|
+
private threshold;
|
|
17
|
+
private direction;
|
|
18
|
+
private isSwipeValid;
|
|
19
|
+
private x;
|
|
20
|
+
private y;
|
|
21
|
+
private xStart;
|
|
22
|
+
private yStart;
|
|
23
|
+
private xThrottled;
|
|
24
|
+
private yThrottled;
|
|
25
|
+
constructor(params: SwipeInitParams);
|
|
26
|
+
private touchStart;
|
|
27
|
+
private touchMove;
|
|
28
|
+
private touchEnd;
|
|
29
|
+
private onswipestart;
|
|
30
|
+
/**
|
|
31
|
+
* This method will be called during the swipe
|
|
32
|
+
*/
|
|
33
|
+
private onswipe;
|
|
34
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ClickHandler } from '@windy/ClickHandler';
|
|
2
|
+
import type { ClickHandlerInitParams } from '@windy/ClickHandler';
|
|
3
|
+
export type SwitchInitParams<T> = ClickHandlerInitParams<T> & {
|
|
4
|
+
initValue?: T | null;
|
|
5
|
+
onset?(_value: T): void;
|
|
6
|
+
};
|
|
7
|
+
export declare class Switch<T> extends ClickHandler<T> {
|
|
8
|
+
/**
|
|
9
|
+
* Init value
|
|
10
|
+
*/
|
|
11
|
+
protected initValue: T | null;
|
|
12
|
+
protected selected: T | null;
|
|
13
|
+
constructor(params: SwitchInitParams<T>);
|
|
14
|
+
set(value: T, noEmit?: boolean): void;
|
|
15
|
+
/**
|
|
16
|
+
* Returns first element with particular value
|
|
17
|
+
*/
|
|
18
|
+
protected getEl(value: T): HTMLElement | null;
|
|
19
|
+
protected click(command: string, value: T, noEmit?: boolean): void;
|
|
20
|
+
/**
|
|
21
|
+
* Will be called upon click on something
|
|
22
|
+
*/
|
|
23
|
+
protected onset(_value: T): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WindowPlugin } from '@windy/WindowPlugin';
|
|
2
|
+
import type { TagPlugins } from '@windy/plugins.d';
|
|
3
|
+
export declare class TagPlugin<P extends keyof TagPlugins> extends WindowPlugin<P> {
|
|
4
|
+
ident: P;
|
|
5
|
+
plugin: WPluginModules[`@plugins/${P}`] & AdditionalPluginAssets;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Renderer } from '@windy/Renderer';
|
|
2
|
+
import type { FullRenderParameters } from '@windy/Layer.d';
|
|
3
|
+
import type { RendererInitParams } from '@windy/Renderer';
|
|
4
|
+
import type { Renderers } from '@windy/Renderer.d';
|
|
5
|
+
export declare class TileLayer extends Renderer {
|
|
6
|
+
constructor(params: RendererInitParams);
|
|
7
|
+
onopen(params?: FullRenderParameters): void;
|
|
8
|
+
close(rqrdRenderers: Renderers[]): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BindedBar } from '@windy/BindedBar';
|
|
2
|
+
import type { BindedBarInitParams } from '@windy/BindedBar';
|
|
3
|
+
export type TimestampBarInitParams = Omit<BindedBarInitParams, 'bindTimestamp' | 'bindCalendar' | 'bindAnimation'>;
|
|
4
|
+
export declare class TimestampBar extends BindedBar {
|
|
5
|
+
constructor(params: TimestampBarInitParams);
|
|
6
|
+
protected createText(el: HTMLElement): string;
|
|
7
|
+
protected createGhostText(ghostLeft: number): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ClickHandler } from '@windy/ClickHandler';
|
|
2
|
+
import type { ClickHandlerInitParams } from '@windy/ClickHandler';
|
|
3
|
+
import type { WebcamDetail, WebcamsLoadingParams, WebcamMetadata } from '@windy/Webcams.d';
|
|
4
|
+
import type { Plugins } from '@windy/plugins.d';
|
|
5
|
+
import type { LatLon } from '@windy/interfaces';
|
|
6
|
+
export type WebcamsInitParams = {
|
|
7
|
+
useHover?: boolean;
|
|
8
|
+
maxAmount?: number;
|
|
9
|
+
singleLine?: boolean;
|
|
10
|
+
imgRatio?: number;
|
|
11
|
+
toOpen?: keyof Plugins;
|
|
12
|
+
} & ClickHandlerInitParams<string>;
|
|
13
|
+
export declare class Webcams extends ClickHandler<string> {
|
|
14
|
+
protected maxAmount: number;
|
|
15
|
+
protected imgRatio: number;
|
|
16
|
+
private toOpen;
|
|
17
|
+
private currentLocation;
|
|
18
|
+
protected singleLine: boolean;
|
|
19
|
+
private useHover;
|
|
20
|
+
private hasListener;
|
|
21
|
+
protected daylight: boolean;
|
|
22
|
+
private marker;
|
|
23
|
+
data: WebcamDetail[];
|
|
24
|
+
constructor(params: WebcamsInitParams);
|
|
25
|
+
/**
|
|
26
|
+
* Based on webcam item returns additional metadata
|
|
27
|
+
*/
|
|
28
|
+
static getMetadata(loc: LatLon, cam: WebcamDetail, daylight?: boolean): WebcamMetadata;
|
|
29
|
+
/**
|
|
30
|
+
* Just adds dayligtListener
|
|
31
|
+
*/
|
|
32
|
+
addListeners(): this;
|
|
33
|
+
/**
|
|
34
|
+
* Remove listener, remove marker
|
|
35
|
+
*/
|
|
36
|
+
unmount(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Loads a webcams near { lat, lon }
|
|
39
|
+
*
|
|
40
|
+
* @returns promise with loaded json
|
|
41
|
+
*/
|
|
42
|
+
load<T extends WebcamsLoadingParams>(params: T): Promise<WebcamDetail[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Pulsating marker
|
|
45
|
+
*/
|
|
46
|
+
addMarker(index: number): void;
|
|
47
|
+
removeMarker(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Calls callback for each webcam
|
|
50
|
+
*/
|
|
51
|
+
forEach(cb: (el: HTMLDivElement, i: number) => void): void;
|
|
52
|
+
/**
|
|
53
|
+
* Renders HTML into page
|
|
54
|
+
*/
|
|
55
|
+
protected render(): void | string;
|
|
56
|
+
/**
|
|
57
|
+
* Sets w,h of image
|
|
58
|
+
*/
|
|
59
|
+
protected setWH(w: number, h: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* Load images into it
|
|
62
|
+
*/
|
|
63
|
+
protected loadImages(): void;
|
|
64
|
+
protected click(command: string, index: string): void;
|
|
65
|
+
private index2location;
|
|
66
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines openable `Window` containing HTML, CSS
|
|
3
|
+
*/
|
|
4
|
+
import type { WindowOpeningOptions, WindowClosingOptions } from '@windy/interfaces.d';
|
|
5
|
+
import type { HTMLString } from '@windy/types.d';
|
|
6
|
+
export type WindowInitParams = Pick<Window, 'ident' | 'html'> & Partial<Omit<Window, 'isOpen' | 'node' | 'refs' | 'close' | 'open' | 'mount'>>;
|
|
7
|
+
export declare class Window {
|
|
8
|
+
private static iAm;
|
|
9
|
+
private closingTimer;
|
|
10
|
+
private timeoutTimer;
|
|
11
|
+
/**
|
|
12
|
+
* Binded veriosn of self closing
|
|
13
|
+
*/
|
|
14
|
+
private bindedClose;
|
|
15
|
+
/**
|
|
16
|
+
* Identifier of window
|
|
17
|
+
*/
|
|
18
|
+
ident: string;
|
|
19
|
+
domEl: null | HTMLElement;
|
|
20
|
+
/**
|
|
21
|
+
* Attachement point, where the window will come if domEl is not specified
|
|
22
|
+
* Use data-plugin="" attribute to in HTML code, se we can distinguish between
|
|
23
|
+
* normal tags and attachement points
|
|
24
|
+
*/
|
|
25
|
+
attachPoint: string;
|
|
26
|
+
/**
|
|
27
|
+
* Does the window reguires keyboard input?
|
|
28
|
+
*/
|
|
29
|
+
keyboard: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Should the item be closed on click somewhere else? True for any click, false ignores everything (default), 'outside' closes Window only when clicking outside the window
|
|
32
|
+
*/
|
|
33
|
+
closeOnClick: boolean | 'outside';
|
|
34
|
+
/**
|
|
35
|
+
* Uses el.style.display = block to hide/display el on page
|
|
36
|
+
*/
|
|
37
|
+
displayBlock: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* How long should closing of the Window last?
|
|
40
|
+
*/
|
|
41
|
+
timeout: number;
|
|
42
|
+
/**
|
|
43
|
+
* is window open right now
|
|
44
|
+
*/
|
|
45
|
+
isOpen: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Class applied to body
|
|
48
|
+
*/
|
|
49
|
+
bodyClass: string;
|
|
50
|
+
/**
|
|
51
|
+
* HTML element of this Window
|
|
52
|
+
*/
|
|
53
|
+
node?: HTMLDivElement;
|
|
54
|
+
/**
|
|
55
|
+
* Class name applied to Window element
|
|
56
|
+
*/
|
|
57
|
+
className?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Optional HTML ID identifier
|
|
60
|
+
*/
|
|
61
|
+
htmlID?: `${'plugin' | 'window' | 'windy-plugin'}-${string}`;
|
|
62
|
+
/**
|
|
63
|
+
* HTML content of the Window
|
|
64
|
+
*/
|
|
65
|
+
html?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Disable opening & closing animation
|
|
68
|
+
*/
|
|
69
|
+
noAnimation?: boolean;
|
|
70
|
+
constructor(params: WindowInitParams);
|
|
71
|
+
close(opts?: WindowClosingOptions): void;
|
|
72
|
+
/**
|
|
73
|
+
* Open and show the window
|
|
74
|
+
*/
|
|
75
|
+
open(options?: WindowOpeningOptions): Window;
|
|
76
|
+
/**
|
|
77
|
+
* Ready to be overloaded: Will be called after open
|
|
78
|
+
*/
|
|
79
|
+
onopen(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Ready to be overloaded: Will be called before close
|
|
82
|
+
*/
|
|
83
|
+
onclose(_opts?: WindowClosingOptions): void;
|
|
84
|
+
/**
|
|
85
|
+
* Ready to be overloaded: Will be called after close
|
|
86
|
+
*/
|
|
87
|
+
onclosed(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Mounting the Window
|
|
90
|
+
*/
|
|
91
|
+
mount(optionalHtml?: HTMLString): void;
|
|
92
|
+
/**
|
|
93
|
+
* Unmounting the Window
|
|
94
|
+
*/
|
|
95
|
+
unmount(): void;
|
|
96
|
+
protected initProperties(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Creates node with closing X and put inside HTML code
|
|
99
|
+
*/
|
|
100
|
+
private createNode;
|
|
101
|
+
private removeHooks;
|
|
102
|
+
private addHooks;
|
|
103
|
+
/**
|
|
104
|
+
* Key catcher should prevent to send commands to body tag, where they work as navigation
|
|
105
|
+
*/
|
|
106
|
+
private keyCatcher;
|
|
107
|
+
}
|