@nice2dev/ui-buildings 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,1191 @@
1
+ import { AlignmentGuide } from '@nice2dev/spatial-core';
2
+ import { AngleUnit } from '@nice2dev/spatial-core';
3
+ import { AreaUnit } from '@nice2dev/spatial-core';
4
+ import { BoundingBox } from '@nice2dev/spatial-core';
5
+ import { CSSProperties } from 'react';
6
+ import { default as default_2 } from 'react';
7
+ import { FloorPlanDocument } from '@nice2dev/spatial-core';
8
+ import { LengthUnit } from '@nice2dev/spatial-core';
9
+ import { Point2D as Point2D_2 } from '@nice2dev/spatial-core';
10
+ import { SnapMode } from '@nice2dev/spatial-core';
11
+ import { SpatialObject } from '@nice2dev/spatial-core';
12
+ import { TracelessStorageProps } from '@nice2dev/ui';
13
+ import { UnitSystem } from '@nice2dev/spatial-core';
14
+
15
+ declare interface AccessLogEntry {
16
+ id: string;
17
+ timestamp: string;
18
+ user?: string;
19
+ method: 'pin' | 'key' | 'app' | 'fingerprint' | 'rfid' | 'auto';
20
+ success: boolean;
21
+ }
22
+
23
+ declare type ActionType = 'device_control' | 'scene_activate' | 'notification' | 'delay' | 'webhook' | 'http_request' | 'building_mode' | 'script';
24
+
25
+ export declare interface AlarmState {
26
+ armed: 'disarmed' | 'armed_home' | 'armed_away' | 'armed_night' | 'armed_vacation';
27
+ triggered: boolean;
28
+ triggeredZones?: string[];
29
+ code?: string;
30
+ }
31
+
32
+ declare type AlertSeverity = 'info' | 'warning' | 'critical' | 'resolved';
33
+
34
+ export declare type AutomationAction = DeviceControlAction | SceneActivateAction | NotificationAction | DelayAction | {
35
+ type: ActionType;
36
+ [key: string]: unknown;
37
+ };
38
+
39
+ export declare interface AutomationCondition {
40
+ operator?: ConditionOperator;
41
+ conditions?: AutomationCondition[];
42
+ deviceId?: BuildingId;
43
+ attribute?: string;
44
+ operator2?: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
45
+ value?: unknown;
46
+ timeAfter?: string;
47
+ timeBefore?: string;
48
+ days?: string[];
49
+ OccupancyMode?: string;
50
+ }
51
+
52
+ export declare type AutomationTrigger = TimeTrigger | SunTrigger | DeviceStateTrigger | SensorThresholdTrigger | GeofenceTrigger | {
53
+ type: TriggerType;
54
+ [key: string]: unknown;
55
+ };
56
+
57
+ export declare interface BlindState {
58
+ open: boolean;
59
+ position: number;
60
+ tilt?: number;
61
+ moving?: 'up' | 'down' | null;
62
+ }
63
+
64
+ export declare type BmsProtocol = 'bacnet' | 'dali' | 'lonworks' | 'opc-ua' | 'knx' | 'modbus';
65
+
66
+ export declare interface Building {
67
+ id: BuildingId;
68
+ name: string;
69
+ address?: string;
70
+ timezone?: string;
71
+ latitude?: number;
72
+ longitude?: number;
73
+ floors: BuildingFloor[];
74
+ rooms: BuildingZone[];
75
+ devices: BuildingDevice[];
76
+ scenes: BuildingScene[];
77
+ automations: BuildingAutomation[];
78
+ floorPlan?: FloorPlanFloor[];
79
+ }
80
+
81
+ /** Root aggregated building model used as top-level prop for most components */
82
+ export declare interface Building {
83
+ id: BuildingId;
84
+ name: string;
85
+ type: BuildingType;
86
+ address?: string;
87
+ timezone?: string;
88
+ latitude?: number;
89
+ longitude?: number;
90
+ floors: BuildingFloor[];
91
+ zones: BuildingZone[];
92
+ devices: BuildingDevice[];
93
+ scenes: BuildingScene[];
94
+ automations: BuildingAutomation[];
95
+ floorPlan?: FloorPlanFloor[];
96
+ }
97
+
98
+ declare interface BuildingAlert {
99
+ id: BuildingId;
100
+ deviceId?: BuildingId;
101
+ zoneId?: BuildingId;
102
+ type: string;
103
+ severity: AlertSeverity;
104
+ title: string;
105
+ message: string;
106
+ timestamp: string;
107
+ acknowledged: boolean;
108
+ acknowledgedAt?: string;
109
+ resolvedAt?: string;
110
+ }
111
+
112
+ export declare interface BuildingAutomation {
113
+ id: BuildingId;
114
+ name: string;
115
+ description?: string;
116
+ enabled: boolean;
117
+ triggers: AutomationTrigger[];
118
+ /** Optional list of conditions that must all match. */
119
+ conditions?: AutomationCondition[];
120
+ actions: AutomationAction[];
121
+ lastTriggered?: string;
122
+ runCount?: number;
123
+ category?: string;
124
+ icon?: string;
125
+ }
126
+
127
+ export declare interface BuildingDevice {
128
+ id: BuildingId;
129
+ name: string;
130
+ type: DeviceType;
131
+ zoneId?: BuildingId;
132
+ area?: string;
133
+ protocol: DeviceProtocol;
134
+ model?: string;
135
+ manufacturer?: string;
136
+ firmwareVersion?: string;
137
+ status: DeviceStatus;
138
+ state: DeviceState;
139
+ capabilities: DeviceCapability[];
140
+ /** Position on floor plan (relative to room bounds, 0-1) */
141
+ floorPlanPosition?: Point2D;
142
+ icon?: string;
143
+ color?: string;
144
+ tags?: string[];
145
+ favorite?: boolean;
146
+ hidden?: boolean;
147
+ lastSeen?: string;
148
+ metadata?: Record<string, unknown>;
149
+ }
150
+
151
+ export declare interface BuildingFloor {
152
+ id: BuildingId;
153
+ name: string;
154
+ level: number;
155
+ icon?: string;
156
+ /** Zones contained on this floor. */
157
+ zones?: FloorPlanZone[];
158
+ }
159
+
160
+ export declare type BuildingId = string;
161
+
162
+ export declare interface BuildingScene {
163
+ id: BuildingId;
164
+ name: string;
165
+ icon?: string;
166
+ color?: string;
167
+ description?: string;
168
+ /** Per-device target states applied when the scene activates. */
169
+ deviceTargets: SceneDeviceTarget[];
170
+ /** @deprecated alias for {@link deviceTargets}. */
171
+ devices?: SceneDeviceTarget[];
172
+ isActive?: boolean;
173
+ favorite?: boolean;
174
+ category?: string;
175
+ activatedAt?: string;
176
+ }
177
+
178
+ export declare interface BuildingState {
179
+ buildingId: BuildingId;
180
+ mode: OccupancyMode;
181
+ occupants?: string[];
182
+ lastModeChange?: string;
183
+ weather?: {
184
+ temp: number;
185
+ description: string;
186
+ icon: string;
187
+ humidity: number;
188
+ windSpeed: number;
189
+ };
190
+ energy?: EnergyStats;
191
+ /** Per-zone live occupancy snapshot. */
192
+ occupancy?: Record<string, {
193
+ occupancy?: number;
194
+ mode?: OccupancyMode;
195
+ } | undefined>;
196
+ activeAlerts: BuildingAlert[];
197
+ activeScenes: BuildingId[];
198
+ }
199
+
200
+ export declare type BuildingType = 'residential' | 'office' | 'retail' | 'industrial' | 'hotel' | 'hospital' | 'school' | 'warehouse' | 'mixed' | 'other';
201
+
202
+ export declare interface BuildingZone {
203
+ id: BuildingId;
204
+ name: string;
205
+ type: ZoneType;
206
+ floorId?: BuildingId;
207
+ icon?: string;
208
+ color?: string;
209
+ area?: number;
210
+ order?: number;
211
+ /** Live climate / occupancy snapshot. */
212
+ temperature?: number;
213
+ humidity?: number;
214
+ co2?: number;
215
+ occupancy?: number;
216
+ /** Optional list of device IDs attached to this zone. */
217
+ deviceIds?: BuildingId[];
218
+ }
219
+
220
+ export declare interface CameraState {
221
+ streaming: boolean;
222
+ recording: boolean;
223
+ motionDetected: boolean;
224
+ streamUrl?: string;
225
+ snapshotUrl?: string;
226
+ lastMotion?: string;
227
+ }
228
+
229
+ export declare interface ClimateState extends ThermostatState {
230
+ swingMode?: 'off' | 'vertical' | 'horizontal' | 'both';
231
+ presetMode?: 'eco' | 'comfort' | 'boost' | 'sleep' | 'away';
232
+ }
233
+
234
+ declare type ConditionOperator = 'and' | 'or';
235
+
236
+ declare interface DelayAction {
237
+ type: 'delay';
238
+ seconds: number;
239
+ }
240
+
241
+ /** Capability identifier. Either a free-form string (e.g. `'dimming'`) or a structured descriptor. */
242
+ declare type DeviceCapability = string | {
243
+ name: string;
244
+ type: 'onoff' | 'brightness' | 'color_temp' | 'color_rgb' | 'temperature_set' | 'mode' | 'position' | 'tilt' | 'volume' | 'media_controls' | 'lock_unlock' | 'alarm_arm' | 'energy_read' | 'text' | 'button' | 'sensor_read' | 'camera_stream';
245
+ readOnly?: boolean;
246
+ min?: number;
247
+ max?: number;
248
+ step?: number;
249
+ options?: string[];
250
+ };
251
+
252
+ declare interface DeviceControlAction {
253
+ type: 'device_control';
254
+ deviceId: BuildingId;
255
+ state: Partial<DeviceState>;
256
+ transitionMs?: number;
257
+ }
258
+
259
+ export declare type DeviceProtocol = 'zigbee' | 'z-wave' | 'wifi' | 'bluetooth' | 'matter' | 'thread' | 'knx' | 'modbus' | 'cloud' | 'local_api' | 'other';
260
+
261
+ declare type DeviceState = LightState | ThermostatState | LockState | BlindState | SwitchState | CameraState | AlarmState | SensorState | ClimateState | MediaPlayerState | EnergyMeterState | Record<string, unknown>;
262
+
263
+ declare interface DeviceStateTrigger {
264
+ type: 'device_state';
265
+ deviceId: BuildingId;
266
+ attribute: string;
267
+ operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'changed';
268
+ value?: unknown;
269
+ }
270
+
271
+ export declare type DeviceStatus = 'online' | 'offline' | 'unavailable' | 'updating' | 'error';
272
+
273
+ export declare type DeviceType = 'light' | 'dimmer' | 'rgb_light' | 'led_strip' | 'thermostat' | 'heater' | 'air_conditioner' | 'fan' | 'heat_pump' | 'lock' | 'door' | 'window' | 'blind' | 'shutter' | 'garage' | 'gate' | 'switch' | 'outlet' | 'smart_plug' | 'power_strip' | 'camera' | 'doorbell' | 'alarm' | 'siren' | 'motion_sensor' | 'door_sensor' | 'window_sensor' | 'smoke_detector' | 'co_detector' | 'water_leak' | 'gas_detector' | 'temperature_sensor' | 'humidity_sensor' | 'air_quality' | 'light_sensor' | 'presence_sensor' | 'speaker' | 'tv' | 'media_player' | 'vacuum' | 'washing_machine' | 'dishwasher' | 'oven' | 'fridge' | 'irrigation' | 'pool' | 'ev_charger' | 'solar_panel' | 'battery' | 'energy_meter' | 'hub' | 'router' | 'other';
274
+
275
+ declare type DisplayDensity = 'compact' | 'comfortable' | 'spacious';
276
+
277
+ export declare interface EnergyByZone {
278
+ zoneId: BuildingId;
279
+ zoneName: string;
280
+ kwh: number;
281
+ percentOfTotal: number;
282
+ }
283
+
284
+ export declare interface EnergyMeterState {
285
+ power: number;
286
+ voltage: number;
287
+ current: number;
288
+ frequency?: number;
289
+ energyTotal: number;
290
+ energyToday: number;
291
+ energyMonth: number;
292
+ tariff?: number;
293
+ }
294
+
295
+ declare interface EnergyStats {
296
+ /** kWh consumed today */
297
+ today: number;
298
+ /** kWh consumed this week */
299
+ week: number;
300
+ /** kWh consumed this month */
301
+ month: number;
302
+ /** Current power draw in Watts */
303
+ currentPower: number;
304
+ /** Alias for {@link currentPower} (Watts). */
305
+ currentPowerW?: number;
306
+ /** Alias for {@link today} (kWh). */
307
+ todayKwh?: number;
308
+ /** Cost today in home currency */
309
+ costToday?: number;
310
+ /** Solar production today (kWh) */
311
+ solarToday?: number;
312
+ /** Battery level if home battery present (0-100) */
313
+ batteryLevel?: number;
314
+ /** Hourly data for today [0-23] */
315
+ hourlyToday?: number[];
316
+ /** Daily data for last 30 days */
317
+ dailyMonth?: number[];
318
+ }
319
+
320
+ export declare interface FloorPlanEditorState {
321
+ floorId: BuildingId;
322
+ tool: FloorPlanTool;
323
+ selectedElements: FloorPlanSelection[];
324
+ zoom: number;
325
+ panOffset: Point2D;
326
+ drawingPolygon: Point2D[] | null;
327
+ hoveredElement: FloorPlanSelection | null;
328
+ showGrid: boolean;
329
+ showDimensions: boolean;
330
+ showDeviceLabels: boolean;
331
+ snapToGrid: boolean;
332
+ gridSize: number;
333
+ }
334
+
335
+ declare type FloorPlanElementType = 'room' | 'zone' | 'device' | 'door' | 'window_fp' | 'wall' | 'stair' | 'annotation';
336
+
337
+ export declare interface FloorPlanFloor {
338
+ id: BuildingId;
339
+ name: string;
340
+ level: number;
341
+ backgroundImage?: string;
342
+ width: number;
343
+ height: number;
344
+ scale?: number;
345
+ /** Floor zones (preferred). */
346
+ zones: FloorPlanZone[];
347
+ /** @deprecated alias for {@link zones}. */
348
+ rooms?: FloorPlanZone[];
349
+ }
350
+
351
+ export declare interface FloorPlanSelection {
352
+ type: FloorPlanElementType;
353
+ id: BuildingId;
354
+ }
355
+
356
+ export declare type FloorPlanTool = 'select' | 'draw_room' | 'draw_zone' | 'draw_wall' | 'place_device' | 'place_door' | 'place_window' | 'annotate' | 'erase' | 'measure' | 'pan';
357
+
358
+ export declare interface FloorPlanZone {
359
+ id: BuildingId;
360
+ name: string;
361
+ type: ZoneType;
362
+ floorId: BuildingId;
363
+ /** Polygon vertices relative to floor plan canvas (px) */
364
+ polygon: Point2D[];
365
+ /** Bounding rect (computed from polygon) */
366
+ bounds?: Rect2D;
367
+ color?: string;
368
+ opacity?: number;
369
+ /** Climate sensor reading for this room */
370
+ temperature?: number;
371
+ humidity?: number;
372
+ /** CO₂ ppm reading. */
373
+ co2?: number;
374
+ /** Number of detected occupants. */
375
+ occupancy?: number;
376
+ area?: number;
377
+ /** Optional list of device IDs attached to this zone. */
378
+ deviceIds?: BuildingId[];
379
+ }
380
+
381
+ declare interface FloorTransition {
382
+ fromFloorId: string;
383
+ toFloorId: string;
384
+ type: 'elevator' | 'stairs' | 'escalator';
385
+ position: Point2D_2;
386
+ }
387
+
388
+ declare interface GeofenceTrigger {
389
+ type: 'geofence';
390
+ userId?: string;
391
+ zone: 'home' | 'away';
392
+ radius?: number;
393
+ }
394
+
395
+ /**
396
+ * History action for undo/redo
397
+ */
398
+ declare interface HistoryAction {
399
+ id: string;
400
+ timestamp: number;
401
+ type: 'create' | 'update' | 'delete' | 'move' | 'group' | 'ungroup';
402
+ objectIds: string[];
403
+ /** State before action (for undo) */
404
+ before: unknown;
405
+ /** State after action (for redo) */
406
+ after: unknown;
407
+ }
408
+
409
+ /** @deprecated Use OccupancyMode instead */
410
+ export declare type HomeMode = OccupancyMode;
411
+
412
+ export declare const LayerPanel: default_2.FC<LayerPanelProps>;
413
+
414
+ declare interface LayerPanelProps {
415
+ /** Layer states */
416
+ layers: LayerState[];
417
+ /** Callback when visibility is toggled */
418
+ onVisibilityToggle: (layerType: LayerType) => void;
419
+ /** Callback when lock is toggled */
420
+ onLockToggle: (layerType: LayerType) => void;
421
+ /** Callback when opacity changes */
422
+ onOpacityChange: (layerType: LayerType, opacity: number) => void;
423
+ /** CSS class name */
424
+ className?: string;
425
+ }
426
+
427
+ /**
428
+ * Layer visibility and editing state
429
+ */
430
+ export declare interface LayerState {
431
+ type: LayerType;
432
+ visible: boolean;
433
+ locked: boolean;
434
+ opacity: number;
435
+ zIndex: number;
436
+ }
437
+
438
+ /**
439
+ * Layer types available in the editor
440
+ */
441
+ export declare type LayerType = 'floor-plan' | 'zones' | 'devices' | 'furniture' | 'network' | 'infrastructure' | 'annotations' | 'dimensions' | 'grid' | 'background' | 'game-objects' | 'collision';
442
+
443
+ export declare interface LightState {
444
+ on: boolean;
445
+ brightness?: number;
446
+ colorTemperature?: number;
447
+ /** Backwards-compatible alias for {@link colorTemperature}. */
448
+ colorTemp?: number;
449
+ /** RGB tuple [r,g,b] each 0-255. */
450
+ rgbColor?: [number, number, number];
451
+ /** Backwards-compatible alias for {@link rgbColor}. */
452
+ color?: RgbColor;
453
+ effect?: string;
454
+ }
455
+
456
+ export declare interface LockState {
457
+ locked: boolean;
458
+ jammed?: boolean;
459
+ lastChanged?: string;
460
+ lastChangedBy?: string;
461
+ doorOpen?: boolean;
462
+ accessLog?: AccessLogEntry[];
463
+ }
464
+
465
+ declare interface MeasurementPoint {
466
+ position: Point2D_2;
467
+ snapped: boolean;
468
+ }
469
+
470
+ declare interface MeasurementResult {
471
+ type: 'distance' | 'angle' | 'area' | 'perimeter';
472
+ value: number;
473
+ formatted: string;
474
+ points: Point2D_2[];
475
+ }
476
+
477
+ export declare interface MediaPlayerState {
478
+ playing: boolean;
479
+ volume: number;
480
+ muted: boolean;
481
+ source?: string;
482
+ title?: string;
483
+ artist?: string;
484
+ albumArt?: string;
485
+ position?: number;
486
+ duration?: number;
487
+ }
488
+
489
+ export declare const Minimap: default_2.FC<MinimapProps>;
490
+
491
+ declare interface MinimapProps {
492
+ /** Document to display */
493
+ document: FloorPlanDocument;
494
+ /** Active floor ID */
495
+ activeFloorId: string | null;
496
+ /** Current viewport state */
497
+ viewport: ViewportState;
498
+ /** Callback when viewport changes (pan) */
499
+ onViewportChange: (viewport: Partial<ViewportState>) => void;
500
+ /** Minimap size */
501
+ size?: number;
502
+ /** CSS class name */
503
+ className?: string;
504
+ }
505
+
506
+ declare interface NavigationInstruction {
507
+ type: 'straight' | 'left' | 'right' | 'elevator' | 'stairs' | 'arrive';
508
+ distance?: number;
509
+ direction?: string;
510
+ landmark?: string;
511
+ }
512
+
513
+ declare interface NavigationRoute {
514
+ id: string;
515
+ startPoint: Point2D_2;
516
+ endPoint: Point2D_2;
517
+ path: Point2D_2[];
518
+ floorTransitions: FloorTransition[];
519
+ totalDistance: number;
520
+ estimatedTime: number;
521
+ instructions: NavigationInstruction[];
522
+ }
523
+
524
+ export declare const NiceAutomationEditor: default_2.FC<NiceAutomationEditorProps>;
525
+
526
+ export declare interface NiceAutomationEditorProps {
527
+ automations: BuildingAutomation[];
528
+ devices?: BuildingDevice[];
529
+ zones?: BuildingZone[];
530
+ scenes?: BuildingScene[];
531
+ onAutomationsChange?: (automations: BuildingAutomation[]) => void;
532
+ onSave?: (automation: BuildingAutomation) => Promise<void> | void;
533
+ onDelete?: (id: BuildingId) => Promise<void> | void;
534
+ onToggle?: (id: BuildingId, enabled: boolean) => Promise<void> | void;
535
+ readOnly?: boolean;
536
+ className?: string;
537
+ style?: CSSProperties;
538
+ theme?: 'light' | 'dark';
539
+ }
540
+
541
+ export declare const NiceBuildingDashboard: default_2.FC<NiceBuildingDashboardProps>;
542
+
543
+ export declare interface NiceBuildingDashboardProps {
544
+ /** Building model (preferred). */
545
+ building: Building;
546
+ /** @deprecated alias for {@link building}. */
547
+ home?: Building;
548
+ state?: BuildingState;
549
+ onDeviceControl?: (deviceId: BuildingId, state: Partial<DeviceState>) => Promise<void> | void;
550
+ onSceneActivate?: (sceneId: BuildingId) => Promise<void> | void;
551
+ onModeChange?: (mode: OccupancyMode) => void;
552
+ /** @deprecated use {@link onModeChange}. */
553
+ onHomeModeChange?: (mode: OccupancyMode) => void;
554
+ onZoneClick?: (zoneId: BuildingId) => void;
555
+ /** Optional weather widget data. */
556
+ weather?: {
557
+ temperature?: number;
558
+ description?: string;
559
+ };
560
+ showEnergy?: boolean;
561
+ showMap?: boolean;
562
+ showWeather?: boolean;
563
+ density?: DisplayDensity;
564
+ favoriteDeviceIds?: BuildingId[];
565
+ className?: string;
566
+ style?: CSSProperties;
567
+ theme?: 'light' | 'dark';
568
+ }
569
+
570
+ export declare const NiceDeviceControl: default_2.FC<NiceDeviceControlProps>;
571
+
572
+ export declare interface NiceDeviceControlProps {
573
+ device: BuildingDevice;
574
+ /** Device control callback. Receives device id and partial state patch. */
575
+ onControl?: (deviceId: BuildingId, state: Partial<DeviceState> & {
576
+ command?: string;
577
+ }) => Promise<void> | void;
578
+ compact?: boolean;
579
+ showLabel?: boolean;
580
+ className?: string;
581
+ style?: CSSProperties;
582
+ theme?: 'light' | 'dark';
583
+ }
584
+
585
+ export declare const NiceFloorPlanEditor: default_2.FC<NiceFloorPlanEditorProps>;
586
+
587
+ export declare interface NiceFloorPlanEditorProps {
588
+ floors: FloorPlanFloor[];
589
+ devices?: BuildingDevice[];
590
+ onFloorChange?: (floors: FloorPlanFloor[]) => void;
591
+ onDeviceMove?: (deviceId: BuildingId, floorId: BuildingId, roomId: BuildingId | null, position: Point2D) => void;
592
+ readOnly?: boolean;
593
+ initialFloorId?: BuildingId;
594
+ showDevices?: boolean;
595
+ showDimensions?: boolean;
596
+ showGrid?: boolean;
597
+ /** Show occupancy heatmap overlay. */
598
+ showOccupancy?: boolean;
599
+ /** Show climate (temperature/humidity) overlay. */
600
+ showClimate?: boolean;
601
+ devicePalette?: BuildingDevice[];
602
+ className?: string;
603
+ style?: CSSProperties;
604
+ theme?: 'light' | 'dark';
605
+ }
606
+
607
+ export declare const NiceLightControl: default_2.FC<NiceLightControlProps>;
608
+
609
+ export declare interface NiceLightControlProps {
610
+ device: BuildingDevice;
611
+ state?: LightState;
612
+ onControl?: (deviceId: BuildingId, state: Partial<LightState>) => Promise<void> | void;
613
+ showColor?: boolean;
614
+ showColorTemp?: boolean;
615
+ showEffects?: boolean;
616
+ compact?: boolean;
617
+ className?: string;
618
+ style?: CSSProperties;
619
+ theme?: 'light' | 'dark';
620
+ }
621
+
622
+ export declare const NiceSceneEditor: default_2.FC<NiceSceneEditorProps>;
623
+
624
+ export declare interface NiceSceneEditorProps {
625
+ scenes: BuildingScene[];
626
+ devices?: BuildingDevice[];
627
+ zones?: BuildingZone[];
628
+ /** Currently active scene ids (highlighted). */
629
+ activeSceneIds?: BuildingId[];
630
+ onScenesChange?: (scenes: BuildingScene[]) => void;
631
+ onSave?: (scene: BuildingScene) => Promise<void> | void;
632
+ onDelete?: (id: BuildingId) => Promise<void> | void;
633
+ onActivate?: (id: BuildingId) => Promise<void> | void;
634
+ readOnly?: boolean;
635
+ className?: string;
636
+ style?: CSSProperties;
637
+ theme?: 'light' | 'dark';
638
+ }
639
+
640
+ export declare const NiceSpatialEditor: default_2.FC<NiceSpatialEditorProps>;
641
+
642
+ /**
643
+ * NiceSpatialEditor component props
644
+ */
645
+ export declare interface NiceSpatialEditorProps extends TracelessStorageProps {
646
+ /** Initial document to edit */
647
+ document?: FloorPlanDocument;
648
+ /** Alias for {@link document} — initial document loaded into the editor. */
649
+ initialDocument?: FloorPlanDocument;
650
+ /** Default editor mode */
651
+ defaultMode?: SpatialEditorMode;
652
+ /** Available modes (defaults to all) */
653
+ availableModes?: SpatialEditorMode[];
654
+ /** Read-only mode */
655
+ readOnly?: boolean;
656
+ /** Theme */
657
+ theme?: 'light' | 'dark' | 'auto';
658
+ /** Locale for labels */
659
+ locale?: 'en' | 'pl' | 'de' | 'es' | 'fr';
660
+ /** Initial grid size */
661
+ gridSize?: number;
662
+ /** Enable snap by default */
663
+ snapEnabled?: boolean;
664
+ /** Show object library sidebar */
665
+ showObjectLibrary?: boolean;
666
+ /** Show layer panel */
667
+ showLayerPanel?: boolean;
668
+ /** Show properties panel */
669
+ showPropertiesPanel?: boolean;
670
+ /** Show minimap */
671
+ showMinimap?: boolean;
672
+ /** Custom object library items */
673
+ customObjects?: SpatialObject[];
674
+ /** Callback when document changes */
675
+ onDocumentChange?: (document: FloorPlanDocument) => void;
676
+ /** Callback when selection changes */
677
+ onSelectionChange?: (selection: SpatialSelection) => void;
678
+ /** Callback when mode changes */
679
+ onModeChange?: (mode: SpatialEditorMode) => void;
680
+ /** Export callback */
681
+ onExport?: (format: 'nsp' | 'svg' | 'png' | 'pdf' | 'dxf', data: Blob | string) => void;
682
+ /** Import callback */
683
+ onImport?: (document: FloorPlanDocument) => void;
684
+ /** CSS class name */
685
+ className?: string;
686
+ /** Inline styles */
687
+ style?: React.CSSProperties;
688
+ /** Persist editor preferences (zoom, pan, grid, layer visibility) */
689
+ persistPreferences?: boolean;
690
+ }
691
+
692
+ export declare const NiceSpatialViewer: default_2.FC<NiceSpatialViewerProps>;
693
+
694
+ declare interface NiceSpatialViewerProps {
695
+ /** Floor plan document to display. */
696
+ document: FloorPlanDocument;
697
+ /** Initial floor ID to show. */
698
+ initialFloorId?: string;
699
+ /** Show navigation panel. */
700
+ showNavigation?: boolean;
701
+ /** Show mini-map overlay. */
702
+ showMinimap?: boolean;
703
+ /** Show floor selector. */
704
+ showFloorSelector?: boolean;
705
+ /** Show search bar. */
706
+ showSearch?: boolean;
707
+ /** Show layers panel button. */
708
+ showLayersPanel?: boolean;
709
+ /** Alias of {@link showLayersPanel}. */
710
+ showLayers?: boolean;
711
+ /** Show legend panel button. */
712
+ showLegend?: boolean;
713
+ /** Enable route planning. */
714
+ enableRoutePlanning?: boolean;
715
+ /** Reference points for navigation (entrances, elevators). */
716
+ referencePoints?: ReferencePoint[];
717
+ /** Called when user clicks on an object. */
718
+ onObjectClick?: (object: SpatialObject) => void;
719
+ /** Called when navigation route is calculated. */
720
+ onRouteCalculated?: (route: NavigationRoute | null) => void;
721
+ /** Current user location (for indoor positioning). */
722
+ currentLocation?: Point2D_2;
723
+ /** Theme: light or dark. */
724
+ theme?: 'light' | 'dark';
725
+ /** Custom class name. */
726
+ className?: string;
727
+ /**
728
+ * Enable virtual rendering for large floor plans (1000+ objects).
729
+ * Uses viewport culling and QuadTree spatial indexing.
730
+ */
731
+ virtualRendering?: boolean;
732
+ /**
733
+ * Object count threshold to auto-enable virtual rendering.
734
+ * Default: 200.
735
+ */
736
+ virtualRenderingThreshold?: number;
737
+ /** Debug mode: show visible object count and stats. */
738
+ debugVirtualRendering?: boolean;
739
+ }
740
+
741
+ export declare const NiceThermostatControl: default_2.FC<NiceThermostatControlProps>;
742
+
743
+ export declare interface NiceThermostatControlProps {
744
+ device: BuildingDevice;
745
+ state?: ThermostatState;
746
+ onControl?: (deviceId: BuildingId, state: Partial<ThermostatState>) => Promise<void> | void;
747
+ showSchedule?: boolean;
748
+ showHumidity?: boolean;
749
+ size?: 'sm' | 'md' | 'lg';
750
+ unit?: 'C' | 'F';
751
+ compact?: boolean;
752
+ className?: string;
753
+ style?: CSSProperties;
754
+ theme?: 'light' | 'dark';
755
+ }
756
+
757
+ export declare const NiceZoneCard: default_2.FC<NiceZoneCardProps>;
758
+
759
+ export declare interface NiceZoneCardProps {
760
+ /** Zone metadata (preferred). */
761
+ zone: FloorPlanZone | BuildingZone;
762
+ /** @deprecated alias for {@link zone}. */
763
+ room?: BuildingZone;
764
+ devices?: BuildingDevice[];
765
+ temperature?: number;
766
+ humidity?: number;
767
+ expanded?: boolean;
768
+ onExpand?: () => void;
769
+ onDeviceControl?: (deviceId: BuildingId, state: Partial<DeviceState>) => Promise<void> | void;
770
+ /** @deprecated use {@link onDeviceControl}. */
771
+ onControl?: (deviceId: BuildingId, state: Partial<DeviceState>) => Promise<void> | void;
772
+ onClick?: () => void;
773
+ onRoomClick?: (roomId: BuildingId) => void;
774
+ density?: DisplayDensity;
775
+ className?: string;
776
+ style?: CSSProperties;
777
+ theme?: 'light' | 'dark';
778
+ }
779
+
780
+ declare interface NotificationAction {
781
+ type: 'notification';
782
+ title: string;
783
+ message: string;
784
+ channel?: 'push' | 'email' | 'sms' | 'in_app';
785
+ priority?: 'low' | 'normal' | 'high' | 'critical';
786
+ }
787
+
788
+ export declare type NotificationChannel = 'push' | 'email' | 'sms' | 'in_app' | 'teams' | 'slack' | 'webhook';
789
+
790
+ export declare const ObjectLibrary: default_2.FC<ObjectLibraryProps>;
791
+
792
+ declare interface ObjectLibraryProps {
793
+ /** Current editor mode */
794
+ mode: SpatialEditorMode;
795
+ /** Callback when an object is selected for placement */
796
+ onObjectSelect: (object: {
797
+ id: string;
798
+ name: string;
799
+ category: string;
800
+ icon?: string;
801
+ }) => void;
802
+ /** Custom objects to include */
803
+ customObjects?: Array<{
804
+ id: string;
805
+ name: string;
806
+ category: string;
807
+ icon?: string;
808
+ }>;
809
+ /** CSS class name */
810
+ className?: string;
811
+ }
812
+
813
+ export declare type OccupancyMode = 'home' | 'away' | 'night' | 'vacation' | 'guest' | 'party' | 'occupied' | 'closed' | 'weekend' | 'event' | 'emergency' | 'maintenance';
814
+
815
+ /** Extended occupancy sensor state (zone-level device) */
816
+ export declare interface OccupancySensorState {
817
+ occupied: boolean;
818
+ count?: number;
819
+ confidence?: number;
820
+ lastMotion?: string;
821
+ }
822
+
823
+ export declare interface OccupancyStats {
824
+ totalOccupied: number;
825
+ totalZones: number;
826
+ byZone: ZoneOccupancy[];
827
+ peakToday?: number;
828
+ peakTime?: string;
829
+ hourlyToday?: number[];
830
+ }
831
+
832
+ export declare interface Point2D {
833
+ x: number;
834
+ y: number;
835
+ }
836
+
837
+ export declare const PropertiesPanel: default_2.FC<PropertiesPanelProps>;
838
+
839
+ declare interface PropertiesPanelProps {
840
+ /** Current selection */
841
+ selection: SpatialSelection;
842
+ /** Document for lookups */
843
+ document: FloorPlanDocument;
844
+ /** Callback when a property changes */
845
+ onPropertyChange: (objectId: string, key: string, value: unknown) => void;
846
+ /** CSS class name */
847
+ className?: string;
848
+ }
849
+
850
+ declare interface Rect2D {
851
+ x: number;
852
+ y: number;
853
+ width: number;
854
+ height: number;
855
+ }
856
+
857
+ declare interface ReferencePoint {
858
+ id: string;
859
+ name: string;
860
+ type: 'entrance' | 'elevator' | 'stairs' | 'exit' | 'poi' | 'parking';
861
+ position: Point2D_2;
862
+ floorId: string;
863
+ icon?: string;
864
+ description?: string;
865
+ }
866
+
867
+ declare interface RgbColor {
868
+ r: number;
869
+ g: number;
870
+ b: number;
871
+ }
872
+
873
+ declare interface SceneActivateAction {
874
+ type: 'scene_activate';
875
+ sceneId: BuildingId;
876
+ }
877
+
878
+ export declare interface SceneDeviceTarget {
879
+ deviceId: BuildingId;
880
+ state: Partial<DeviceState>;
881
+ transitionMs?: number;
882
+ }
883
+
884
+ declare type SensorReadingType = 'temperature' | 'humidity' | 'pressure' | 'co2' | 'voc' | 'pm25' | 'pm10' | 'noise' | 'lux' | 'uv' | 'motion' | 'power' | 'energy' | 'water_flow' | 'gas' | 'radon';
885
+
886
+ export declare interface SensorState {
887
+ value: number;
888
+ unit: string;
889
+ battery?: number;
890
+ tampered?: boolean;
891
+ }
892
+
893
+ declare interface SensorThresholdTrigger {
894
+ type: 'sensor_threshold';
895
+ deviceId: BuildingId;
896
+ sensorType: SensorReadingType;
897
+ operator: 'above' | 'below' | 'eq';
898
+ threshold: number;
899
+ unit: string;
900
+ hysteresis?: number;
901
+ }
902
+
903
+ /** @deprecated Use Building instead */
904
+ export declare type SmartHome = Building;
905
+
906
+ /** @deprecated Use BuildingDevice instead */
907
+ export declare type SmartHomeDevice = BuildingDevice;
908
+
909
+ /**
910
+ * Editor modes — each mode provides different tools and UI
911
+ */
912
+ export declare type SpatialEditorMode = 'floor-plan' | 'network-topology' | 'infrastructure' | 'cad' | 'interior' | 'game-scene';
913
+
914
+ /**
915
+ * Complete editor state
916
+ */
917
+ export declare interface SpatialEditorState {
918
+ /** Current editor mode */
919
+ mode: SpatialEditorMode;
920
+ /** Active tool */
921
+ tool: SpatialTool;
922
+ /** Document being edited */
923
+ document: FloorPlanDocument | null;
924
+ /** Current floor ID */
925
+ activeFloorId: string | null;
926
+ /** Layer states */
927
+ layers: LayerState[];
928
+ /** Current selection */
929
+ selection: SpatialSelection;
930
+ /** Viewport state */
931
+ viewport: ViewportState;
932
+ /** Drawing state (when using draw tools) */
933
+ drawing: {
934
+ active: boolean;
935
+ points: Point2D_2[];
936
+ preview: Point2D_2 | null;
937
+ };
938
+ /** History for undo/redo */
939
+ history: {
940
+ past: HistoryAction[];
941
+ future: HistoryAction[];
942
+ };
943
+ /** Alignment guides (for snap) */
944
+ guides: AlignmentGuide[];
945
+ /** Currently dragged object (drag & drop) */
946
+ dragging: {
947
+ objectType: string | null;
948
+ objectData: unknown;
949
+ position: Point2D_2 | null;
950
+ } | null;
951
+ /** Connection drawing state (for connect tool) */
952
+ connecting: {
953
+ active: boolean;
954
+ sourceId: string | null;
955
+ sourcePort?: string;
956
+ sourcePosition: Point2D_2 | null;
957
+ previewPosition: Point2D_2 | null;
958
+ };
959
+ /** Clipboard */
960
+ clipboard: SpatialObject[];
961
+ /** UI state */
962
+ ui: {
963
+ showObjectLibrary: boolean;
964
+ showLayerPanel: boolean;
965
+ showPropertiesPanel: boolean;
966
+ showMinimap: boolean;
967
+ };
968
+ }
969
+
970
+ /**
971
+ * Selection state
972
+ */
973
+ export declare interface SpatialSelection {
974
+ /** Selected object IDs */
975
+ objectIds: string[];
976
+ /** Bounding box of selection */
977
+ bounds: BoundingBox | null;
978
+ /** Is selection locked */
979
+ locked: boolean;
980
+ }
981
+
982
+ /**
983
+ * Available spatial editing tools
984
+ */
985
+ export declare type SpatialTool = 'select' | 'multi-select' | 'pan' | 'zoom' | 'draw-wall' | 'draw-zone' | 'draw-polyline' | 'draw-rectangle' | 'draw-circle' | 'draw-arc' | 'place-device' | 'place-furniture' | 'place-network' | 'place-infra' | 'place-door' | 'place-window' | 'place-stairs' | 'connect' | 'route-cable' | 'annotate' | 'dimension' | 'label' | 'measure-distance' | 'measure-angle' | 'measure-area' | 'move' | 'rotate' | 'scale' | 'erase' | 'copy' | 'paste';
986
+
987
+ declare interface SunTrigger {
988
+ type: 'sunrise' | 'sunset';
989
+ offsetMinutes?: number;
990
+ }
991
+
992
+ export declare interface SwitchState {
993
+ on: boolean;
994
+ power?: number;
995
+ voltage?: number;
996
+ current?: number;
997
+ energyToday?: number;
998
+ }
999
+
1000
+ export declare interface ThermostatState {
1001
+ /** Current measured temperature in °C (or °F per `unit` prop). */
1002
+ temperature: number;
1003
+ /** Target setpoint in °C. */
1004
+ targetTemperature: number;
1005
+ /** @deprecated use {@link temperature} */
1006
+ currentTemp?: number;
1007
+ /** @deprecated use {@link targetTemperature} */
1008
+ targetTemp?: number;
1009
+ mode: 'heat' | 'cool' | 'auto' | 'off' | 'fan_only' | 'dry';
1010
+ fanMode?: 'auto' | 'low' | 'medium' | 'high';
1011
+ humidity?: number;
1012
+ targetHumidity?: number;
1013
+ hvacAction?: 'heating' | 'cooling' | 'idle' | 'fan' | 'drying' | 'off';
1014
+ isScheduleActive?: boolean;
1015
+ }
1016
+
1017
+ declare interface TimeTrigger {
1018
+ type: 'time';
1019
+ time: string;
1020
+ days?: ('mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun')[];
1021
+ repeat?: boolean;
1022
+ }
1023
+
1024
+ declare type TriggerType = 'time' | 'sunrise' | 'sunset' | 'device_state' | 'sensor_threshold' | 'geofence' | 'webhook' | 'manual' | 'scene_activated' | 'building_mode';
1025
+
1026
+ export declare function useMeasurement(options?: UseMeasurementOptions): UseMeasurementReturn;
1027
+
1028
+ declare interface UseMeasurementOptions {
1029
+ /** Unit system (metric or imperial) */
1030
+ unitSystem?: UnitSystem;
1031
+ /** Preferred length unit */
1032
+ lengthUnit?: LengthUnit;
1033
+ /** Preferred area unit */
1034
+ areaUnit?: AreaUnit;
1035
+ /** Preferred angle unit */
1036
+ angleUnit?: AngleUnit;
1037
+ /** Scale factor (pixels per meter) */
1038
+ scale?: number;
1039
+ }
1040
+
1041
+ declare interface UseMeasurementReturn {
1042
+ /** Start a measurement */
1043
+ startMeasurement: (type: 'distance' | 'angle' | 'area') => void;
1044
+ /** Add a measurement point */
1045
+ addPoint: (point: Point2D_2, snapped?: boolean) => void;
1046
+ /** Clear current measurement */
1047
+ clearMeasurement: () => void;
1048
+ /** Finish measurement */
1049
+ finishMeasurement: () => MeasurementResult | null;
1050
+ /** Current measurement type */
1051
+ measurementType: 'distance' | 'angle' | 'area' | null;
1052
+ /** Current measurement points */
1053
+ points: MeasurementPoint[];
1054
+ /** Live distance (while measuring) */
1055
+ liveDistance: string | null;
1056
+ /** Live angle (while measuring) */
1057
+ liveAngle: string | null;
1058
+ /** Live area (while measuring) */
1059
+ liveArea: string | null;
1060
+ /** Calculate distance between two points */
1061
+ getDistance: (p1: Point2D_2, p2: Point2D_2) => {
1062
+ value: number;
1063
+ formatted: string;
1064
+ };
1065
+ /** Calculate angle at three points */
1066
+ getAngle: (p1: Point2D_2, vertex: Point2D_2, p2: Point2D_2) => {
1067
+ value: number;
1068
+ formatted: string;
1069
+ };
1070
+ /** Calculate polygon area */
1071
+ getArea: (points: Point2D_2[]) => {
1072
+ value: number;
1073
+ formatted: string;
1074
+ };
1075
+ /** Calculate polyline length */
1076
+ getLength: (points: Point2D_2[]) => {
1077
+ value: number;
1078
+ formatted: string;
1079
+ };
1080
+ }
1081
+
1082
+ export declare function useSnapToGrid(options?: UseSnapToGridOptions): UseSnapToGridReturn;
1083
+
1084
+ declare interface UseSnapToGridOptions {
1085
+ /** Grid size in pixels */
1086
+ gridSize?: number;
1087
+ /** Enable snap */
1088
+ enabled?: boolean;
1089
+ /** Active snap modes */
1090
+ snapModes?: SnapMode[];
1091
+ /** Existing objects for alignment guides */
1092
+ objects?: BoundingBox[];
1093
+ /** Snap threshold distance */
1094
+ threshold?: number;
1095
+ }
1096
+
1097
+ declare interface UseSnapToGridReturn {
1098
+ /** Snap a point to grid */
1099
+ snap: (point: Point2D_2) => Point2D_2;
1100
+ /** Snap a 3D point to grid */
1101
+ snap3D: (point: {
1102
+ x: number;
1103
+ y: number;
1104
+ z: number;
1105
+ }) => {
1106
+ x: number;
1107
+ y: number;
1108
+ z: number;
1109
+ };
1110
+ /** Get alignment guides for a point */
1111
+ getGuides: (point: Point2D_2) => AlignmentGuide[];
1112
+ /** Perform advanced snap with mode support */
1113
+ performAdvancedSnap: (point: Point2D_2) => {
1114
+ point: Point2D_2;
1115
+ snapped: boolean;
1116
+ guides: AlignmentGuide[];
1117
+ };
1118
+ /** Generate grid lines */
1119
+ generateGridLines: (width: number, height: number) => Array<{
1120
+ x1: number;
1121
+ y1: number;
1122
+ x2: number;
1123
+ y2: number;
1124
+ }>;
1125
+ }
1126
+
1127
+ export declare function useSpatialEditor(options?: UseSpatialEditorOptions): UseSpatialEditorReturn;
1128
+
1129
+ declare interface UseSpatialEditorOptions {
1130
+ initialDocument?: FloorPlanDocument;
1131
+ defaultMode?: SpatialEditorMode;
1132
+ gridSize?: number;
1133
+ snapEnabled?: boolean;
1134
+ onChange?: (document: FloorPlanDocument) => void;
1135
+ }
1136
+
1137
+ declare interface UseSpatialEditorReturn {
1138
+ state: SpatialEditorState;
1139
+ setMode: (mode: SpatialEditorMode) => void;
1140
+ setTool: (tool: SpatialTool) => void;
1141
+ newDocument: (name?: string) => void;
1142
+ loadDocument: (doc: FloorPlanDocument) => void;
1143
+ zoom: (delta: number) => void;
1144
+ pan: (delta: Point2D_2) => void;
1145
+ resetView: () => void;
1146
+ toggleGrid: () => void;
1147
+ toggleSnap: () => void;
1148
+ setGridSize: (size: number) => void;
1149
+ setLayerVisible: (layerType: string, visible: boolean) => void;
1150
+ setLayerLocked: (layerType: string, locked: boolean) => void;
1151
+ select: (objectIds: string[]) => void;
1152
+ clearSelection: () => void;
1153
+ undo: () => void;
1154
+ redo: () => void;
1155
+ canUndo: boolean;
1156
+ canRedo: boolean;
1157
+ copy: () => void;
1158
+ paste: (position: Point2D_2) => void;
1159
+ cut: () => void;
1160
+ }
1161
+
1162
+ /**
1163
+ * Viewport state
1164
+ */
1165
+ export declare interface ViewportState {
1166
+ /** Current zoom level (1 = 100%) */
1167
+ zoom: number;
1168
+ /** Pan offset in screen coordinates */
1169
+ pan: Point2D_2;
1170
+ /** Rotation (for 2D) or camera angle (for 3D) */
1171
+ rotation: number;
1172
+ /** Grid visibility */
1173
+ showGrid: boolean;
1174
+ /** Grid size */
1175
+ gridSize: number;
1176
+ /** Snap to grid enabled */
1177
+ snapEnabled: boolean;
1178
+ /** Active snap modes */
1179
+ snapModes: SnapMode[];
1180
+ }
1181
+
1182
+ export declare interface ZoneOccupancy {
1183
+ zoneId: BuildingId;
1184
+ occupied: boolean;
1185
+ count?: number;
1186
+ lastUpdated: string;
1187
+ }
1188
+
1189
+ export declare type ZoneType = 'living_room' | 'bedroom' | 'master_bedroom' | 'kids_room' | 'bathroom' | 'kitchen' | 'dining_room' | 'hallway' | 'office' | 'garage' | 'basement' | 'attic' | 'balcony' | 'garden' | 'laundry' | 'storage' | 'gym' | 'cinema' | 'open_office' | 'private_office' | 'meeting_room' | 'boardroom' | 'reception' | 'waiting_area' | 'server_room' | 'it_room' | 'break_room' | 'lobby' | 'corridor' | 'stairwell' | 'parking' | 'cafeteria' | 'mechanical_room' | 'other';
1190
+
1191
+ export { }