@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.
Files changed (112) hide show
  1. package/package.json +1 -1
  2. package/types/client/Calendar.d.ts +4 -0
  3. package/types/client/Color.d.ts +9 -2
  4. package/types/client/DataTiler.d.ts +2 -2
  5. package/types/client/EventManager.d.ts +69 -0
  6. package/types/client/ExternalSveltePlugin.d.ts +4 -3
  7. package/types/client/GlBuffer.d.ts +45 -0
  8. package/types/client/GlMesh.d.ts +147 -0
  9. package/types/client/GlProgram.d.ts +41 -0
  10. package/types/client/GlRenderer.d.ts +95 -0
  11. package/types/client/GlTexture.d.ts +98 -0
  12. package/types/client/GlVertexArray.d.ts +38 -0
  13. package/types/client/IDB.d.ts +25 -4
  14. package/types/client/LabelsLayer.d.ts +69 -2
  15. package/types/client/Layer.d.ts +2 -1
  16. package/types/client/MetricClasses.d.ts +1 -1
  17. package/types/client/Overlay.d.ts +1 -5
  18. package/types/client/Product.d.ts +10 -5
  19. package/types/client/ProductClasses.d.ts +7 -0
  20. package/types/client/Renderer.d.ts +16 -19
  21. package/types/client/ShaderStorage.d.ts +25 -0
  22. package/types/client/StartupElementPlugin.d.ts +8 -0
  23. package/types/client/SveltePlugin.d.ts +4 -4
  24. package/types/client/SwitchableTileCache.d.ts +104 -0
  25. package/types/client/TileLayer.d.ts +11 -2
  26. package/types/client/TileLayerCustom.d.ts +51 -0
  27. package/types/client/TileLayerMulti.d.ts +53 -0
  28. package/types/client/TileLayerPreprocessorStandalone.d.ts +45 -0
  29. package/types/client/TileLayerRenderer.d.ts +24 -0
  30. package/types/client/TileLayerUtils.d.ts +43 -0
  31. package/types/client/TilePreprocessor.d.ts +27 -0
  32. package/types/client/TopoMap.d.ts +2 -1
  33. package/types/client/WindowPlugin.d.ts +1 -3
  34. package/types/client/baseMap.d.ts +12 -2
  35. package/types/client/broadcast.d.ts +1 -1
  36. package/types/client/cityLabels.d.ts +2 -3
  37. package/types/client/colorGradients.d.ts +1 -2
  38. package/types/client/css.test.d.ts +1 -0
  39. package/types/client/customProtocol.d.ts +11 -0
  40. package/types/client/d.ts.files/GlObj.d.ts +1 -5
  41. package/types/client/d.ts.files/Metric.d.ts +2 -0
  42. package/types/client/d.ts.files/broadcast.d.ts +28 -32
  43. package/types/client/d.ts.files/dataSpecifications.d.ts +60 -42
  44. package/types/client/d.ts.files/glUtils.d.ts +71 -0
  45. package/types/client/d.ts.files/http.d.ts +0 -5
  46. package/types/client/d.ts.files/interpolatorTypes.d.ts +5 -5
  47. package/types/client/d.ts.files/lib.d.ts +1 -1
  48. package/types/client/d.ts.files/liveAlerts.d.ts +52 -0
  49. package/types/client/d.ts.files/mapUtils.d.ts +25 -0
  50. package/types/client/d.ts.files/outgoingMessages.d.ts +1 -1
  51. package/types/client/d.ts.files/plugin-params.d.ts +31 -13
  52. package/types/client/d.ts.files/plugins.d.ts +44 -29
  53. package/types/client/d.ts.files/singleclick.d.ts +4 -2
  54. package/types/client/d.ts.files/startup.d.ts +7 -52
  55. package/types/client/d.ts.files/storage.d.ts +0 -11
  56. package/types/client/d.ts.files/user.d.ts +6 -1
  57. package/types/client/embed.d.ts +2 -5
  58. package/types/client/errorLogger.d.ts +19 -0
  59. package/types/client/externalPlugins.d.ts +4 -2
  60. package/types/client/fetch.d.ts +38 -5
  61. package/types/client/format.d.ts +11 -0
  62. package/types/client/glContextUtils.d.ts +9 -0
  63. package/types/client/glStatus.d.ts +7 -0
  64. package/types/client/glUtils.d.ts +119 -0
  65. package/types/client/http.d.ts +0 -6
  66. package/types/client/idbConnection.d.ts +13 -0
  67. package/types/client/idbInstances.d.ts +36 -42
  68. package/types/client/landLayer.d.ts +3 -0
  69. package/types/client/layers.d.ts +2 -1
  70. package/types/client/lib.d.ts +11 -14
  71. package/types/client/liveAlerts.d.ts +2 -2
  72. package/types/client/location.d.ts +1 -1
  73. package/types/client/map.d.ts +95 -22
  74. package/types/client/mapUtils.d.ts +66 -0
  75. package/types/client/math.d.ts +14 -0
  76. package/types/client/mobile.d.ts +16 -34
  77. package/types/client/mobileUtils.d.ts +10 -0
  78. package/types/client/models.d.ts +1 -1
  79. package/types/client/overlays.d.ts +2 -2
  80. package/types/client/picker.d.ts +4 -8
  81. package/types/client/products.d.ts +0 -1
  82. package/types/client/promo.d.ts +1 -1
  83. package/types/client/renderUtils.d.ts +14 -0
  84. package/types/client/renderers.d.ts +5 -6
  85. package/types/client/rootScope.d.ts +9 -9
  86. package/types/client/router.d.ts +7 -2
  87. package/types/client/singleclick.d.ts +1 -1
  88. package/types/client/startup.d.ts +48 -0
  89. package/types/client/startupUtils.d.ts +19 -0
  90. package/types/client/subscription.d.ts +3 -26
  91. package/types/client/throttler.d.ts +32 -0
  92. package/types/client/tileHelpers.d.ts +35 -0
  93. package/types/client/tileLayerInterpolator.d.ts +40 -0
  94. package/types/client/tileLayerSource.d.ts +98 -0
  95. package/types/client/timestampUtils.test.d.ts +1 -0
  96. package/types/client/topMessage.d.ts +22 -0
  97. package/types/client/user.d.ts +1 -0
  98. package/types/client/userConsent.d.ts +0 -2
  99. package/types/client/userFavs.d.ts +0 -8
  100. package/types/client/utils.d.ts +62 -10
  101. package/types/client/utils.test.d.ts +1 -0
  102. package/types/iconfont.d.ts +2 -5
  103. package/types/interfaces.d.ts +121 -100
  104. package/types/lang-files.d.ts +412 -72
  105. package/types/leaflet-gl.d.ts +12773 -0
  106. package/types/types.d.ts +28 -6
  107. package/types/client/d.ts.files/CanvasLayer.d.ts +0 -70
  108. package/types/client/d.ts.files/DataTiler.d.ts +0 -45
  109. package/types/client/d.ts.files/LandMask.d.ts +0 -17
  110. package/types/client/d.ts.files/PoisOverlay.d.ts +0 -27
  111. package/types/client/d.ts.files/TileLayerCanvas.d.ts +0 -78
  112. package/types/client/d.ts.files/TileLayerMultiPatch.d.ts +0 -13
