@mark1russell7/room-view 0.2.4 → 0.3.1

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.
Files changed (53) hide show
  1. package/README.md +64 -34
  2. package/build/{anchors-Ba3OUmhF.js → check-lFfxIUS3.js} +11 -260
  3. package/build/check-lFfxIUS3.js.map +1 -0
  4. package/build/index.d.ts +5 -5
  5. package/build/index.js +6 -5
  6. package/build/index.js.map +1 -1
  7. package/build/{layers-BO_MMtQJ.d.ts → layers-BiiyFJwZ.d.ts} +35 -9
  8. package/build/layers-BiiyFJwZ.d.ts.map +1 -0
  9. package/build/{layers-B5nL_lVW.js → layers-DmTro5Ny.js} +158 -26
  10. package/build/layers-DmTro5Ny.js.map +1 -0
  11. package/build/{level-CXCIX08K.js → level-CvbiwvhH.js} +12 -37
  12. package/build/level-CvbiwvhH.js.map +1 -0
  13. package/build/{level-Cjcf3u20.d.ts → level-DmEftWYn.d.ts} +11 -19
  14. package/build/level-DmEftWYn.d.ts.map +1 -0
  15. package/build/marks.d.ts +2 -2
  16. package/build/marks.js +1 -2
  17. package/build/marks.js.map +1 -1
  18. package/build/plan-import.d.ts +325 -0
  19. package/build/plan-import.d.ts.map +1 -0
  20. package/build/plan-import.js +855 -0
  21. package/build/plan-import.js.map +1 -0
  22. package/build/room-BQua5eSs.d.ts +124 -0
  23. package/build/room-BQua5eSs.d.ts.map +1 -0
  24. package/build/room-CiVZ_07s.js +29 -0
  25. package/build/room-CiVZ_07s.js.map +1 -0
  26. package/build/sample.d.ts +4 -4
  27. package/build/sample.d.ts.map +1 -1
  28. package/build/sample.js +21 -217
  29. package/build/sample.js.map +1 -1
  30. package/build/schema.d.ts +59 -9
  31. package/build/schema.d.ts.map +1 -1
  32. package/build/schema.js +251 -91
  33. package/build/schema.js.map +1 -1
  34. package/build/solids-CdJf0U39.d.ts +148 -0
  35. package/build/solids-CdJf0U39.d.ts.map +1 -0
  36. package/build/three.d.ts +9 -16
  37. package/build/three.d.ts.map +1 -1
  38. package/build/three.js +13 -106
  39. package/build/three.js.map +1 -1
  40. package/build/units-BZmvVyu4.js +30 -0
  41. package/build/units-BZmvVyu4.js.map +1 -0
  42. package/package.json +7 -1
  43. package/build/anchors-Ba3OUmhF.js.map +0 -1
  44. package/build/layers-B5nL_lVW.js.map +0 -1
  45. package/build/layers-BO_MMtQJ.d.ts.map +0 -1
  46. package/build/level-CXCIX08K.js.map +0 -1
  47. package/build/level-Cjcf3u20.d.ts.map +0 -1
  48. package/build/loads-CtHa4EHo.js +0 -103
  49. package/build/loads-CtHa4EHo.js.map +0 -1
  50. package/build/loads-Diy6-Ekz.d.ts +0 -73
  51. package/build/loads-Diy6-Ekz.d.ts.map +0 -1
  52. package/build/solids-S_j17vFJ.d.ts +0 -313
  53. package/build/solids-S_j17vFJ.d.ts.map +0 -1
package/build/sample.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // src/sample.ts
2
2
  /**
3
- * A sample room in meters. It is not a real room.
3
+ * A sample room in meters. It is not a real room. It has no records of an add-on: the add-ons give their own samples of this room.
4
4
  *
5
5
  * The outline is an L shape. Each outer wall has its line on the inner face: `side` is `right` on a counter-clockwise outline.
6
6
  * A short wall makes a nook at the top. The floor goes around that wall.
7
7
  */
8
8
  const SAMPLE_ROOM = {
9
- schema: "room/1",
9
+ schema: "room/2",
10
10
  name: "Sample room",
11
11
  unit: "m",
12
12
  height: 2.5,
@@ -98,82 +98,11 @@ const SAMPLE_ROOM = {
98
98
  [2.45, 5],
99
99
  [0, 5]
100
100
  ]
101
- }],
102
- outlets: [
103
- {
104
- id: "south-1",
105
- wall: "south",
106
- face: "left",
107
- offset: 2.4,
108
- height: .3,
109
- circuit: "a"
110
- },
111
- {
112
- id: "south-2",
113
- wall: "south",
114
- face: "left",
115
- offset: 4.6,
116
- height: .3,
117
- circuit: "a"
118
- },
119
- {
120
- id: "east-1",
121
- wall: "east",
122
- face: "left",
123
- offset: .4,
124
- height: .3,
125
- circuit: "a"
126
- },
127
- {
128
- id: "west-1",
129
- wall: "west",
130
- face: "left",
131
- offset: 4.2,
132
- height: .3,
133
- circuit: "a"
134
- },
135
- {
136
- id: "north-1",
137
- wall: "north",
138
- face: "left",
139
- offset: 2.8,
140
- height: .3,
141
- circuit: "a"
142
- },
143
- {
144
- id: "nook-1",
145
- wall: "north",
146
- face: "left",
147
- offset: .7,
148
- height: .3,
149
- circuit: "b"
150
- },
151
- {
152
- id: "nook-2",
153
- wall: "inset-east",
154
- face: "left",
155
- offset: 1.2,
156
- height: .3,
157
- circuit: "b"
158
- }
159
- ],
160
- circuits: [{
161
- id: "a",
162
- name: "Circuit A",
163
- breaker: 15,
164
- voltage: 120,
165
- limit: 1440
166
- }, {
167
- id: "b",
168
- name: "Circuit B",
169
- breaker: 15,
170
- voltage: 120,
171
- limit: 1440
172
101
  }]
173
102
  };
