- 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
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
/**
|
|
Create an error from multiple errors.
|
|
*/
|
|
declare class AggregateError<T extends Error = Error> extends Error implements Iterable<T> {
|
|
readonly name: 'AggregateError';
|
|
|
|
/**
|
|
@param errors - If a string, a new `Error` is created with the string as the error message. If a non-Error object, a new `Error` is created with all properties from the object copied over.
|
|
@returns An Error that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors.
|
|
|
|
@example
|
|
```
|
|
import AggregateError = require('aggregate-error');
|
|
|
|
const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]);
|
|
|
|
throw error;
|
|
|
|
// AggregateError:
|
|
// Error: foo
|
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:33)
|
|
// Error: bar
|
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
|
// Error: baz
|
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
|
// at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)
|
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
|
// at Module._compile (module.js:556:32)
|
|
// at Object.Module._extensions..js (module.js:565:10)
|
|
// at Module.load (module.js:473:32)
|
|
// at tryModuleLoad (module.js:432:12)
|
|
// at Function.Module._load (module.js:424:3)
|
|
// at Module.runMain (module.js:590:10)
|
|
// at run (bootstrap_node.js:394:7)
|
|
// at startup (bootstrap_node.js:149:9)
|
|
|
|
|
|
for (const individualError of error) {
|
|
console.log(individualError);
|
|
}
|
|
//=> [Error: foo]
|
|
//=> [Error: bar]
|
|
//=> [Error: baz]
|
|
```
|
|
*/
|
|
constructor(errors: ReadonlyArray<T | {[key: string]: any} | string>);
|
|
|
|
[Symbol.iterator](): IterableIterator<T>;
|
|
}
|
|
|
|
export = AggregateError;
|