@windycom/plugin-devtools 1.0.7 → 1.0.9

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 CHANGED
@@ -4,6 +4,7 @@ Check out https://docs.windy-plugins.com for more information.
4
4
 
5
5
  # CHANGELOG
6
6
 
7
+ - 1.0.9 - Updated client TS declarations
7
8
  - 1.0.6 - Fix plugin version validation
8
9
  - 1.0.5 - Fixing .d.ts declarations
9
10
  - 1.0.0 - TS declarations for client v42
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windycom/plugin-devtools",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Developer tools and TS declarations for developers of Windy Plugins.",
5
5
  "main": "index.mjs",
6
6
  "module": "index.mjs",
@@ -12,7 +12,6 @@
12
12
  "@rollup/plugin-terser": "^0.4.4",
13
13
  "@rollup/plugin-typescript": "^11.1.6",
14
14
  "@types/geojson": "^7946.0.14",
15
- "@windycom/plugin-devtools": "file:../windy-plugins-devtools/dist",
16
15
  "eslint-import-resolver-typescript": "^3.6.1",
17
16
  "eslint-plugin-svelte": "^2.35.1",
18
17
  "less": "^4.2.0",
@@ -4,7 +4,7 @@ import type { Metric } from '@windy/Metric';
4
4
  import type { DirectionFunction } from '@windy/format.d';
5
5
  import type { Iconfont } from '@windy/iconfont.d';
6
6
  import type { Overlays } from '@windy/rootScope.d';
7
- import type { RGBNumValues } from '@windy/tileInterpolator.d';
7
+ import type { RGBNumValues } from '@windy/interpolatorTypes';
8
8
  import type { LoadedTranslations } from '@windy/trans.d';
9
9
  import type { HTMLString } from '@windy/types';
10
10
  export type UsedOverlays = Overlays | 'gh' | 'swell' | 'satelliteIRBT';
@@ -1,7 +1,7 @@
1
1
  import { Overlay } from '@windy/Overlay';
2
2
  import type { DirectionFunction } from '@windy/format.d';
3
3
  import type { Overlays } from '@windy/rootScope.d';
4
- import type { RGBNumValues } from '@windy/tileInterpolator.d';
4
+ import type { RGBNumValues } from '@windy/interpolatorTypes';
5
5
  import type { LoadedTranslations } from '@windy/trans.d';