174
- /** A sample scene of the sample room: a desk, a sofa, and a rack of four computers in the nook. Circuit B is near its limit. */
103
+ /** A sample scene of the sample room: a desk, a sofa, and a rack of four computers in the nook. */
175
104
  const SAMPLE_SCENE = {
176
- schema: "scene/1",
105
+ schema: "scene/2",
177
106
  name: "Sample scene",
178
107
  room: SAMPLE_ROOM,
179
108
  objects: [
@@ -210,8 +139,7 @@ const SAMPLE_SCENE = {
210
139
  .45,
211
140
  .45
212
141
  ],
213
- at: [2.2, 4.6],
214
- outlet: "north-1"
142
+ at: [2.2, 4.6]
215
143
  },
216
144
  {
217
145
  id: "sofa",
@@ -246,8 +174,7 @@ const SAMPLE_SCENE = {
246
174
  ],
247
175
  at: [0, 0],
248
176
  lift: .08,
249
- parent: "rack",
250
- outlet: "nook-1"
177
+ parent: "rack"
251
178
  },
252
179
  {
253
180
  id: "node-2",
@@ -260,8 +187,7 @@ const SAMPLE_SCENE = {
260
187
  ],
261
188
  at: [0, 0],
262
189
  lift: .34,
263
- parent: "rack",
264
- outlet: "nook-1"
190
+ parent: "rack"
265
191
  },
266
192
  {
267
193
  id: "node-3",
@@ -274,8 +200,7 @@ const SAMPLE_SCENE = {
274
200
  ],
275
201
  at: [0, 0],
276
202
  lift: .6,
277
- parent: "rack",
278
- outlet: "nook-2"
203
+ parent: "rack"
279
204
  },
280
205
  {
281
206
  id: "node-4",
@@ -288,17 +213,9 @@ const SAMPLE_SCENE = {
288
213
  ],
289
214
  at: [0, 0],
290
215
  lift: .86,
291
- parent: "rack",
292
- outlet: "nook-2"
216
+ parent: "rack"
293
217
  }
294
- ],
295
- loads: [{
296
- circuit: "a",
297
- watts: 420
298
- }, {
299
- circuit: "b",
300
- watts: 1260
301
- }]
218
+ ]
302
219
  };
303
220
  /**
304
221
  * The survey of the sample room: its six outer walls as a walk along their inner faces. The diagonal of the large part is a check.
@@ -306,7 +223,7 @@ const SAMPLE_SCENE = {
306
223
  * Its objects are the objects of the sample scene, each with its measurements from a wall, from the desk or from the rack.
307
224
  */
308
225
  const SAMPLE_SURVEY = {
309
- schema: "survey/1",
226
+ schema: "survey/2",
310
227
  name: "Sample room",
311
228
  unit: "m",
312
229
  height: 2.5,
@@ -377,70 +294,6 @@ const SAMPLE_SURVEY = {
377
294
  height: 1.2
378
295
  }
379
296
  ],
