@apocaliss92/nodedreame 1.1.0 → 1.3.0

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.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { fetch } from 'undici';
2
+ import { z } from 'zod';
2
3
 
3
4
  /** Public name of this library. */
4
5
  declare const LIBRARY_NAME = "nodedreame";
@@ -466,11 +467,27 @@ declare enum MiotState {
466
467
  ReturnToEmpty = 28,
467
468
  WaitingForTask = 29,
468
469
  CleanWashboardBase = 30,
470
+ ReturningToDrain = 31,
471
+ Draining = 32,
469
472
  AutoWaterDraining = 33,
473
+ Emptying = 34,
474
+ DustBagDrying = 35,
475
+ DustBagDryingPaused = 36,
476
+ HeadingToExtraCleaning = 37,
477
+ ExtraCleaning = 38,
478
+ FindingPetPaused = 95,
479
+ FindingPet = 96,
470
480
  ShortcutRunning = 97,
471
481
  CameraMonitoring = 98,
472
482
  CameraMonitoringPaused = 99,
473
- InitialDeepClean = 101
483
+ InitialDeepClean = 101,
484
+ InitialDeepCleanPaused = 102,
485
+ Sanitizing = 103,
486
+ SanitizingWithDry = 104,
487
+ ChangingMop = 105,
488
+ ChangingMopPaused = 106,
489
+ FloorMaintaining = 107,
490
+ FloorMaintainingPaused = 108
474
491
  }
475
492
  /** VERIFIED on r2532a 2026-05-02 — ChargingStatus (siid 3 piid 2). */