6
6
  export declare class CurrentOverlay<I extends Overlays | 'gh' = Overlays | 'gh'> extends Overlay<I> {
7
7
  createPickerHTML(values: RGBNumValues, formatDir: DirectionFunction): string;
@@ -55,8 +55,8 @@ export declare class Plugin<P extends PluginIdent> {
55
55
  * and should prevent opening several overlapping plugins at the same location
56
56
  * especially on desktop or tablet devices.
57
57
  *
58
- * On mobile phones, most of the plugins (expecially LH, RH pane) become
59
- * fullsctreen plugins.
58
+ * On mobile phones, most of the plugins (especially LH, RH pane) become
59
+ * fullscreen plugins.
60
60
  */
61
61
  pane?: PluginPane;
62
62
  /**
@@ -83,8 +83,8 @@ export declare class Plugin<P extends PluginIdent> {
83
83
  plugin?: WPluginModules[`@plugins/${P}`] & AdditionalPluginAssets;
84
84
  /**
85
85
  * Whenever set, this plugin (when opened) disables opening
86
- * of mobile picker on map interaction. Shoul be used with
87
- * bottm, top pane plugins and plugins, that can be opened
86
+ * of mobile picker on map interaction. Should be used with
87
+ * bottom, top pane plugins and plugins, that can be opened
88
88
  * in half
89
89
  */
90
90
  disableMobilePicker?: boolean;
@@ -15,8 +15,8 @@ import {
15
15
  Consent,
16
16
  GeolocationInfo,
17
17
  HomeLocation,
18
- LatLon,
19
18
  InstalledExternalPluginConfig,
19
+ LatLon,
20
20
  } from '@windy/interfaces.d';
21
21
 
22
22
  import {
@@ -33,10 +33,10 @@ import { ColorGradient } from '@windy/Color.d';
33
33
 
34
34
  import { MetricItem } from '@windy/Metric.d';
35
35
 
36
+ import type { SubscriptionInfo } from '@plugins/_shared/subscription-services/subscription-services.d';
36
37
  import type { DownloadedInfo, OfflineConfiguration } from '@plugins/offline/offline.d';
37
- import type RadarCalendar from '@plugins/_radar/calendar/RadarCalendar';
38
+ import type RadarCalendar from '@plugins/radar/calendar/RadarCalendar';
38
39
  import type SatelliteCalendar from '@plugins/satellite/calendar/SatelliteCalendar';
39
- import type { SubscriptionInfo } from '@plugins/_shared/subscription-services/subscription-services.d';
40
40
 
41
41
  /**
42
42
  * Custom animation particles settings
@@ -912,6 +912,11 @@ export interface DataSpecifications {
912
912
  */
913
913
  twitterConsent: DataSpecificationsObject<Omit<Consent, 'analytics'> | null>;
914
914
 
915
+ /**
916
+ * Counter to synchronize Client and native backup data
917
+ */
918
+ appLocalStorageCounter: DataSpecificationsObject<number | null>;
919
+
915
920
  /**
916
921
  * List of installed external plugins
917
922
  * @ignore
@@ -221,6 +221,7 @@ export type PluginsOpenParams = {
221
221
  offline: PluginSource;
222
222
  'developer-mode': (PluginSource & { qs: Record<string, string> | undefined }) | undefined;
223
223
  'windy-external-plugin': PluginSource & LatLon;
224
+ menu: PluginSource;
224
225
  } & {
225
226
  [external: ExternalPluginIdent]:
226
227
  | (PluginSource & { query: Record<string, string> | undefined })
@@ -1,3 +1,4 @@
1
+ /// <reference types="@windy/declarations/windy-modules" />
1
2
  import './utils/errorLogger';
2
3
  import './leafletExt/CanvasLayer';
3
4
  import './services/params';
@@ -1,5 +1,4 @@
1
- import type { CoordsInterpolationFun, PixelInterpolationFun, RGBNumValues, InterpolatorPossibleReturns } from '@windy/tileInterpolator.d';
2
- export type { CoordsInterpolationFun, PixelInterpolationFun, RGBNumValues, InterpolatorPossibleReturns, };
1
+ import type { CoordsInterpolationFun, PixelInterpolationFun } from '@windy/interpolatorTypes';
3
2
  export type InterpolatorFactory = {
4
3
  createFun: (cb: <T>(...args: unknown[]) => T | void) => void;
5
4
  };
@@ -14,4 +14,18 @@ export interface WindyWidgetPlugin {
14
14
  value: boolean;
15
15
  }>;
16
16
  }
17
+ export interface WindyBackupPlugin {
18
+ syncCounter: (arg: {
19
+ clientCounter: number;
20
+ }) => Promise<{
21
+ nativeCounter: number;
22
+ backup?: string;
23
+ }>;
24
+ saveBackup: (arg: {
25
+ clientCounter: number;
26
+ backup: string;
27
+ }) => Promise<void>;
28
+ reloadApp: () => Promise<void>;
29
+ clearBackup: () => Promise<void>;
30
+ }
17
31
  export {};
@@ -1,7 +1,16 @@
1
1
  /**
2
- * @module pluginsCtrl
2
+ * # @windy/pluginCtrl
3
+ *
4
+ * Handles opening and closing of plugins, solving UI collisions by closing plugins
5
+ * that can overlap other plugins.
6
+ *
7
+ * Can be used from other modules
8
+ * just by emitting `rqstOpen`, `rqstClose` or `closeAllPlugins` events,
9
+ * on {@link module:bcast} channel in order to avoid circular dependencies.
3
10
  *
4
- * Handles opening and closing of plugins. Can be used from other modules
5
- * just by emitting `rqstOpen`, `rqstClose` or `closeAllPlugins` events.
11
+ * Unless we are opening external plugins, `openPlugin` provides satisfactory
12
+ * type safety of provided plugin parameters.
13
+ *
14
+ * @module pluginsCtrl
6
15
  */
7
16
  export {};
@@ -3,4 +3,4 @@ import type { TileParams } from '@windy/Renderer.d';
3
3
  import type { TileLayerCanvas } from '@windy/TileLayerCanvas.d';
4
4
  declare const renderNoDataTile: (canvas: HTMLCanvasElement, url?: string) => void;
5
5
  declare const renderTile: (this: TileLayerCanvas, step: 1 | 2, canvas: HTMLCanvasElement, rqrdSyncNum: number, tInfo: TileParams, dTile: DataTile) => void;
6
- export { renderTile, renderNoDataTile };
6
+ export { renderNoDataTile, renderTile };
@@ -8,7 +8,7 @@ declare const renderers: {
8
8
  */
9
9
  tileLayer: TileLayer;
10
10
  noUserControl: TileLayer;
11
- radar: Renderer<"radar", typeof import("../../plugins/_radar/radar")>;
11
+ radar: Renderer<"radar", typeof import("../../plugins/radar/radar")>;
12
12
  satellite: Renderer<"satellite", typeof import("../../plugins/satellite/satellite")>;
13
13
  capAlerts: Renderer<"cap-alerts", typeof import("../../plugins/cap-alerts/cap-alerts")>;
14
14
  isolines: Renderer<"isolines", typeof import("../../plugins/isolines/isolines")>;
@@ -79,7 +79,7 @@ export declare const overlays: readonly ["radar", "satellite", "wind", "gust", "
79
79
  /**
80
80
  * List of valid accumulation times
81
81
  */
82
- export declare const acTimes: readonly ["next12h", "next24h", "next2d", "next48h", "next60h", "next3d", "next5d", "next10d"];
82
+ export declare const acTimes: readonly ["next12h", "next24h", "next36h", "next2d", "next48h", "next60h", "next3d", "next5d", "next10d"];
83
83
  /**
84
84
  * Identifier of products that cover only certain area
85
85
  */
@@ -140,6 +140,10 @@ export declare const prefLang: string;
140
140
  export declare const levelsData: {
141
141
  [L in (typeof levels)[number]]: [string, string];
142
142
  };
143
+ /**
144
+ * Maximum number of fav POIs displayed in the GUI
145
+ */
146
+ export declare const maxFavPoisDesktop = 7;
143
147
  /**
144
148
  * Valid POI layers, their name and icon
145
149
  * @ignore this will crash Markdown parser
@@ -9,10 +9,10 @@
9
9
  * @module tileInterpolator
10
10
  */
11
11
  import { DataTiler } from '@windy/DataTiler';
12
- import type { PixelInterpolationFun, CoordsInterpolationFun } from './d.ts.files/tileInterpolator.d';
12
+ import type { PixelInterpolationFun, CoordsInterpolationFun } from '@windy/interpolatorTypes';
13
13
  import type { DataTile } from './dataLoader';
14
- import type { ExtendedTileParams } from './d.ts.files/DataTiler.d';
15
- import type { FullRenderParameters } from './d.ts.files/Layer.d';
14
+ import type { ExtendedTileParams } from '@windy/DataTiler.d';
15
+ import type { FullRenderParameters } from '@windy/Layer.d';
16
16
  export declare class TileInterpolator extends DataTiler {
17
17
  cb<T extends true | false>(f1: CoordsInterpolationFun, // async interpolator does not use fakeFun with null return type
18
18
  f2: PixelInterpolationFun | (() => null), isAsync?: T & (true | false)): void;
@@ -4,7 +4,7 @@ import type { RGBA } from '@windy/Color.d';
4
4
  import type { HttpError } from '@windy/http';
5
5
  import type { QueryStringSource } from '@windy/http.d';
6
6
  import type { LatLon, LinearScale, TilePoint } from '@windy/interfaces.d';
7
- import type { RGBNumValues } from '@windy/tileInterpolator.d';
7
+ import type { RGBNumValues } from '@windy/interpolatorTypes';
8
8
  import type { HTMLString, Timestamp, ExtendedStationType } from '@windy/types.d';
9
9
  /**
10
10
  * One minute in ms.
@@ -273,7 +273,7 @@ export declare const getAdjustedNow: (syncTime?: number) => number;
273
273
  */
274
274
  export declare const isValidLang: (lang: string) => lang is "en" | "zh-TW" | "zh" | "ja" | "fr" | "ko" | "it" | "ru" | "nl" | "cs" | "tr" | "pl" | "sv" | "fi" | "ro" | "el" | "hu" | "hr" | "ca" | "da" | "ar" | "fa" | "hi" | "ta" | "sk" | "uk" | "bg" | "he" | "is" | "lt" | "et" | "vi" | "sl" | "sr" | "id" | "th" | "sq" | "pt" | "nb" | "es" | "de" | "bn";
275
275
  /**
276
- * Safely joins server name (without trailing / ) and path
276
+ * Safely joins server name and path
277
277
  *
278
278
  * @param url1 URL to join
279
279
  * @param url2 URL to join
@@ -1748,6 +1748,16 @@ export interface CompiledExternalPluginConfig extends ExternalPluginConfig {
1748
1748
  * If the final build contains screenshot, they are stored here
1749
1749
  */
1750
1750
  screenshot?: string;
1751
+
1752
+ /**
1753
+ * User ID of the author of the plugin
1754
+ */
1755
+ windyUserId: number;
1756
+
1757
+ /**
1758
+ * URL of users profile
1759
+ */
1760
+ communityProfileUrl: string;
1751
1761
  }
1752
1762
 
1753
1763
  /**
package/types/types.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import weatherTable from '@plugins/_shared/detail-render/weatherTable';
2
- import { WeatherParameters, LatLon } from './interfaces';
2
+ import { WeatherParameters, LatLon } from './interfaces.d';
3
+
4
+ export * from '@windy/interpolatorTypes.d';
3
5
 
4
6
  /**
5
7
  * ISO date string representation of the Date
@@ -1,19 +0,0 @@
1
- #!/bin/bash
2
-
3
- source .secret-api-key.sh
4
-
5
- NAME=example
6
- SHA=$(git rev-parse --short HEAD)
7
- OWNER=windycom
8
-
9
- DIR=dist/example06
10
-
11
- cd ./$DIR
12
- echo "Creating plugin archive..."
13
- echo "{\"repositoryName\": \"https://github.com/windycom/windy-plugin-template\", \"commitSha\": \"${SHA}\", \"repositoryOwner\": \"${OWNER}\"}" > ./plugin-info.json
14
- jq -s '.[0] * .[1]' ./plugin.json ./plugin-info.json > ./plugin2.json
15
- rm ./plugin.json && mv ./plugin2.json ./plugin.json
16
- tar cf ./plugin.tar --exclude='./plugin.tar' .
17
- echo "Publishing plugin..."
18
- curl -s --fail-with-body -XPOST 'https://api.windy.com/api/windy-plugins/v1.0/upload' -H "x-windy-api-key: ${WINDY_API_KEY}" -F "plugin_archive=@./plugin.tar"
19
- rm ./plugin.tar