@nice2dev/ui-iot 1.0.10

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.
@@ -0,0 +1,453 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ export declare interface Alarm {
4
+ id: string;
5
+ deviceId: string;
6
+ capabilityId?: string;
7
+ severity: AlarmSeverity;
8
+ type: string;
9
+ message: string;
10
+ timestamp: Date;
11
+ acknowledged: boolean;
12
+ acknowledgedBy?: string;
13
+ acknowledgedAt?: Date;
14
+ cleared: boolean;
15
+ clearedAt?: Date;
16
+ }
17
+
18
+ export declare interface AlarmAction {
19
+ type: 'email' | 'sms' | 'webhook' | 'mqtt' | 'command';
20
+ config: Record<string, unknown>;
21
+ }
22
+
23
+ export declare interface AlarmCondition {
24
+ type: 'threshold' | 'deviation' | 'rateOfChange' | 'missing' | 'expression';
25
+ operator?: '>' | '>=' | '<' | '<=' | '==' | '!=';
26
+ value?: number;
27
+ windowMs?: number;
28
+ expression?: string;
29
+ }
30
+
31
+ export declare interface AlarmRule {
32
+ id: string;
33
+ name: string;
34
+ enabled: boolean;
35
+ deviceFilter?: string[];
36
+ capabilityFilter?: string[];
37
+ condition: AlarmCondition;
38
+ severity: AlarmSeverity;
39
+ message: string;
40
+ actions: AlarmAction[];
41
+ cooldown?: number;
42
+ }
43
+
44
+ export declare type AlarmSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
45
+
46
+ export declare type CapabilityType = 'temperature' | 'humidity' | 'pressure' | 'velocity' | 'acceleration' | 'voltage' | 'current' | 'power' | 'energy' | 'flow' | 'level' | 'position' | 'state' | 'switch' | 'dimmer' | 'color' | 'motion' | 'presence' | 'door' | 'window' | 'alarm' | 'custom';
47
+
48
+ export declare interface CoAPConfig {
49
+ host: string;
50
+ port: number;
51
+ useDTLS: boolean;
52
+ resources: CoAPResource[];
53
+ observe?: boolean;
54
+ blockSize?: number;
55
+ }
56
+
57
+ export declare interface CoAPResource {
58
+ path: string;
59
+ methods: Array<'GET' | 'POST' | 'PUT' | 'DELETE'>;
60
+ mediaType: string;
61
+ observable: boolean;
62
+ }
63
+
64
+ export declare interface ConnectionCredentials {
65
+ type: 'none' | 'basic' | 'token' | 'certificate' | 'oauth';
66
+ username?: string;
67
+ password?: string;
68
+ token?: string;
69
+ certificate?: string;
70
+ privateKey?: string;
71
+ }
72
+
73
+ export declare interface ConnectionInfo {
74
+ host?: string;
75
+ port?: number;
76
+ path?: string;
77
+ secure?: boolean;
78
+ credentials?: ConnectionCredentials;
79
+ options?: Record<string, unknown>;
80
+ }
81
+
82
+ export declare interface DataPoint {
83
+ deviceId: string;
84
+ capabilityId: string;
85
+ timestamp: Date;
86
+ value: unknown;
87
+ quality: DataQuality;
88
+ source?: string;
89
+ }
90
+
91
+ export declare type DataPointType = 'boolean' | 'int' | 'float' | 'string' | 'enum' | 'json' | 'binary';
92
+
93
+ export declare type DataQuality = 'good' | 'bad' | 'uncertain';
94
+
95
+ export declare interface DeployedModule {
96
+ id: string;
97
+ name: string;
98
+ version: string;
99
+ status: 'running' | 'stopped' | 'error' | 'pending';
100
+ image?: string;
101
+ resources?: {
102
+ cpuLimit?: number;
103
+ memoryLimitMB?: number;
104
+ };
105
+ env?: Record<string, string>;
106
+ ports?: Array<{
107
+ container: number;
108
+ host: number;
109
+ protocol: 'tcp' | 'udp';
110
+ }>;
111
+ }
112
+
113
+ export declare interface DeviceCapability {
114
+ id: string;
115
+ type: CapabilityType;
116
+ name: string;
117
+ dataType: DataPointType;
118
+ unit?: string;
119
+ min?: number;
120
+ max?: number;
121
+ enumValues?: string[];
122
+ readable: boolean;
123
+ writable: boolean;
124
+ address?: string;
125
+ }
126
+
127
+ export declare interface DeviceLocation {
128
+ building?: string;
129
+ floor?: string;
130
+ room?: string;
131
+ zone?: string;
132
+ coordinates?: {
133
+ lat: number;
134
+ lng: number;
135
+ };
136
+ indoor?: {
137
+ x: number;
138
+ y: number;
139
+ z?: number;
140
+ };
141
+ }
142
+
143
+ export declare interface DeviceMetadata {
144
+ manufacturer?: string;
145
+ model?: string;
146
+ serialNumber?: string;
147
+ description?: string;
148
+ customFields?: Record<string, unknown>;
149
+ }
150
+
151
+ export declare type DeviceStatus = 'online' | 'offline' | 'warning' | 'error' | 'maintenance' | 'unknown';
152
+
153
+ export declare type DeviceType = 'sensor' | 'actuator' | 'gateway' | 'controller' | 'plc' | 'rtu' | 'edge' | 'camera' | 'meter' | 'hvac' | 'lighting' | 'custom';
154
+
155
+ export declare interface EdgeConnectivity {
156
+ cloudConnected: boolean;
157
+ localNetwork: string;
158
+ publicIP?: string;
159
+ vpnActive?: boolean;
160
+ lastSync?: Date;
161
+ }
162
+
163
+ export declare interface EdgeHardware {
164
+ cpu: string;
165
+ cores: number;
166
+ memoryMB: number;
167
+ storageMB: number;
168
+ architecture: 'x86_64' | 'arm64' | 'arm32' | 'other';
169
+ }
170
+
171
+ export declare interface EdgeMetrics {
172
+ cpuUsage: number;
173
+ memoryUsage: number;
174
+ diskUsage: number;
175
+ networkIn: number;
176
+ networkOut: number;
177
+ uptime: number;
178
+ timestamp: Date;
179
+ }
180
+
181
+ export declare interface EdgeNode {
182
+ id: string;
183
+ name: string;
184
+ type: EdgeNodeType;
185
+ status: EdgeNodeStatus;
186
+ hardware: EdgeHardware;
187
+ software: EdgeSoftware;
188
+ connectivity: EdgeConnectivity;
189
+ deployedModules: DeployedModule[];
190
+ metrics?: EdgeMetrics;
191
+ }
192
+
193
+ export declare type EdgeNodeStatus = 'running' | 'stopped' | 'updating' | 'error' | 'unreachable';
194
+
195
+ export declare type EdgeNodeType = 'gateway' | 'compute' | 'storage' | 'hybrid';
196
+
197
+ export declare interface EdgeSoftware {
198
+ os: string;
199
+ osVersion: string;
200
+ runtime: string;
201
+ runtimeVersion: string;
202
+ agent: string;
203
+ agentVersion: string;
204
+ }
205
+
206
+ export declare interface FirmwareInfo {
207
+ version: string;
208
+ lastUpdated?: Date;
209
+ updateAvailable?: string;
210
+ updateRequired?: boolean;
211
+ }
212
+
213
+ /**
214
+ * @package @nice2dev/ui-iot
215
+ * IoT Components Type Definitions
216
+ */
217
+ export declare interface IoTDevice {
218
+ id: string;
219
+ name: string;
220
+ type: DeviceType;
221
+ status: DeviceStatus;
222
+ protocol: ProtocolType;
223
+ connectionInfo: ConnectionInfo;
224
+ metadata?: DeviceMetadata;
225
+ capabilities: DeviceCapability[];
226
+ lastSeen?: Date;
227
+ firmware?: FirmwareInfo;
228
+ location?: DeviceLocation;
229
+ tags?: string[];
230
+ }
231
+
232
+ export declare interface IoTWidget {
233
+ id: string;
234
+ type: IoTWidgetType;
235
+ title: string;
236
+ position: {
237
+ x: number;
238
+ y: number;
239
+ width: number;
240
+ height: number;
241
+ };
242
+ config: IoTWidgetConfig;
243
+ }
244
+
245
+ export declare interface IoTWidgetConfig {
246
+ deviceIds?: string[];
247
+ capabilityIds?: string[];
248
+ timeRange?: string;
249
+ refreshInterval?: number;
250
+ chartType?: string;
251
+ gaugeConfig?: {
252
+ min: number;
253
+ max: number;
254
+ thresholds?: Array<{
255
+ value: number;
256
+ color: string;
257
+ }>;
258
+ };
259
+ mapConfig?: {
260
+ center?: {
261
+ lat: number;
262
+ lng: number;
263
+ };
264
+ zoom?: number;
265
+ showDevices?: boolean;
266
+ showConnections?: boolean;
267
+ };
268
+ }
269
+
270
+ export declare type IoTWidgetType = 'device-list' | 'device-status' | 'telemetry-chart' | 'gauge' | 'map' | 'alarms' | 'control-panel' | 'topology' | 'kpi' | 'camera-feed';
271
+
272
+ export declare interface ModbusConfig {
273
+ type: 'tcp' | 'rtu';
274
+ host?: string;
275
+ port?: number;
276
+ serialPort?: string;
277
+ baudRate?: number;
278
+ parity?: 'none' | 'even' | 'odd';
279
+ stopBits?: 1 | 2;
280
+ dataBits?: 7 | 8;
281
+ slaveId: number;
282
+ timeout: number;
283
+ registers: ModbusRegister[];
284
+ }
285
+
286
+ export declare interface ModbusRegister {
287
+ name: string;
288
+ address: number;
289
+ type: 'coil' | 'discrete' | 'holding' | 'input';
290
+ dataType: 'bool' | 'int16' | 'uint16' | 'int32' | 'uint32' | 'float32' | 'float64' | 'string';
291
+ scale?: number;
292
+ offset?: number;
293
+ unit?: string;
294
+ readable: boolean;
295
+ writable: boolean;
296
+ }
297
+
298
+ export declare interface MQTTConfig {
299
+ broker: string;
300
+ port: number;
301
+ clientId: string;
302
+ username?: string;
303
+ password?: string;
304
+ useTLS: boolean;
305
+ keepAlive: number;
306
+ cleanSession: boolean;
307
+ topics: MQTTTopic[];
308
+ will?: {
309
+ topic: string;
310
+ payload: string;
311
+ qos: 0 | 1 | 2;
312
+ retain: boolean;
313
+ };
314
+ }
315
+
316
+ export declare interface MQTTTopic {
317
+ pattern: string;
318
+ qos: 0 | 1 | 2;
319
+ direction: 'subscribe' | 'publish' | 'both';
320
+ payloadFormat: 'json' | 'text' | 'binary' | 'sparkplug';
321
+ }
322
+
323
+ export declare interface NiceDeviceExplorerProps {
324
+ device: IoTDevice;
325
+ capabilities?: DeviceCapability[];
326
+ telemetry?: DataPoint[];
327
+ onCommand?: (capabilityId: string, value: unknown) => Promise<void>;
328
+ onRefresh?: () => void;
329
+ fetchHistory?: (capabilityId: string, range: {
330
+ start: Date;
331
+ end: Date;
332
+ }) => Promise<DataPoint[]>;
333
+ className?: string;
334
+ }
335
+
336
+ /**
337
+ * NiceEdgeManager - Edge Node Management Component
338
+ */
339
+ export declare function NiceEdgeManager({ nodes, modules, onNodeSelect, onModuleDeploy, onModuleAction, onNodeSync, className, }: NiceEdgeManagerProps): default_2.ReactElement;
340
+
341
+ export declare interface NiceEdgeManagerProps {
342
+ nodes?: EdgeNode[];
343
+ modules?: DeployedModule[];
344
+ onNodeSelect?: (node: EdgeNode) => void;
345
+ onModuleDeploy?: (nodeId: string, module: Partial<DeployedModule>) => Promise<void>;
346
+ onModuleAction?: (nodeId: string, moduleId: string, action: 'start' | 'stop' | 'restart' | 'remove') => Promise<void>;
347
+ onNodeSync?: (nodeId: string) => Promise<void>;
348
+ className?: string;
349
+ }
350
+
351
+ /**
352
+ * NiceIoTDashboard - IoT Device Dashboard
353
+ */
354
+ export declare function NiceIoTDashboard({ devices, widgets: initialWidgets, alarms, onDeviceSelect, onWidgetChange, onCommand, onAlarmAcknowledge, fetchTelemetry, className, }: NiceIoTDashboardProps): default_2.ReactElement;
355
+
356
+ export declare interface NiceIoTDashboardProps {
357
+ devices?: IoTDevice[];
358
+ widgets?: IoTWidget[];
359
+ alarms?: Alarm[];
360
+ onDeviceSelect?: (device: IoTDevice) => void;
361
+ onWidgetChange?: (widgets: IoTWidget[]) => void;
362
+ onCommand?: (deviceId: string, capabilityId: string, value: unknown) => Promise<void>;
363
+ onAlarmAcknowledge?: (alarmId: string) => void;
364
+ fetchTelemetry?: (query: TimeSeriesQuery) => Promise<TimeSeriesData[]>;
365
+ className?: string;
366
+ }
367
+
368
+ /**
369
+ * NiceProtocolConfig - Protocol Configuration Component
370
+ */
371
+ export declare function NiceProtocolConfig({ protocol: initialProtocol, config: initialConfig, onSave, onTest, className, }: NiceProtocolConfigProps): default_2.ReactElement;
372
+
373
+ export declare interface NiceProtocolConfigProps {
374
+ protocol: ProtocolType;
375
+ config?: {
376
+ type: 'mqtt';
377
+ config: Partial<MQTTConfig>;
378
+ } | {
379
+ type: 'coap';
380
+ config: Partial<CoAPConfig>;
381
+ } | {
382
+ type: 'modbus';
383
+ config: Partial<ModbusConfig>;
384
+ } | {
385
+ type: 'opcua';
386
+ config: Partial<OPCUAConfig>;
387
+ };
388
+ onSave?: (config: MQTTConfig | CoAPConfig | ModbusConfig | OPCUAConfig) => void;
389
+ onTest?: (config: MQTTConfig | CoAPConfig | ModbusConfig | OPCUAConfig) => Promise<{
390
+ success: boolean;
391
+ message: string;
392
+ }>;
393
+ className?: string;
394
+ }
395
+
396
+ export declare interface OPCUAConfig {
397
+ endpointUrl: string;
398
+ securityMode: 'None' | 'Sign' | 'SignAndEncrypt';
399
+ securityPolicy?: string;
400
+ authentication: 'anonymous' | 'username' | 'certificate';
401
+ username?: string;
402
+ password?: string;
403
+ certificate?: string;
404
+ privateKey?: string;
405
+ applicationName: string;
406
+ nodes: OPCUANode[];
407
+ subscriptions?: OPCUASubscription[];
408
+ }
409
+
410
+ export declare interface OPCUANode {
411
+ nodeId: string;
412
+ displayName: string;
413
+ dataType: string;
414
+ browse?: boolean;
415
+ read?: boolean;
416
+ write?: boolean;
417
+ }
418
+
419
+ export declare interface OPCUASubscription {
420
+ id: string;
421
+ publishingInterval: number;
422
+ samplingInterval: number;
423
+ queueSize: number;
424
+ nodes: string[];
425
+ }
426
+
427
+ export declare type ProtocolType = 'mqtt' | 'coap' | 'modbus-tcp' | 'modbus-rtu' | 'opcua' | 'bacnet' | 'zigbee' | 'zwave' | 'lorawan' | 'http' | 'websocket' | 'custom';
428
+
429
+ export declare interface TimeSeriesAggregation {
430
+ function: 'avg' | 'min' | 'max' | 'sum' | 'count' | 'first' | 'last' | 'stddev';
431
+ interval: string;
432
+ }
433
+
434
+ export declare interface TimeSeriesData {
435
+ deviceId: string;
436
+ capabilityId: string;
437
+ points: Array<{
438
+ timestamp: Date;
439
+ value: unknown;
440
+ }>;
441
+ }
442
+
443
+ export declare interface TimeSeriesQuery {
444
+ deviceIds: string[];
445
+ capabilityIds?: string[];
446
+ startTime: Date;
447
+ endTime: Date;
448
+ aggregation?: TimeSeriesAggregation;
449
+ interval?: string;
450
+ limit?: number;
451
+ }
452
+
453
+ export { }