@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 @@
|
|
|
1
|
+
export declare const getApiUrl: (url: string) => string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # @windy/location
|
|
3
|
+
*
|
|
4
|
+
* Modifies URL of the page and document title. Well configured
|
|
5
|
+
* plugins need to use this module to change URL and title of the page
|
|
6
|
+
* ONLY when their parameters are changed.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { setUrl, setTitle } from '@windy/location';
|
|
11
|
+
*
|
|
12
|
+
* export const onopen = (params: PluginParams) => {
|
|
13
|
+
* // We DO NOT NEED to set URL and title here!!!
|
|
14
|
+
* // Windy's plugin system will do it for us automatically
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* // Here we detect change of params
|
|
18
|
+
* export const onpPramsChanged = (newParams: PluginParams) => {
|
|
19
|
+
* setUrl('windy-plugin-name', newParams);
|
|
20
|
+
* setTitle('New title for ne params');
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @module location
|
|
25
|
+
*/
|
|
26
|
+
import type { ExternalPluginIdent } from '@windy/types.d';
|
|
27
|
+
import type { PluginIdent } from '@windy/Plugin';
|
|
28
|
+
import type { WindowPlugins } from '@windy/WindowPlugin';
|
|
29
|
+
import type { PluginsOpenParams } from '@windy/plugin-params';
|
|
30
|
+
/**
|
|
31
|
+
* Sets browser's description meta tag for purpose of SEO
|
|
32
|
+
*/
|
|
33
|
+
export declare const description: (desc: string) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Gets current browser's URL (for example for purpose of sharing)
|
|
36
|
+
*/
|
|
37
|
+
export declare const getURL: () => string;
|
|
38
|
+
/**
|
|
39
|
+
* Resets browser's title to initial value
|
|
40
|
+
* Windy's plugin system should do it automatically
|
|
41
|
+
*/
|
|
42
|
+
export declare function resetTitle(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Set URL of page. PluginId makes sure, that only plugin that changed URL can
|
|
45
|
+
* reset it later on.
|
|
46
|
+
* @param pluginId id, respective name of the plugin that is updating the URL
|
|
47
|
+
* @param pluginParams parameters of the plugin. Same parameters as plugin receives in its onopen method
|
|
48
|
+
* @param seoPrefix SEO prefix of the URL
|
|
49
|
+
*/
|
|
50
|
+
export declare const setUrl: <P extends keyof WindowPlugins>(pluginId: `windy-plugin-${string}` | P, pluginParams?: PluginsOpenParams[P], seoPrefix?: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Sets browser's title of a page
|
|
53
|
+
*/
|
|
54
|
+
export declare const setTitle: (newTitle: string) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Sets browser's search string (the part after ?)
|
|
57
|
+
*
|
|
58
|
+
* TODO: Only subscription plugin uses this method
|
|
59
|
+
* There is potentional BUG that debounced change in some parameters
|
|
60
|
+
* will overwrite this change
|
|
61
|
+
* @ignore
|
|
62
|
+
*/
|
|
63
|
+
export declare const setSearch: (newSearch?: string) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Reset both, title & URL, to its default values. PluginId makes sure, that
|
|
66
|
+
* only plugin that changed URL can reset it. Well configured plugins should
|
|
67
|
+
* not need to call this method, and Windy's plugin system should do it
|
|
68
|
+
* for you automatically.
|
|
69
|
+
*
|
|
70
|
+
* @param pluginId Plugin ident (or null if called not from plugin)
|
|
71
|
+
*/
|
|
72
|
+
export declare const reset: (pluginId?: PluginIdent | ExternalPluginIdent) => void;
|
package/types/log.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
type Key = string | number;
|
|
2
|
+
interface Entry<T> {
|
|
3
|
+
key: Key;
|
|
4
|
+
value: T;
|
|
5
|
+
older: undefined | Entry<T>;
|
|
6
|
+
newer?: Entry<T>;
|
|
7
|
+
}
|
|
8
|
+
declare class LRUCache<T = unknown> {
|
|
9
|
+
private size;
|
|
10
|
+
private limit;
|
|
11
|
+
private _keymap;
|
|
12
|
+
private tail;
|
|
13
|
+
private head;
|
|
14
|
+
constructor(limit: number);
|
|
15
|
+
/**
|
|
16
|
+
* Put <value> into the cache associated with <key>.
|
|
17
|
+
*
|
|
18
|
+
* @param key Key of the cache item
|
|
19
|
+
* @param value Value of the cache item
|
|
20
|
+
* @returns The entry which was removed to make room for the new entry. Otherwise undefined is returned (i.e. if there was enough room already).
|
|
21
|
+
*/
|
|
22
|
+
put(key: Key, value: T): Entry<T> | void;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a JSON (array) representation of the cache
|
|
25
|
+
*
|
|
26
|
+
* @returns Array of key-value pairs
|
|
27
|
+
*/
|
|
28
|
+
toJSON(): {
|
|
29
|
+
key: Key;
|
|
30
|
+
value: T;
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* Purge the least recently used (oldest) entry from the cache.
|
|
34
|
+
*
|
|
35
|
+
* If you need to perform any form of finalization of purged items, this is a
|
|
36
|
+
* good place to do it. Simply override/replace this function:
|
|
37
|
+
*
|
|
38
|
+
* ```
|
|
39
|
+
* var c = new LRUCache(123);
|
|
40
|
+
* c.shift = function() {
|
|
41
|
+
* var entry = LRUCache.prototype.shift.call(this);
|
|
42
|
+
* doSomethingWith(entry);
|
|
43
|
+
* return entry;
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @returns The removed entry or undefined if the cache was empty.
|
|
48
|
+
*/
|
|
49
|
+
shift(): Entry<T> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Get and register recent use of <key>.
|
|
52
|
+
*
|
|
53
|
+
* @param key Key of cache item
|
|
54
|
+
* @returns The value associated with <key> or undefined if not in cache.
|
|
55
|
+
*/
|
|
56
|
+
get(key: Key): T | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Remove entry <key> from cache and return its value.
|
|
59
|
+
*
|
|
60
|
+
* @param key Key of cache item
|
|
61
|
+
* @returns Value of removed item, undefined if not found
|
|
62
|
+
*/
|
|
63
|
+
remove(key: Key): T | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Removes all entries
|
|
66
|
+
*/
|
|
67
|
+
removeAll(): void;
|
|
68
|
+
}
|
|
69
|
+
export default LRUCache;
|
package/types/map.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # @windy/map
|
|
3
|
+
*
|
|
4
|
+
* Already initialized instance of Leaflet map and other map related functions and stuff
|
|
5
|
+
*
|
|
6
|
+
* Instance of Leaflet map is available as `map` in this module.
|
|
7
|
+
*
|
|
8
|
+
* Windy.com uses Leaflet version `1.4.0` that is [well documented here](http://leafletjs.com/)
|
|
9
|
+
* and contains plenty of [plugins that you can use](http://leafletjs.com/plugins.html).
|
|
10
|
+
*
|
|
11
|
+
* @module map
|
|
12
|
+
*/
|
|
13
|
+
import type { LatLon } from '@windy/interfaces.d';
|
|
14
|
+
import type { Pixel } from '@windy/types';
|
|
15
|
+
/**
|
|
16
|
+
* Already initialized instance of Leaflet L.Map
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```js
|
|
20
|
+
* import { map } from '@windy/map';
|
|
21
|
+
*
|
|
22
|
+
* map.on('zoomend', () => {
|
|
23
|
+
* console.log('Map was zoomed');
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const map: L.Map;
|
|
28
|
+
/**
|
|
29
|
+
* Already initialized reusable set of minimalistic Leaflet markers
|
|
30
|
+
*
|
|
31
|
+
* `icon` Pulsating icon
|
|
32
|
+
*
|
|
33
|
+
* `pulsatingIcon` Pulsating icon forever
|
|
34
|
+
*
|
|
35
|
+
* `myLocationIcon` Blue icon of user's location
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```js
|
|
39
|
+
* import { map, markers } from '@windy/map';
|
|
40
|
+
*
|
|
41
|
+
* const myPulsatingMarker = L.marker([ 50, 14 ], {
|
|
42
|
+
* icon: markers.pulsatingIcon
|
|
43
|
+
* }).addTo( map );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const markers: Record<string, L.DivIcon>;
|
|
47
|
+
/**
|
|
48
|
+
* @ignore
|
|
49
|
+
*/
|
|
50
|
+
export interface CenterOptions extends LatLon {
|
|
51
|
+
zoom?: number;
|
|
52
|
+
paddingTop?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Centers/zooms leaflet map with optional offset to the left or top
|
|
56
|
+
* @ignore
|
|
57
|
+
*/
|
|
58
|
+
export declare function centerMap(coords: CenterOptions, animation?: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
* Makes sure point is visible from bottom of the pane (will be depreciated)
|
|
61
|
+
* @ignore
|
|
62
|
+
*/
|
|
63
|
+
export declare function ensurePointVisibleY(lat: number, lon: number, offset: number): void;
|
|
64
|
+
/**
|
|
65
|
+
* Makes sure, that y coordinate on the map is coordinated with lat, lon provided.
|
|
66
|
+
* Useful for mobile picker & such
|
|
67
|
+
* @ignore
|
|
68
|
+
*/
|
|
69
|
+
export declare function panToOffset(y: Pixel, lat: number, lon: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* Changes base map of underlying Windy.com map.
|
|
72
|
+
* @ignore
|
|
73
|
+
*/
|
|
74
|
+
export declare const baseLayer: L.GridLayer;
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the map tiles from the mapTilesRecord.
|
|
77
|
+
* @ignore
|
|
78
|
+
* @returns The map tiles.
|
|
79
|
+
*/
|
|
80
|
+
export declare const getMapTiles: (patchType?: string) => Record<import("@windy/baseMap").MapTilesKeys, string>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Layers } from '@windy/Layer.d';
|
|
2
|
+
import type { UsedOverlays } from '@windy/Overlay';
|
|
3
|
+
import type { LatLon } from '@windy/interfaces.d';
|
|
4
|
+
import type { Overlays, PointProducts, Products } from '@windy/rootScope.d';
|
|
5
|
+
type LayerOrOverlay = Layers | UsedOverlays;
|
|
6
|
+
/**
|
|
7
|
+
* Layer <--> product relations
|
|
8
|
+
*/
|
|
9
|
+
export declare const layer2product: {
|
|
10
|
+
[P in LayerOrOverlay]?: Products[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Overlay <--> product relations
|
|
14
|
+
*/
|
|
15
|
+
export declare const overlay2product: {
|
|
16
|
+
[P in LayerOrOverlay]?: Products[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* From list of products deduplicates icon/iconEu, iconWaves/iconEuWaves
|
|
20
|
+
*/
|
|
21
|
+
export declare const dedupeIcon: (productsList: Products[]) => Products[];
|
|
22
|
+
/**
|
|
23
|
+
* Return particular icon related model based on rqrd and avbl models
|
|
24
|
+
*/
|
|
25
|
+
export declare const getIconModel: (rqrdProduct: Products, avProducts: Products[]) => Products | null;
|
|
26
|
+
/**
|
|
27
|
+
* Return idents of visible local products available in the current map boundaries (or empty array undefined)
|
|
28
|
+
*/
|
|
29
|
+
export declare const betterProducts: <T extends LatLon, PT extends boolean, R extends PT extends true ? "icon" | "gfs" | "ecmwf" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeReunion" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "ukv" | "mblue" : "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">(latLon: T, pointFcts?: PT) => R[];
|
|
30
|
+
/**
|
|
31
|
+
* Return product string on a basis of overlay & wanted forecast model
|
|
32
|
+
*/
|
|
33
|
+
export declare const getProduct: (overlay: Overlays, rqrdProduct: Products) => Products;
|
|
34
|
+
/**
|
|
35
|
+
* Returns all AIR products for point forecast in given location
|
|
36
|
+
*/
|
|
37
|
+
export declare const getAllPointProducts: <T extends LatLon>(latLon: T) => PointProducts[];
|
|
38
|
+
/**
|
|
39
|
+
* Returns dedupped AIR products for point forecast in given location
|
|
40
|
+
*/
|
|
41
|
+
export declare const getPointProducts: <T extends LatLon>(latLon: T) => Products[];
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// DEV tools without typings --> for purpose of make.ts
|
|
2
|
+
|
|
3
|
+
declare module 'preprocess';
|
|
4
|
+
declare module 'tiny-lr';
|
|
5
|
+
declare module 'less-plugin-autoprefixer';
|
|
6
|
+
|
|
7
|
+
// just shut up svelte-preprocess with its missing dependency
|
|
8
|
+
declare module 'sass' {
|
|
9
|
+
type LegacyStringOptions<T> = unknown & T;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Nothing should be imported from svelte/internal as it can break in ANY Svelte update
|
|
13
|
+
// TODO Remove all imports of this module before updating to Svelte 5
|
|
14
|
+
declare module 'svelte/internal' {
|
|
15
|
+
function get_current_component(): import('svelte').SvelteComponent;
|
|
16
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Evented } from '@windy/Evented';
|
|
2
|
+
import type { HttpPayload } from '@windy/http.d';
|
|
3
|
+
import type { NotificationInfo } from '@windy/notifications.d';
|
|
4
|
+
declare class Notification extends Evented<Notification> {
|
|
5
|
+
data: Record<string, unknown>;
|
|
6
|
+
eventSource: null | EventSource;
|
|
7
|
+
canReceiveNotif: boolean;
|
|
8
|
+
hasUnloadListener: boolean;
|
|
9
|
+
constructor();
|
|
10
|
+
/**
|
|
11
|
+
* Close SSE event stream
|
|
12
|
+
*/
|
|
13
|
+
clean(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Connect to SSE event stream and hook all event listeners
|
|
16
|
+
*/
|
|
17
|
+
watchChanges(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get notifications list (paging is applied)
|
|
20
|
+
*
|
|
21
|
+
* @param currentPage Page number to get
|
|
22
|
+
* @param pageSize Page size to include into list
|
|
23
|
+
* @returns Page is updated with received data or error is shown if anything failed
|
|
24
|
+
*/
|
|
25
|
+
loadNotificationList(currentPage: number, pageSize: number): Promise<void | NotificationInfo>;
|
|
26
|
+
/**
|
|
27
|
+
* Mark alert as seen by its id. This may affect more notifications if the alert has some.
|
|
28
|
+
*
|
|
29
|
+
* @param id Alert id
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
markAlertAsSeen(id: string): Promise<HttpPayload<void>>;
|
|
33
|
+
/**
|
|
34
|
+
* Mark notification as seen by its id. It affects just and only one specific notification.
|
|
35
|
+
*
|
|
36
|
+
* @param id Notification id
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
markNotificationAsSeen(id: string): Promise<HttpPayload<void>>;
|
|
40
|
+
/**
|
|
41
|
+
* Mark all notifications ad received (= not seen yet, but already delivered)
|
|
42
|
+
*
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
markNotificationsAsReceived(): Promise<void | HttpPayload<void>>;
|
|
46
|
+
/**
|
|
47
|
+
* Delete all users notifications
|
|
48
|
+
*
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
deleteAllNotifications(): Promise<HttpPayload<void>>;
|
|
52
|
+
/**
|
|
53
|
+
* Mark all users notifications as seen
|
|
54
|
+
*/
|
|
55
|
+
markAllAsSeen(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Update notification state. It updates store value so all necessary events are triggered.
|
|
58
|
+
*
|
|
59
|
+
* @param vals `totalCount` and `newCount` values to set
|
|
60
|
+
* @param vals.totalCount Total count of all notifications (already seen is included)
|
|
61
|
+
* @param vals.newCount Count of new unseen notifications
|
|
62
|
+
*/
|
|
63
|
+
updateInfo({ totalCount, newCount }: NotificationInfo): void;
|
|
64
|
+
}
|
|
65
|
+
declare const _default: Notification;
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Timestamp } from '@windy/types';
|
|
2
|
+
/**
|
|
3
|
+
* Min zoom used for offline download
|
|
4
|
+
*/
|
|
5
|
+
export declare const minZoom = 5;
|
|
6
|
+
/**
|
|
7
|
+
* Max zoom used for offline download
|
|
8
|
+
*/
|
|
9
|
+
export declare const maxZoom = 8;
|
|
10
|
+
export declare const installServiceWorker: () => void;
|
|
11
|
+
export declare const checkOfflinePlugin: () => void;
|
|
12
|
+
export declare const uninstallSericeWorker: () => void;
|
|
13
|
+
export declare const isServiceWorkerSupported: () => boolean;
|
|
14
|
+
export declare const getServiceWorkerError: () => string | null;
|
|
15
|
+
export declare const closeTopMessages: () => void;
|
|
16
|
+
export declare const showErrorMessage: (message: string) => void;
|
|
17
|
+
export declare const showReadyToGoOfflineMessage: (expires: Timestamp) => void;
|
|
18
|
+
export declare const showOfflineModeMessage: (lastTimeDownloaded: Timestamp) => void;
|
|
19
|
+
export declare const showDownloadingProgressMessage: () => void;
|
|
20
|
+
export declare const isProgressMessageOn: () => boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Overlay } from '@windy/Overlay';
|
|
2
|
+
import { AwpOverlay, CloudsOverlay, CurrentOverlay, FwiOverlay, RainPtypeOverlay, WaveOverlay } from '@windy/OverlayClasses';
|
|
3
|
+
declare const overlays: {
|
|
4
|
+
wind: Overlay<"wind", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
5
|
+
temp: Overlay<"temp", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
6
|
+
wetbulbtemp: Overlay<"temp", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
7
|
+
solarpower: Overlay<"solarpower", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
8
|
+
uvindex: Overlay<"uvindex", import("../weatherClasses/MetricClasses").UVIndexMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").UVIndexMetric>>;
|
|
9
|
+
dewpoint: Overlay<"dewpoint", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
10
|
+
gust: Overlay<"gust", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
11
|
+
gustAccu: Overlay<"gustAccu", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
12
|
+
turbulence: Overlay<"turbulence", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
13
|
+
icing: Overlay<"icing", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
14
|
+
rh: Overlay<"rh", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
15
|
+
pressure: Overlay<"pressure", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
16
|
+
rain: RainPtypeOverlay<"rain">;
|
|
17
|
+
clouds: CloudsOverlay<"clouds">;
|
|
18
|
+
lclouds: CloudsOverlay<"lclouds">;
|
|
19
|
+
mclouds: CloudsOverlay<"mclouds">;
|
|
20
|
+
hclouds: CloudsOverlay<"hclouds">;
|
|
21
|
+
cape: Overlay<"cape", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
22
|
+
cbase: Overlay<"cbase", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
23
|
+
snowAccu: Overlay<"snowAccu", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
24
|
+
rainAccu: Overlay<"rainAccu", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
25
|
+
waves: WaveOverlay<"waves">;
|
|
26
|
+
wwaves: WaveOverlay<"wwaves">;
|
|
27
|
+
swell1: WaveOverlay<"swell1">;
|
|
28
|
+
swell2: WaveOverlay<"swell2">;
|
|
29
|
+
swell3: WaveOverlay<"swell3">;
|
|
30
|
+
swell: WaveOverlay<"swell1">;
|
|
31
|
+
currents: CurrentOverlay<"currents">;
|
|
32
|
+
currentsTide: CurrentOverlay<"currentsTide">;
|
|
33
|
+
sst: Overlay<"sst", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
34
|
+
visibility: Overlay<"visibility", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
35
|
+
fog: Overlay<"fog", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
36
|
+
thunder: Overlay<"thunder", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
37
|
+
snowcover: Overlay<"snowcover", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
38
|
+
cloudtop: Overlay<"cloudtop", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
39
|
+
deg0: Overlay<"deg0", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
40
|
+
gtco3: Overlay<"gtco3", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
41
|
+
pm2p5: Overlay<"pm2p5", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
42
|
+
no2: Overlay<"no2", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
43
|
+
aod550: Overlay<"aod550", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
44
|
+
tcso2: Overlay<"tcso2", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
45
|
+
go3: Overlay<"go3", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
46
|
+
cosc: Overlay<"cosc", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
47
|
+
dustsm: Overlay<"dustsm", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
48
|
+
ptype: RainPtypeOverlay<"ptype">;
|
|
49
|
+
ccl: Overlay<"ccl", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
50
|
+
gh: Overlay<"gh", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
51
|
+
radar: Overlay<"radar", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
52
|
+
satellite: Overlay<"satellite", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
53
|
+
satelliteIRBT: Overlay<"satellite", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
54
|
+
capAlerts: Overlay<"capAlerts", undefined, import("../weatherClasses/Layer").Layer<undefined>>;
|
|
55
|
+
efiWind: Overlay<"efiWind", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
56
|
+
efiTemp: Overlay<"efiTemp", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
57
|
+
efiRain: Overlay<"efiRain", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
58
|
+
moistureAnom40: Overlay<"moistureAnom40", import("../weatherClasses/MetricClasses").PrecipMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").PrecipMetric>>;
|
|
59
|
+
moistureAnom100: Overlay<"moistureAnom100", import("../weatherClasses/MetricClasses").PrecipMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").PrecipMetric>>;
|
|
60
|
+
drought40: AwpOverlay<"drought40">;
|
|
61
|
+
drought100: AwpOverlay<"drought100">;
|
|
62
|
+
soilMoisture40: Overlay<"soilMoisture40", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
63
|
+
soilMoisture100: Overlay<"soilMoisture100", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
64
|
+
fwi: FwiOverlay<"fwi">;
|
|
65
|
+
dfm10h: Overlay<"dfm10h", import("../weatherClasses/MetricClasses").NumberedMetric, import("../weatherClasses/Layer").Layer<import("../weatherClasses/MetricClasses").NumberedMetric>>;
|
|
66
|
+
};
|
|
67
|
+
export default overlays;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Evented } from '@windy/Evented';
|
|
2
|
+
import type { OnHoverPOIData } from '@plugins/poi-libs/poi-libs.d';
|
|
3
|
+
import type { LatLon } from '@windy/interfaces.d';
|
|
4
|
+
import type { PluginsOpenParams } from '@windy/plugin-params.d';
|
|
5
|
+
import type { Pixel, PickerOpener } from '@windy/types';
|
|
6
|
+
interface Events {
|
|
7
|
+
pickerOpened: [PluginsOpenParams['picker'] & {
|
|
8
|
+
source?: 'picker';
|
|
9
|
+
}];
|
|
10
|
+
pickerMoved: [PluginsOpenParams['picker']];
|
|
11
|
+
pickerClosed: [];
|
|
12
|
+
dataChanged: [];
|
|
13
|
+
getPOIsAtXY: [Pixel, Pixel];
|
|
14
|
+
POIloaded: [OnHoverPOIData];
|
|
15
|
+
POIclose: [];
|
|
16
|
+
rqstOpenPOIdetail: [PickerOpener];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Main emitter for purpose of picker actions, must be pard of core, so it is here.
|
|
20
|
+
*/
|
|
21
|
+
export declare const emitter: Evented<Events>;
|
|
22
|
+
/**
|
|
23
|
+
* Major handling of mobile/tablet picker dot on the screen
|
|
24
|
+
*/
|
|
25
|
+
export declare class PickerDot {
|
|
26
|
+
pickerDotEl: HTMLDivElement;
|
|
27
|
+
mapContainerEl: HTMLDivElement;
|
|
28
|
+
lat: number | null;
|
|
29
|
+
lon: number | null;
|
|
30
|
+
constructor();
|
|
31
|
+
/**
|
|
32
|
+
* Locks picker in position, so any change in picker location
|
|
33
|
+
* will sync its position to desired lat,lons
|
|
34
|
+
*/
|
|
35
|
+
lockPosition(): void;
|
|
36
|
+
unlockPosition(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Sets & lock the position of picker dot
|
|
39
|
+
*/
|
|
40
|
+
setPosition(lat: number, lon: number): void;
|
|
41
|
+
/**
|
|
42
|
+
* Offsets position of picker to top by moving whole map container
|
|
43
|
+
* moves map only to top
|
|
44
|
+
*/
|
|
45
|
+
offsetPosition(y: Pixel): void;
|
|
46
|
+
/** Resets previously offset picker position */
|
|
47
|
+
resetOffset(): void;
|
|
48
|
+
/** Returns picker dot position as Leaflet coords */
|
|
49
|
+
getLatLng(): L.LatLng;
|
|
50
|
+
/** Returns lat and lon of the actual picker dot position */
|
|
51
|
+
getLatLon(): LatLon;
|
|
52
|
+
/** Returns position of pickerDot on Leaflet map */
|
|
53
|
+
getDotPosition(): {
|
|
54
|
+
x: Pixel;
|
|
55
|
+
y: Pixel;
|
|
56
|
+
};
|
|
57
|
+
private positionChanged;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Instance of blinking dot on map (used in picker-mobile, detail & distance plugins so far)
|
|
61
|
+
* Handles resizing of map and rotation changes
|
|
62
|
+
*
|
|
63
|
+
* Unfortunately is initialized even for desktop, where is not used
|
|
64
|
+
*/
|
|
65
|
+
export declare const pickerDot: PickerDot;
|
|
66
|
+
export {};
|
package/types/pois.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module pois
|
|
3
|
+
* Single purpose of this module is to load `poi-libs` plugin whenever user selects non-empty poi or has/adds alert/favourite
|
|
4
|
+
*/
|
|
5
|
+
import type { PoisCheckboxes } from '@windy/pois.d';
|
|
6
|
+
/**
|
|
7
|
+
* Config for checkboxes of specified poi
|
|
8
|
+
*
|
|
9
|
+
* - used for dynamic rendering in rhbottom section and mobile menu
|
|
10
|
+
*/
|
|
11
|
+
export declare const poisCheckboxes: PoisCheckboxes;
|
|
12
|
+
/**
|
|
13
|
+
* Is there something to display on map as a POI
|
|
14
|
+
* TODO: Make sure Alerts are included in favs too by creating alert on map
|
|
15
|
+
*/
|
|
16
|
+
export declare const displayPoiOnMap: () => boolean;
|
package/types/promo.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import '@windy/geolocation';
|
|
2
|
+
export interface PromoInfoObject {
|
|
3
|
+
displayed: number;
|
|
4
|
+
ts: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* TODO: Keep this as default export due to backward compatibility with client-patch
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
/**
|
|
11
|
+
* Get basic info about promo
|
|
12
|
+
*
|
|
13
|
+
* @param ident Identificator
|
|
14
|
+
* @returns Promo info object
|
|
15
|
+
*/
|
|
16
|
+
getCounter2: (ident: string) => PromoInfoObject;
|
|
17
|
+
/**
|
|
18
|
+
* Increases 'seen' counter for particular promo
|
|
19
|
+
*
|
|
20
|
+
* @param ident Ident
|
|
21
|
+
*/
|
|
22
|
+
hitCounter: (ident: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Flag the promo to be never seen again (by setting
|
|
25
|
+
* its number to 1000)
|
|
26
|
+
*
|
|
27
|
+
* @param ident Ident
|
|
28
|
+
*/
|
|
29
|
+
neverSee: (ident: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Get raw promo object from localStorage
|
|
32
|
+
*
|
|
33
|
+
* @returns Local promos
|
|
34
|
+
*/
|
|
35
|
+
getAll: () => Record<string, number>;
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
package/types/query.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module query
|
|
3
|
+
*
|
|
4
|
+
* Handles operations with query input box
|
|
5
|
+
*/
|
|
6
|
+
/** HTML input element */
|
|
7
|
+
export declare const element: HTMLInputElement;
|
|
8
|
+
/** Set content of search input box */
|
|
9
|
+
export declare const set: (text: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get value of search input box
|
|
12
|
+
*
|
|
13
|
+
* @returns Search input box value
|
|
14
|
+
*/
|
|
15
|
+
export declare const get: () => string;
|
|
16
|
+
/** Show loader in search input */
|
|
17
|
+
export declare const showLoader: () => void;
|
|
18
|
+
/** Hide loader in search input */
|
|
19
|
+
export declare const hideLoader: () => void;
|