package/types/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { MainLangFile, PluginTranslations } from '@windy/lang-files.d';
2
2
 
3
3
  import weatherTable from '@plugins/_shared/detail-render/weatherTable';
4
- import { LatLon, WeatherParameters } from './interfaces.d';
4
+ import { LatLon, WeatherParameters } from '@windy/interfaces.d';
5
5
 
6
6
  export * from '@windy/interpolatorTypes.d';
7
7
 
@@ -64,7 +64,7 @@ export type StationId = `${ExtendedStationType}-${string}`;
64
64
  */
65
65
  export type StationOrPoiType = StationType | PoiType;
66
66
 
67
- export type FlightCategory = 'I' | 'V' | 'L' | 'M' | 'U';
67
+ export type FlyingConditions = 'I' | 'V' | 'L' | 'M' | 'U';
68
68
 
69
69
  /**
70
70
  * Allowed type of tides
@@ -107,6 +107,9 @@ export type SveltePanePluginIdent =
107
107
  export type BottomSveltePluginIdent =
108
108
  `@plugins/${keyof import('@windy/plugins.d').BottomSveltePlugins}`;
109
109
 
110
+ export type StartupElementPluginIdent =
111
+ `@plugins/${keyof import('@windy/plugins.d').StartupElementPlugins}`;
112
+
110
113
  export type TagPluginIdent = `@plugins/${keyof import('@windy/plugins.d').TagPlugins}`;
111
114
 
112
115
  export type PlainPluginIdent = `@plugins/${keyof import('@windy/plugins.d').PlainPlugins}`;
@@ -190,6 +193,9 @@ export type GpsPreferences = {
190
193
  status: 'denied' | 'authorized';
191
194
  };
192
195
 
196
+ /**
197
+ * Implemented only on android native - iOS does not restrict battery usage for individual applications
198
+ */
193
199
  export type BatteryPreferences = {
194
200
  status: 'denied' | 'authorized';
195
201
  };
