- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
81 lines
2.8 KiB
TypeScript
81 lines
2.8 KiB
TypeScript
import type { DevToolsPluginClientOptions } from './devtools.types';
|
|
export interface Options {
|
|
/**
|
|
* Reconnect interval in milliseconds.
|
|
* @default 1500
|
|
*/
|
|
retriesInterval?: number;
|
|
/**
|
|
* The maximum number of retries.
|
|
* @default 200
|
|
*/
|
|
maxRetries?: number;
|
|
/**
|
|
* The timeout in milliseconds for the WebSocket connecting.
|
|
*/
|
|
connectTimeout?: number;
|
|
/**
|
|
* The error handler.
|
|
* @default throwing an error
|
|
*/
|
|
onError?: (error: Error) => void;
|
|
/**
|
|
* The callback to be called when the WebSocket is reconnected.
|
|
* @default no-op
|
|
*/
|
|
onReconnect?: (reason: string) => void;
|
|
/**
|
|
* The [`binaryType`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/binaryType).
|
|
*/
|
|
binaryType?: DevToolsPluginClientOptions['websocketBinaryType'];
|
|
}
|
|
export declare class WebSocketWithReconnect implements WebSocket {
|
|
readonly url: string;
|
|
private readonly retriesInterval;
|
|
private readonly maxRetries;
|
|
private readonly connectTimeout;
|
|
private readonly onError;
|
|
private readonly onReconnect;
|
|
private ws;
|
|
private retries;
|
|
private connectTimeoutHandle;
|
|
private isClosed;
|
|
private sendQueue;
|
|
private lastCloseEvent;
|
|
private readonly emitter;
|
|
private readonly eventSubscriptions;
|
|
private readonly wsBinaryType?;
|
|
constructor(url: string, options?: Options);
|
|
close(code?: number, reason?: string): void;
|
|
addEventListener(event: 'message', listener: (event: WebSocketMessageEvent) => void): void;
|
|
addEventListener(event: 'open', listener: () => void): void;
|
|
addEventListener(event: 'error', listener: (event: WebSocketErrorEvent) => void): void;
|
|
addEventListener(event: 'close', listener: (event: WebSocketCloseEvent) => void): void;
|
|
removeEventListener(event: string, listener: (event: any) => void): void;
|
|
private connect;
|
|
send(data: string | ArrayBufferView | Blob | ArrayBufferLike): void;
|
|
private handleOpen;
|
|
private handleMessage;
|
|
private handleError;
|
|
private handleClose;
|
|
private handleConnectTimeout;
|
|
private clearConnectTimeoutIfNeeded;
|
|
private reconnectIfNeeded;
|
|
private wsClose;
|
|
get readyState(): number;
|
|
readonly CONNECTING = 0;
|
|
readonly OPEN = 1;
|
|
readonly CLOSING = 2;
|
|
readonly CLOSED = 3;
|
|
get binaryType(): BinaryType;
|
|
get bufferedAmount(): number;
|
|
get extensions(): string;
|
|
get protocol(): string;
|
|
ping(): void;
|
|
dispatchEvent(event: Event): boolean;
|
|
set onclose(value: ((e: WebSocketCloseEvent) => any) | null);
|
|
set onerror(value: ((e: Event) => any) | null);
|
|
set onmessage(value: ((e: WebSocketMessageEvent) => any) | null);
|
|
set onopen(value: (() => any) | null);
|
|
}
|
|
//# sourceMappingURL=WebSocketWithReconnect.d.ts.map
|