@windycom/plugin-devtools 3.0.1 → 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/README.md +1 -0
- package/package.json +1 -1
- package/types/client/Calendar.d.ts +104 -70
- package/types/client/Color.d.ts +25 -5
- package/types/client/DataTiler.d.ts +2 -2
- package/types/client/EcmwfProduct.d.ts +22 -0
- 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 +96 -26
- package/types/client/LayerClasses.d.ts +5 -0
- package/types/client/Metric.d.ts +31 -46
- package/types/client/MetricClasses.d.ts +1 -1
- package/types/client/Overlay.d.ts +5 -12
- package/types/client/OverlayClasses.d.ts +8 -0
- package/types/client/Particles.d.ts +1 -1
- package/types/client/Product.d.ts +38 -67
- package/types/client/ProductClasses.d.ts +51 -0
- package/types/client/RadarPlusProduct.d.ts +1 -1
- package/types/client/Renderer.d.ts +44 -19
- package/types/client/SatelliteProduct.d.ts +1 -1
- package/types/client/ShaderStorage.d.ts +25 -0
- package/types/client/StartupElementPlugin.d.ts +8 -0
- package/types/client/SveltePlugin.d.ts +5 -5
- package/types/client/SwitchableTileCache.d.ts +104 -0
- package/types/client/TileLayer.d.ts +12 -3
- 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 +4 -4
- package/types/client/WindowPlugin.d.ts +7 -6
- package/types/client/appsFlyer.d.ts +2 -1
- 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 +4 -10
- package/types/client/colors.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 +23 -2
- package/types/client/d.ts.files/alerts.d.ts +1 -0
- package/types/client/d.ts.files/broadcast.d.ts +31 -35
- package/types/client/d.ts.files/dataSpecifications.d.ts +82 -66
- package/types/client/d.ts.files/favs.d.ts +7 -18
- package/types/client/d.ts.files/glUtils.d.ts +71 -0
- package/types/client/d.ts.files/http.d.ts +4 -4
- package/types/client/d.ts.files/interpolatorTypes.d.ts +5 -5
- package/types/client/d.ts.files/lib.d.ts +1 -2
- 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 +46 -24
- package/types/client/d.ts.files/plugins.d.ts +44 -31
- package/types/client/d.ts.files/rootScope.d.ts +2 -0
- 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/d.ts.files/webcams.d.ts +9 -2
- package/types/client/dataLoader.d.ts +2 -2
- package/types/client/detectDevice.d.ts +3 -0
- package/types/client/embed.d.ts +2 -7
- package/types/client/errorLogger.d.ts +20 -1
- package/types/client/externalPlugins.d.ts +5 -1
- package/types/client/fetch.d.ts +62 -5
- package/types/client/format.d.ts +12 -0
- package/types/client/glContextUtils.d.ts +9 -0
- package/types/client/glStatus.d.ts +7 -0
- package/types/client/glTileRender.d.ts +1 -7
- 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 +118 -13
- package/types/client/landLayer.d.ts +3 -0
- package/types/client/layers.d.ts +5 -2
- package/types/client/legends.d.ts +1 -1
- package/types/client/lib.d.ts +11 -21
- package/types/client/liveAlerts.d.ts +2 -2
- package/types/client/location.d.ts +1 -1
- package/types/client/map.d.ts +94 -15
- package/types/client/mapUtils.d.ts +66 -0
- package/types/client/math.d.ts +14 -0
- package/types/client/mobile.d.ts +16 -41
- package/types/client/mobileUtils.d.ts +10 -0
- package/types/client/models.d.ts +2 -6
- package/types/client/overlays.d.ts +4 -3
- package/types/client/particleRenderers.d.ts +1 -1
- package/types/client/picker.d.ts +4 -8
- package/types/client/plugins.d.ts +0 -4
- package/types/client/products.d.ts +53 -2
- package/types/client/promo.d.ts +28 -5
- package/types/client/pushNotifications.d.ts +19 -1
- package/types/client/renderCtrl.d.ts +1 -1
- package/types/client/renderTile.d.ts +2 -2
- package/types/client/renderUtils.d.ts +21 -27
- package/types/client/renderers.d.ts +6 -9
- package/types/client/reverseName.d.ts +2 -1
- package/types/client/rhMessage.d.ts +1 -1
- package/types/client/rootScope.d.ts +17 -9
- package/types/client/router.d.ts +41 -9
- package/types/client/seoParser.d.ts +35 -0
- package/types/client/showableErrorsService.d.ts +10 -6
- 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/store.d.ts +20 -52
- 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/tileInterpolator.d.ts +1 -1
- 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/userAlerts.d.ts +0 -4
- package/types/client/userConsent.d.ts +0 -2
- package/types/client/userFavs.d.ts +17 -12
- package/types/client/utils.d.ts +78 -25
- package/types/client/utils.test.d.ts +1 -0
- package/types/iconfont.d.ts +2 -5
- package/types/interfaces.d.ts +290 -88
- package/types/lang-files.d.ts +578 -98
- package/types/leaflet-gl.d.ts +12773 -0
- package/types/types.d.ts +323 -11
- package/types/client/d.ts.files/Calendar.d.ts +0 -96
- package/types/client/d.ts.files/CanvasLayer.d.ts +0 -70
- package/types/client/d.ts.files/Color.d.ts +0 -94
- 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/Layer.d.ts +0 -191
- package/types/client/d.ts.files/PoisOverlay.d.ts +0 -27
- package/types/client/d.ts.files/Renderer.d.ts +0 -44
- package/types/client/d.ts.files/TileLayerCanvas.d.ts +0 -78
- package/types/client/d.ts.files/TileLayerMultiPatch.d.ts +0 -13
- package/types/client/d.ts.files/products.d.ts +0 -60
- package/types/client/imaker.d.ts +0 -112
- package/types/offline.d.ts +0 -100
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared rendering utilities (and also event
|
|
2
|
+
* Shared rendering utilities (and also event emitter for rendering purposes)
|
|
3
3
|
*/
|
|
4
4
|
import { Evented } from '@windy/Evented';
|
|
5
5
|
import type { Color } from '@windy/Color';
|
|
6
|
-
import type { Layer } from '@windy/Layer';
|
|
7
|
-
import type { FullRenderParameters } from '@windy/Layer.d';
|
|
8
6
|
import type { DataQuality } from '@windy/Product';
|
|
9
|
-
import type { TileParams } from '@windy/Renderer
|
|
10
|
-
import type { TilePoint } from '@windy/interfaces.d';
|
|
7
|
+
import type { TileParams } from '@windy/Renderer';
|
|
8
|
+
import type { TilePoint, FullRenderParameters, WeatherParameters } from '@windy/interfaces.d';
|
|
11
9
|
interface Events {
|
|
12
10
|
rendered: ['particles' | 'isolines' | 'map' | 'radar' | 'satellite' | 'tileLayer'];
|
|
13
11
|
glParticlesFailed: [];
|
|
14
12
|
toggleSeaMask: [boolean];
|
|
15
13
|
toggleLandMask: [boolean];
|
|
14
|
+
toggleLandSeaMaskColored: [boolean];
|
|
15
|
+
updateStateChange: ['move' | 'time'];
|
|
16
|
+
tileLayerRendererInitialized: [];
|
|
17
|
+
contextLost: [];
|
|
18
|
+
contextRestored: [];
|
|
16
19
|
}
|
|
17
20
|
export declare const emitter: Evented<Events>;
|
|
21
|
+
import type { Timestamp } from '@windy/types';
|
|
22
|
+
import type { Layers } from '@windy/Layer';
|
|
18
23
|
/**
|
|
19
24
|
* Zoom2zoom transformation table
|
|
20
25
|
*
|
|
21
|
-
* Maximal
|
|
26
|
+
* Maximal zoom levels:
|
|
22
27
|
*
|
|
23
28
|
* GFS 0, 1, 2
|
|
24
29
|
* ECMWF 0, 1, 2, 3
|
|
25
|
-
* NAM/
|
|
30
|
+
* NAM/MB EUROPE 0, 1, 2, 3, 4, 5
|
|
26
31
|
*
|
|
27
32
|
* WARNING: Minimal dataZoom for map zooms 10,11 is 3 since
|
|
28
|
-
* maximal amount of data -> pixel
|
|
33
|
+
* maximal amount of data -> pixel transition ratio is 256 !!!
|
|
29
34
|
*
|
|
30
35
|
* NOTE: particles don't work for zoom 0 on -180/180 border ("low" map zooms 3 & 4 changed to data zoom 1)
|
|
31
36
|
*/
|
|
@@ -35,7 +40,7 @@ export declare const zoom2zoom: Record<DataQuality, number[]>;
|
|
|
35
40
|
*/
|
|
36
41
|
export declare const tileW: (zoom: number) => number;
|
|
37
42
|
/**
|
|
38
|
-
*
|
|
43
|
+
* Return transformation ratio based on map zoom and data zoom
|
|
39
44
|
*/
|
|
40
45
|
export declare const getTrans: (mapZoom: number, dZoom: number) => number;
|
|
41
46
|
/**
|
|
@@ -50,7 +55,7 @@ export declare const getDataZoom: (params: FullRenderParameters, tileZoom: numbe
|
|
|
50
55
|
export declare const whichTile: (tilePoint: TilePoint, params: FullRenderParameters) => TileParams | null;
|
|
51
56
|
/**
|
|
52
57
|
* Test that values in blue channel are bigger than X,
|
|
53
|
-
* which means
|
|
58
|
+
* which means transparency for this point in JPG data tile
|
|
54
59
|
*/
|
|
55
60
|
export declare const testJPGtransparency: (source: Uint8ClampedArray, sourceIndex: number) => boolean;
|
|
56
61
|
/**
|
|
@@ -80,28 +85,17 @@ export declare const getWTable: (trans: number) => Uint16Array | null;
|
|
|
80
85
|
export type ColorizingFun = (x: number, y: number, scalar: number) => void;
|
|
81
86
|
/**
|
|
82
87
|
* Create function for colorizing x,y, point in step x step area
|
|
83
|
-
*
|
|
88
|
+
* Allowed values of step are 1,2
|
|
84
89
|
* Colorizes only for 256x256 tiles
|
|
85
90
|
*/
|
|
86
91
|
export declare const createFillFun: (dest: Uint8ClampedArray, step: 1 | 2, col: Color) => ColorizingFun;
|
|
87
|
-
export type CombinedColorizingFun = (x: number, y: number, value1: number, value2: number) => void;
|
|
88
92
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* Amount can be 0..4
|
|
92
|
-
*
|
|
93
|
-
* [1,2]
|
|
94
|
-
* [3,4]
|
|
95
|
-
*/
|
|
96
|
-
export declare const createCombinedFillFun: (dest: Uint8ClampedArray, c1: Color, c2: Color, amountFun: Layer['getAmountByColor']) => CombinedColorizingFun;
|
|
97
|
-
/**
|
|
98
|
-
* Reusable 256x256 image data object
|
|
99
|
-
* WARNING: Watch concurency,only one task can use this
|
|
93
|
+
* Interpolates to nearest discreet value either by using interpolation table
|
|
94
|
+
* or a,b,c,d coefficients
|
|
100
95
|
*/
|
|
101
|
-
export declare const
|
|
96
|
+
export declare const interpolateNearest: (w: number[] | null, wIndex: number, G00: number, G01: number, G10: number, G11: number, a: number, b: number, c: number, d: number) => number;
|
|
102
97
|
/**
|
|
103
|
-
*
|
|
104
|
-
* or a,b,c,d coefs
|
|
98
|
+
* Creates RenderingParameters
|
|
105
99
|
*/
|
|
106
|
-
export declare const
|
|
100
|
+
export declare const createFullRenderingParams: (layerIdent: Layers, weatherParams: WeatherParameters, timestamp: Timestamp) => Promise<FullRenderParameters>;
|
|
107
101
|
export {};
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { Renderer } from '@windy/Renderer';
|
|
2
|
-
import { TopoMap } from '@windy/TopoMap';
|
|
3
2
|
import { TileLayer } from '@windy/TileLayer';
|
|
3
|
+
import { TopoMap } from '@windy/TopoMap';
|
|
4
4
|
declare const renderers: {
|
|
5
5
|
/**
|
|
6
6
|
* All layers should be now supported by gl-tiles-render
|
|
7
|
-
* Original tileLayer and patternator rendering ('legacy-tile-render')
|
|
8
|
-
* is used as backup (or when "Compatibility mode" is active)
|
|
9
7
|
*/
|
|
10
8
|
tileLayer: TileLayer;
|
|
11
9
|
noUserControl: TileLayer;
|
|
12
|
-
radar: Renderer
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
particles: Renderer<"gl-particles", typeof import("../../plugins/gl-particles/gl-particles")> | Renderer<"particles", typeof import("../../plugins/particles/particles")>;
|
|
10
|
+
radar: Renderer;
|
|
11
|
+
radarPlus: Renderer;
|
|
12
|
+
capAlerts: Renderer;
|
|
13
|
+
isolines: Renderer;
|
|
14
|
+
particles: Renderer;
|
|
18
15
|
/** Extreme forecast and intersucho layers */
|
|
19
16
|
daySwitcher: TileLayer;
|
|
20
17
|
accumulations: TileLayer;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ReverseResult } from '@windy/dataSpecifications.d';
|
|
2
2
|
import type { LatLon } from '@windy/interfaces.d';
|
|
3
|
+
import type { ISOCountryCode } from '@windy/types';
|
|
3
4
|
export interface ReverseHttpPayload<IncludeIds extends boolean = false> {
|
|
4
5
|
city?: string;
|
|
5
6
|
country?: string;
|
|
6
|
-
country_code?:
|
|
7
|
+
country_code?: ISOCountryCode;
|
|
7
8
|
county?: string;
|
|
8
9
|
district?: string;
|
|
9
10
|
locality?: string;
|
|
@@ -4,12 +4,12 @@ import type { LoadedTranslations } from './d.ts.files/types';
|
|
|
4
4
|
* Version of Windy.com client (as taken from package.json)
|
|
5
5
|
* @ignore
|
|
6
6
|
*/
|
|
7
|
-
export declare const version:
|
|
7
|
+
export declare const version: `${number}.${number}.${number}`;
|
|
8
8
|
/**
|
|
9
9
|
* Target
|
|
10
10
|
* @ignore
|
|
11
11
|
*/
|
|
12
|
-
export declare const target: "
|
|
12
|
+
export declare const target: "index" | "embed" | "mobile" | "lib";
|
|
13
13
|
/**
|
|
14
14
|
* Platform
|
|
15
15
|
* @ignore
|
|
@@ -43,7 +43,7 @@ export declare const setNodeServer: (value: string) => void;
|
|
|
43
43
|
* Map tile server
|
|
44
44
|
* @ignore
|
|
45
45
|
*/
|
|
46
|
-
export declare const tileServer
|
|
46
|
+
export declare const tileServer = "<!-- @echo TILES_HOST -->";
|
|
47
47
|
/**
|
|
48
48
|
* Community forum DO NOT PUT TRAILING "/" TO THE URL
|
|
49
49
|
* @ignore
|
|
@@ -69,7 +69,7 @@ export declare const iconsDir = "<!-- @echo IMG_RELATIVE_PATH -->/icons7";
|
|
|
69
69
|
/**
|
|
70
70
|
* List of valid overlay identifiers
|
|
71
71
|
*/
|
|
72
|
-
export declare const overlays: readonly ["radar", "satellite", "
|
|
72
|
+
export declare const overlays: readonly ["radar", "satellite", "wind", "gust", "gustAccu", "turbulence", "icing", "rain", "rainAccu", "snowAccu", "snowcover", "ptype", "thunder", "temp", "dewpoint", "rh", "deg0", "wetbulbtemp", "solarpower", "uvindex", "clouds", "hclouds", "mclouds", "lclouds", "fog", "cloudtop", "cbase", "visibility", "cape", "ccl", "waves", "swell1", "swell2", "swell3", "wwaves", "sst", "currents", "currentsTide", "wavePower", "aqi", "no2", "pm2p5", "aod550", "gtco3", "tcso2", "go3", "cosc", "dustsm", "pressure", "efiTemp", "efiWind", "efiRain", "capAlerts", "soilMoisture40", "soilMoisture100", "moistureAnom40", "moistureAnom100", "drought40", "drought100", "fwi", "dfm10h", "heatmaps", "topoMap", "hurricanes", "radarPlus"];
|
|
73
73
|
/**
|
|
74
74
|
* Identifier of products that cover only certain area
|
|
75
75
|
*/
|
|
@@ -77,7 +77,7 @@ export declare const localProducts: readonly ["nems", "namConus", "namHawaii", "
|
|
|
77
77
|
/**
|
|
78
78
|
* Identifiers of global products
|
|
79
79
|
*/
|
|
80
|
-
export declare const globalProducts: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "capAlerts", "cams", "efi", "satellite", "
|
|
80
|
+
export declare const globalProducts: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "capAlerts", "cams", "efi", "satellite", "cmems", "drought", "fireDanger", "activeFires", "topoMap"];
|
|
81
81
|
/**
|
|
82
82
|
* Identifiers of sea products
|
|
83
83
|
*/
|
|
@@ -93,7 +93,7 @@ export declare const airQualityProducts: readonly ["cams", "camsEu"];
|
|
|
93
93
|
/**
|
|
94
94
|
* identifiers of local products, that have point forecast
|
|
95
95
|
*/
|
|
96
|
-
export declare const localPointProducts: readonly ["namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "czeAladin", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves"];
|
|
96
|
+
export declare const localPointProducts: readonly ["namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "czeAladin", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves", "camsEu"];
|
|
97
97
|
/**
|
|
98
98
|
* Identifiers of global products, that have point forecast
|
|
99
99
|
*/
|
|
@@ -101,11 +101,15 @@ export declare const globalPointProducts: readonly ["gfs", "ecmwf", "icon", "mbl
|
|
|
101
101
|
/**
|
|
102
102
|
* Identifiers of all land products combined
|
|
103
103
|
*/
|
|
104
|
-
export declare const products: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "capAlerts", "cams", "efi", "satellite", "
|
|
104
|
+
export declare const products: readonly ["gfs", "ecmwf", "ecmwfAnalysis", "radar", "ecmwfWaves", "gfsWaves", "icon", "capAlerts", "cams", "efi", "satellite", "cmems", "drought", "fireDanger", "activeFires", "topoMap", "nems", "namConus", "namHawaii", "namAlaska", "iconEu", "iconD2", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "camsEu", "czeAladin", "iconEuWaves", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves", "cams", "camsEu", "mblue"];
|
|
105
105
|
/**
|
|
106
106
|
* Identifiers of all point products combines
|
|
107
107
|
*/
|
|
108
|
-
export declare const pointProducts: readonly ["gfs", "ecmwf", "icon", "mblue", "namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "czeAladin", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves"];
|
|
108
|
+
export declare const pointProducts: readonly ["gfs", "ecmwf", "icon", "mblue", "namConus", "namHawaii", "namAlaska", "iconD2", "iconEu", "iconEuWaves", "arome", "aromeAntilles", "aromeFrance", "aromeReunion", "canHrdps", "canRdwpsWaves", "czeAladin", "hrrrAlaska", "hrrrConus", "bomAccess", "bomAccessAd", "bomAccessBn", "bomAccessDn", "bomAccessNq", "bomAccessPh", "bomAccessSy", "bomAccessVt", "ukv", "jmaMsm", "jmaCwmWaves", "camsEu"];
|
|
109
|
+
/**
|
|
110
|
+
* Point products that have air point forecast
|
|
111
|
+
*/
|
|
112
|
+
export declare const airPointProducts: ("icon" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeFrance" | "aromeReunion" | "canHrdps" | "canRdwpsWaves" | "camsEu" | "czeAladin" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "bomAccessAd" | "bomAccessBn" | "bomAccessDn" | "bomAccessNq" | "bomAccessPh" | "bomAccessSy" | "bomAccessVt" | "ukv" | "jmaMsm" | "jmaCwmWaves" | "gfs" | "ecmwf" | "mblue")[];
|
|
109
113
|
/**
|
|
110
114
|
* IndicatesIndicates that that browsing device is mobile
|
|
111
115
|
*/
|
|
@@ -146,7 +150,7 @@ export declare const maxFavPoisDesktop = 7;
|
|
|
146
150
|
* Valid POI layers, their name and icon
|
|
147
151
|
* @ignore this will crash Markdown parser
|
|
148
152
|
*/
|
|
149
|
-
export declare const pois: Record<string, [keyof LoadedTranslations
|
|
153
|
+
export declare const pois: Record<string, [keyof LoadedTranslations, Iconfont]>;
|
|
150
154
|
/**
|
|
151
155
|
* List of valid isoline identifiers
|
|
152
156
|
* @ignore this will crash Markdown parser
|
|
@@ -157,3 +161,7 @@ export declare const isolinesType: readonly ["pressure", "gh", "temp", "deg0"];
|
|
|
157
161
|
* TODO: Mobile apps have probably different location
|
|
158
162
|
*/
|
|
159
163
|
export declare const pluginsLocation: string;
|
|
164
|
+
export declare const pollenProducts: Record<string, [
|
|
165
|
+
longTranslation: keyof LoadedTranslations,
|
|
166
|
+
shortTranslation: keyof LoadedTranslations
|
|
167
|
+
]>;
|
package/types/client/router.d.ts
CHANGED
|
@@ -1,10 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { PluginIdent } from '@windy/Plugin';
|
|
2
|
+
import type { Coords, PickerCoords } from '@windy/interfaces.d';
|
|
3
|
+
import type { Overlays, Products } from '@windy/rootScope.d';
|
|
4
|
+
import type { ExternalPluginIdent, ParsedQueryString } from '@windy/types';
|
|
5
|
+
export type ParsedStartupValues = {
|
|
6
|
+
sharedCoords: Coords | null;
|
|
7
|
+
pickerCoords: PickerCoords | null;
|
|
8
|
+
overlay: Overlays | null;
|
|
9
|
+
product: Products | null;
|
|
10
|
+
hideStartupWeather?: boolean;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Parse URL to plugin and its parameters (if any)
|
|
14
|
+
*
|
|
15
|
+
* While the method is async, for internal plugins it is not awaited, and
|
|
16
|
+
* only external plugins are awaited.
|
|
17
|
+
*
|
|
18
|
+
* @returns ident of matched plugin for purpose of stats
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveRoute(purl: string, source: 'url' | 'back-button', parsedQs?: ParsedQueryString): Promise<PluginIdent | ExternalPluginIdent | void>;
|
|
21
|
+
/**
|
|
22
|
+
* Parse search part of the URL
|
|
23
|
+
* eg: https://www.windy.com/?overlay,level,lat,lon,zoom,marker
|
|
24
|
+
* lat,lon,zoom are obligatory and must go always together
|
|
25
|
+
* All other params are optional and can be in any order
|
|
26
|
+
* WARNING: This method has thousands of side effects!!
|
|
27
|
+
*
|
|
28
|
+
* @param searchQuery Search part of the URL, eg: lat,lon,zoom,marker
|
|
29
|
+
* @returns Coordinates from the URL (if any) and coordinates of the picker (if any)
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseSearch(searchQuery: string | undefined): ParsedStartupValues | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Parsed items from URL
|
|
34
|
+
*/
|
|
35
|
+
export declare const sharedCoords: Coords;
|
|
36
|
+
/**
|
|
37
|
+
* The app was launched by widget or notification, so we should hide
|
|
38
|
+
* the startup weather
|
|
39
|
+
*/
|
|
40
|
+
export declare const hideStartupWeather: boolean;
|
|
41
|
+
export declare const parsedOverlay: "pressure" | "visibility" | "radar" | "satellite" | "wind" | "gust" | "gustAccu" | "turbulence" | "icing" | "rain" | "rainAccu" | "snowAccu" | "snowcover" | "ptype" | "thunder" | "temp" | "dewpoint" | "rh" | "deg0" | "wetbulbtemp" | "solarpower" | "uvindex" | "clouds" | "hclouds" | "mclouds" | "lclouds" | "fog" | "cloudtop" | "cbase" | "cape" | "ccl" | "waves" | "swell1" | "swell2" | "swell3" | "wwaves" | "sst" | "currents" | "currentsTide" | "wavePower" | "aqi" | "no2" | "pm2p5" | "aod550" | "gtco3" | "tcso2" | "go3" | "cosc" | "dustsm" | "efiTemp" | "efiWind" | "efiRain" | "capAlerts" | "soilMoisture40" | "soilMoisture100" | "moistureAnom40" | "moistureAnom100" | "drought40" | "drought100" | "fwi" | "dfm10h" | "heatmaps" | "topoMap" | "hurricanes" | "radarPlus";
|
|
42
|
+
export declare const parsedProduct: "icon" | "radar" | "satellite" | "capAlerts" | "topoMap" | "nems" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeFrance" | "aromeReunion" | "canHrdps" | "canRdwpsWaves" | "camsEu" | "czeAladin" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "bomAccessAd" | "bomAccessBn" | "bomAccessDn" | "bomAccessNq" | "bomAccessPh" | "bomAccessSy" | "bomAccessVt" | "ukv" | "jmaMsm" | "jmaCwmWaves" | "gfs" | "ecmwf" | "ecmwfAnalysis" | "ecmwfWaves" | "gfsWaves" | "cams" | "efi" | "cmems" | "drought" | "fireDanger" | "activeFires" | "mblue";
|
|
@@ -1,5 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # seoParser
|
|
3
|
+
*
|
|
4
|
+
* The main purpose of this module is to parse the SEO related part of URL.
|
|
5
|
+
*
|
|
6
|
+
* Examples of SEO URLs:
|
|
7
|
+
*
|
|
8
|
+
* ## https://www.windy.com/cs/... (case [1])
|
|
9
|
+
* SEO language, used in @module trans Must be followed by string
|
|
10
|
+
*
|
|
11
|
+
* ## https://www.windy.com/-Name-Whatever-overlay (case [2])
|
|
12
|
+
* SEO Name of Overlay
|
|
13
|
+
*
|
|
14
|
+
* ## https://www.windy.com/-Name-Whatever/... (case [3])
|
|
15
|
+
* SEO NAME of plugin name, followed by any other string
|
|
16
|
+
*
|
|
17
|
+
* Remember that numbers are not allowed at the beginning of the URL, to distinguish
|
|
18
|
+
* any URL from detail.
|
|
19
|
+
*
|
|
20
|
+
* @module seoParser
|
|
21
|
+
*/
|
|
1
22
|
declare const _default: {
|
|
23
|
+
/**
|
|
24
|
+
* Language parsed from startupUrl, null if cannot be parsed
|
|
25
|
+
*/
|
|
26
|
+
lang: string;
|
|
27
|
+
/**
|
|
28
|
+
* Path part of the startup URL without SEO parts
|
|
29
|
+
*/
|
|
2
30
|
purl: string;
|
|
31
|
+
/**
|
|
32
|
+
* Path part of the initial URL when client was open
|
|
33
|
+
*/
|
|
3
34
|
startupUrl: string;
|
|
35
|
+
/**
|
|
36
|
+
* Overlay parsed from startupUrl, null if cannot be parsed
|
|
37
|
+
*/
|
|
38
|
+
overlay: string;
|
|
4
39
|
};
|
|
5
40
|
export default _default;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import type { ErrorCategory, ShowableError } from '@windy/types.d';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Add showableError to local storage
|
|
4
|
+
* @param error
|
|
5
|
+
*/
|
|
6
|
+
export declare const add: (error: ShowableError) => void;
|
|
3
7
|
/**
|
|
4
8
|
* Sets showableError to not be displayed anymore
|
|
5
9
|
* @param errorId
|
|
6
10
|
*/
|
|
7
|
-
export declare const close: (
|
|
11
|
+
export declare const close: (errorId: string) => void;
|
|
8
12
|
/**
|
|
9
13
|
* It return array unresolvedErrors with removed showableError
|
|
10
14
|
* @param errorId
|
|
11
15
|
*/
|
|
12
|
-
export declare const resolve: (
|
|
16
|
+
export declare const resolve: (errorId: string) => void;
|
|
13
17
|
/**
|
|
14
18
|
* It resolve whole category of errors from unresolvedErrors
|
|
15
19
|
* @param category
|
|
16
20
|
*/
|
|
17
|
-
export declare const resolveCategory: (
|
|
21
|
+
export declare const resolveCategory: (category: ErrorCategory) => void;
|
|
18
22
|
/**
|
|
19
23
|
* Returns unresolved errors
|
|
20
24
|
* @returns ShowableError[]
|
|
21
25
|
*/
|
|
22
|
-
export declare const getUnresolvedErrors: () =>
|
|
26
|
+
export declare const getUnresolvedErrors: () => ShowableError[];
|
|
23
27
|
/**
|
|
24
28
|
* Control if error was resolved, based on category of the error
|
|
25
29
|
* @param error
|
|
26
30
|
*/
|
|
27
|
-
export declare function checkError(
|
|
31
|
+
export declare function checkError(error: ShowableError): void;
|
|
@@ -49,4 +49,4 @@ export declare const release: (ident: PluginIdent, priority: ListeningPriority)
|
|
|
49
49
|
* Handles all singleclick events from instance of Leaflet map
|
|
50
50
|
* @ignore
|
|
51
51
|
*/
|
|
52
|
-
export declare const opener: (ev:
|
|
52
|
+
export declare const opener: (ev: LeafletMouseEvent) => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* # @windy/startup
|
|
4
|
+
*
|
|
5
|
+
* Controls display of startup elements
|
|
6
|
+
*
|
|
7
|
+
* @module startup
|
|
8
|
+
*/
|
|
9
|
+
import type { GeolocationInfo, HomeLocation } from './d.ts.files/interfaces.d';
|
|
10
|
+
/**
|
|
11
|
+
* Capture an event so that the HP window is cleverly hidden, but
|
|
12
|
+
* at the same time trigger a user action (e.g. opening a menu, etc.)
|
|
13
|
+
*/
|
|
14
|
+
export declare function addDefaultListeners(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Show the weather box on HP
|
|
17
|
+
*
|
|
18
|
+
* Priority of display on HP is like this:
|
|
19
|
+
*
|
|
20
|
+
* 1. HP weather - always displayed (contains embedded CAP alerts)
|
|
21
|
+
*
|
|
22
|
+
* 2. If applicable fires whats-new or display app is obsolete
|
|
23
|
+
*
|
|
24
|
+
* 3. Live alerts - displayed if there are any for users location
|
|
25
|
+
*
|
|
26
|
+
* 4. Published article
|
|
27
|
+
*
|
|
28
|
+
* 5. Our custom promos
|
|
29
|
+
*
|
|
30
|
+
* 6. Pin to homepage - always displayed only if user has any pinned favorites
|
|
31
|
+
*
|
|
32
|
+
* @param coords At which location show the HP
|
|
33
|
+
*/
|
|
34
|
+
export declare function showStartupElements(coords: HomeLocation | GeolocationInfo): Promise<void>;
|
|
35
|
+
export declare const searchBetterLocation: (this: unknown, ...args: [] & unknown[]) => void;
|
|
36
|
+
export declare const closeAllStartupPlugins: (includingPermanentElements?: boolean) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Hides, the weather DIV
|
|
39
|
+
*
|
|
40
|
+
* @param ev Event that initiated hiding
|
|
41
|
+
*/
|
|
42
|
+
export declare function hideStartupElements(ev?: MouseEvent | KeyboardEvent | TouchEvent): void;
|
|
43
|
+
/**
|
|
44
|
+
* Click on title or home button
|
|
45
|
+
*/
|
|
46
|
+
export declare function back2home(): Promise<void>;
|
|
47
|
+
export declare const shouldHideStartupElements: () => boolean;
|
|
48
|
+
export declare const unsetShouldBeHidden: () => boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HttpPayload } from '@windy/http.d';
|
|
2
|
+
import type { WhatsNewObsolete, WhatsNewData } from '@windy/startup.d';
|
|
3
|
+
import type { LiveAlertEvent } from '@plugins/startup-live-alerts/startup-live-alerts.d';
|
|
4
|
+
import type { GeolocationInfo, HomeLocation } from '@windy/interfaces';
|
|
5
|
+
/**
|
|
6
|
+
* Opens whatsNew plugin, displays app is obsolete message or does nothing
|
|
7
|
+
*
|
|
8
|
+
* @returns true if whatsNew or app is obsolete was opened
|
|
9
|
+
*/
|
|
10
|
+
export declare const openWhatsNewOrObsoleteApp: (whatsNewPromise: Promise<HttpPayload<WhatsNewData | WhatsNewObsolete>>) => Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Determines if article should be displayed or not
|
|
13
|
+
*/
|
|
14
|
+
export declare const loadAndOpenArticle: (coords: HomeLocation | GeolocationInfo) => Promise<boolean>;
|
|
15
|
+
export declare const openLiveAlert: (coords: HomeLocation | GeolocationInfo, liveAlertsPromise: Promise<HttpPayload<{
|
|
16
|
+
alerts: LiveAlertEvent[];
|
|
17
|
+
}>>) => Promise<boolean>;
|
|
18
|
+
export declare const openPin2Hp: () => Promise<void>;
|
|
19
|
+
export declare const loadPatch: () => Promise<void>;
|
package/types/client/store.d.ts
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
* @module store
|
|
39
39
|
*/
|
|
40
40
|
import { Evented } from '@windy/Evented';
|
|
41
|
-
import type { DataSpecifications
|
|
41
|
+
import type { DataSpecifications } from './d.ts.files/dataSpecifications.d';
|
|
42
42
|
import type { SetReturnType, StoreOptions, StoreTypes } from './d.ts.files/store.d';
|
|
43
43
|
declare class Store extends Evented<StoreTypes> {
|
|
44
44
|
/**
|
|
@@ -49,30 +49,16 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
49
49
|
*/
|
|
50
50
|
setDefault<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, value: Item['def']): void;
|
|
51
51
|
/**
|
|
52
|
-
* Defines property in dataSpecification list. Used
|
|
52
|
+
* Defines property in dataSpecification list. Used only for
|
|
53
53
|
* definition of `syncSet` or `asyncSet`
|
|
54
54
|
*
|
|
55
55
|
* @param name identifier of property in dataSpecification
|
|
56
56
|
* @param prop property
|
|
57
57
|
* @param value Value
|
|
58
58
|
*/
|
|
59
|
-
defineProperty: <T extends keyof DataSpecifications, Prop extends
|
|
59
|
+
defineProperty: <T extends keyof DataSpecifications, Prop extends "asyncSet" | "syncSet", Value extends DataSpecifications[T][Prop]>(name: T, prop: Prop, value: Value) => void;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @param name identifier of property in dataSpecification
|
|
64
|
-
* @returns Stored value
|
|
65
|
-
*/
|
|
66
|
-
getProperty: <T extends keyof DataSpecifications>(name: T) => DataSpecifications[T];
|
|
67
|
-
/**
|
|
68
|
-
* Checks existence of property
|
|
69
|
-
*
|
|
70
|
-
* @param name Name
|
|
71
|
-
* @returns True if property exists
|
|
72
|
-
*/
|
|
73
|
-
hasProperty: <T extends keyof DataSpecifications>(name: T) => boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Sets a value in key, value store. If succesfull,a nd value has been changed, store will brodcast message with name and value.
|
|
61
|
+
* Sets a value in key, value store. If successful, and value has been changed, store will broadcast message with name and value.
|
|
76
62
|
* Limitation:** Our store is quite primitive so it can not compare Arrays and Objects. Always create new one or use `forceChange` * option.
|
|
77
63
|
*
|
|
78
64
|
* @param name Name
|
|
@@ -88,17 +74,6 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
88
74
|
* @param opts Options
|
|
89
75
|
*/
|
|
90
76
|
remove: <T extends keyof DataSpecifications>(name: T, opts?: StoreOptions) => void;
|
|
91
|
-
/**
|
|
92
|
-
* Outputs all allowed properties for give key into console.log
|
|
93
|
-
*/
|
|
94
|
-
getAll: () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Return list of permitted values for given key
|
|
97
|
-
*
|
|
98
|
-
* @param name Name
|
|
99
|
-
* @returns List of allowed values for the name; or string with info it is checked by function
|
|
100
|
-
*/
|
|
101
|
-
getAllowed: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T) => string | Item["allowed"];
|
|
102
77
|
/**
|
|
103
78
|
* Returns default value for given key
|
|
104
79
|
*
|
|
@@ -106,23 +81,10 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
106
81
|
* @returns Data specification type
|
|
107
82
|
*/
|
|
108
83
|
getDefault<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T): Item['def'];
|
|
109
|
-
isAsyncStore<T>(item: DataSpecificationsObject<T>): item is DataSpecificationsObject<T> & Required<Pick<DataSpecificationsObject<T>, 'asyncSet'>>;
|
|
110
|
-
/**
|
|
111
|
-
* Check if value was changed
|
|
112
|
-
* !!!! WARNING: for perfomance reasons check only against hot cache, so can
|
|
113
|
-
* lead to faulty results around default || never used values
|
|
114
|
-
*
|
|
115
|
-
* @param name Name
|
|
116
|
-
* @param item Item
|
|
117
|
-
* @param value Value
|
|
118
|
-
* @returns True if value was changed
|
|
119
|
-
*/
|
|
120
|
-
wasChanged<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, item: Item, value: Item['def']): boolean;
|
|
121
84
|
/**
|
|
122
|
-
* Insert dataSpecifications key (if not present)
|
|
123
|
-
*
|
|
124
|
-
* @
|
|
125
|
-
* @param obj Data specifications object
|
|
85
|
+
* Insert dataSpecifications key (if not present). So far used only for
|
|
86
|
+
* runtime inserting of Metrics
|
|
87
|
+
* @deprecated
|
|
126
88
|
*/
|
|
127
89
|
insert: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, obj: Item) => void;
|
|
128
90
|
/**
|
|
@@ -135,14 +97,20 @@ declare class Store extends Evented<StoreTypes> {
|
|
|
135
97
|
get<T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, options?: {
|
|
136
98
|
forceGet: boolean;
|
|
137
99
|
}): Item['def'];
|
|
138
|
-
|
|
100
|
+
private isAsyncStore;
|
|
101
|
+
/**
|
|
102
|
+
* Check if value was changed
|
|
103
|
+
* !!!! WARNING: for performance reasons check only against hot cache, so can
|
|
104
|
+
* lead to faulty results around default || never used values
|
|
105
|
+
*
|
|
106
|
+
* @param name Name
|
|
107
|
+
* @param item Item
|
|
108
|
+
* @param value Value
|
|
109
|
+
* @returns True if value was changed
|
|
110
|
+
*/
|
|
111
|
+
private wasChanged;
|
|
112
|
+
private isValid;
|
|
139
113
|
private setFinally;
|
|
140
114
|
}
|
|
141
115
|
declare const store: Store;
|
|
142
|
-
export declare const getAll: () => void, getAllowed: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T) => string | Item["allowed"], getDefault: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T) => Item["def"], get: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, options?: {
|
|
143
|
-
forceGet: boolean;
|
|
144
|
-
}) => Item["def"], on: <K extends keyof StoreTypes, Q extends StoreTypes[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>, once?: boolean) => number, off: {
|
|
145
|
-
(id: number): void;
|
|
146
|
-
<K extends keyof StoreTypes, Q extends StoreTypes[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>): void;
|
|
147
|
-
}, once: <K extends keyof StoreTypes, Q extends StoreTypes[K]>(topic: K, callback: (...data: TrimUndefinedFromRight<Arrayify<Q>>) => void, context?: ThisType<unknown>) => number, set: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, value: Item["def"], opts?: StoreOptions) => SetReturnType<T>, defineProperty: <T extends keyof DataSpecifications, Prop extends keyof DataSpecifications[T], Value extends DataSpecifications[T][Prop]>(name: T, prop: Prop, value: Value) => void, setDefault: <T extends keyof DataSpecifications, Item extends DataSpecifications[T]>(name: T, value: Item["def"]) => void;
|
|
148
116
|
export default store;
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { SubscriptionInfo } from '@plugins/_shared/subscription-services/subscription-services.d';
|
|
1
|
+
import type { SubscriptionInfo } from '@plugins/shared/subscription-services/subscription-services.d';
|
|
3
2
|
export type SubscriptionIssue = {
|
|
4
3
|
type: 'graced' | 'paused' | 'onhold';
|
|
5
4
|
} | {
|
|
6
5
|
type: 'expiring';
|
|
7
6
|
expiresInHours: number;
|
|
8
7
|
};
|
|
9
|
-
/**
|
|
10
|
-
* Get the current tier of the user.
|
|
11
|
-
*
|
|
12
|
-
* @returns "premium" for premium user, null otherwise
|
|
13
|
-
*/
|
|
14
|
-
export declare const getTier: () => SubTier;
|
|
15
|
-
/**
|
|
16
|
-
* When any user changes his/her premium status (redeem, restore, ...), we need to refresh token2 to
|
|
17
|
-
* reflect premium status for our backends
|
|
18
|
-
*/
|
|
19
|
-
declare const reloadUserToken: () => void;
|
|
20
8
|
/**
|
|
21
9
|
* Clear pending subscription (i.e. unclaimed, not-redeemed subscription) from store.
|
|
22
10
|
*/
|
|
@@ -27,21 +15,11 @@ export declare const clearPendingSubscription: () => void;
|
|
|
27
15
|
* @param {string} redeemCode Code to store
|
|
28
16
|
*/
|
|
29
17
|
export declare const setPendingSubscription: (redeemCode: string) => void;
|
|
30
|
-
|
|
31
|
-
* Disable all premium features for the user. It does not deactivate subscription, it is just client GUI reset.
|
|
32
|
-
*/
|
|
33
|
-
export declare const deactivateAllFeatures: () => void;
|
|
18
|
+
export declare const setSubsBodyClass: (tier: 'premium') => void;
|
|
34
19
|
/**
|
|
35
20
|
* Set a tier for the user. It also clears pending and failed subscriptions if tier is passed.
|
|
36
|
-
*
|
|
37
|
-
* @param value Tier to set for the user, "null" for the subscription deactivation
|
|
38
|
-
* @param options Optionally `reloadUserToken: true` if client should reload JWT token after setting the tier
|
|
39
|
-
* @returns Same value which has been set
|
|
40
21
|
*/
|
|
41
|
-
export declare const setTier: (
|
|
42
|
-
reloadUserToken?: boolean;
|
|
43
|
-
subscriptionInfo?: SubscriptionInfo;
|
|
44
|
-
}) => SubTier;
|
|
22
|
+
export declare const setTier: (subscriptionInfo: SubscriptionInfo | null) => void;
|
|
45
23
|
/**
|
|
46
24
|
* Returns boolean value if user has any valid premium subscription.
|
|
47
25
|
*
|
|
@@ -63,4 +41,3 @@ export declare const checkPendingSubscription: () => void;
|
|
|
63
41
|
*/
|
|
64
42
|
export declare const getBaitTitle: (issue: SubscriptionIssue | null) => string;
|
|
65
43
|
export declare const checkAndRenderSubsIssue: () => void;
|
|
66
|
-
export {};
|