@@ -294,12 +300,16 @@ export type LogPaths =
294
300
  export type LogEvents =
295
301
  | 'logout'
296
302
  | 'animation-started'
303
+ | 'animation-speed-changed'
297
304
  | 'user-logged'
298
305
  | 'click-on-hp'
299
306
  | 'article-event'
300
307
  | 'displayed-on-hp'
301
308
  | 'subs-opened'
302
- | 'subs-purchased';
309
+ | 'subs-purchased'
310
+ | 'map-selector-clicked'
311
+ | 'radsat-animation-speed-changed'
312
+ | 'login-finish-action';
303
313
 
304
314
  /**
305
315
  * Type of user consent
@@ -354,7 +364,9 @@ export type PickerOpener = LatLon & { id: string };
354
364
 
355
365
  export type ExternalPluginIdent = `windy-plugin-${string}`;
356
366
 
357
- export type DropDownValues = { key: string | number | null; value: string | number }[];
367
+ export type AllowedDropDownKey = string | number | null | boolean;
368
+
369
+ export type DropDownValues = { key: AllowedDropDownKey; value: string | number }[];
358
370
 
359
371
  /*
360
372
  * Plugin for creating backups of Local storage
@@ -388,13 +400,16 @@ export interface WindyBackupPlugin {
388
400
  /**
389
401
  * Currently used main map library
390
402
  */
391
- export type UsedMapLibrary = 'leaflet' | 'maplibre' | 'globe';
403
+ export type UsedMapLibrary = 'leafletGl' | 'globe';
392
404
 
393
405
  /**
394
406
  * Time defined in hours
395
407
  */
396
408
  export type Hours = number;
397
409
 
410
+ /**
411
+ * Time defined in minutes
412
+ */
398
413
  export type Minutes = number;
399
414
 
400
415
  /**
@@ -440,6 +455,8 @@ export type ColorGradient = [NumValue, RGBA][];
440
455
 
441
456
  export type ColorGradientString = [NumValue, RGBString | RGBAString][];
442
457
 
458
+ export type AnimationSpeed = 'normal' | 'fast' | 'very-fast';
459
+
443
460
  /**
444
461
  * 'rgb(200,0,150)'
445
462
  */
@@ -472,7 +489,6 @@ export type CustomAppIcon =
472
489
 
473
490
  /**
474
491
  * All ISO 3166-1 alpha-2 country codes (current), lowercase.
475
- * TODO: Later on properly type all the country codes in the codebase, where we uae string now
476
492
  */
477
493
  export type ISOCountryCode =
478
494
  | 'ad'
@@ -724,3 +740,9 @@ export type ISOCountryCode =
724
740
  | 'za'
725
741
  | 'zm'
726
742
  | 'zw';