380
- outlets: [
381
- {
382
- id: "south-1",
383
- wall: "south",
384
- offset: 2.4,
385
- height: .3,
386
- circuit: "a"
387
- },
388
- {
389
- id: "south-2",
390
- wall: "south",
391
- offset: 4.6,
392
- height: .3,
393
- circuit: "a"
394
- },
395
- {
396
- id: "east-1",
397
- wall: "east",
398
- offset: .4,
399
- height: .3,
400
- circuit: "a"
401
- },
402
- {
403
- id: "west-1",
404
- wall: "west",
405
- offset: 4.2,
406
- height: .3,
407
- circuit: "a"
408
- },
409
- {
410
- id: "north-1",
411
- wall: "north",
412
- offset: 2.8,
413
- height: .3,
414
- circuit: "a"
415
- },
416
- {
417
- id: "nook-1",
418
- wall: "north",
419
- offset: .7,
420
- height: .3,
421
- circuit: "b"
422
- },
423
- {
424
- id: "nook-2",
425
- wall: "inset-east",
426
- offset: 1.2,
427
- height: .3,
428
- circuit: "b"
429
- }
430
- ],
431
- circuits: [{
432
- id: "a",
433
- name: "Circuit A",
434
- breaker: 15,
435
- voltage: 120,
436
- limit: 1440
437
- }, {
438
- id: "b",
439
- name: "Circuit B",
440
- breaker: 15,
441
- voltage: 120,
442
- limit: 1440
443
- }],
444
297
  objects: [
445
298
  {
446
299
  id: "desk",
@@ -473,8 +326,7 @@ const SAMPLE_SURVEY = {
473
326
  width: .22,
474
327
  depth: .45,
475
328
  height: .45,
476
- gap: .175,
477
- outlet: "north-1"
329
+ gap: .175
478
330
  },
479
331
  {
480
332
  id: "sofa",
@@ -508,8 +360,7 @@ const SAMPLE_SURVEY = {
508
360
  depth: .6,
509
361
  height: .18,
510
362
  gap: .1,
511
- lift: .08,
512
- outlet: "nook-1"
363
+ lift: .08
513
364
  },
514
365
  {
515
366
  id: "node-2",
@@ -521,8 +372,7 @@ const SAMPLE_SURVEY = {
521
372
  depth: .6,
522
373
  height: .18,
523
374
  gap: .1,
524
- lift: .34,
525
- outlet: "nook-1"
375
+ lift: .34
526
376
  },
527
377
  {
528
378
  id: "node-3",
@@ -534,8 +384,7 @@ const SAMPLE_SURVEY = {
534
384
  depth: .6,
535
385
  height: .18,
536
386
  gap: .1,
537
- lift: .6,
538
- outlet: "nook-2"
387
+ lift: .6
539
388
  },
540
389
  {
541
390
  id: "node-4",
@@ -547,8 +396,7 @@ const SAMPLE_SURVEY = {
547
396
  depth: .6,
548
397
  height: .18,
549
398
  gap: .1,
550
- lift: .86,
551
- outlet: "nook-2"
399
+ lift: .86
552
400
  }
553
401
  ]
554
402
  };
@@ -562,7 +410,7 @@ const SAMPLE_SURVEY = {
562
410
  * Each room has objects: the hall has a shelf, the bathroom has a vanity, and the bedroom has a bed and a wardrobe.
563
411
  */
564
412
  const SAMPLE_LEVEL = {
565
- schema: "level/1",
413
+ schema: "level/2",
566
414
  name: "Sample apartment",
567
415
  unit: "m",
568
416
  rooms: [
@@ -576,7 +424,7 @@ const SAMPLE_LEVEL = {
576
424
  {
577
425
  id: "hall",
578
426
  survey: {
579
- schema: "survey/1",
427
+ schema: "survey/2",
580
428
  name: "Hall",
581
429
  unit: "m",
582
430
  height: 2.5,
@@ -637,13 +485,6 @@ const SAMPLE_LEVEL = {
637
485
  height: 2.05
638
486
  }
639
487
  ],
640
- outlets: [{
641
- id: "south-1",
642
- wall: "south",
643
- offset: 2.6,
644
- height: .3,
645
- circuit: "c"
646
- }],
647
488
  objects: [{
648
489
  id: "shelf",
649
490
  kind: "shelf",
@@ -659,7 +500,7 @@ const SAMPLE_LEVEL = {
659
500
  {
660
501
  id: "bathroom",
661
502
  survey: {
662
- schema: "survey/1",
503
+ schema: "survey/2",
663
504
  name: "Bathroom",
664
505
  unit: "m",
665
506
  height: 2.5,
@@ -702,13 +543,6 @@ const SAMPLE_LEVEL = {
702
543
  sill: 1.3,
703
544
  height: .8
704
545
  }],
705
- outlets: [{
706
- id: "east-1",
707
- wall: "east",
708
- offset: 2.1,
709
- height: 1.1,
710
- circuit: "c"
711
- }],
712
546
  objects: [{
713
547
  id: "vanity",
714
548
  kind: "cabinet",
@@ -724,7 +558,7 @@ const SAMPLE_LEVEL = {
724
558
  {
725
559
  id: "bedroom",
726
560
  survey: {
727
- schema: "survey/1",
561
+ schema: "survey/2",
728
562
  name: "Bedroom",
729
563
  unit: "m",
730
564
  height: 2.5,
@@ -777,29 +611,6 @@ const SAMPLE_LEVEL = {
777
611
  sill: .9,
778
612
  height: 1.2
779
613
  }],
780
- outlets: [
781
- {
782
- id: "south-1",
783
- wall: "south",
784
- offset: 1,
785
- height: .3,
786
- circuit: "c"
787
- },
788
- {
789
- id: "south-2",
790
- wall: "south",
791
- offset: 5,
792
- height: .3,
793
- circuit: "c"
794
- },
795
- {
796
- id: "west-1",
797
- wall: "west",
798
- offset: 1.8,
799
- height: .3,
800
- circuit: "c"
801
- }
802
- ],
803
614
  objects: [{
804
615
  id: "bed",
805
616
  kind: "bed",
@@ -859,14 +670,7 @@ const SAMPLE_LEVEL = {
859
670
  },
860
671
  thickness: .1
861
672
  }
862
- ],
863
- circuits: [{
864
- id: "c",
865
- name: "Circuit C",
866
- breaker: 15,
867
- voltage: 120,
868
- limit: 1440
869
- }]
673
+ ]
870
674
  };
871
675
  export { SAMPLE_LEVEL, SAMPLE_ROOM, SAMPLE_SCENE, SAMPLE_SURVEY };
872
676
 
@@ -1 +1 @@
1
- {"version":3,"file":"sample.js","names":[],"sources":["../src/sample.ts"],"sourcesContent":["import type { Level } from \"./level.ts\";\nimport type { Room, Scene } from \"./room.ts\";\nimport type { Survey } from \"./survey.ts\";\n\n/**\n * A sample room in meters. It is not a real room.\n *\n * The outline is an L shape. Each outer wall has its line on the inner face: `side` is `right` on a counter-clockwise outline.\n * A short wall makes a nook at the top. The floor goes around that wall.\n */\nexport const SAMPLE_ROOM: Room = {\n schema: \"room/1\",\n name: \"Sample room\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n walls: [\n { id: \"south\", from: [0, 0], to: [6, 0], side: \"right\" },\n { id: \"east\", from: [6, 0], to: [6, 3], side: \"right\" },\n { id: \"inset-north\", from: [6, 3], to: [4, 3], side: \"right\" },\n { id: \"inset-east\", from: [4, 3], to: [4, 5], side: \"right\" },\n { id: \"north\", from: [4, 5], to: [0, 5], side: \"right\" },\n { id: \"west\", from: [0, 5], to: [0, 0], side: \"right\" },\n { id: \"nook\", from: [2.5, 5], to: [2.5, 3.6], thickness: 0.1 },\n ],\n openings: [\n { id: \"door\", wall: \"south\", kind: \"door\", offset: 0.6, width: 0.9, height: 2.05 },\n { id: \"window-east\", wall: \"east\", kind: \"window\", offset: 0.8, width: 1.4, sill: 0.9, height: 1.2 },\n { id: \"window-west\", wall: \"west\", kind: \"window\", offset: 1.5, width: 1.6, sill: 0.9, height: 1.2 },\n ],\n floors: [\n {\n id: \"floor\",\n name: \"Room\",\n ring: [\n [0, 0],\n [6, 0],\n [6, 3],\n [4, 3],\n [4, 5],\n [2.55, 5],\n [2.55, 3.6],\n [2.45, 3.6],\n [2.45, 5],\n [0, 5],\n ],\n },\n ],\n outlets: [\n { id: \"south-1\", wall: \"south\", face: \"left\", offset: 2.4, height: 0.3, circuit: \"a\" },\n { id: \"south-2\", wall: \"south\", face: \"left\", offset: 4.6, height: 0.3, circuit: \"a\" },\n { id: \"east-1\", wall: \"east\", face: \"left\", offset: 0.4, height: 0.3, circuit: \"a\" },\n { id: \"west-1\", wall: \"west\", face: \"left\", offset: 4.2, height: 0.3, circuit: \"a\" },\n { id: \"north-1\", wall: \"north\", face: \"left\", offset: 2.8, height: 0.3, circuit: \"a\" },\n { id: \"nook-1\", wall: \"north\", face: \"left\", offset: 0.7, height: 0.3, circuit: \"b\" },\n { id: \"nook-2\", wall: \"inset-east\", face: \"left\", offset: 1.2, height: 0.3, circuit: \"b\" },\n ],\n circuits: [\n { id: \"a\", name: \"Circuit A\", breaker: 15, voltage: 120, limit: 1440 },\n { id: \"b\", name: \"Circuit B\", breaker: 15, voltage: 120, limit: 1440 },\n ],\n};\n\n/** A sample scene of the sample room: a desk, a sofa, and a rack of four computers in the nook. Circuit B is near its limit. */\nexport const SAMPLE_SCENE: Scene = {\n schema: \"scene/1\",\n name: \"Sample scene\",\n room: SAMPLE_ROOM,\n objects: [\n { id: \"desk\", kind: \"desk\", name: \"Desk\", size: [1.6, 0.75, 0.74], at: [1.2, 4.55] },\n { id: \"display\", kind: \"display\", name: \"Display\", size: [0.6, 0.2, 0.4], at: [0, 0.2], lift: 0.74, parent: \"desk\" },\n { id: \"tower\", kind: \"computer\", name: \"Tower\", size: [0.22, 0.45, 0.45], at: [2.2, 4.6], outlet: \"north-1\" },\n { id: \"sofa\", kind: \"sofa\", name: \"Sofa\", size: [2, 0.9, 0.8], at: [4.4, 0.6] },\n { id: \"rack\", kind: \"rack\", name: \"Rack\", size: [0.6, 0.8, 1.2], at: [3.3, 4.5] },\n { id: \"node-1\", kind: \"computer\", name: \"Node 1\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.08, parent: \"rack\", outlet: \"nook-1\" },\n { id: \"node-2\", kind: \"computer\", name: \"Node 2\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.34, parent: \"rack\", outlet: \"nook-1\" },\n { id: \"node-3\", kind: \"computer\", name: \"Node 3\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.6, parent: \"rack\", outlet: \"nook-2\" },\n { id: \"node-4\", kind: \"computer\", name: \"Node 4\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.86, parent: \"rack\", outlet: \"nook-2\" },\n ],\n loads: [\n { circuit: \"a\", watts: 420 },\n { circuit: \"b\", watts: 1260 },\n ],\n};\n\n/**\n * The survey of the sample room: its six outer walls as a walk along their inner faces. The diagonal of the large part is a check.\n * It does not have the short wall of the nook, because that wall is not a side of the walk.\n * Its objects are the objects of the sample scene, each with its measurements from a wall, from the desk or from the rack.\n */\nexport const SAMPLE_SURVEY: Survey = {\n schema: \"survey/1\",\n name: \"Sample room\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"south\", length: 6, turn: \"left\" },\n { id: \"east\", length: 3, turn: \"left\" },\n { id: \"inset-north\", length: 2, turn: \"right\" },\n { id: \"inset-east\", length: 2, turn: \"left\" },\n { id: \"north\", length: 4, turn: \"left\" },\n { id: \"west\", length: 5, turn: \"left\" },\n ],\n checks: [{ id: \"diagonal\", from: \"south\", to: \"inset-east\", length: 5 }],\n openings: [\n { id: \"door\", wall: \"south\", kind: \"door\", offset: 0.6, width: 0.9, height: 2.05 },\n { id: \"window-east\", wall: \"east\", kind: \"window\", offset: 0.8, width: 1.4, sill: 0.9, height: 1.2 },\n { id: \"window-west\", wall: \"west\", kind: \"window\", offset: 1.5, width: 1.6, sill: 0.9, height: 1.2 },\n ],\n outlets: [\n { id: \"south-1\", wall: \"south\", offset: 2.4, height: 0.3, circuit: \"a\" },\n { id: \"south-2\", wall: \"south\", offset: 4.6, height: 0.3, circuit: \"a\" },\n { id: \"east-1\", wall: \"east\", offset: 0.4, height: 0.3, circuit: \"a\" },\n { id: \"west-1\", wall: \"west\", offset: 4.2, height: 0.3, circuit: \"a\" },\n { id: \"north-1\", wall: \"north\", offset: 2.8, height: 0.3, circuit: \"a\" },\n { id: \"nook-1\", wall: \"north\", offset: 0.7, height: 0.3, circuit: \"b\" },\n { id: \"nook-2\", wall: \"inset-east\", offset: 1.2, height: 0.3, circuit: \"b\" },\n ],\n circuits: [\n { id: \"a\", name: \"Circuit A\", breaker: 15, voltage: 120, limit: 1440 },\n { id: \"b\", name: \"Circuit B\", breaker: 15, voltage: 120, limit: 1440 },\n ],\n objects: [\n { id: \"desk\", kind: \"desk\", name: \"Desk\", wall: \"north\", offset: 2, width: 1.6, depth: 0.75, height: 0.74, gap: 0.075 },\n { id: \"display\", kind: \"display\", name: \"Display\", on: \"desk\", offset: 0.5, width: 0.6, depth: 0.2, height: 0.4, gap: 0.075 },\n { id: \"tower\", kind: \"computer\", name: \"Tower\", wall: \"north\", offset: 1.69, width: 0.22, depth: 0.45, height: 0.45, gap: 0.175, outlet: \"north-1\" },\n { id: \"sofa\", kind: \"sofa\", name: \"Sofa\", wall: \"south\", offset: 3.4, width: 2, depth: 0.9, height: 0.8, gap: 0.15 },\n { id: \"rack\", kind: \"rack\", name: \"Rack\", wall: \"north\", offset: 0.4, width: 0.6, depth: 0.8, height: 1.2, gap: 0.1 },\n { id: \"node-1\", kind: \"computer\", name: \"Node 1\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.08, outlet: \"nook-1\" },\n { id: \"node-2\", kind: \"computer\", name: \"Node 2\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.34, outlet: \"nook-1\" },\n { id: \"node-3\", kind: \"computer\", name: \"Node 3\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.6, outlet: \"nook-2\" },\n { id: \"node-4\", kind: \"computer\", name: \"Node 4\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.86, outlet: \"nook-2\" },\n ],\n};\n\n/**\n * A sample apartment in meters. It is not a real apartment.\n *\n * The living room is the sample room. A hall is below it in the plan, with a bathroom on its right. A bedroom is below the hall and the bathroom.\n * Each survey starts at its own corner, and the three doors give the places of the rooms.\n * The walk of the bathroom starts along its west wall, so the bathroom turns. A wall between two rooms has a thickness of 0.1 m.\n *\n * Each room has objects: the hall has a shelf, the bathroom has a vanity, and the bedroom has a bed and a wardrobe.\n */\nexport const SAMPLE_LEVEL: Level = {\n schema: \"level/1\",\n name: \"Sample apartment\",\n unit: \"m\",\n rooms: [\n { id: \"living\", survey: { ...SAMPLE_SURVEY, name: \"Living room\" } },\n {\n id: \"hall\",\n survey: {\n schema: \"survey/1\",\n name: \"Hall\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"south\", length: 4, turn: \"left\" },\n { id: \"east\", length: 1.2, turn: \"left\" },\n { id: \"north\", length: 4, turn: \"left\" },\n { id: \"west\", length: 1.2, turn: \"left\" },\n ],\n openings: [\n { id: \"bedroom\", wall: \"south\", kind: \"door\", offset: 0.4, width: 0.8, height: 2.05 },\n { id: \"bathroom\", wall: \"east\", kind: \"door\", offset: 0.2, width: 0.75, height: 2.05 },\n { id: \"living\", wall: \"north\", kind: \"door\", offset: 2.5, width: 0.9, height: 2.05 },\n { id: \"entry\", wall: \"west\", kind: \"door\", offset: 0.15, width: 0.9, height: 2.05 },\n ],\n outlets: [{ id: \"south-1\", wall: \"south\", offset: 2.6, height: 0.3, circuit: \"c\" }],\n objects: [{ id: \"shelf\", kind: \"shelf\", name: \"Shoe shelf\", wall: \"south\", offset: 1.6, width: 1.2, depth: 0.3, height: 0.9 }],\n },\n },\n {\n id: \"bathroom\",\n survey: {\n schema: \"survey/1\",\n name: \"Bathroom\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"west\", length: 2.5, turn: \"left\" },\n { id: \"south\", length: 1.9, turn: \"left\" },\n { id: \"east\", length: 2.5, turn: \"left\" },\n { id: \"north\", length: 1.9, turn: \"left\" },\n ],\n openings: [\n { id: \"door\", wall: \"west\", kind: \"door\", offset: 0.25, width: 0.75, height: 2.05 },\n { id: \"window\", wall: \"east\", kind: \"window\", offset: 0.9, width: 0.7, sill: 1.3, height: 0.8 },\n ],\n outlets: [{ id: \"east-1\", wall: \"east\", offset: 2.1, height: 1.1, circuit: \"c\" }],\n objects: [{ id: \"vanity\", kind: \"cabinet\", name: \"Vanity\", wall: \"east\", offset: 1.7, width: 0.7, depth: 0.45, height: 0.85 }],\n },\n },\n {\n id: \"bedroom\",\n survey: {\n schema: \"survey/1\",\n name: \"Bedroom\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"south\", length: 6, turn: \"left\" },\n { id: \"east\", length: 2.3, turn: \"left\" },\n { id: \"inset-north\", length: 2, turn: \"right\" },\n { id: \"inset-east\", length: 1.3, turn: \"left\" },\n { id: \"north\", length: 4, turn: \"left\" },\n { id: \"west\", length: 3.6, turn: \"left\" },\n ],\n openings: [\n { id: \"door\", wall: \"north\", kind: \"door\", offset: 2.8, width: 0.8, height: 2.05 },\n { id: \"window\", wall: \"south\", kind: \"window\", offset: 2.2, width: 1.6, sill: 0.9, height: 1.2 },\n ],\n outlets: [\n { id: \"south-1\", wall: \"south\", offset: 1, height: 0.3, circuit: \"c\" },\n { id: \"south-2\", wall: \"south\", offset: 5, height: 0.3, circuit: \"c\" },\n { id: \"west-1\", wall: \"west\", offset: 1.8, height: 0.3, circuit: \"c\" },\n ],\n objects: [\n { id: \"bed\", kind: \"bed\", name: \"Bed\", wall: \"west\", offset: 1, width: 1.6, depth: 2, height: 0.5 },\n { id: \"wardrobe\", kind: \"cabinet\", name: \"Wardrobe\", wall: \"east\", offset: 0.3, width: 1.8, depth: 0.6, height: 2 },\n ],\n },\n },\n ],\n connections: [\n { id: \"living-hall\", from: { room: \"living\", opening: \"door\" }, to: { room: \"hall\", opening: \"living\" }, thickness: 0.1 },\n { id: \"hall-bathroom\", from: { room: \"hall\", opening: \"bathroom\" }, to: { room: \"bathroom\", opening: \"door\" }, thickness: 0.1 },\n { id: \"hall-bedroom\", from: { room: \"hall\", opening: \"bedroom\" }, to: { room: \"bedroom\", opening: \"door\" }, thickness: 0.1 },\n ],\n circuits: [{ id: \"c\", name: \"Circuit C\", breaker: 15, voltage: 120, limit: 1440 }],\n};\n"],"mappings":";;;;;;;AAUA,MAAa,cAAoB;CAC/B,QAAQ;CACR,MAAM;CACN,MAAM;CACN,QAAQ;CACR,eAAe;CACf,OAAO;EACL;GAAE,IAAI;GAAS,MAAM,CAAC,GAAG,CAAC;GAAG,IAAI,CAAC,GAAG,CAAC;GAAG,MAAM;EAAQ;EACvD;GAAE,IAAI;GAAQ,MAAM,CAAC,GAAG,CAAC;GAAG,IAAI,CAAC,GAAG,CAAC;GAAG,MAAM;EAAQ;EACtD;GAAE,IAAI;GAAe,MAAM,CAAC,GAAG,CAAC;GAAG,IAAI,CAAC,GAAG,CAAC;GAAG,MAAM;EAAQ;EAC7D;GAAE,IAAI;GAAc,MAAM,CAAC,GAAG,CAAC;GAAG,IAAI,CAAC,GAAG,CAAC;GAAG,MAAM;EAAQ;EAC5D;GAAE,IAAI;GAAS,MAAM,CAAC,GAAG,CAAC;GAAG,IAAI,CAAC,GAAG,CAAC;GAAG,MAAM;EAAQ;EACvD;GAAE,IAAI;GAAQ,MAAM,CAAC,GAAG,CAAC;GAAG,IAAI,CAAC,GAAG,CAAC;GAAG,MAAM;EAAQ;EACtD;GAAE,IAAI;GAAQ,MAAM,CAAC,KAAK,CAAC;GAAG,IAAI,CAAC,KAAK,GAAG;GAAG,WAAW;EAAI;CAC/D;CACA,UAAU;EACR;GAAE,IAAI;GAAQ,MAAM;GAAS,MAAM;GAAQ,QAAQ;GAAK,OAAO;GAAK,QAAQ;EAAK;EACjF;GAAE,IAA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MAAM;IAAQ,SAAS;GAAU;GAAG,IAAI;IAAE,MAAM;IAAW,SAAS;GAAO;GAAG,WAAW;EAAI;CAC7H;CACA,UAAU,CAAC;EAAE,IAAI;EAAK,MAAM;EAAa,SAAS;EAAI,SAAS;EAAK,OAAO;CAAK,CAAC;AACnF"}
1
+ {"version":3,"file":"sample.js","names":[],"sources":["../src/sample.ts"],"sourcesContent":["import type { Level } from \"./level.ts\";\nimport type { Room, Scene } from \"./room.ts\";\nimport type { Survey } from \"./survey.ts\";\n\n/**\n * A sample room in meters. It is not a real room. It has no records of an add-on: the add-ons give their own samples of this room.\n *\n * The outline is an L shape. Each outer wall has its line on the inner face: `side` is `right` on a counter-clockwise outline.\n * A short wall makes a nook at the top. The floor goes around that wall.\n */\nexport const SAMPLE_ROOM: Room = {\n schema: \"room/2\",\n name: \"Sample room\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n walls: [\n { id: \"south\", from: [0, 0], to: [6, 0], side: \"right\" },\n { id: \"east\", from: [6, 0], to: [6, 3], side: \"right\" },\n { id: \"inset-north\", from: [6, 3], to: [4, 3], side: \"right\" },\n { id: \"inset-east\", from: [4, 3], to: [4, 5], side: \"right\" },\n { id: \"north\", from: [4, 5], to: [0, 5], side: \"right\" },\n { id: \"west\", from: [0, 5], to: [0, 0], side: \"right\" },\n { id: \"nook\", from: [2.5, 5], to: [2.5, 3.6], thickness: 0.1 },\n ],\n openings: [\n { id: \"door\", wall: \"south\", kind: \"door\", offset: 0.6, width: 0.9, height: 2.05 },\n { id: \"window-east\", wall: \"east\", kind: \"window\", offset: 0.8, width: 1.4, sill: 0.9, height: 1.2 },\n { id: \"window-west\", wall: \"west\", kind: \"window\", offset: 1.5, width: 1.6, sill: 0.9, height: 1.2 },\n ],\n floors: [\n {\n id: \"floor\",\n name: \"Room\",\n ring: [\n [0, 0],\n [6, 0],\n [6, 3],\n [4, 3],\n [4, 5],\n [2.55, 5],\n [2.55, 3.6],\n [2.45, 3.6],\n [2.45, 5],\n [0, 5],\n ],\n },\n ],\n};\n\n/** A sample scene of the sample room: a desk, a sofa, and a rack of four computers in the nook. */\nexport const SAMPLE_SCENE: Scene = {\n schema: \"scene/2\",\n name: \"Sample scene\",\n room: SAMPLE_ROOM,\n objects: [\n { id: \"desk\", kind: \"desk\", name: \"Desk\", size: [1.6, 0.75, 0.74], at: [1.2, 4.55] },\n { id: \"display\", kind: \"display\", name: \"Display\", size: [0.6, 0.2, 0.4], at: [0, 0.2], lift: 0.74, parent: \"desk\" },\n { id: \"tower\", kind: \"computer\", name: \"Tower\", size: [0.22, 0.45, 0.45], at: [2.2, 4.6] },\n { id: \"sofa\", kind: \"sofa\", name: \"Sofa\", size: [2, 0.9, 0.8], at: [4.4, 0.6] },\n { id: \"rack\", kind: \"rack\", name: \"Rack\", size: [0.6, 0.8, 1.2], at: [3.3, 4.5] },\n { id: \"node-1\", kind: \"computer\", name: \"Node 1\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.08, parent: \"rack\" },\n { id: \"node-2\", kind: \"computer\", name: \"Node 2\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.34, parent: \"rack\" },\n { id: \"node-3\", kind: \"computer\", name: \"Node 3\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.6, parent: \"rack\" },\n { id: \"node-4\", kind: \"computer\", name: \"Node 4\", size: [0.48, 0.6, 0.18], at: [0, 0], lift: 0.86, parent: \"rack\" },\n ],\n};\n\n/**\n * The survey of the sample room: its six outer walls as a walk along their inner faces. The diagonal of the large part is a check.\n * It does not have the short wall of the nook, because that wall is not a side of the walk.\n * Its objects are the objects of the sample scene, each with its measurements from a wall, from the desk or from the rack.\n */\nexport const SAMPLE_SURVEY: Survey = {\n schema: \"survey/2\",\n name: \"Sample room\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"south\", length: 6, turn: \"left\" },\n { id: \"east\", length: 3, turn: \"left\" },\n { id: \"inset-north\", length: 2, turn: \"right\" },\n { id: \"inset-east\", length: 2, turn: \"left\" },\n { id: \"north\", length: 4, turn: \"left\" },\n { id: \"west\", length: 5, turn: \"left\" },\n ],\n checks: [{ id: \"diagonal\", from: \"south\", to: \"inset-east\", length: 5 }],\n openings: [\n { id: \"door\", wall: \"south\", kind: \"door\", offset: 0.6, width: 0.9, height: 2.05 },\n { id: \"window-east\", wall: \"east\", kind: \"window\", offset: 0.8, width: 1.4, sill: 0.9, height: 1.2 },\n { id: \"window-west\", wall: \"west\", kind: \"window\", offset: 1.5, width: 1.6, sill: 0.9, height: 1.2 },\n ],\n objects: [\n { id: \"desk\", kind: \"desk\", name: \"Desk\", wall: \"north\", offset: 2, width: 1.6, depth: 0.75, height: 0.74, gap: 0.075 },\n { id: \"display\", kind: \"display\", name: \"Display\", on: \"desk\", offset: 0.5, width: 0.6, depth: 0.2, height: 0.4, gap: 0.075 },\n { id: \"tower\", kind: \"computer\", name: \"Tower\", wall: \"north\", offset: 1.69, width: 0.22, depth: 0.45, height: 0.45, gap: 0.175 },\n { id: \"sofa\", kind: \"sofa\", name: \"Sofa\", wall: \"south\", offset: 3.4, width: 2, depth: 0.9, height: 0.8, gap: 0.15 },\n { id: \"rack\", kind: \"rack\", name: \"Rack\", wall: \"north\", offset: 0.4, width: 0.6, depth: 0.8, height: 1.2, gap: 0.1 },\n { id: \"node-1\", kind: \"computer\", name: \"Node 1\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.08 },\n { id: \"node-2\", kind: \"computer\", name: \"Node 2\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.34 },\n { id: \"node-3\", kind: \"computer\", name: \"Node 3\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.6 },\n { id: \"node-4\", kind: \"computer\", name: \"Node 4\", on: \"rack\", offset: 0.06, width: 0.48, depth: 0.6, height: 0.18, gap: 0.1, lift: 0.86 },\n ],\n};\n\n/**\n * A sample apartment in meters. It is not a real apartment.\n *\n * The living room is the sample room. A hall is below it in the plan, with a bathroom on its right. A bedroom is below the hall and the bathroom.\n * Each survey starts at its own corner, and the three doors give the places of the rooms.\n * The walk of the bathroom starts along its west wall, so the bathroom turns. A wall between two rooms has a thickness of 0.1 m.\n *\n * Each room has objects: the hall has a shelf, the bathroom has a vanity, and the bedroom has a bed and a wardrobe.\n */\nexport const SAMPLE_LEVEL: Level = {\n schema: \"level/2\",\n name: \"Sample apartment\",\n unit: \"m\",\n rooms: [\n { id: \"living\", survey: { ...SAMPLE_SURVEY, name: \"Living room\" } },\n {\n id: \"hall\",\n survey: {\n schema: \"survey/2\",\n name: \"Hall\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"south\", length: 4, turn: \"left\" },\n { id: \"east\", length: 1.2, turn: \"left\" },\n { id: \"north\", length: 4, turn: \"left\" },\n { id: \"west\", length: 1.2, turn: \"left\" },\n ],\n openings: [\n { id: \"bedroom\", wall: \"south\", kind: \"door\", offset: 0.4, width: 0.8, height: 2.05 },\n { id: \"bathroom\", wall: \"east\", kind: \"door\", offset: 0.2, width: 0.75, height: 2.05 },\n { id: \"living\", wall: \"north\", kind: \"door\", offset: 2.5, width: 0.9, height: 2.05 },\n { id: \"entry\", wall: \"west\", kind: \"door\", offset: 0.15, width: 0.9, height: 2.05 },\n ],\n objects: [{ id: \"shelf\", kind: \"shelf\", name: \"Shoe shelf\", wall: \"south\", offset: 1.6, width: 1.2, depth: 0.3, height: 0.9 }],\n },\n },\n {\n id: \"bathroom\",\n survey: {\n schema: \"survey/2\",\n name: \"Bathroom\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"west\", length: 2.5, turn: \"left\" },\n { id: \"south\", length: 1.9, turn: \"left\" },\n { id: \"east\", length: 2.5, turn: \"left\" },\n { id: \"north\", length: 1.9, turn: \"left\" },\n ],\n openings: [\n { id: \"door\", wall: \"west\", kind: \"door\", offset: 0.25, width: 0.75, height: 2.05 },\n { id: \"window\", wall: \"east\", kind: \"window\", offset: 0.9, width: 0.7, sill: 1.3, height: 0.8 },\n ],\n objects: [{ id: \"vanity\", kind: \"cabinet\", name: \"Vanity\", wall: \"east\", offset: 1.7, width: 0.7, depth: 0.45, height: 0.85 }],\n },\n },\n {\n id: \"bedroom\",\n survey: {\n schema: \"survey/2\",\n name: \"Bedroom\",\n unit: \"m\",\n height: 2.5,\n wallThickness: 0.15,\n sides: [\n { id: \"south\", length: 6, turn: \"left\" },\n { id: \"east\", length: 2.3, turn: \"left\" },\n { id: \"inset-north\", length: 2, turn: \"right\" },\n { id: \"inset-east\", length: 1.3, turn: \"left\" },\n { id: \"north\", length: 4, turn: \"left\" },\n { id: \"west\", length: 3.6, turn: \"left\" },\n ],\n openings: [\n { id: \"door\", wall: \"north\", kind: \"door\", offset: 2.8, width: 0.8, height: 2.05 },\n { id: \"window\", wall: \"south\", kind: \"window\", offset: 2.2, width: 1.6, sill: 0.9, height: 1.2 },\n ],\n objects: [\n { id: \"bed\", kind: \"bed\", name: \"Bed\", wall: \"west\", offset: 1, width: 1.6, depth: 2, height: 0.5 },\n { id: \"wardrobe\", kind: \"cabinet\", name: \"Wardrobe\", wall: \"east\", offset: 0.3, width: 1.8, depth: 0.6, height: 2 },\n ],\n },\n },\n ],\n connections: [\n { id: \"living-hall\", from: { room: \"living\", opening: \"door\" }, to: { room: \"hall\", opening: \"living\" }, thickness: 0.1 },\n { id: \"hall-bathroom\", from: { room: \"hall\", opening: \"bathroom\" }, to: { room: \"bathroom\", opening: \"door\" }, thickness: 0.1 },\n { id: \"hall-bedroom\", from: { room: \"hall\", opening: \"bedroom\" }, to: { room: \"bedroom\", opening: \"door\" }, thickness: 0.1 },\n ],\n};\n"],"mappings":";;;;;;;AAUA,MAAa,cAAoB;CAC/B,QAAQ;CACR,MAAM;CACN,MAAM;CACN,QAAQ;CACR,eAAe;CACf,OAAO;EACL;GAAE,IA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+1,80 @@
1
- import { N as Anchor } from "./layers-BO_MMtQJ.js";
2
- import { S as Survey, c as Level } from "./level-Cjcf3u20.js";
3
- import { B as Scene, R as Room } from "./solids-S_j17vFJ.js";
4
- import { z } from "zod";
1
+ import { E as FindingLevel, I as Anchor, a as FileKind, t as AddOn } from "./layers-BiiyFJwZ.js";
2
+ import { S as Survey, c as Level } from "./level-DmEftWYn.js";
3
+ import { c as Room, u as Scene } from "./room-BQua5eSs.js";
4
+ import * as z from "zod/mini";
5
+ /** The parse context of each read of this entry and of each add-on: the faults have the English messages of zod. */
6
+ export declare const READ_CONTEXT: z.core.ParseContext<z.core.$ZodIssue>;
5
7
  /**
6
8
  * The schema of an anchor. It examines the form of the record, and it refuses a field that the surface of the anchor does not have.
7
9
  * The schema of an add-on uses it for the anchor of each record. `checkAnchor` examines the meaning of an anchor with a correct form.
8
10
  */
9
- export declare const anchorSchema: z.ZodType<Anchor>;
11
+ export declare const anchorSchema: z.ZodMiniType<Anchor>;
10
12
  /**
11
13
  * The schema of a room record. It examines the form of the record: the fields, their types and the finite numbers.
12
14
  * It refuses a field that the format does not have. `checkRoom` examines the meaning of a record with a correct form.
13
15
  */
14
- export declare const roomSchema: z.ZodType<Room>;
16
+ export declare const roomSchema: z.ZodMiniType<Room>;
15
17
  /**
16
18
  * The schema of a scene record. It examines the form of the record, and it refuses a field that the format does not have.
17
19
  * `checkScene` examines the meaning of a record with a correct form.
18
20
  */
19
- export declare const sceneSchema: z.ZodType<Scene>;
21
+ export declare const sceneSchema: z.ZodMiniType<Scene>;
20
22
  /**
21
23
  * The schema of a survey record. It examines the form of the record, and it refuses a field that the format does not have.
22
24
  * `expandSurvey` makes the room record of a survey with a correct form, and `checkRoom` examines that room record.
23
25
  */
24
- export declare const surveySchema: z.ZodType<Survey>;
26
+ export declare const surveySchema: z.ZodMiniType<Survey>;
25
27
  /**
26
28
  * The schema of a level record. It examines the form of the record and of each survey, and it refuses a field that the format does not have.
27
29
  * `expandLevel` makes the room record of a level with a correct form, and `checkRoom` examines that room record.
28
30
  */
29
- export declare const levelSchema: z.ZodType<Level>;
31
+ export declare const levelSchema: z.ZodMiniType<Level>;
32
+ /** The record of each kind, in version 2. */
33
+ export interface KindRecords {
34
+ readonly room: Room;
35
+ readonly scene: Scene;
36
+ readonly survey: Survey;
37
+ readonly level: Level;
38
+ }
39
+ /** These are the codes of the findings of `readRecord`. */
40
+ export declare const READ_CODES: readonly ["read-both"];
41
+ /** A finding of the read of a record of version 1. The read keeps the record, so a finding is not an error. */
42
+ export interface ReadFinding {
43
+ readonly level: FindingLevel;
44
+ /** A code of `READ_CODES`. */
45
+ readonly code: string;
46
+ /** The key of the layer in the record. */
47
+ readonly layer: string;
48
+ /** The `id` of the room of a level with the finding. A finding of the record has none. */
49
+ readonly room?: string | undefined;
50
+ /** The finding in plain words. */
51
+ readonly message: string;
52
+ }
53
+ /** The result of `readRecord`: the record in version 2, its kind and its version in the file, or the faults of its form. */
54
+ export type RecordRead = { readonly [Kind in FileKind]: {
55
+ readonly ok: true;
56
+ readonly kind: Kind;
57
+ readonly record: KindRecords[Kind];
58
+ /** The version of the format in the file. */
59
+ readonly version: 1 | 2;
60
+ readonly findings: readonly ReadFinding[];
61
+ }; }[FileKind] | {
62
+ readonly ok: false;
63
+ readonly errors: readonly string[];
64
+ };
65
+ /**
66
+ * This function reads the JSON of a record of the core in version 1 or in version 2. The record is a room, a scene, a survey or a level.
67
+ * The result is the record in version 2. The schemas of this entry examine its form.
68
+ *
69
+ * A record of version 1 kept the records of some topics in fields of its own. For each add-on of the list with the read `v1`:
70
+ *
71
+ * - The read removes the fields of the add-on from the record, from each object and from each nested record.
72
+ * - The function `read` of the add-on gives the layer of these fields. For a scene, this layer has the records of its room too.
73
+ * For a level, the level record and the survey of each room get a layer.
74
+ * - A record that has the layer and the old fields keeps the layer. The finding `read-both` tells it.
75
+ *
76
+ * A field of version 1 that no add-on of the list removes is a fault of the form. A room record has no layers.
77
+ * Thus a `room/1` with old records gives a `scene/2` with the room and the layers, and a `room/1` with none gives a `room/2`.
78
+ */
79
+ export declare function readRecord(value: unknown, addOns?: readonly AddOn<unknown>[]): RecordRead;
30
80
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","names":[],"sources":["../src/schema.ts"],"mappings":";;;;;;;;qBAgBa,cAAc,EAAE,QAAQ;;;;;qBAqDxB,YAAY,EAAE,QAAQ;;;;;qBAqCtB,aAAa,EAAE,QAAQ;;;;;qBAmDvB,cAAc,EAAE,QAAQ;;;;;qBA0BxB,aAAa,EAAE,QAAQ"}
1
+ {"version":3,"file":"schema.d.ts","names":[],"sources":["../src/schema.ts"],"mappings":";;;;;qBAca,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK;;;;;qBAWzC,cAAc,EAAE,YAAY;;;;;qBAoC5B,YAAY,EAAE,YAAY;;;;;qBA8B1B,aAAa,EAAE,YAAY;;;;;qBAyC3B,cAAc,EAAE,YAAY;;;;;qBAwB5B,aAAa,EAAE,YAAY;;iBAUvB;WACN,MAAM;WACN,OAAO;WACP,QAAQ;WACR,OAAO;;;qBAIL;;iBAGI;WACN,OAAO;;WAEP;;WAEA;;WAEA;;WAEA;;;YAIC,yBAEI,QAAQ;WACP;WACA,MAAM;WACN,QAAQ,YAAY;;WAEpB;WACA,mBAAmB;KAE9B;WACS;WAAoB;;;;;;;;;;;;;;;;wBAmCnB,WAAW,gBAAgB,kBAAiB,mBAAwB"}