Skip to content

Commit 53d12e8

Browse files
committed
Sync Windy types
@windycom/plugin-devtools@3.0.1
1 parent 0557ed5 commit 53d12e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1521
-586
lines changed

libs/windy-sounding/types/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

libs/windy-sounding/types/client/BottomSlide.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export declare class BottomSlide extends Drag {
4848
ondrag(_x: number, y: number, e: Event): void;
4949
ondragend(): void;
5050
startDrag(e: TouchEvent): void;
51+
release(): void;
5152
private initCloseOnSwipeDown;
53+
private setHalfOpen;
5254
private updatePosition;
55+
private onRqstPluginHalfOpen;
5356
}

libs/windy-sounding/types/client/Color.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export declare class Color {
7676
* bOpaque .. set alpha to 255
7777
* bPremultiply .. mul RGB by A
7878
* valueScale .. optional scale used for WebGL texture data (coef 0.5 means half step - gradient size is doubled)
79-
* return .. output Uint8Array with color data
79+
* return .. output Uint8Array with color data (NOTE: Uint8ClampedArray NOT SUPPORTED in WebGL!)
8080
*/
8181
createGradientArray(bOpaque?: boolean, bPremultiply?: boolean, valueScale?: number): Uint8Array;
8282
/**
Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
import { Calendar } from '@windy/Calendar';
22
import { Product } from '@windy/Product';
33
import type { ProductInitParams } from '@windy/Product';
4-
/**
5-
* Common product params for ECMWF products.
6-
*/
7-
export declare const EcmwfProductParams: {
8-
modelName: string;
9-
modelResolution: number;
10-
provider: string;
11-
interval: number;
12-
intervalPremium: number;
13-
maxTileZoom: {
14-
free: number;
15-
premium: number;
16-
};
17-
dataQuality: 'normal';
18-
};
194
export declare class EcmwfProduct extends Product {
205
calendar: Calendar;
216
constructor(params: Partial<ProductInitParams>);
22-
/**
23-
* Create fake minifest file for ECMWF product to use it during rendering of
24-
* UI before real minifest is loaded.
25-
*
26-
* DO NOT TRY TO USE THIS CALENDAR FOR FETCHING DATA FROM SERVER!!!!
27-
*/
28-
static createVirtualCalendar(this: EcmwfProduct): Calendar;
297
}

libs/windy-sounding/types/client/ExternalSveltePlugin.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export declare class ExternalSveltePlugin extends SveltePlugin<'windy-external-p
3232
mobileConfig: Record<InstalledExternalPluginConfig['mobileUI'], Config2config>;
3333
desktopConfig: Record<InstalledExternalPluginConfig['desktopUI'], Config2config>;
3434
widthOfRhPane: number;
35+
version: string;
3536
listenToSingleclick: ExternalPluginConfig['listenToSingleclick'];
3637
addToContextmenu: ExternalPluginConfig['addToContextmenu'];
3738
constructor(
@@ -45,9 +46,14 @@ export declare class ExternalSveltePlugin extends SveltePlugin<'windy-external-p
4546
listenToSingleclick,
4647
addToContextmenu,
4748
url,
49+
version,
4850
}: InstalledExternalPluginConfig,
4951
);
5052
open({ params, disableOpeningAnimation, qs }: PluginOpeningOptions<'windy-external-plugin'>): Promise<void | boolean>;
53+
hasNewerVersion(latestVersion: string): boolean;
54+
showConfirmationWindow(): Promise<boolean>;
55+
getDayDiff(timestamp: string): number;
56+
uninstallPlugin(): Promise<void>;
5157
getCss(): string;
5258
}
5359
export {};

