@apocaliss92/nodedreame 1.11.4 → 1.11.5
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.cjs +2 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -7
- package/dist/index.d.ts +3 -7
- package/dist/index.js +2 -74
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1243,16 +1243,12 @@ interface VacuumMap {
|
|
|
1243
1243
|
* Pure: only `pngjs` + arithmetic. No casts.
|
|
1244
1244
|
*/
|
|
1245
1245
|
|
|
1246
|
-
/**
|
|
1247
|
-
|
|
1248
|
-
* choices; `flat` / `dark-neon` / `materico` are node-dreame additions for
|
|
1249
|
-
* distinct visual styles.
|
|
1250
|
-
*/
|
|
1251
|
-
type MapColorScheme = 'dreame-light' | 'dreame-dark' | 'mijia-light' | 'tasshack' | 'flat' | 'dark-neon' | 'materico';
|
|
1246
|
+
/** A named map palette — node-dreame's own distinct visual styles. */
|
|
1247
|
+
type MapColorScheme = 'flat' | 'dark-neon' | 'materico';
|
|
1252
1248
|
interface RenderVacuumPngOptions {
|
|
1253
1249
|
/** Integer upscale factor (nearest-neighbour). Default 1. */
|
|
1254
1250
|
scale?: number;
|
|
1255
|
-
/** Palette. Default `'
|
|
1251
|
+
/** Palette. Default `'flat'`. */
|
|
1256
1252
|
colorScheme?: MapColorScheme;
|
|
1257
1253
|
/** Draw the cleaning/mopping path polylines. Default true. */
|
|
1258
1254
|
showPath?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1243,16 +1243,12 @@ interface VacuumMap {
|
|
|
1243
1243
|
* Pure: only `pngjs` + arithmetic. No casts.
|
|
1244
1244
|
*/
|
|
1245
1245
|
|
|
1246
|
-
/**
|
|
1247
|
-
|
|
1248
|
-
* choices; `flat` / `dark-neon` / `materico` are node-dreame additions for
|
|
1249
|
-
* distinct visual styles.
|
|
1250
|
-
*/
|
|
1251
|
-
type MapColorScheme = 'dreame-light' | 'dreame-dark' | 'mijia-light' | 'tasshack' | 'flat' | 'dark-neon' | 'materico';
|
|
1246
|
+
/** A named map palette — node-dreame's own distinct visual styles. */
|
|
1247
|
+
type MapColorScheme = 'flat' | 'dark-neon' | 'materico';
|
|
1252
1248
|
interface RenderVacuumPngOptions {
|
|
1253
1249
|
/** Integer upscale factor (nearest-neighbour). Default 1. */
|
|
1254
1250
|
scale?: number;
|
|
1255
|
-
/** Palette. Default `'
|
|
1251
|
+
/** Palette. Default `'flat'`. */
|
|
1256
1252
|
colorScheme?: MapColorScheme;
|
|
1257
1253
|
/** Draw the cleaning/mopping path polylines. Default true. */
|
|
1258
1254
|
showPath?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/support/version.ts
|
|
2
2
|
var LIBRARY_NAME = "nodedreame";
|
|
3
|
-
var LIBRARY_VERSION = "1.11.
|
|
3
|
+
var LIBRARY_VERSION = "1.11.5";
|
|
4
4
|
|
|
5
5
|
// src/transport/errors.ts
|
|
6
6
|
var DreameError = class extends Error {
|
|
@@ -2827,78 +2827,6 @@ function pose(x, y, angle, absent) {
|
|
|
2827
2827
|
// src/models/vacuum/map/render.ts
|
|
2828
2828
|
import { PNG } from "pngjs";
|
|
2829
2829
|
var SCHEMES = {
|
|
2830
|
-
"dreame-light": {
|
|
2831
|
-
floor: [210, 222, 235, 255],
|
|
2832
|
-
wall: [60, 60, 60, 255],
|
|
2833
|
-
carpet: [180, 150, 120, 200],
|
|
2834
|
-
segSat: 0.45,
|
|
2835
|
-
segVal: 0.95,
|
|
2836
|
-
path: [60, 110, 180, 235],
|
|
2837
|
-
robotBody: [40, 70, 110, 255],
|
|
2838
|
-
robotHeading: [255, 255, 255, 255],
|
|
2839
|
-
charger: [40, 160, 80, 255],
|
|
2840
|
-
noGoFill: [220, 60, 60, 70],
|
|
2841
|
-
noGoBorder: [200, 40, 40, 220],
|
|
2842
|
-
noMopFill: [60, 120, 220, 60],
|
|
2843
|
-
noMopBorder: [40, 90, 200, 200],
|
|
2844
|
-
virtualWall: [200, 40, 40, 230],
|
|
2845
|
-
obstacle: [230, 150, 30, 255],
|
|
2846
|
-
label: [40, 40, 40, 255]
|
|
2847
|
-
},
|
|
2848
|
-
"dreame-dark": {
|
|
2849
|
-
floor: [40, 46, 56, 255],
|
|
2850
|
-
wall: [15, 15, 18, 255],
|
|
2851
|
-
carpet: [80, 66, 52, 200],
|
|
2852
|
-
segSat: 0.5,
|
|
2853
|
-
segVal: 0.62,
|
|
2854
|
-
path: [120, 170, 230, 235],
|
|
2855
|
-
robotBody: [120, 170, 230, 255],
|
|
2856
|
-
robotHeading: [20, 24, 30, 255],
|
|
2857
|
-
charger: [60, 200, 110, 255],
|
|
2858
|
-
noGoFill: [220, 70, 70, 80],
|
|
2859
|
-
noGoBorder: [230, 70, 70, 220],
|
|
2860
|
-
noMopFill: [70, 130, 230, 70],
|
|
2861
|
-
noMopBorder: [80, 140, 235, 210],
|
|
2862
|
-
virtualWall: [230, 70, 70, 235],
|
|
2863
|
-
obstacle: [240, 180, 60, 255],
|
|
2864
|
-
label: [225, 230, 240, 255]
|
|
2865
|
-
},
|
|
2866
|
-
"mijia-light": {
|
|
2867
|
-
floor: [225, 232, 240, 255],
|
|
2868
|
-
wall: [70, 78, 92, 255],
|
|
2869
|
-
carpet: [188, 162, 132, 200],
|
|
2870
|
-
segSat: 0.35,
|
|
2871
|
-
segVal: 0.98,
|
|
2872
|
-
path: [80, 130, 200, 230],
|
|
2873
|
-
robotBody: [30, 100, 200, 255],
|
|
2874
|
-
robotHeading: [255, 255, 255, 255],
|
|
2875
|
-
charger: [40, 170, 90, 255],
|
|
2876
|
-
noGoFill: [225, 70, 70, 70],
|
|
2877
|
-
noGoBorder: [205, 45, 45, 220],
|
|
2878
|
-
noMopFill: [70, 130, 225, 60],
|
|
2879
|
-
noMopBorder: [50, 100, 205, 200],
|
|
2880
|
-
virtualWall: [205, 45, 45, 230],
|
|
2881
|
-
obstacle: [235, 160, 35, 255],
|
|
2882
|
-
label: [45, 52, 64, 255]
|
|
2883
|
-
},
|
|
2884
|
-
tasshack: {
|
|
2885
|
-
floor: [200, 210, 225, 255],
|
|
2886
|
-
wall: [80, 80, 95, 255],
|
|
2887
|
-
carpet: [176, 148, 118, 205],
|
|
2888
|
-
segSat: 0.5,
|
|
2889
|
-
segVal: 0.9,
|
|
2890
|
-
path: [50, 100, 170, 235],
|
|
2891
|
-
robotBody: [35, 60, 100, 255],
|
|
2892
|
-
robotHeading: [255, 255, 255, 255],
|
|
2893
|
-
charger: [35, 150, 75, 255],
|
|
2894
|
-
noGoFill: [215, 55, 55, 75],
|
|
2895
|
-
noGoBorder: [195, 35, 35, 220],
|
|
2896
|
-
noMopFill: [55, 115, 215, 65],
|
|
2897
|
-
noMopBorder: [35, 85, 195, 205],
|
|
2898
|
-
virtualWall: [195, 35, 35, 230],
|
|
2899
|
-
obstacle: [225, 145, 25, 255],
|
|
2900
|
-
label: [35, 42, 54, 255]
|
|
2901
|
-
},
|
|
2902
2830
|
// Flat-design: soft neutral floor, bright low-saturation segment fills, thin
|
|
2903
2831
|
// mid-grey walls, a single vivid accent for the path.
|
|
2904
2832
|
flat: {
|
|
@@ -2995,7 +2923,7 @@ function segmentColor(id, pal) {
|
|
|
2995
2923
|
}
|
|
2996
2924
|
function renderVacuumPng(map, opts = {}) {
|
|
2997
2925
|
const scale = Math.max(1, Math.trunc(opts.scale ?? 1));
|
|
2998
|
-
const pal = SCHEMES[opts.colorScheme ?? "
|
|
2926
|
+
const pal = SCHEMES[opts.colorScheme ?? "flat"] ?? SCHEMES.flat;
|
|
2999
2927
|
const w = Math.max(1, map.dimensions.width * scale);
|
|
3000
2928
|
const h = Math.max(1, map.dimensions.height * scale);
|
|
3001
2929
|
const png = new PNG({ width: w, height: h });
|