- 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
40 lines
1.7 KiB
TypeScript
40 lines
1.7 KiB
TypeScript
/**
|
|
* A message frame packer that serializes a messageKey and a payload into a binary format.
|
|
*
|
|
* +------------------+-------------------+----------------------------+--------------------------+
|
|
* | 4 bytes (Uint32) | Variable length | 1 byte (Uint8) | Variable length |
|
|
* | MessageKeyLength | MessageKey (JSON) | PayloadTypeIndicator (enum)| Payload (binary data) |
|
|
* +------------------+-------------------+----------------------------+--------------------------+
|
|
*
|
|
* MessageFrame Format:
|
|
*
|
|
* 1. MessageKeyLength (4 bytes):
|
|
* - A 4-byte unsigned integer indicating the length of the MessageKey JSON string.
|
|
*
|
|
* 2. MessageKey (Variable length):
|
|
* - The JSON string representing the message key, encoded as UTF-8.
|
|
*
|
|
* 3. PayloadTypeIndicator (1 byte):
|
|
* - A single byte enum value representing the type of the payload (e.g., Uint8Array, String, Object, ArrayBuffer, Blob).
|
|
*
|
|
* 4. Payload (Variable length):
|
|
* - The actual payload data, which can vary in type and length depending on the PayloadType.
|
|
*
|
|
*/
|
|
type MessageKeyTypeBase = string | object;
|
|
type PayloadType = Uint8Array | string | number | null | undefined | object | ArrayBuffer | Blob;
|
|
interface MessageFrame<T extends MessageKeyTypeBase> {
|
|
messageKey: T;
|
|
payload?: PayloadType;
|
|
}
|
|
export declare class MessageFramePacker<T extends MessageKeyTypeBase> {
|
|
private textEncoder;
|
|
private textDecoder;
|
|
pack({ messageKey, payload }: MessageFrame<T>): Promise<Uint8Array>;
|
|
unpack(packedData: ArrayBuffer): Promise<MessageFrame<T>>;
|
|
private payloadToUint8Array;
|
|
private deserializePayload;
|
|
private static getPayloadTypeIndicator;
|
|
}
|
|
export {};
|
|
//# sourceMappingURL=MessageFramePacker.d.ts.map
|