libs/windy-sounding/types/client/IDB.d.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
import type { Timestamp } from '@windy/types.d';
2+
/**
3+
* List of all collections we will need in our database
4+
* remember to update this list when adding new collections
5+
* Collections MUST be created at once
6+
*/
7+
export declare const allUsedCollections: readonly [
8+
'customColors',
9+
'installedPlugins',
10+
'likedStoryComments',
11+
'log',
12+
'markedNotams',
13+
'popularLocations',
14+
'searchRecents',
15+
'seenArticles',
16+
'seenPromos',
17+
'seenStories',
18+
'slidedCapAlerts',
19+
'userAlerts',
20+
'userFavs',
21+
];
222
/**
323
* Allowed data types for storage
424
*/
5-
export type DatabaseStore =
6-
| 'userFavs'
7-
| 'userAlerts'
8-
| 'customColors'
9-
| 'searchRecents'
10-
| 'markedNotams'
11-
| 'minifests'
12-
| 'seenArticles'
13-
| 'seenPromos';
25+
export type DatabaseStore = (typeof allUsedCollections)[number];
1426
export type BackendItem<V> = {
1527
updated: Timestamp;
1628
id: string;

libs/windy-sounding/types/client/Metric.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ export declare abstract class Metric<T extends string | number = string | number
9595
* @param params
9696
*/
9797
constructor(params: MetricInitParams);
98+
/**
99+
* Returns metric value
100+
*/
101+
getMetric(): MetricItem;
98102
onMetricChanged(metric: MetricItem): void;
99103
getDefault(): MetricItem;
100104
setDefault(): void;
101105
/**
102106
* get value + label on a basis of user selected metric
103107
*/
104-
convertValue(value: NumValue, separator?: string, suffix?: string): string;
108+
convertValue(value: NumValue, separator?: string, suffix?: string, forcedPrecision?: number): string;
105109
/**
106110
* Not available
107111
*/

libs/windy-sounding/types/client/Overlay.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export declare class Overlay<
163163
/**
164164
* Just proxy to the Metric's metric property
165165
*/
166-
get metric(): '' | import('./Metric').MetricItem;
166+
get metric(): import('./Metric').MetricItem | '';
167167
protected initProperties(): void;
168168
}
169169
export {};

libs/windy-sounding/types/client/Plugin.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ export declare class Plugin<P extends PluginIdent> {
110110
* Ready to be overloaded
111111
*/
112112
paramsChanged(..._args: unknown[]): void;
113+
/**
114+
* Ready to be overloaded
115+
*/
116+
onRenderStart(..._args: unknown[]): void;
113117
protected initProperties(): void;
114118
}
115119
export {};

libs/windy-sounding/types/client/Product.d.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ export declare class Product {
229229
*/
230230
hideProductSwitch?: boolean;
231231
constructor(params: ProductInitParams);
232-
refTime(): YYYYMMDDHH | '';
232+
refTime(): YYYYMMDDHH | undefined;
233233
getUpdateTimes(): {
234234
refTime: ISODateString;
235235
minUpdate: Timestamp;
236236
} | null;
237-
moveTs(moveRight: boolean, isAccu?: boolean): boolean | void;
237+
moveTs(moveRight: boolean, isAccu?: boolean): boolean;
238238
getMinifestUrl(): string;
239239
loadMinifest(): Promise<http.HttpPayload<MinifestObject>>;
240240
loadAndGetReftime(): Promise<ISODateString | undefined>;
@@ -248,14 +248,6 @@ export declare class Product {
248248
printLogo(): void;
249249
getCalendar(): Promise<Calendar>;
250250
protected expire(): void;
251-
/**
252-
* Since dissemination of minifests is not instant, and can last for minutes,
253-
* we have to double check, that incoming minifest
254-
* is newer than the one we have in store. If not, we keep the old one.
255-
*
256-
* @returns Incoming, or stored minifest, which is newer
257-
*/
258-
protected getUpdatedMinifest(minifest: MinifestObject): Promise<MinifestObject>;
259251
protected setExpireTime(): void;
260252
/**
261253
* Major reason for this error is user's bad connection, which is handled

0 commit comments

Comments
 (0)