@windycom/plugin-devtools 3.0.2 → 3.0.3
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/package.json +1 -1
- package/types/client/Calendar.d.ts +4 -0
- package/types/client/Color.d.ts +9 -2
- package/types/client/DataTiler.d.ts +2 -2
- package/types/client/EventManager.d.ts +69 -0
- package/types/client/ExternalSveltePlugin.d.ts +4 -3
- package/types/client/GlBuffer.d.ts +45 -0
- package/types/client/GlMesh.d.ts +147 -0
- package/types/client/GlProgram.d.ts +41 -0
- package/types/client/GlRenderer.d.ts +95 -0
- package/types/client/GlTexture.d.ts +98 -0
- package/types/client/GlVertexArray.d.ts +38 -0
- package/types/client/IDB.d.ts +25 -4
- package/types/client/LabelsLayer.d.ts +69 -2
- package/types/client/Layer.d.ts +2 -1
- package/types/client/MetricClasses.d.ts +1 -1
- package/types/client/Overlay.d.ts +1 -5
- package/types/client/Product.d.ts +10 -5
- package/types/client/ProductClasses.d.ts +7 -0
- package/types/client/Renderer.d.ts +16 -19
- package/types/client/ShaderStorage.d.ts +25 -0
- package/types/client/StartupElementPlugin.d.ts +8 -0
- package/types/client/SveltePlugin.d.ts +4 -4
- package/types/client/SwitchableTileCache.d.ts +104 -0
- package/types/client/TileLayer.d.ts +11 -2
- package/types/client/TileLayerCustom.d.ts +51 -0
- package/types/client/TileLayerMulti.d.ts +53 -0
- package/types/client/TileLayerPreprocessorStandalone.d.ts +45 -0
- package/types/client/TileLayerRenderer.d.ts +24 -0
- package/types/client/TileLayerUtils.d.ts +43 -0
- package/types/client/TilePreprocessor.d.ts +27 -0
- package/types/client/TopoMap.d.ts +2 -1
- package/types/client/WindowPlugin.d.ts +1 -3
- package/types/client/baseMap.d.ts +12 -2
- package/types/client/broadcast.d.ts +1 -1
- package/types/client/cityLabels.d.ts +2 -3
- package/types/client/colorGradients.d.ts +1 -2
- package/types/client/css.test.d.ts +1 -0
- package/types/client/customProtocol.d.ts +11 -0
- package/types/client/d.ts.files/GlObj.d.ts +1 -5
- package/types/client/d.ts.files/Metric.d.ts +2 -0
- package/types/client/d.ts.files/broadcast.d.ts +28 -32
- package/types/client/d.ts.files/dataSpecifications.d.ts +60 -42
- package/types/client/d.ts.files/glUtils.d.ts +71 -0
- package/types/client/d.ts.files/http.d.ts +0 -5
- package/types/client/d.ts.files/interpolatorTypes.d.ts +5 -5
- package/types/client/d.ts.files/lib.d.ts +1 -1
- package/types/client/d.ts.files/liveAlerts.d.ts +52 -0
- package/types/client/d.ts.files/mapUtils.d.ts +25 -0
- package/types/client/d.ts.files/outgoingMessages.d.ts +1 -1
- package/types/client/d.ts.files/plugin-params.d.ts +31 -13
- package/types/client/d.ts.files/plugins.d.ts +44 -29
- package/types/client/d.ts.files/singleclick.d.ts +4 -2
- package/types/client/d.ts.files/startup.d.ts +7 -52
- package/types/client/d.ts.files/storage.d.ts +0 -11
- package/types/client/d.ts.files/user.d.ts +6 -1
- package/types/client/embed.d.ts +2 -5
- package/types/client/errorLogger.d.ts +19 -0
- package/types/client/externalPlugins.d.ts +4 -2
- package/types/client/fetch.d.ts +38 -5
- package/types/client/format.d.ts +11 -0
- package/types/client/glContextUtils.d.ts +9 -0
- package/types/client/glStatus.d.ts +7 -0
- package/types/client/glUtils.d.ts +119 -0
- package/types/client/http.d.ts +0 -6
- package/types/client/idbConnection.d.ts +13 -0
- package/types/client/idbInstances.d.ts +36 -42
- package/types/client/landLayer.d.ts +3 -0
- package/types/client/layers.d.ts +2 -1
- package/types/client/lib.d.ts +11 -14
- package/types/client/liveAlerts.d.ts +2 -2
- package/types/client/location.d.ts +1 -1
- package/types/client/map.d.ts +95 -22
- package/types/client/mapUtils.d.ts +66 -0
- package/types/client/math.d.ts +14 -0
- package/types/client/mobile.d.ts +16 -34
- package/types/client/mobileUtils.d.ts +10 -0
- package/types/client/models.d.ts +1 -1
- package/types/client/overlays.d.ts +2 -2
- package/types/client/picker.d.ts +4 -8
- package/types/client/products.d.ts +0 -1
- package/types/client/promo.d.ts +1 -1
- package/types/client/renderUtils.d.ts +14 -0
- package/types/client/renderers.d.ts +5 -6
- package/types/client/rootScope.d.ts +9 -9
- package/types/client/router.d.ts +7 -2
- package/types/client/singleclick.d.ts +1 -1
- package/types/client/startup.d.ts +48 -0
- package/types/client/startupUtils.d.ts +19 -0
- package/types/client/subscription.d.ts +3 -26
- package/types/client/throttler.d.ts +32 -0
- package/types/client/tileHelpers.d.ts +35 -0
- package/types/client/tileLayerInterpolator.d.ts +40 -0
- package/types/client/tileLayerSource.d.ts +98 -0
- package/types/client/timestampUtils.test.d.ts +1 -0
- package/types/client/topMessage.d.ts +22 -0
- package/types/client/user.d.ts +1 -0
- package/types/client/userConsent.d.ts +0 -2
- package/types/client/userFavs.d.ts +0 -8
- package/types/client/utils.d.ts +62 -10
- package/types/client/utils.test.d.ts +1 -0
- package/types/iconfont.d.ts +2 -5
- package/types/interfaces.d.ts +121 -100
- package/types/lang-files.d.ts +412 -72
- package/types/leaflet-gl.d.ts +12773 -0
- package/types/types.d.ts +28 -6
- package/types/client/d.ts.files/CanvasLayer.d.ts +0 -70
- package/types/client/d.ts.files/DataTiler.d.ts +0 -45
- package/types/client/d.ts.files/LandMask.d.ts +0 -17
- package/types/client/d.ts.files/PoisOverlay.d.ts +0 -27
- package/types/client/d.ts.files/TileLayerCanvas.d.ts +0 -78
- package/types/client/d.ts.files/TileLayerMultiPatch.d.ts +0 -13
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type TileHeader } from '@windy/TileLayerUtils';
|
|
2
|
+
import { PreprocessedTileParams } from '@windy/TilePreprocessor';
|
|
3
|
+
import type { FullRenderParameters } from '@windy/interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* A refactored TileLayer preprocessor intended for use with the new tile management.
|
|
6
|
+
* Assumes that it is only created once for a given set of render params and then disposed when render params change.
|
|
7
|
+
* Render params may not be changed after initialization.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TileLayerPreprocessorStandalone {
|
|
10
|
+
private static _textures;
|
|
11
|
+
private static _texturesLoadPromise;
|
|
12
|
+
private _renderer;
|
|
13
|
+
private _primaryGradient?;
|
|
14
|
+
private _secondaryGradient?;
|
|
15
|
+
private _renderProperties;
|
|
16
|
+
private _ptypeColors;
|
|
17
|
+
private _params;
|
|
18
|
+
private _gl;
|
|
19
|
+
private _initialized;
|
|
20
|
+
private _destroyed;
|
|
21
|
+
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, params: FullRenderParameters);
|
|
22
|
+
init(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Renders a tile with the preprocessing shader into the currently bound framebuffer.
|
|
25
|
+
*/
|
|
26
|
+
renderTile(gl: WebGLRenderingContext | WebGL2RenderingContext, tileTexture: WebGLTexture, tileHeader: TileHeader, tileParams: PreprocessedTileParams): void;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
private _bindUniforms;
|
|
29
|
+
/**
|
|
30
|
+
* @summary Initializes the preprocessor renderer including its shader program and geometry
|
|
31
|
+
*/
|
|
32
|
+
private _initRenderer;
|
|
33
|
+
/**
|
|
34
|
+
* @summary Function called on each params update (in case user changed color palette)
|
|
35
|
+
*/
|
|
36
|
+
private _createUpdateGradients;
|
|
37
|
+
/**
|
|
38
|
+
* Ensures that pattern textures are loaded.
|
|
39
|
+
* Either initiates the load and awaits it, or,
|
|
40
|
+
* if the textures are already loaded, returns immediately.
|
|
41
|
+
* If called while the textures are loading, waits until they are ready.
|
|
42
|
+
*/
|
|
43
|
+
private _prepareTextures;
|
|
44
|
+
private static _prepareTextures;
|
|
45
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GlRenderer } from '@windy/glUtils';
|
|
2
|
+
import type { ReadyTile } from '@windy/tileHelpers';
|
|
3
|
+
import type { SwitchableTileCache } from '@windy/SwitchableTileCache';
|
|
4
|
+
/**
|
|
5
|
+
* Handles rendering of already preprocessed tiles with a simple shader.
|
|
6
|
+
* Does not depend on current map/render params,
|
|
7
|
+
* only needs a {@link SwitchableTileCache} instance in order to render its tiles.
|
|
8
|
+
* Has no internal state other than compiled shaders and empty placeholder texture.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TileLayerRenderer extends GlRenderer {
|
|
11
|
+
private _emptyPlaceholderTexture;
|
|
12
|
+
private _bindings;
|
|
13
|
+
constructor(gl: WebGL2RenderingContext | WebGLRenderingContext);
|
|
14
|
+
render(_gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
15
|
+
/**
|
|
16
|
+
* Renders the layer using the currently loaded tiles in the current cache of the supplied SwitchableTileCache.
|
|
17
|
+
*/
|
|
18
|
+
renderTiles(gl: WebGL2RenderingContext | WebGLRenderingContext, cache: SwitchableTileCache<ReadyTile>): void;
|
|
19
|
+
/**
|
|
20
|
+
* @summary Renderer destructor
|
|
21
|
+
*/
|
|
22
|
+
destroy(gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
23
|
+
private _initializeRenderer;
|
|
24
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { GlTexture } from '@windy/glUtils';
|
|
2
|
+
import type { Color } from '@windy/Color';
|
|
3
|
+
import type { DataQuality } from '@windy/Product';
|
|
4
|
+
import type { Vector2 } from '@windy/math';
|
|
5
|
+
export type TileHeader = {
|
|
6
|
+
decoderRstep: number;
|
|
7
|
+
decoderRmin: number;
|
|
8
|
+
decoderGstep: number;
|
|
9
|
+
decoderGmin: number;
|
|
10
|
+
decoderBstep: number;
|
|
11
|
+
decoderBmin: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* TileLayer min-max zoom - affects all tileLayer-based layers (tileLayer, accumulations, etc)
|
|
15
|
+
*/
|
|
16
|
+
export declare const tileLayerZoomBounds: Vector2;
|
|
17
|
+
export type GradientProps = {
|
|
18
|
+
texture: GlTexture | null;
|
|
19
|
+
mul: number;
|
|
20
|
+
add: number;
|
|
21
|
+
} | null;
|
|
22
|
+
export declare function decodeHeader(imageData: Uint8Array | Uint8ClampedArray, width: number): Float32Array;
|
|
23
|
+
export declare function processHeader(decodedHeader: Float32Array): TileHeader;
|
|
24
|
+
export declare function imageBitmapToUint8Array(imageBitmap: ImageBitmap): Uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* Creates color gradient texture
|
|
27
|
+
* @param colorObj Color instance
|
|
28
|
+
* @returns texture with additional params
|
|
29
|
+
*/
|
|
30
|
+
export declare function createGradientObject(gl: WebGL2RenderingContext | WebGLRenderingContext, colorObj: Color): GradientProps;
|
|
31
|
+
export declare function prepareRainPattern(gl: WebGL2RenderingContext | WebGLRenderingContext): GlTexture;
|
|
32
|
+
/**
|
|
33
|
+
* @summary Returns data zoom offset for the supplied data quality
|
|
34
|
+
* - zoom offset is used to offset the current map/tile zoom for fetching data tiles
|
|
35
|
+
* @param dataQuality
|
|
36
|
+
*/
|
|
37
|
+
export declare function dataQualityToZoomOffset(dataQuality: DataQuality): number;
|
|
38
|
+
export declare const decodedTileDataSize = 257;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a 257x257 texture containing the image with the header removed.
|
|
41
|
+
*/
|
|
42
|
+
export declare function decodeImageBytesCompact(imageData: Uint8Array | Uint8ClampedArray): Uint8Array;
|
|
43
|
+
export declare function decodeImage(imageData: Uint8Array): Promise<ImageBitmap>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GlTexture } from '@windy/glUtils';
|
|
2
|
+
import type { Coords } from '@leafletGl';
|
|
3
|
+
export declare enum TilePreprocessorType {
|
|
4
|
+
NONE = 0,
|
|
5
|
+
RADAR_FLOW = 1,
|
|
6
|
+
RADAR_DATA_WEBP = 2,
|
|
7
|
+
SATELLITE_DATA = 3,
|
|
8
|
+
SATELLITE_FLOW = 4,
|
|
9
|
+
TILE_LAYER = 5,
|
|
10
|
+
RADAR_PTYPE = 6
|
|
11
|
+
}
|
|
12
|
+
export declare class PreprocessedTileParams {
|
|
13
|
+
tileCoords: Coords;
|
|
14
|
+
payload?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare abstract class TilePreprocessor {
|
|
17
|
+
/**
|
|
18
|
+
* @summary Renders given tile (texture) using the preprocessor into the the currently bound framebuffer
|
|
19
|
+
* @param tileTexture Texture to preprocess
|
|
20
|
+
* @param params Additional optional parameters which might be required for some preprocessing
|
|
21
|
+
*/
|
|
22
|
+
abstract renderTile(gl: WebGLRenderingContext | WebGL2RenderingContext, tileTexture: GlTexture, tileParams: PreprocessedTileParams): void;
|
|
23
|
+
/**
|
|
24
|
+
* @summary Deletes the preprocessor (releases its resources)
|
|
25
|
+
*/
|
|
26
|
+
abstract destroy(gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
27
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Renderer } from '@windy/Renderer';
|
|
2
|
+
import { TileLayer } from '@leafletGl';
|
|
2
3
|
import type { Renderers } from '@windy/Renderer';
|
|
3
4
|
export declare class TopoMap extends Renderer {
|
|
4
|
-
baseLayer:
|
|
5
|
+
baseLayer: TileLayer | null;
|
|
5
6
|
open(): Promise<void>;
|
|
6
7
|
close(rqrdRenderers: Renderers[]): void;
|
|
7
8
|
addOrUpdateBaseLayer(): void;
|
|
@@ -6,11 +6,9 @@ import type { WindowInitParams } from '@windy/Window';
|
|
|
6
6
|
import type { PluginOpeningOptions, WindowClosingOptions } from '@windy/interfaces.d';
|
|
7
7
|
import type { InterpolatorFactory } from '@windy/interpolator';
|
|
8
8
|
import type { PluginsOpenParams, PluginsQsParams } from '@windy/plugin-params.d';
|
|
9
|
-
import type {
|
|
9
|
+
import type { WindowPlugins } from '@windy/plugins.d';
|
|
10
10
|
import type { ListeningPriority } from '@windy/singleclick.d';
|
|
11
11
|
import type { LoadedTranslations, ParsedQueryString } from '@windy/types';
|
|
12
|
-
export interface WindowPlugins extends TagPlugins, SveltePlugins, SveltePanePlugins, BottomSveltePlugins {
|
|
13
|
-
}
|
|
14
12
|
/** Allowed params to WindowPlugin constructor (private and protected props are omited by default) */
|
|
15
13
|
export type WindowPluginInitParams<P extends keyof WindowPlugins> = PluginInitParams<P> & Omit<WindowInitParams, 'ident' | 'html'> & Partial<Omit<WindowPlugin<P>, 'open' | 'load' | 'refs' | 'node' | 'domEl'>>;
|
|
16
14
|
export declare abstract class WindowPlugin<P extends keyof WindowPlugins> extends Plugin<P> {
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
export type MapTilesKeys = 'graymap' | 'landmaskmap' | 'simplemap' | 'graymapPatch5' | 'graymapPatch11' | 'simplemapPatch5' | 'simplemapPatch9' | 'sznmap' | 'winter' | 'satLocal' | 'sat';
|
|
2
|
+
/**
|
|
3
|
+
* Last zoom level at which the gray base map is displayed.
|
|
4
|
+
* At higher zooms, outdoor map is used instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare const grayMapZoomEnd = 11;
|
|
2
7
|
/**
|
|
3
8
|
* Return just record of different map tilesURLs that we use as basemap
|
|
4
9
|
*/
|
|
5
10
|
export declare const mapTilesRecord: (patchType?: string | null) => Record<MapTilesKeys, string>;
|
|
11
|
+
export declare const baseMapLayerId = "raster-basemap";
|
|
6
12
|
/**
|
|
7
13
|
* Adds basemap to Leaflet map or updates source of tiles it if already exists
|
|
8
14
|
*/
|
|
9
|
-
export declare function addOrUpdateBasemap(
|
|
15
|
+
export declare function addOrUpdateBasemap(): void;
|
|
10
16
|
/**
|
|
11
17
|
* Remove basemap from Leaflet map
|
|
12
18
|
*/
|
|
13
|
-
export declare function removeBasemap(
|
|
19
|
+
export declare function removeBasemap(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Move basemap to a new bucket
|
|
22
|
+
*/
|
|
23
|
+
export declare function reorderBasemapLayer(newBucketId: number): void;
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module cityLabels.ts
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
export declare const add: () => void;
|
|
8
|
-
export declare const remove: () => void;
|
|
6
|
+
import LabelsLayer from '@windy/LabelsLayer';
|
|
9
7
|
export declare const disable: () => void;
|
|
10
8
|
export declare const enable: () => void;
|
|
9
|
+
export declare const cityLabels: LabelsLayer;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reusable color gradients
|
|
3
3
|
*/
|
|
4
|
-
import type { RGBString
|
|
4
|
+
import type { RGBString } from '@windy/types.d';
|
|
5
5
|
export declare const moistureAnomaly: RGBString[];
|
|
6
6
|
export declare const airPollutant: RGBString[];
|
|
7
7
|
export declare const cloudBaseAndVisibility: RGBString[];
|
|
8
|
-
export declare const radarGradientAndValues: ColorGradientString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CustomProtocol, TileDataPreprocessCallback, TransformedUrlPayload } from '@windy/mapUtils.d';
|
|
2
|
+
/**
|
|
3
|
+
* @summary Registers custom protocol to the maplibre, which tells maplibre that we would like to take responsibility for fetching these tiles
|
|
4
|
+
* - this is useful when we want to modify the original tile request url etc.
|
|
5
|
+
* - for example to inject additional parameters such as timestamp, satellite key etc., since maplibre supports only {x}/{y}/{z} parameters
|
|
6
|
+
* @param protocol Placeholder protocol (e.g. "myProtocol") which is set to the tile url instead of the standard http/https protocol and which is used by maplibre to differentiate between tiles to be intercepted
|
|
7
|
+
* @param urlTransformCallback Callback function to be called for each intercepted tile request
|
|
8
|
+
* - the provided callback should take two parameters (the current tile url and the custom protocol) and should output valid tile url or empty string in case the tile should be aborted
|
|
9
|
+
* @param usePlaceholderImage Whether to use "no-data" placeholder tile in case the original tile could not be loaded
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerCustomTileProtocol(protocol: CustomProtocol, urlTransformCallback: (url: string, protocol: string) => TransformedUrlPayload, tilePreprocessCallback?: TileDataPreprocessCallback, fallbackImageData?: ArrayBuffer, replaceEmpty?: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Texture2D } from 'plugins/
|
|
1
|
+
import type { Texture2D } from '@plugins/shared/gl-lib/gl-lib';
|
|
2
2
|
import type {
|
|
3
3
|
Mat2,
|
|
4
4
|
Mat2d,
|
|
@@ -18,10 +18,6 @@ export interface CustomError extends Error {
|
|
|
18
18
|
full?: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
// export type WebGLProgramObject = {
|
|
22
|
-
// [whatever: string]: any;
|
|
23
|
-
// };
|
|
24
|
-
|
|
25
21
|
export type UniformName = `u${string}`;
|
|
26
22
|
|
|
27
23
|
export type AttributeName = `a${string}`;
|
|
@@ -47,6 +47,7 @@ export type MetricItem =
|
|
|
47
47
|
| 'type'
|
|
48
48
|
| 'l/km²'
|
|
49
49
|
| 'W/m²'
|
|
50
|
+
| 'kW/m'
|
|
50
51
|
| 'drought'
|
|
51
52
|
| 'fwi'
|
|
52
53
|
| 'mm/h'
|
|
@@ -119,6 +120,7 @@ export interface MetricTypes {
|
|
|
119
120
|
fwi: NumberedMetric;
|
|
120
121
|
dfm10h: NumberedMetric;
|
|
121
122
|
solarpower: NumberedMetric;
|
|
123
|
+
wavePower: NumberedMetric;
|
|
122
124
|
uvindex: UVIndexMetric;
|
|
123
125
|
capAlerts: NumberedMetric;
|
|
124
126
|
turbulence: NumberedMetric;
|
|
@@ -4,27 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
Now it is better to use close coupled components, with strong type control
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
TODO: Minimize amount of these events and reduce their usage
|
|
9
8
|
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
import { Params as GlobeParams, Poi as GlobePoi } from '@plugins/globe/types.d';
|
|
13
|
-
import { ExtendedDataAndParams } from '@plugins/isolines/IsolinesCanvas2D.d';
|
|
10
|
+
|
|
14
11
|
import { Evented } from '@windy/Evented';
|
|
15
12
|
import { MetricIdent, MetricItem } from '@windy/Metric.d';
|
|
16
13
|
import { PluginIdent } from '@windy/Plugin';
|
|
17
14
|
import { NotificationPreferences } from '@windy/dataSpecifications.d';
|
|
18
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
GeolocationInfo,
|
|
17
|
+
LatLon,
|
|
18
|
+
WeatherParameters,
|
|
19
|
+
type FullRenderParameters,
|
|
20
|
+
} from '@windy/interfaces.d';
|
|
19
21
|
import { PluginSource, PluginsOpenParams, PluginsQsParams } from '@windy/plugin-params.d';
|
|
20
22
|
import { Plugins } from '@windy/plugins.d';
|
|
21
23
|
import { Pois } from '@windy/rootScope.d';
|
|
22
24
|
import type { ExternalPluginIdent } from '@windy/types';
|
|
23
|
-
import type {
|
|
24
|
-
import type { AnimationOptions, FitBoundsOptions, LngLatBoundsLike } from '@windycom/maplibre-gl';
|
|
25
|
-
import type { ViewportBounds } from '@plugins/_shared/maplibre/utils/maplibreUtils';
|
|
25
|
+
import type { ZoomOptions } from '@leafletGl';
|
|
26
26
|
import type { RadarPlusLayer } from '@plugins/radar-plus/types';
|
|
27
|
-
import type { ParsedStartupValues } from '
|
|
27
|
+
import type { ParsedStartupValues } from '@windy/router';
|
|
28
|
+
import type { ParsLocation as GlobeParsLocation } from '@plugins/globe/main/receiver.d';
|
|
29
|
+
import type { Params as GlobeParams, Poi as GlobePoi } from '@plugins/globe/types.d';
|
|
30
|
+
import type { ExtendedDataAndParams } from '@plugins/isolines/IsolinesCanvas2D.d';
|
|
28
31
|
|
|
29
32
|
type BcastTypesNonGeneric = {
|
|
30
33
|
/**
|
|
@@ -104,14 +107,18 @@ export interface BasicBcastTypes<T extends keyof Plugins> {
|
|
|
104
107
|
*/
|
|
105
108
|
metricChanged: [MetricIdent | undefined, MetricItem | undefined];
|
|
106
109
|
|
|
107
|
-
/** Indicates that user added,
|
|
110
|
+
/** Indicates that user added, removed or rename his fav */
|
|
108
111
|
favChanged: [];
|
|
109
112
|
|
|
110
|
-
/** Indicates that user added,
|
|
113
|
+
/** Indicates that user added, removed or rename his alert */
|
|
111
114
|
alertChanged: [];
|
|
112
115
|
|
|
116
|
+
/** Indicates that user added or removed external plugin */
|
|
117
|
+
externalPluginChanged: [];
|
|
118
|
+
|
|
113
119
|
/**
|
|
114
|
-
* Indicates
|
|
120
|
+
* Indicates that router has parsed new route,
|
|
121
|
+
* used to trigger opening plugins based on url
|
|
115
122
|
*/
|
|
116
123
|
routerParsed: [PluginIdent | ExternalPluginIdent | void, ParsedStartupValues | undefined];
|
|
117
124
|
|
|
@@ -137,28 +144,13 @@ export interface BasicBcastTypes<T extends keyof Plugins> {
|
|
|
137
144
|
/** @ignore */ 'globe-zoomOut': [[number, number] | null] | [];
|
|
138
145
|
/** @ignore */ 'globe-paramsChanged': [GlobeParams];
|
|
139
146
|
|
|
140
|
-
/** @ignore */ '
|
|
141
|
-
/** @ignore */ '
|
|
142
|
-
/** @ignore */ '
|
|
147
|
+
/** @ignore */ 'leafletGl-zoomIn': [number | undefined, ZoomOptions | undefined];
|
|
148
|
+
/** @ignore */ 'leafletGl-zoomOut': [number | undefined, ZoomOptions | undefined];
|
|
149
|
+
/** @ignore */ 'leafletGl-paramsChanged': [
|
|
143
150
|
WeatherParameters,
|
|
144
151
|
keyof WeatherParameters | undefined,
|
|
145
152
|
];
|
|
146
153
|
|
|
147
|
-
/** @ignore */ 'maplibre-zoomIn': [AnimationOptions | undefined, unknown | undefined];
|
|
148
|
-
/** @ignore */ 'maplibre-zoomOut': [AnimationOptions | undefined, unknown | undefined];
|
|
149
|
-
/** @ignore */ 'maplibre-setZoom': [number, unknown | undefined];
|
|
150
|
-
/** @ignore */ 'maplibre-centerMap': [CenterOptions];
|
|
151
|
-
/** @ignore */ 'maplibre-triggerDragging': [boolean];
|
|
152
|
-
/** @ignore */ 'maplibre-fitBounds': [LngLatBoundsLike, FitBoundsOptions | undefined];
|
|
153
|
-
/** @ignore */ 'maplibre-panToOffset': [number, number, number];
|
|
154
|
-
/** @ignore */ 'maplibre-ensurePointVisibleY': [number, number, number];
|
|
155
|
-
/** @ignore */ 'maplibre-moveEnd': [];
|
|
156
|
-
/** @ignore */ 'maplibre-zoomChange': [number];
|
|
157
|
-
/** @ignore */ 'maplibre-boundsChange': [ViewportBounds];
|
|
158
|
-
/** @ignore */ 'maplibre-paramsChanged': [
|
|
159
|
-
WeatherParameters,
|
|
160
|
-
keyof WeatherParameters | undefined,
|
|
161
|
-
];
|
|
162
154
|
/** @ignore */ 'radarPlus-open-layer': [RadarPlusLayer, boolean | undefined]; // Layer to open, whether to open layer for color editing
|
|
163
155
|
/** @ignore */ detailClose: [];
|
|
164
156
|
/** @ignore */ detailRendered: []; // used only in embed indicates that detail is ready
|
|
@@ -175,11 +167,15 @@ export interface BasicBcastTypes<T extends keyof Plugins> {
|
|
|
175
167
|
/** @ignore */ loadingFailed: [string];
|
|
176
168
|
/** @ignore */ zoomIn: [];
|
|
177
169
|
/** @ignore */ zoomOut: [];
|
|
178
|
-
/** @ignore */ userReloadInfo: [];
|
|
179
170
|
/** @ignore */ showSocialError: [string];
|
|
180
|
-
/** @ignore */ openCapAlerts: [PluginsOpenParams['picker']];
|
|
181
171
|
/** @ignore */ openapp: [];
|
|
182
172
|
/** @ignore */ openSearch: [];
|
|
173
|
+
/** @ignore */ renderersUpdated: []; // Fired once all renderers have had their params updated.
|
|
174
|
+
/** @ignore */ tileLayerParamsChanged: [FullRenderParameters];
|
|
175
|
+
/** @ignore */ glContextLost: [];
|
|
176
|
+
/** @ignore */ glContextRestored: [];
|
|
177
|
+
/** @ignore */ glRestoreContext: [];
|
|
178
|
+
/** @ignore */ glLoseContext: [];
|
|
183
179
|
}
|
|
184
180
|
|
|
185
181
|
interface BcastTypes<T extends keyof Plugins> extends BcastTypesNonGeneric, BasicBcastTypes<T> {}
|
|
@@ -29,18 +29,20 @@ import {
|
|
|
29
29
|
UsedMapLibrary,
|
|
30
30
|
UserInterest,
|
|
31
31
|
type ISOCountryCode,
|
|
32
|
+
type AnimationSpeed,
|
|
32
33
|
} from '@windy/types.d';
|
|
33
34
|
|
|
34
35
|
import { MetricItem } from '@windy/Metric.d';
|
|
35
36
|
|
|
36
37
|
import type { LoginAndFinishAction, User } from '@windy/user.d';
|
|
37
38
|
|
|
38
|
-
import type { SubscriptionInfo } from '@plugins/
|
|
39
|
-
import type RadarCalendar from '@plugins/radar/calendar/
|
|
40
|
-
import type SatelliteCalendar from '@plugins/
|
|
39
|
+
import type { SubscriptionInfo } from '@plugins/shared/subscription-services/subscription-services.d';
|
|
40
|
+
import type RadarCalendar from '@plugins/radar-plus/calendar/radarCalendar';
|
|
41
|
+
import type { SatelliteCalendar } from '@plugins/radar-plus/calendar/satelliteCalendar';
|
|
41
42
|
import type { NumberRange } from '@windy/alerts.d';
|
|
42
43
|
import type { FavType } from '@windy/favs.d';
|
|
43
|
-
import type
|
|
44
|
+
import type { Range } from '@plugins/shared/radsat/context';
|
|
45
|
+
import type { TiledPoiClasses } from '@plugins/poi-libs/poi-libs.d';
|
|
44
46
|
|
|
45
47
|
/**
|
|
46
48
|
* Custom animation particles settings
|
|
@@ -158,11 +160,16 @@ export interface DataSpecificationsObject<T> {
|
|
|
158
160
|
* This so far does not do anything, it's merely a flag for developer
|
|
159
161
|
*/
|
|
160
162
|
readOnly?: boolean;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* This item can be used by Premium only users. Free users get always default value,
|
|
166
|
+
* so additional checks before using store.get('item') are not necessary.
|
|
167
|
+
*/
|
|
168
|
+
premiumOnly?: boolean;
|
|
161
169
|
}
|
|
162
170
|
|
|
163
171
|
export interface FeatureFlags {
|
|
164
|
-
|
|
165
|
-
disableNewRadarPlusGui: boolean;
|
|
172
|
+
useNewGui: boolean;
|
|
166
173
|
}
|
|
167
174
|
|
|
168
175
|
/**
|
|
@@ -259,6 +266,11 @@ export interface DataSpecifications {
|
|
|
259
266
|
*/
|
|
260
267
|
animation: DataSpecificationsObject<boolean>;
|
|
261
268
|
|
|
269
|
+
/**
|
|
270
|
+
* Animation playback speed (normal = legacy speed)
|
|
271
|
+
*/
|
|
272
|
+
animationSpeed: DataSpecificationsObject<AnimationSpeed>;
|
|
273
|
+
|
|
262
274
|
/**
|
|
263
275
|
* Actual calendar (instance of `Calendar`) for selected overlay/product (if it has calendar)
|
|
264
276
|
*/
|
|
@@ -289,6 +301,11 @@ export interface DataSpecifications {
|
|
|
289
301
|
*/
|
|
290
302
|
showPickerElevation: DataSpecificationsObject<boolean>;
|
|
291
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Whether picker is being dragged
|
|
306
|
+
*/
|
|
307
|
+
pickerDragging: DataSpecificationsObject<boolean>;
|
|
308
|
+
|
|
292
309
|
/**
|
|
293
310
|
* Desired language for Windy. By default is determined by user's browser setting and set to `auto`.
|
|
294
311
|
* Use `store.getAllowed('lang')` to get list of avail langs defined in `supportedLanguages.
|
|
@@ -318,12 +335,12 @@ export interface DataSpecifications {
|
|
|
318
335
|
/**
|
|
319
336
|
* 2 letter lowercase Country Code
|
|
320
337
|
*/
|
|
321
|
-
country: DataSpecificationsObject<
|
|
338
|
+
country: DataSpecificationsObject<ISOCountryCode | 'xx'>;
|
|
322
339
|
|
|
323
340
|
/**
|
|
324
|
-
*
|
|
341
|
+
* Default units setting (computed on the first visit based on GeoIP)
|
|
325
342
|
*/
|
|
326
|
-
|
|
343
|
+
defaultUnits: DataSpecificationsObject<'unset' | 'imperial' | 'metric'>;
|
|
327
344
|
|
|
328
345
|
/**
|
|
329
346
|
* Type of map tiles map shown in detail
|
|
@@ -463,11 +480,6 @@ export interface DataSpecifications {
|
|
|
463
480
|
*/
|
|
464
481
|
detail1h: DataSpecificationsObject<boolean>;
|
|
465
482
|
|
|
466
|
-
/**
|
|
467
|
-
* Timestamp of detail's progress bar or middleFrame
|
|
468
|
-
*/
|
|
469
|
-
detailTimestamp: DataSpecificationsObject<Timestamp>;
|
|
470
|
-
|
|
471
483
|
/**
|
|
472
484
|
* Detail keeps its 10+ days expanded forecast
|
|
473
485
|
*/
|
|
@@ -508,6 +520,11 @@ export interface DataSpecifications {
|
|
|
508
520
|
*/
|
|
509
521
|
blitzSoundOn: DataSpecificationsObject<boolean>;
|
|
510
522
|
|
|
523
|
+
/**
|
|
524
|
+
* Whether to render baseLayer using tiles with thick borders
|
|
525
|
+
*/
|
|
526
|
+
showThickBorders: DataSpecificationsObject<boolean>;
|
|
527
|
+
|
|
511
528
|
/**
|
|
512
529
|
* Timestamp in ms
|
|
513
530
|
*/
|
|
@@ -524,14 +541,9 @@ export interface DataSpecifications {
|
|
|
524
541
|
radSatFlowOn: DataSpecificationsObject<boolean>;
|
|
525
542
|
|
|
526
543
|
/**
|
|
527
|
-
*
|
|
528
|
-
*/
|
|
529
|
-
satelliteExtraOn: DataSpecificationsObject<boolean>;
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* this override is needed for video capture
|
|
544
|
+
* Render precipitation type pattern on radar
|
|
533
545
|
*/
|
|
534
|
-
|
|
546
|
+
radarRenderPType: DataSpecificationsObject<boolean>;
|
|
535
547
|
|
|
536
548
|
/**
|
|
537
549
|
* Satellite/Radar archive on
|
|
@@ -548,11 +560,6 @@ export interface DataSpecifications {
|
|
|
548
560
|
*/
|
|
549
561
|
archiveRange: DataSpecificationsObject<number>;
|
|
550
562
|
|
|
551
|
-
/**
|
|
552
|
-
* Information, if startup weather box is shown or not
|
|
553
|
-
*/
|
|
554
|
-
startupWeatherShown: DataSpecificationsObject<boolean>;
|
|
555
|
-
|
|
556
563
|
/**
|
|
557
564
|
* pois layer that user selected
|
|
558
565
|
*
|
|
@@ -691,7 +698,8 @@ export interface DataSpecifications {
|
|
|
691
698
|
lastPoiLocation: DataSpecificationsObject<(LatLon & { type?: string }) | null>;
|
|
692
699
|
|
|
693
700
|
/**
|
|
694
|
-
* Picker last location
|
|
701
|
+
* Picker last location, to be consumed by location service to enhance URL
|
|
702
|
+
* Used only on desktop device
|
|
695
703
|
*/
|
|
696
704
|
pickerLocation: DataSpecificationsObject<LatLon | null>;
|
|
697
705
|
|
|
@@ -784,11 +792,6 @@ export interface DataSpecifications {
|
|
|
784
792
|
*/
|
|
785
793
|
radsatTimestamp: DataSpecificationsObject<Timestamp>;
|
|
786
794
|
|
|
787
|
-
/**
|
|
788
|
-
* RadarPlus calendar
|
|
789
|
-
*/
|
|
790
|
-
radarPlusCalendar: DataSpecificationsObject<RadarPlusCalendar | null>;
|
|
791
|
-
|
|
792
795
|
/**
|
|
793
796
|
* Display this type of WX stations on POI map
|
|
794
797
|
* @ignore
|
|
@@ -844,11 +847,6 @@ export interface DataSpecifications {
|
|
|
844
847
|
*/
|
|
845
848
|
rhMenuArrangeMode: DataSpecificationsObject<boolean>;
|
|
846
849
|
|
|
847
|
-
/*
|
|
848
|
-
* If startup widgets should persist
|
|
849
|
-
*/
|
|
850
|
-
persistentWidgets: DataSpecificationsObject<boolean>;
|
|
851
|
-
|
|
852
850
|
/**
|
|
853
851
|
* List of interests user has, based on onboarding picker
|
|
854
852
|
*/
|
|
@@ -877,7 +875,7 @@ export interface DataSpecifications {
|
|
|
877
875
|
*/
|
|
878
876
|
pushNotificationsReady: DataSpecificationsObject<boolean>;
|
|
879
877
|
|
|
880
|
-
|
|
878
|
+
/*
|
|
881
879
|
* Feature flags to enable/disable features without the need to re-release the client
|
|
882
880
|
*/
|
|
883
881
|
featureFlags: DataSpecificationsObject<FeatureFlags>;
|
|
@@ -894,14 +892,34 @@ export interface DataSpecifications {
|
|
|
894
892
|
advancedDebugConsole: DataSpecificationsObject<boolean>;
|
|
895
893
|
|
|
896
894
|
/**
|
|
897
|
-
*
|
|
895
|
+
* Active tab in pin menu (fav-layers plugin)
|
|
896
|
+
*/
|
|
897
|
+
pinMenuActiveTab: DataSpecificationsObject<'models' | 'layers'>;
|
|
898
|
+
|
|
899
|
+
/*
|
|
900
|
+
* Range of the currently used segment
|
|
901
|
+
*/
|
|
902
|
+
radarPlusSegmentRange: DataSpecificationsObject<Range>;
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Whether the debug performance overlay (frametimes & FPS) is enabled (DEBUG type setting)
|
|
906
|
+
*/
|
|
907
|
+
perfOverlayEnabled: DataSpecificationsObject<boolean>;
|
|
908
|
+
|
|
909
|
+
/*
|
|
910
|
+
* Instance of TIlePoi, that is used to display POIs
|
|
898
911
|
*/
|
|
899
|
-
|
|
912
|
+
tiledPoiLayer: DataSpecificationsObject<TiledPoiClasses | null>;
|
|
900
913
|
|
|
901
914
|
/**
|
|
902
|
-
*
|
|
915
|
+
* Whether to multisample pType composite when rendering pType (to smooth-out transition between precipitation categories)
|
|
903
916
|
*/
|
|
904
|
-
|
|
917
|
+
pTypeMultiSampled: DataSpecificationsObject<boolean>;
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Whether to DEBUG airport related stuff
|
|
921
|
+
*/
|
|
922
|
+
airportDebugMode: DataSpecificationsObject<boolean>;
|
|
905
923
|
}
|
|
906
924
|
|
|
907
925
|
/**
|