476
493
  declare enum ChargingStatus {
@@ -505,27 +522,97 @@ declare enum CleaningMode {
505
522
  }
506
523
  /**
507
524
  * Error / fault value space for ERROR (siid 2 piid 2) and FAULTS_STR
508
- * (siid 4 piid 18). VERIFIED members confirmed live on r2532a; the rest are
509
- * ASSUMED from Tasshack types.py — the integer is the source of truth.
525
+ * (siid 4 piid 18). This is the FULL Tasshack `DreameVacuumErrorCode` table
526
+ * (types.py) — every documented integer is mapped. Members whose names were
527
+ * VERIFIED live on r2532a keep their verified labels even where the donor uses
528
+ * a different label for the same integer (annotated inline); the rest carry the
529
+ * donor's documented name. UNKNOWN (-1) is intentionally omitted — an unknown
530
+ * code falls through the cast-free lookup and surfaces as the raw number.
510
531
  */
511
532
  declare enum MiotError {
512
- Clear = 0,
513
- WheelRotationAnomaly = 1,
514
- RobotLifted = 18,
515
- TaskComplete = 68,
516
- ManualMopInstallRequired = 74,
517
- WastewaterTankFull = 105,
518
- CleanWaterTankEmpty = 107,
519
- WashboardFilterNeedsCleaning = 114,
520
- MopPadsMissing = 120,
533
+ Clear = 0,// donor NO_ERROR
534
+ WheelRotationAnomaly = 1,// donor DROP (VERIFIED label kept)
535
+ Cliff = 2,
536
+ Bumper = 3,
537
+ Gesture = 4,
538
+ BumperRepeat = 5,
539
+ DropRepeat = 6,
540
+ OpticalFlow = 7,
541
+ Box = 8,
542
+ TankBox = 9,
543
+ WaterBoxEmpty = 10,
544
+ BoxFull = 11,
545
+ Brush = 12,
546
+ SideBrush = 13,
547
+ Fan = 14,
548
+ LeftWheelMotor = 15,
549
+ RightWheelMotor = 16,
550
+ TurnSuffocate = 17,
551
+ RobotLifted = 18,// donor FORWARD_SUFFOCATE (VERIFIED label kept)
552
+ ChargerGet = 19,
521
553
  BatteryLow = 20,
522
554
  ChargeFault = 21,
523
- BatteryPercentageAnomaly = 22,
555
+ BatteryPercentageAnomaly = 22,// donor BATTERY_PERCENTAGE
556
+ Heart = 23,
557
+ CameraOcclusion = 24,
558
+ Move = 25,
559
+ FlowShielding = 26,
560
+ InfraredShielding = 27,
524
561
  ChargeNoElectric = 28,
525
562
  BatteryFault = 29,
563
+ FanSpeedError = 30,
564
+ LeftWheelSpeed = 31,
565
+ RightWheelSpeed = 32,
566
+ Bmi055Acce = 33,
567
+ Bmi055Gyro = 34,
568
+ Xv7001 = 35,
569
+ LeftMagnet = 36,
570
+ RightMagnet = 37,
571
+ FlowError = 38,
572
+ InfraredFault = 39,
573
+ CameraFault = 40,
574
+ StrongMagnet = 41,
575
+ WaterPump = 42,
576
+ Rtc = 43,
577
+ AutoKeyTrig = 44,
578
+ P3v3 = 45,
579
+ CameraIdle = 46,
580
+ Blocked = 47,
581
+ LdsError = 48,
582
+ LdsBumper = 49,
583
+ WaterPump2 = 50,
584
+ FilterBlocked = 51,
585
+ Edge = 54,
586
+ Carpet = 55,
587
+ Laser = 56,
588
+ Edge2 = 57,
589
+ Ultrasonic = 58,
590
+ NoGoZone = 59,
591
+ Route = 61,
592
+ Route2 = 62,
593
+ Blocked2 = 63,
594
+ Blocked3 = 64,
595
+ Restricted = 65,
596
+ Restricted2 = 66,
597
+ Restricted3 = 67,
598
+ TaskComplete = 68,// donor REMOVE_MOP (VERIFIED label kept)
599
+ MopRemoved = 69,
600
+ MopRemoved2 = 70,
601
+ MopPadStopRotate = 71,
602
+ MopPadStopRotate2 = 72,
603
+ ManualMopInstallRequired = 74,// donor MOP_INSTALL_FAILED (VERIFIED label kept)
526
604
  LowBatteryTurnOff = 75,
605
+ DirtyTankNotInstalled = 76,
606
+ RobotInHiddenRoom = 78,
607
+ LdsFailedToLift = 79,
527
608
  RobotStuck = 80,
528
609
  RobotStuckRepeat = 81,
610
+ SlipperyFloor = 82,
611
+ UnknownError = 84,
612
+ CheckMopInstall = 85,
613
+ DirtyWaterTankFull = 86,
614
+ RetractableLegStuck = 88,
615
+ InternalError = 89,
529
616
  RobotStuck2 = 90,
530
617
  RobotStuckOnTables = 91,
531
618
  RobotStuckOnPassage = 92,
@@ -536,19 +623,91 @@ declare enum MiotError {
536
623
  RobotStuckOnPet = 97,
537
624
  RobotStuckOnSlipperySurface = 98,
538
625
  RobotStuckOnCarpet = 99,
539
- RobotStuckOnCurtain = 200,
540
626
  BinFull = 101,
627
+ BinOpen = 102,
628
+ BinOpen2 = 103,
629
+ BinFull2 = 104,
630
+ WastewaterTankFull = 105,// donor WATER_TANK (VERIFIED label kept)
631
+ DirtyWaterTank = 106,
632
+ CleanWaterTankEmpty = 107,// donor WATER_TANK_DRY (VERIFIED label kept)
633
+ DirtyWaterTank2 = 108,
634
+ DirtyWaterTankBlocked = 109,
635
+ DirtyWaterTankPump = 110,
636
+ MopPad = 111,
637
+ WetMopPad = 112,
638
+ WashboardFilterNeedsCleaning = 114,// donor CLEAN_MOP_PAD (VERIFIED label kept)
639
+ CleanTankLevel = 116,
541
640
  StationDisconnected = 117,
542
- DustBagFull = 121
641
+ DirtyTankLevel = 118,
642
+ WashboardLevel = 119,
643
+ MopPadsMissing = 120,// donor NO_MOP_IN_STATION (VERIFIED label kept)
644
+ DustBagFull = 121,
645
+ UnknownWarning = 122,
646
+ SelfTestFailed = 123,
647
+ WashboardNotWorking = 124,
648
+ DrainageFailed = 125,
649
+ MopNotDetected = 126,
650
+ MopHolderError = 127,
651
+ DockError = 128,
652
+ WashFailed = 129,
653
+ RobotStuckOnCurtain = 200,
654
+ EdgeMopStopRotate = 201,
655
+ EdgeMopDetached = 202,
656
+ ChassisLiftMalfunction = 203,
657
+ InternalError2 = 207,
658
+ MopCoverError = 209,
659
+ RollerMopError = 210,
660
+ OnboardWaterTankEmpty = 213,
661
+ OnboardDirtyWaterTankFull = 214,
662
+ MopNotInstalled = 215,
663
+ RollerMopError2 = 218,
664
+ FluffingRollerError = 222,
665
+ MopCoverError2 = 223,
666
+ BlockedByObstacle = 226,
667
+ ReturnToChargeFailed = 1000
543
668
  }
544
- /** VERIFIED on r2532a 2026-05-02 — TASK_STATUS (siid 4 piid 1). */
669
+ /**
670
+ * TASK_STATUS (siid 4 piid 1). Codes 1/2/3/6/12/14 carry the labels VERIFIED
671
+ * live on r2532a 2026-05-02 — these are KEPT verbatim because they were
672
+ * observed against real task transitions and differ from the donor's labels for
673
+ * the same integers (donor: 1=AUTO_CLEANING, 2=ZONE_CLEANING, 3=SEGMENT_CLEANING,
674
+ * 6=AUTO_CLEANING_PAUSED, 12=MOPPING_PAUSED, 14=ZONE_MOPPING_PAUSED). The
675
+ * remaining members are ASSUMED from Tasshack `DreameVacuumTaskStatus`
676
+ * (types.py) — added so documented codes resolve to a name. Unknown codes
677
+ * surface as raw via {@link VacuumDevice.taskStatusRaw}.
678
+ */
545
679
  declare enum TaskStatus {
680
+ Completed = 0,
546
681
  InterruptedOrPaused = 1,
547
682
  Active = 2,
548
683
  Transitioning = 3,
684
+ SpotCleaning = 4,
685
+ FastMapping = 5,
549
686
  OnDockIdle = 6,
687
+ ZoneCleaningPaused = 7,
688
+ SegmentCleaningPaused = 8,
689
+ SpotCleaningPaused = 9,
690
+ MapCleaningPaused = 10,
691
+ DockingPaused = 11,
550
692
  TransientPauseEdge = 12,
551
- NeedsIntervention = 14
693
+ SegmentMoppingPaused = 13,
694
+ NeedsIntervention = 14,
695
+ AutoMoppingPaused = 15,
696
+ AutoDockingPaused = 16,
697
+ SegmentDockingPaused = 17,
698
+ ZoneDockingPaused = 18,
699
+ CruisingPath = 20,
700
+ CruisingPathPaused = 21,
701
+ CruisingPoint = 22,
702
+ CruisingPointPaused = 23,
703
+ SummonCleanPaused = 24,
704
+ ReturningInstallMop = 25,
705
+ ReturningRemoveMop = 26,
706
+ StationCleaning = 27,
707
+ PetFinding = 30,
708
+ AutoCleaningWashingPaused = 31,
709
+ AreaCleaningWashingPaused = 32,
710
+ CustomCleaningWashingPaused = 33
552
711
  }
553
712
 
554
713
  /**
@@ -1024,6 +1183,14 @@ declare class VacuumDevice extends BaseDevice<VacuumDeviceEvents> {
1024
1183
  constructor(input: BaseDeviceInput);
1025
1184
  /** Rich, vacuum-specific capability record (booleans + supported enums). */
1026
1185
  get vacuumCapabilities(): VacuumCapabilities;
1186
+ /**
1187
+ * The suction levels this model supports, as a {@link SuctionLevel} enum array
1188
+ * (from the capability record). Lets a consumer see which fan speeds are
1189
+ * selectable without reaching into {@link vacuumCapabilities}.
1190
+ */
1191
+ get supportedSuctionLevels(): readonly SuctionLevel[];
1192
+ /** The water/mop volumes this model supports, as a {@link WaterVolume} enum array. */
1193
+ get supportedWaterVolumes(): readonly WaterVolume[];
1027
1194
  get statusRaw(): number | null;
1028
1195
  get status(): MiotState | null;
1029
1196
  get battery(): number | null;
@@ -1215,13 +1382,104 @@ declare enum MowerControlAction {
1215
1382
  }
1216
1383
  /**
1217
1384
  * Observed TASK_STATUS codes (siid 5 piid 104), service5.py TASK_STATUS_MAPPING.
1218
- * Only `SpotIncomplete` (7) has a confirmed meaning; the others in the donor are
1219
- * "Unknown task status: N" — ASSUMED / not exposed as named members here.
1385
+ * Only `SpotIncomplete` (7) has a confirmed meaning; the donor explicitly marks
1386
+ * codes 2/3/10/13 as "Unknown task status: N" (observed after RAIN/LOST/
1387
+ * LOW_BATTERY events). Those are NOT invented as named members — they surface as
1388
+ * raw via {@link MowerDevice.taskStatusRaw}. This is the FULL documented set:
1389
+ * the donor names exactly one code.
1220
1390
  */
1221
1391
  declare enum MowerTaskStatus {
1222
1392
  /** "Task incomplete - spot mowing". */
1223
1393
  SpotIncomplete = 7
1224
1394
  }
1395
+ /**
1396
+ * Mower device-code / fault value space for DEVICE_CODE (siid 2 piid 2). This is
1397
+ * the FULL donor `BASE_DEVICE_CODES` registry (property/device_code.py), codes
1398
+ * 0..73 contiguous. Each integer is documented by the donor with a name +
1399
+ * severity (INFO / WARNING / ERROR — noted inline). 0 = NO_DEVICE_CODE (normal
1400
+ * operation). Codes not in this table (model-specific extensions) fall through
1401
+ * the cast-free lookup and surface as raw via {@link MowerDevice.faultRaw}.
1402
+ *
1403
+ * Two donor names repeat at different integers; the second occurrence is
1404
+ * suffixed (`LidarDirtyWarning` 38, `BatteryOverheatWarning` 42) to keep enum
1405
+ * member names unique while preserving the integer source of truth.
1406
+ */
1407
+ declare enum MowerFault {
1408
+ NoDeviceCode = 0,// INFO
1409
+ Tilted = 1,// ERROR
1410
+ Trapped = 2,// ERROR
1411
+ NarrowPathToStation = 3,// ERROR
1412
+ LeftWheel = 4,// ERROR
1413
+ RightWheel = 5,// ERROR
1414
+ LiftMotor = 6,// ERROR
1415
+ Cutter = 7,// ERROR
1416
+ SidedMotor = 8,// ERROR
1417
+ CrashPlate = 9,// ERROR
1418
+ Charging = 10,// ERROR
1419
+ BatteryOverheat = 11,// ERROR
1420
+ LidarCovered = 12,// ERROR
1421
+ LidarOverheatWithoutMap = 13,// ERROR
1422
+ LidarOverheatWithMap = 14,// ERROR
1423
+ LidarOverheat = 15,// ERROR
1424
+ LidarDirty = 16,// ERROR
1425
+ LidarAbnormal = 17,// ERROR
1426
+ LocationWeak = 18,// ERROR
1427
+ LocationLost = 19,// ERROR
1428
+ Sensor = 20,// ERROR
1429
+ InForbiddenArea = 21,// ERROR
1430
+ OutOfMap = 22,// ERROR
1431
+ EmergencyStop = 23,// ERROR
1432
+ BatteryLow = 24,// ERROR
1433
+ MapFileCrack = 25,// ERROR
1434
+ AwayFromMap = 26,// ERROR
1435
+ HumanDetected = 27,// ERROR
1436
+ BladeLoss = 28,// ERROR
1437
+ StationLoss = 29,// ERROR
1438
+ MaintainLoss = 30,// ERROR
1439
+ BackChargeFailed = 31,// WARNING
1440
+ DockingFailed = 32,// WARNING
1441
+ LocatingFailedWithMap = 33,// WARNING
1442
+ LocatingFailedWithoutMap = 34,// WARNING
1443
+ LocatingAbnormal = 35,// WARNING
1444
+ TaskStartFailed = 36,// WARNING
1445
+ PathImpassable = 37,// ERROR
1446
+ LidarDirtyWarning = 38,// WARNING (donor LIDAR_DIRTY at 38)
1447
+ CamDirty = 39,// WARNING
1448
+ CamAbnormal = 40,// WARNING
1449
+ CamCover = 41,// WARNING
1450
+ BatteryOverheatWarning = 42,// WARNING (donor BATTERY_OVERHEAT at 42)
1451
+ BatteryTempLow = 43,// WARNING
1452
+ AutobuildBorder = 44,// WARNING
1453
+ AutobuildSide = 45,// WARNING
1454
+ BorderFinish = 46,// INFO
1455
+ NewMap = 47,// INFO
1456
+ TaskFinish = 48,// INFO
1457
+ DestinationNotReachable = 49,// INFO
1458
+ TaskStart = 50,// INFO
1459
+ CruiseStart = 51,// INFO
1460
+ PointAndGoStart = 52,// INFO
1461
+ ScheduleStart = 53,// INFO
1462
+ BatteryLowReturning = 54,// INFO
1463
+ BatteryLowScheduleSuspend = 55,// INFO
1464
+ BadWeatherProtecting = 56,// INFO
1465
+ RainScheduleInterupted = 57,// INFO
1466
+ RainScheduleSuspend = 58,// INFO
1467
+ ForzenReturning = 59,// INFO
1468
+ FrozenScheduleSuspend = 60,// INFO
1469
+ NotDisturbReturning = 61,// INFO
1470
+ NotDisturbScheduleSuspend = 62,// INFO
1471
+ WorkingScheduleSuspend = 63,// INFO
1472
+ RemoteControlingScheduleSuspend = 64,// INFO
1473
+ EmergencyStoppedScheduleSuspend = 65,// INFO
1474
+ TopCoverOpenScheduleSuspend = 66,// INFO
1475
+ FaultModeScheduleSuspend = 67,// INFO
1476
+ ScheduleTimeout = 68,// INFO
1477
+ StationNotConnectedToWorkingArea = 69,// INFO
1478
+ ContinueFromBreakpoint = 70,// INFO
1479
+ IdleTimeoutReturning = 71,// INFO
1480
+ PauseTimeoutReturning = 72,// INFO
1481
+ TopCoverOpen = 73
1482
+ }
1225
1483
 
1226
1484
  /**
1227
1485
  * Cast-free mower decoders. Re-exports the shared numeric primitives, and adds
@@ -1440,6 +1698,19 @@ declare class MowerDevice extends BaseDevice {
1440
1698
  get isDocked(): boolean;
1441
1699
  get isMowing(): boolean;
1442
1700
  get taskStatusRaw(): number | null;
1701
+ /**
1702
+ * TASK_STATUS (5:104) decoded to {@link MowerTaskStatus}, or null. The donor
1703
+ * names only code 7 (SpotIncomplete); codes 2/3/10/13 are documented "Unknown
1704
+ * task status" and intentionally surface as raw via {@link taskStatusRaw}.
1705
+ */
1706
+ get taskStatus(): MowerTaskStatus | null;
1707
+ get faultRaw(): number | null;
1708
+ /**
1709
+ * DEVICE_CODE (2:2) decoded to a {@link MowerFault} (the donor's
1710
+ * BASE_DEVICE_CODES registry, 0..73), or null for a model-specific/undocumented
1711
+ * code — which still surfaces as the raw number via {@link faultRaw}.
1712
+ */
1713
+ get fault(): MowerFault | null;
1443
1714
  /** Parsed scheduling task descriptor (2:50), or null. */
1444
1715
  get task(): MowerTaskDescriptor | null;
1445
1716
  /**
@@ -1503,6 +1774,9 @@ declare class MowerDevice extends BaseDevice {
1503
1774
  static readonly DEFAULT_PROPS: readonly [{
1504
1775
  readonly siid: 2;
1505
1776
  readonly piid: 1;
1777
+ }, {
1778
+ readonly siid: 2;
1779
+ readonly piid: 2;
1506
1780
  }, {
1507
1781
  readonly siid: 3;
1508
1782
  readonly piid: 1;
@@ -1521,4 +1795,339 @@ declare class MowerDevice extends BaseDevice {
1521
1795
  }];
1522
1796
  }
1523
1797
 
1524
- export { BaseDevice, type BaseDeviceEvents, type BatchDeviceDataFetcher, type CapabilityResolver, ChargingStatus, type CleanOpts, CleaningMode, type CreateDeviceArgs, DefaultCapabilityResolver, type DeviceCapabilities, type DeviceEvent, DreameApiError, DreameAuthError, type DreameCloudState, type DreameDevice, DreameDeviceOfflineError, DreameError, type DreameRegion, type DreameSession, DreameTransportError, LIBRARY_NAME, MODEL_CAPABILITIES as MOWER_MODEL_CAPABILITIES, type MapBoundingBox, type MapCleanedAreaOverlay, type MapDimensions, type MapFrameType, type MapLayer, type MapLayerType, type MapLowLyingArea, type MapObstacle, type MapPath, type MapPathType, type MapPoint, type MapPose, type MapRestrictedArea, type MapRoom, type MapRoomWall, type MapRun, type MapSegment, type MapStorey, type MapVirtualWall, type MapWallsInfo, type MiotAction, MiotError, type MiotProp, MiotState, type MowerAvailableMap, type MowerCapabilities, MowerCapabilityResolver, MowerChargingStatus, type MowerContour, MowerControlAction, type MowerControlState, MowerDevice, type MowerDeviceInput, type MowerMap, type MowerMapBoundary, type MowerMowPath, type MowerPathEntry, type MowerPoint, type MowerSpotArea, MowerStatus, type MowerTaskDescriptor, MowerTaskStatus, type MowerZone, Nodreame, type NodreameDeps, type NodreameEvents, type NodreameOptions, type OssFetchInput, type OssFetcherLike, type PropertyChangedEvent, type PropertyResult, type PropertyState, type PropertyWrite, type RenderMowerSvgOptions, type RenderVacuumPngOptions, type StateChangedEvent, SuctionLevel, TaskStatus, MODEL_CAPABILITIES$1 as VACUUM_MODEL_CAPABILITIES, type VacuumCapabilities, VacuumCapabilityResolver, VacuumDevice, type VacuumGetMapInput, type VacuumMap, WaterVolume, getMowerCapabilities, getVacuumCapabilities, renderMowerSvg, renderVacuumPng, resolveCapabilities };
1798
+ declare const DeviceDumpSchema: z.ZodObject<{
1799
+ schemaVersion: z.ZodLiteral<1>;
1800
+ library: z.ZodUnion<[z.ZodLiteral<"nodedreame">, z.ZodLiteral<"nodewitt">]>;
1801
+ libraryVersion: z.ZodString;
1802
+ device: z.ZodObject<{
1803
+ model: z.ZodString;
1804
+ firmware: z.ZodOptional<z.ZodString>;
1805
+ region: z.ZodOptional<z.ZodString>;
1806
+ type: z.ZodOptional<z.ZodString>;
1807
+ }, "strip", z.ZodTypeAny, {
1808
+ model: string;
1809
+ type?: string | undefined;
1810
+ region?: string | undefined;
1811
+ firmware?: string | undefined;
1812
+ }, {
1813
+ model: string;
1814
+ type?: string | undefined;
1815
+ region?: string | undefined;
1816
+ firmware?: string | undefined;
1817
+ }>;
1818
+ observations: z.ZodObject<{
1819
+ properties: z.ZodRecord<z.ZodString, z.ZodObject<{
1820
+ values: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">;
1821
+ unmapped: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">;
1822
+ enum: z.ZodOptional<z.ZodString>;
1823
+ count: z.ZodNumber;
1824
+ firstSeen: z.ZodNumber;
1825
+ lastSeen: z.ZodNumber;
1826
+ }, "strip", z.ZodTypeAny, {
1827
+ values: (string | number | boolean)[];
1828
+ unmapped: (string | number | boolean)[];
1829
+ count: number;
1830
+ firstSeen: number;
1831
+ lastSeen: number;
1832
+ enum?: string | undefined;
1833
+ }, {
1834
+ values: (string | number | boolean)[];
1835
+ unmapped: (string | number | boolean)[];
1836
+ count: number;
1837
+ firstSeen: number;
1838
+ lastSeen: number;
1839
+ enum?: string | undefined;
1840
+ }>>;
1841
+ events: z.ZodArray<z.ZodObject<{
1842
+ at: z.ZodNumber;
1843
+ type: z.ZodString;
1844
+ data: z.ZodOptional<z.ZodUnknown>;
1845
+ }, "strip", z.ZodTypeAny, {
1846
+ at: number;
1847
+ type: string;
1848
+ data?: unknown;
1849
+ }, {
1850
+ at: number;
1851
+ type: string;
1852
+ data?: unknown;
1853
+ }>, "many">;
1854
+ rawFrames: z.ZodOptional<z.ZodArray<z.ZodObject<{
1855
+ at: z.ZodNumber;
1856
+ source: z.ZodString;
1857
+ payload: z.ZodUnknown;
1858
+ }, "strip", z.ZodTypeAny, {
1859
+ at: number;
1860
+ source: string;
1861
+ payload?: unknown;
1862
+ }, {
1863
+ at: number;
1864
+ source: string;
1865
+ payload?: unknown;
1866
+ }>, "many">>;
1867
+ }, "strip", z.ZodTypeAny, {
1868
+ properties: Record<string, {
1869
+ values: (string | number | boolean)[];
1870
+ unmapped: (string | number | boolean)[];
1871
+ count: number;
1872
+ firstSeen: number;
1873
+ lastSeen: number;
1874
+ enum?: string | undefined;
1875
+ }>;
1876
+ events: {
1877
+ at: number;
1878
+ type: string;
1879
+ data?: unknown;
1880
+ }[];
1881
+ rawFrames?: {
1882
+ at: number;
1883
+ source: string;
1884
+ payload?: unknown;
1885
+ }[] | undefined;
1886
+ }, {
1887
+ properties: Record<string, {
1888
+ values: (string | number | boolean)[];
1889
+ unmapped: (string | number | boolean)[];
1890
+ count: number;
1891
+ firstSeen: number;
1892
+ lastSeen: number;
1893
+ enum?: string | undefined;
1894
+ }>;
1895
+ events: {
1896
+ at: number;
1897
+ type: string;
1898
+ data?: unknown;
1899
+ }[];
1900
+ rawFrames?: {
1901
+ at: number;
1902
+ source: string;
1903
+ payload?: unknown;
1904
+ }[] | undefined;
1905
+ }>;
1906
+ catalog: z.ZodObject<{
1907
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1908
+ name: z.ZodString;
1909
+ siid: z.ZodOptional<z.ZodNumber>;
1910
+ aiid: z.ZodOptional<z.ZodNumber>;
1911
+ }, "strip", z.ZodTypeAny, {
1912
+ name: string;
1913
+ siid?: number | undefined;
1914
+ aiid?: number | undefined;
1915
+ }, {
1916
+ name: string;
1917
+ siid?: number | undefined;
1918
+ aiid?: number | undefined;
1919
+ }>, "many">>;
1920
+ capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1921
+ sensors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1922
+ model: z.ZodString;
1923
+ channel: z.ZodOptional<z.ZodNumber>;
1924
+ }, "strip", z.ZodTypeAny, {
1925
+ model: string;
1926
+ channel?: number | undefined;
1927
+ }, {
1928
+ model: string;
1929
+ channel?: number | undefined;
1930
+ }>, "many">>;
1931
+ }, "strip", z.ZodTypeAny, {
1932
+ commands?: {
1933
+ name: string;
1934
+ siid?: number | undefined;
1935
+ aiid?: number | undefined;
1936
+ }[] | undefined;
1937
+ capabilities?: Record<string, unknown> | undefined;
1938
+ sensors?: {
1939
+ model: string;
1940
+ channel?: number | undefined;
1941
+ }[] | undefined;
1942
+ }, {
1943
+ commands?: {
1944
+ name: string;
1945
+ siid?: number | undefined;
1946
+ aiid?: number | undefined;
1947
+ }[] | undefined;
1948
+ capabilities?: Record<string, unknown> | undefined;
1949
+ sensors?: {
1950
+ model: string;
1951
+ channel?: number | undefined;
1952
+ }[] | undefined;
1953
+ }>;
1954
+ meta: z.ZodObject<{
1955
+ startedAt: z.ZodNumber;
1956
+ durationMs: z.ZodNumber;
1957
+ generatedAt: z.ZodNumber;
1958
+ }, "strip", z.ZodTypeAny, {
1959
+ startedAt: number;
1960
+ durationMs: number;
1961
+ generatedAt: number;
1962
+ }, {
1963
+ startedAt: number;
1964
+ durationMs: number;
1965
+ generatedAt: number;
1966
+ }>;
1967
+ }, "strip", z.ZodTypeAny, {
1968
+ schemaVersion: 1;
1969
+ library: "nodedreame" | "nodewitt";
1970
+ libraryVersion: string;
1971
+ device: {
1972
+ model: string;
1973
+ type?: string | undefined;
1974
+ region?: string | undefined;
1975
+ firmware?: string | undefined;
1976
+ };
1977
+ observations: {
1978
+ properties: Record<string, {
1979
+ values: (string | number | boolean)[];
1980
+ unmapped: (string | number | boolean)[];
1981
+ count: number;
1982
+ firstSeen: number;
1983
+ lastSeen: number;
1984
+ enum?: string | undefined;
1985
+ }>;
1986
+ events: {
1987
+ at: number;
1988
+ type: string;
1989
+ data?: unknown;
1990
+ }[];
1991
+ rawFrames?: {
1992
+ at: number;
1993
+ source: string;
1994
+ payload?: unknown;
1995
+ }[] | undefined;
1996
+ };
1997
+ catalog: {
1998
+ commands?: {
1999
+ name: string;
2000
+ siid?: number | undefined;
2001
+ aiid?: number | undefined;
2002
+ }[] | undefined;
2003
+ capabilities?: Record<string, unknown> | undefined;
2004
+ sensors?: {
2005
+ model: string;
2006
+ channel?: number | undefined;
2007
+ }[] | undefined;
2008
+ };
2009
+ meta: {
2010
+ startedAt: number;
2011
+ durationMs: number;
2012
+ generatedAt: number;
2013
+ };
2014
+ }, {
2015
+ schemaVersion: 1;
2016
+ library: "nodedreame" | "nodewitt";
2017
+ libraryVersion: string;
2018
+ device: {
2019
+ model: string;
2020
+ type?: string | undefined;
2021
+ region?: string | undefined;
2022
+ firmware?: string | undefined;
2023
+ };
2024
+ observations: {
2025
+ properties: Record<string, {
2026
+ values: (string | number | boolean)[];
2027
+ unmapped: (string | number | boolean)[];
2028
+ count: number;
2029
+ firstSeen: number;
2030
+ lastSeen: number;
2031
+ enum?: string | undefined;
2032
+ }>;
2033
+ events: {
2034
+ at: number;
2035
+ type: string;
2036
+ data?: unknown;
2037
+ }[];
2038
+ rawFrames?: {
2039
+ at: number;
2040
+ source: string;
2041
+ payload?: unknown;
2042
+ }[] | undefined;
2043
+ };
2044
+ catalog: {
2045
+ commands?: {
2046
+ name: string;
2047
+ siid?: number | undefined;
2048
+ aiid?: number | undefined;
2049
+ }[] | undefined;
2050
+ capabilities?: Record<string, unknown> | undefined;
2051
+ sensors?: {
2052
+ model: string;
2053
+ channel?: number | undefined;
2054
+ }[] | undefined;
2055
+ };
2056
+ meta: {
2057
+ startedAt: number;
2058
+ durationMs: number;
2059
+ generatedAt: number;
2060
+ };
2061
+ }>;
2062
+ /** Public shared dump type — inferred from the schema so the two never drift. */
2063
+ type DeviceDump = z.infer<typeof DeviceDumpSchema>;
2064
+
2065
+ /** A property decoder: the enum NAME + a membership test for a raw number. */
2066
+ interface KeyDecoder {
2067
+ enumName: string;
2068
+ isMember(raw: number): boolean;
2069
+ }
2070
+ /** Tunables for a {@link Dumper}. All optional. */
2071
+ interface DumperOptions {
2072
+ /** Capture raw event/property frames into `observations.rawFrames`. Default false. */
2073
+ captureRawFrames?: boolean;
2074
+ /** Cap on retained raw frames (ring). Default 500. */
2075
+ maxRawFrames?: number;
2076
+ /** Periodic cloud-shadow refresh interval (ms). Default 30000; 0 disables. */
2077
+ refreshIntervalMs?: number;
2078
+ }
2079
+ /**
2080
+ * The READ-ONLY slice of a device the {@link Dumper} consumes. Declaring it as
2081
+ * an interface lets tests inject a fake with no cast (mirrors `PushLike`). A real
2082
+ * `BaseDevice`/`VacuumDevice`/`MowerDevice` structurally satisfies it. NOTE it
2083
+ * exposes NO action/command method — the dumper literally cannot execute one.
2084
+ */
2085
+ interface DumperDevice {
2086
+ readonly model: string;
2087
+ readonly deviceId: string;
2088
+ readonly capabilities: {
2089
+ list(): readonly string[];
2090
+ has(t: string): boolean;
2091
+ model: string;
2092
+ };
2093
+ on(event: 'propertyChanged', cb: (e: PropertyChangedEvent) => void): this;
2094
+ on(event: 'event', cb: (e: DeviceEvent) => void): this;
2095
+ off(event: 'propertyChanged', cb: (e: PropertyChangedEvent) => void): this;
2096
+ off(event: 'event', cb: (e: DeviceEvent) => void): this;
2097
+ /** Cloud-shadow read; absent on a bare BaseDevice. Feature-detected. */
2098
+ refreshFromCache?(): Promise<void>;
2099
+ }
2100
+ /**
2101
+ * A passive, READ-ONLY observer that records what a Dreame device exposes while
2102
+ * it operates. {@link start} hooks the device's `propertyChanged`/`event` stream,
2103
+ * does an initial + periodic cloud-shadow {@link DumperDevice.refreshFromCache}
2104
+ * read (feature-detected), and snapshots the static catalog at construction.
2105
+ * {@link stop} detaches every listener + clears the timer (idempotent, no leaks).
2106
+ * {@link export} assembles the ANONYMIZED, zod-valid {@link DeviceDump}. The
2107
+ * dumper NEVER executes a device command/action.
2108
+ */
2109
+ declare class Dumper {
2110
+ #private;
2111
+ constructor(device: DumperDevice, catalog: DeviceDump['catalog'], type: string, decoders: Record<string, KeyDecoder>, options?: DumperOptions);
2112
+ /** Attach to the live stream + arm the periodic shadow refresh. Idempotent. */
2113
+ start(): Promise<void>;
2114
+ /** Detach every listener + clear the timer. Idempotent. */
2115
+ stop(): Promise<void>;
2116
+ /** Build the anonymized, schema-valid dump. Works live or after {@link stop}. */
2117
+ export(): DeviceDump;
2118
+ /** Deterministic pretty JSON of {@link export}. */
2119
+ exportJson(): string;
2120
+ }
2121
+ /**
2122
+ * Create a read-only {@link Dumper} for one device. The family-correct decoder
2123
+ * table + catalog + `device.type` are chosen via cast-free `instanceof` checks;
2124
+ * an unknown family records values with no enum/unmapped detection.
2125
+ */
2126
+ declare function createDumper(target: DumperDevice, options?: DumperOptions): Dumper;
2127
+ /**
2128
+ * Fan-out: one {@link Dumper} per discovered device on a {@link Nodreame} client
2129
+ * (read-only). Each `BaseDevice` structurally satisfies {@link DumperDevice}.
2130
+ */
2131
+ declare function createClientDumper(client: Nodreame, options?: DumperOptions): Dumper[];
2132
+
2133
+ export { BaseDevice, type BaseDeviceEvents, type BatchDeviceDataFetcher, type CapabilityResolver, ChargingStatus, type CleanOpts, CleaningMode, type CreateDeviceArgs, DefaultCapabilityResolver, type DeviceCapabilities, type DeviceDump, type DeviceEvent, DreameApiError, DreameAuthError, type DreameCloudState, type DreameDevice, DreameDeviceOfflineError, DreameError, type DreameRegion, type DreameSession, DreameTransportError, type DumperOptions, LIBRARY_NAME, MODEL_CAPABILITIES as MOWER_MODEL_CAPABILITIES, type MapBoundingBox, type MapCleanedAreaOverlay, type MapDimensions, type MapFrameType, type MapLayer, type MapLayerType, type MapLowLyingArea, type MapObstacle, type MapPath, type MapPathType, type MapPoint, type MapPose, type MapRestrictedArea, type MapRoom, type MapRoomWall, type MapRun, type MapSegment, type MapStorey, type MapVirtualWall, type MapWallsInfo, type MiotAction, MiotError, type MiotProp, MiotState, type MowerAvailableMap, type MowerCapabilities, MowerCapabilityResolver, MowerChargingStatus, type MowerContour, MowerControlAction, type MowerControlState, MowerDevice, type MowerDeviceInput, MowerFault, type MowerMap, type MowerMapBoundary, type MowerMowPath, type MowerPathEntry, type MowerPoint, type MowerSpotArea, MowerStatus, type MowerTaskDescriptor, MowerTaskStatus, type MowerZone, Nodreame, type NodreameDeps, type NodreameEvents, type NodreameOptions, type OssFetchInput, type OssFetcherLike, type PropertyChangedEvent, type PropertyResult, type PropertyState, type PropertyWrite, type RenderMowerSvgOptions, type RenderVacuumPngOptions, type StateChangedEvent, SuctionLevel, TaskStatus, MODEL_CAPABILITIES$1 as VACUUM_MODEL_CAPABILITIES, type VacuumCapabilities, VacuumCapabilityResolver, VacuumDevice, type VacuumGetMapInput, type VacuumMap, WaterVolume, createClientDumper, createDumper, getMowerCapabilities, getVacuumCapabilities, renderMowerSvg, renderVacuumPng, resolveCapabilities };