743
+
744
+ export type Timeout = ReturnType<typeof setTimeout>;
745
+
746
+ export type Interval = ReturnType<typeof setInterval>;
747
+
748
+ export type SemVersion = `${number}.${number}.${number}`;
@@ -1,70 +0,0 @@
1
- export class CanvasLayer extends L.Layer {
2
- targetPane?:
3
- | 'mapPane'
4
- | 'tilePane'
5
- | 'overlayPane'
6
- | 'objectsPane'
7
- | 'popupPane'
8
- | 'shadowPane'
9
- | 'markerPane';
10
- _showCanvasOn?: boolean;
11
- failed?: boolean;
12
- _canvas?: L.CanvasElement | null;
13
- _center?: L.LatLng;
14
- _zoom?: number;
15
- _frame?: number | null;
16
- wasOnZoom?: boolean;
17
- options: L.LayerOptions & {
18
- disableAutoReset: boolean;
19
- padding: number;
20
- };
21
-
22
- initialize(this: this, options?: L.LayerOptions): void;
23
- onResizeCanvas(this: this, width: number, height: number): void;
24
- showCanvas(this: this, on: boolean): void;
25
- reset(this: this): void;
26
- canvasDisplay(this: this, enable: boolean): void;
27
- getCanvas(this: this): L.CanvasElement | undefined | null;
28
- redraw(this: this): void;
29
-
30
- _resize(this: this, event: L.ResizeEvent): void;
31
- _animateZoom(this: this, e: L.ZoomAnimEvent): void;
32
- _onZoom(this: this): void;
33
- _onZoomStart(this: this): void;
34
- _onZoomEnd(this: this): void;
35
- _moveEnd(this: this): void;
36
- _reset(this: this): void;
37
- _redraw(this: this): void;
38
- _updateTransform(center: L.LatLng, zoom: number): void;
39
-
40
- /** TODO empty by default */
41
- onInit(this: this): void;
42
-
43
- /** TODO true by default */
44
- onCreateCanvas(this: this, canvas?: HTMLElement): boolean;
45
-
46
- /** TODO empty by default */
47
- onCanvasFailed(this: this): void;
48
-
49
- /** TODO empty by default */
50
- onRemoveCanvas(this: this, canvas?: HTMLElement): void;
51
-
52
- /** TODO empty by default */
53
- onMoveEnd(this: this): void;
54
-
55
- /** TODO empty by default */
56
- onZoomEnd(this: this): void;
57
-
58
- /** TODO empty by default */
59
- onReset(this: this): void;
60
-
61
- // Just this typings rewrites of leaflet methods
62
- onAdd(this: this, map: L.Map): this;
63
- addTo(this: this, map: L.Map): this;
64
- onRemove(this: this, map: L.Map): this;
65
-
66
- onContextLost(): void;
67
- onContextRestored(): void;
68
- onContextCreationError(e: WebGLContextEvent): void;
69
- canvasHooks(canvas: L.CanvasElement | null | undefined, on: boolean): void;
70
- }
@@ -1,45 +0,0 @@
1
- import { MapCoordinates } from '@windy/dataSpecifications.d';
2
-
3
- export interface TilePoint {
4
- x: number;
5
- y: number;
6
- z: number;
7
- }
8
-
9
- export interface ExtendedTileParams extends MapCoordinates {
10
- /**
11
- * => bounds.min.x of map.getPixelBounds();
12
- */
13
- pixelOriginX: number;
14
-
15
- /**
16
- * => bounds.min.y of map.getPixelBounds();
17
- */
18
- pixelOriginY: number;
19
-
20
- /**
21
- * Data zoom
22
- */
23
- dZoom: number;
24
-
25
- /**
26
- * Size of map in piels
27
- */
28
- width: number;
29
-
30
- /**
31
- * Size of map in pxels
32
- */
33
- height: number;
34
-
35
- /**
36
- * Coords of original unwrapped map tiles
37
- * basicaly map.getPixelBounds();
38
- */
39
- origTiles: {
40
- minX: number;
41
- minY: number;
42
- maxX: number;
43
- maxY: number;
44
- };
45
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * Leaflet layer with alpha-inverse sea mask
3
- */
4
- export class LandMask extends L.TileLayer {
5
- seaColorL: number;
6
- ctx: CanvasRenderingContext2D | null;
7
- _tileOnError(
8
- done: L.DoneCallback,
9
- tile: HTMLImageElement | HTMLCanvasElement,
10
- e: string | Event,
11
- ): void;
12
- getTempCtx(): CanvasRenderingContext2D | null;
13
- getTileUrl(coords: L.Coords): string;
14
- createTile(coords: L.Coords, done: L.DoneCallback): HTMLCanvasElement | HTMLImageElement;
15
- createImageTile(coords: L.Coords, done: L.DoneCallback): HTMLImageElement;
16
- createCanvasTile(coords: L.Coords, done: L.DoneCallback): HTMLCanvasElement;
17
- }
@@ -1,27 +0,0 @@
1
- export class PoisOverlay extends L.Layer {
2
- className?: string;
3
- displayed?: boolean;
4
- _container?: HTMLElement;
5
- _markers?: Record<string, L.LatLng>;
6
- constructor(className?: string);
7
- initialize(this: this, className: string): void;
8
- getHtml(
9
- this: this,
10
- id: string,
11
- point: L.LatLng,
12
- params: { html?: string; style?: string; attrs?: string[] },
13
- ): string;
14
- addPois(this: this, html: string, markers: Record<string, L.LatLng>): void;
15
- getPane(this: this): HTMLElement | undefined;
16
- removePois(this: this): void;
17
- replaceMarker(this: this, id: string, html: string): void;
18
- getAllMarkers(this: this): NodeListOf<HTMLElement>;
19
- _reset(this: this): void;
20
- forAllMarkers(this: this, fun: (point: L.LatLng) => L.Point): void;
21
- getPosReset(this: this, point: L.LatLng): L.Point;
22
- setPoistion(this: this, marker: HTMLElement, pos: L.Point): void;
23
-
24
- // Just this typings rewrites of leaflet methods
25
- onAdd(this: this, map: L.Map): this;
26
- onRemove(this: this, map: L.Map): this;
27
- }
@@ -1,78 +0,0 @@
1
- import { DataTile } from '@windy/dataLoader';
2
-
3
- import { FullRenderParameters } from '@windy/interfaces';
4
- import { TileParams } from '@windy/Renderer';
5
-
6
- export type InternalTile = L.InternalTiles[string] & { el: HTMLCanvasElement };
7
-
8
- export class TileLayerCanvas extends L.GridLayer {
9
- _tiles: Record<string, InternalTile>;
10
- /**
11
- * Latest params
12
- */
13
- latestParams: FullRenderParameters;
14
-
15
- /**
16
- * Incrementing counter, that keeps latestParams and actually rendered ile in sync
17
- */
18
- syncCounter: number;
19
-
20
- /**
21
- * While map is being moved
22
- */
23
- inMotion: boolean;
24
-
25
- /**
26
- * Wis sea applied to CSS tag?
27
- */
28
- hasSea: boolean;
29
-
30
- landOnly: boolean;
31
-
32
- className: string;
33
-
34
- _tilesToLoad: number;
35
-
36
- /**
37
- * Overwriting TileLayer method to disable redrawing layers w/o params
38
- */
39
- // @ts-expect-error We rape TS with overloading properties with properties of different input and output (TODO fix)
40
- onAdd(this: this, map: L.Map): this;
41
- onRemove(this: this, map: L.Map): this;
42
- onMoveStart(this: this): void;
43
- onMoveEnd(this: this): void;
44
- checkLoaded(this: this): void;
45
- redrawFinished(this: this): void;
46
- /**
47
- * Redrawing overlay after changing params
48
- *
49
- * 1. find visible tiles
50
- * 2. remove invisible tiles
51
- * 3. redraw visible tiles
52
- */
53
- redrawLayer(this: this): void;
54
-
55
- removeOtherTiles(this: this, zoom: number, tileBounds: L.Bounds): void;
56
-
57
- _removeTile(this: this, key: string): void;
58
-
59
- /**
60
- * Sort tiles from center out
61
- */
62
- sortTilesFromCenterOut(this: this, bounds: L.Bounds): L.Coords[];
63
-
64
- redrawTile(this: this, tile: InternalTile): void;
65
-
66
- paramsChanged(this: this, params: FullRenderParameters): void;
67
-
68
- init(this: this, params: FullRenderParameters): void;
69
-
70
- renderTile(
71
- this: this,
72
- step: 1 | 2,
73
- canvas: HTMLCanvasElement,
74
- rqrdSyncNum: number,
75
- tInfo: TileParams,
76
- dTile: DataTile,
77
- ): void;
78
- }
@@ -1,13 +0,0 @@
1
- export class TileLayerMultiPatch extends L.TileLayerMulti {
2
- _tileDefs?: Record<number, L.TileDef | null>;
3
- _tileDefsBase?: Record<number, L.TileDef | null>;
4
- _tileDefsPatch?: Record<number, L.TileDef | null>;
5
- _patch?: Record<number, number[]>;
6
- initialize(
7
- this: this,
8
- tileDefs?: Record<number, L.TileDef>,
9
- options?: L.TileLayerOptions,
10
- ): void;
11
- getTileUrl(this: this, tilePoint: L.Point): string;
12
- _convertPatchToZoom(this: this, patch: L.TileDefPatch, zoom: number): number[];
13
- }