@adatechnology/game-floorplan 0.0.0-stage → 0.1.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.
@@ -0,0 +1,670 @@
1
+ /** Seeded random helpers. Same seed and key always produce the same stream. */
2
+ type Rng = () => number;
3
+ declare function mulberry32(a: number): Rng;
4
+ declare function hashString(input: string | number): number;
5
+ /** Independent stream for a `(seed, key)` pair. */
6
+ declare const createRng: (seed: string | number, key: string) => Rng;
7
+
8
+ /** Tools handed to a style recipe. `jit` and `rng` draw from the style's seeded stream: draw order is part of the contract. */
9
+ interface PaletteDraw {
10
+ rng: Rng;
11
+ base: [string, number, number, number];
12
+ H0: number;
13
+ H1: number;
14
+ H2: number;
15
+ jit(v: number, a: number): number;
16
+ hsl(h: number, s: number, l: number): Hsl;
17
+ }
18
+ interface PaletteEarly {
19
+ /** Accent mode: true saturates walls, false puts accents on objects. */
20
+ wallMode: boolean;
21
+ /** Maximum wall saturation. */
22
+ sMax: number;
23
+ /** Facade, wall, gate, roof, ceiling... in insertion order. */
24
+ roles: Record<string, Hsl>;
25
+ /** General floor `[h, s, l]` for room types that do not define their own. */
26
+ generalFloor: [number, number, number];
27
+ }
28
+ interface PaletteStyleDef {
29
+ /** Legacy stream suffix; defaults to the style id. */
30
+ seedKey?: string;
31
+ /** Facade colour table `[labelKey, h, s, l]`. */
32
+ facadeColors: [string, number, number, number][];
33
+ /** Draws up to the room colours (before the room loop). */
34
+ early(d: PaletteDraw): PaletteEarly;
35
+ /** Draws the object roles (wood, fabrics, metal, ground colours) after the room loop. */
36
+ late(d: PaletteDraw, e: PaletteEarly): Record<string, Hsl>;
37
+ }
38
+ interface PaletteContext extends PaletteDraw {
39
+ style: string;
40
+ sMax: number;
41
+ wallMode: boolean;
42
+ generalFloor: [number, number, number];
43
+ }
44
+ interface PaletteOptions {
45
+ seed?: number | string;
46
+ style?: string;
47
+ state?: string;
48
+ }
49
+ type Palette = {
50
+ meta: {
51
+ seed: number | string;
52
+ style: string;
53
+ state: string;
54
+ scheme: string;
55
+ base: string;
56
+ accentMode: 'wall' | 'object';
57
+ };
58
+ } & Record<string, number | object>;
59
+ /** Seeded colour-harmony palette: a facade base colour, a harmony scheme, role colours and contrast rules. */
60
+ declare function palette(o?: PaletteOptions): Palette;
61
+
62
+ /** Axis-aligned rectangle `[u0, v0, u1, v1]`. `u` runs along the facade, `v` from the street to the back. */
63
+ type Rect = [number, number, number, number];
64
+ type Vec2 = [number, number];
65
+ type Weights = Record<string, number>;
66
+ type Json = any;
67
+ type MeshFront = '+z' | '-z' | '+x' | '-x';
68
+ type Mount = 'ceiling' | 'wall' | 'window' | 'support' | 'floor' | 'roof' | 'ground' | 'wall_top' | (string & {});
69
+ /** How an item is coloured: a palette role, a fixed colour, or a seeded pick from a list. */
70
+ type ItemColor = {
71
+ role: string;
72
+ } | {
73
+ hex: number;
74
+ } | {
75
+ pick: number[];
76
+ };
77
+ interface ItemDef {
78
+ type: string;
79
+ category: string;
80
+ w: number;
81
+ d: number;
82
+ h: number;
83
+ /** Local mesh axis that is the front (default `+z`). */
84
+ front: MeshFront;
85
+ /** May sit under a window (default: `h <= 0.95`). */
86
+ window: boolean;
87
+ /** Does not need a clearance in front (default: `h <= 0.5`). */
88
+ low: boolean;
89
+ /** Rugs, decks: ignores collisions. */
90
+ flat: boolean;
91
+ deck: boolean;
92
+ /** Keep-out margin around the item (pools). */
93
+ rim: number;
94
+ decor?: boolean;
95
+ mount?: Mount;
96
+ equip?: string[];
97
+ color?: ItemColor;
98
+ }
99
+ type ItemInput = Pick<ItemDef, 'type' | 'category' | 'w' | 'd' | 'h'> & Partial<ItemDef>;
100
+ type Anchor = 'wall' | 'corner' | 'center' | 'window' | 'on' | 'inside';
101
+ type Side = 'left' | 'right' | 'front' | 'back' | 'any';
102
+ type FacingRule = 'center' | 'door' | 'target' | 'u+' | 'u-' | 'v+' | 'v-';
103
+ interface SlotDef {
104
+ id: string;
105
+ anchor: Anchor;
106
+ size?: number[];
107
+ cats: Weights;
108
+ side?: Side;
109
+ pos?: number;
110
+ shift?: number;
111
+ corner?: string;
112
+ fx?: number;
113
+ fz?: number;
114
+ dx?: number;
115
+ dz?: number;
116
+ on?: string;
117
+ n?: number;
118
+ part?: number;
119
+ required?: boolean;
120
+ chance?: number;
121
+ clearance?: number;
122
+ group?: string;
123
+ requires?: string;
124
+ facing?: FacingRule;
125
+ target?: string;
126
+ slide?: number;
127
+ [extra: string]: Json;
128
+ }
129
+ type SlotLibrary = SlotDef[] | ((room: {
130
+ w: number;
131
+ d: number;
132
+ }) => SlotDef[]);
133
+ interface SlotKit {
134
+ wall(id: string, side: Side, pos: number, size: number[], cats: Weights, o?: Partial<SlotDef>): SlotDef;
135
+ corner(id: string, corner: string, size: number[], cats: Weights, o?: Partial<SlotDef>): SlotDef;
136
+ center(id: string, fx: number, fz: number, size: number[], cats: Weights, o?: Partial<SlotDef>): SlotDef;
137
+ windowSlot(id: string, size: number[], cats: Weights, o?: Partial<SlotDef>): SlotDef;
138
+ on(id: string, parent: string, cats: Weights, o?: Partial<SlotDef>): SlotDef;
139
+ inside(id: string, parent: string, cats: Weights, o?: Partial<SlotDef>): SlotDef;
140
+ }
141
+ interface RoomDef {
142
+ id: string;
143
+ type: string;
144
+ label?: string;
145
+ rect: number[];
146
+ parts?: number[][];
147
+ library?: string;
148
+ without?: string[];
149
+ overrides?: Record<string, Json>;
150
+ extras?: SlotDef[];
151
+ slots?: SlotLibrary;
152
+ link?: number[];
153
+ outdoor?: boolean;
154
+ ceiling?: number;
155
+ seedKey?: string;
156
+ [extra: string]: Json;
157
+ }
158
+ interface DoorDef {
159
+ a: string;
160
+ b: string;
161
+ side?: string;
162
+ at?: number;
163
+ width: number;
164
+ opensTo?: string;
165
+ steel?: boolean;
166
+ [extra: string]: Json;
167
+ }
168
+ interface WindowDef {
169
+ room: string;
170
+ side: string;
171
+ at?: number;
172
+ n?: number;
173
+ width: number;
174
+ y0?: number;
175
+ y1?: number;
176
+ [extra: string]: Json;
177
+ }
178
+ interface FloorDef {
179
+ label?: string;
180
+ ceiling: number;
181
+ openPairs?: [string, string][];
182
+ rooms(w: number, d: number, options: FloorplanOptions): RoomDef[];
183
+ doors(w: number, d: number, options: FloorplanOptions): DoorDef[];
184
+ windows(w: number, d: number, options: FloorplanOptions): WindowDef[];
185
+ }
186
+ interface GateCfg {
187
+ u: number;
188
+ width: number;
189
+ to?: string;
190
+ }
191
+ interface LotConfig {
192
+ frontSetback: number;
193
+ marginLeft: number;
194
+ marginRight: number;
195
+ backyardDepth: number;
196
+ parking?: {
197
+ width: number;
198
+ };
199
+ garage?: GateCfg;
200
+ pedestrian?: {
201
+ u: number;
202
+ };
203
+ cargo?: GateCfg;
204
+ doorTarget?: {
205
+ a: string;
206
+ side: string;
207
+ };
208
+ libraries?: Record<string, string>;
209
+ yardZones?: {
210
+ id: string;
211
+ type: string;
212
+ label?: string;
213
+ v0: number;
214
+ v1: number;
215
+ library?: string;
216
+ }[];
217
+ grounds?: Record<string, string>;
218
+ pool?: boolean;
219
+ }
220
+ interface TemplateDef {
221
+ id: string;
222
+ /** Declared use for zoning, e.g. `residential_single`. */
223
+ use?: string;
224
+ style: string | ((o: FloorplanOptions) => string);
225
+ limits: {
226
+ w: number[];
227
+ d: number[];
228
+ };
229
+ defaults: {
230
+ w: number;
231
+ d: number;
232
+ };
233
+ limitsFn?: (o: FloorplanOptions) => TemplateDef['limits'];
234
+ defaultsFn?: (o: FloorplanOptions) => TemplateDef['defaults'];
235
+ floors?: FloorDef[];
236
+ floorsFn?: (o: FloorplanOptions) => FloorDef[];
237
+ /** Highest floor count the template can reach (zoning); defaults to the generated floor count. */
238
+ /** Adjustable storey count `[min, max]` through `options.floors`; lets zoning clamp the plan. */
239
+ floorRange?: [number, number];
240
+ lot?: ((w: number, d: number, style: StyleDef, o: FloorplanOptions) => LotConfig) | null;
241
+ facade?: {
242
+ balcony?: boolean;
243
+ veranda?: boolean;
244
+ steelDoor?: boolean;
245
+ };
246
+ facadeExtra?: (facade: Json, rng: Rng, w: number, d: number, o: FloorplanOptions) => void;
247
+ building?: (w: number, d: number, o: FloorplanOptions) => Json;
248
+ singleFloor?: boolean;
249
+ /** Sides built against a neighbour (`left` / `right`): exempt from the side setback. */
250
+ partyWalls?: ('left' | 'right')[];
251
+ options?: Json;
252
+ [extra: string]: Json;
253
+ }
254
+ interface BoundaryRule {
255
+ type: Weights;
256
+ top: Weights;
257
+ }
258
+ interface StyleDef {
259
+ id: string;
260
+ /** Other ids resolving to this style. */
261
+ aliases?: string[];
262
+ /** Name of the legacy palette RNG stream (kept so old seeds still reproduce). */
263
+ seedKey?: string;
264
+ height: number;
265
+ front: BoundaryRule;
266
+ sideYard: BoundaryRule;
267
+ back: BoundaryRule;
268
+ gate: {
269
+ garage: Weights;
270
+ };
271
+ facade: {
272
+ finish: Weights;
273
+ grilles: number;
274
+ roof: Weights;
275
+ };
276
+ /** Facade swatches `[labelKey, hex]`. */
277
+ swatches: [string, string][];
278
+ /** Ground type weights per lot zone type. */
279
+ grounds: Record<string, Weights>;
280
+ }
281
+ interface FloorplanOptions {
282
+ seed?: number | string;
283
+ w?: number;
284
+ d?: number;
285
+ style?: string;
286
+ state?: string;
287
+ /** Quality tier used by some templates. */
288
+ tier?: string;
289
+ floor?: number;
290
+ /** Output language for names and messages (default `en`). */
291
+ locale?: string;
292
+ /** Urban zone id or definition to clamp the plan to. */
293
+ zone?: string | ZoneDef;
294
+ [extra: string]: Json;
295
+ }
296
+ interface Room {
297
+ id: string;
298
+ type: string;
299
+ label?: string;
300
+ floor: number;
301
+ parts: Rect[];
302
+ library: string | null;
303
+ without: string[];
304
+ overrides: Record<string, Json>;
305
+ extras: SlotDef[];
306
+ slots: SlotLibrary | null;
307
+ link: number[] | null;
308
+ outdoor: boolean;
309
+ ceiling: number | null;
310
+ seedKey?: string;
311
+ ground?: string;
312
+ }
313
+ interface Plan {
314
+ w: number;
315
+ d: number;
316
+ tpl: TemplateDef;
317
+ floorDefs: FloorDef[];
318
+ style: string;
319
+ floors: {
320
+ index: number;
321
+ name?: string;
322
+ number?: number;
323
+ y0: number;
324
+ ceiling: number;
325
+ }[];
326
+ rooms: Room[];
327
+ zones: Room[];
328
+ doors: Json[];
329
+ windows: Json[];
330
+ walls: Json[];
331
+ gates: Json[];
332
+ paths: Json[];
333
+ lot: Json;
334
+ facade?: Json;
335
+ openPairs: Record<number, [string, string][]>;
336
+ zoning?: ZoningReport;
337
+ }
338
+ interface Slot {
339
+ id: string;
340
+ room: string;
341
+ floor: number;
342
+ outdoor: boolean;
343
+ anchor: string;
344
+ side: string | null;
345
+ cats: Weights;
346
+ valid: boolean;
347
+ reason: string | null;
348
+ [extra: string]: Json;
349
+ }
350
+ interface PlacedItem {
351
+ id: string;
352
+ type: string;
353
+ category: string;
354
+ x: number;
355
+ z: number;
356
+ ry: number;
357
+ w: number;
358
+ d: number;
359
+ h: number;
360
+ y: number;
361
+ room: string | null;
362
+ floor: number;
363
+ outdoor: boolean;
364
+ aabb: Rect;
365
+ color?: number | string;
366
+ [extra: string]: Json;
367
+ }
368
+ interface ZoneDef {
369
+ id: string;
370
+ /** Generic use strings: `residential_single`, `residential_multi`, `commercial`, `mixed`, `industrial`... */
371
+ allowedUses: string[];
372
+ maxFloors: number;
373
+ /** Metres. */
374
+ maxHeight: number;
375
+ /** Minimum setbacks in metres. */
376
+ setbacks: {
377
+ front: number;
378
+ side: number;
379
+ back: number;
380
+ };
381
+ /** Maximum building footprint / lot area (taxa de ocupacao). */
382
+ maxCoverage: number;
383
+ /** Maximum total built area / lot area (coeficiente de aproveitamento). */
384
+ maxFar: number;
385
+ /** Minimum lot area in m2. */
386
+ minLot: number;
387
+ /** Minimum lot frontage in metres. */
388
+ minFrontage: number;
389
+ /** Minimum permeable fraction of the lot (taxa de permeabilidade). */
390
+ permeableMin: number;
391
+ }
392
+ interface ZoneViolation {
393
+ rule: 'use' | 'floors' | 'height' | 'setback_front' | 'setback_side' | 'setback_back' | 'coverage' | 'far' | 'min_lot' | 'min_frontage' | 'permeable';
394
+ actual: number | string;
395
+ limit: number | string;
396
+ message?: string;
397
+ }
398
+ interface ZoneAdjustment {
399
+ field: string;
400
+ from: number | string;
401
+ to: number | string;
402
+ reason: string;
403
+ }
404
+ interface ZoningReport {
405
+ zone: string;
406
+ adjustments: ZoneAdjustment[];
407
+ violations: ZoneViolation[];
408
+ }
409
+ interface StateContext {
410
+ plan: Plan;
411
+ items: PlacedItem[];
412
+ seed: number | string;
413
+ state: string;
414
+ rng: Rng;
415
+ /** Placement helpers shared with the decor passes. */
416
+ ctx: PlacementContext;
417
+ kit: PlacementKit;
418
+ catalog: Record<string, ItemDef>;
419
+ wallTopHeights: Record<string, number>;
420
+ }
421
+ interface StatePlugin {
422
+ /** Name of the legacy RNG stream (kept so old seeds still reproduce). */
423
+ seedKey?: string;
424
+ /** Applies the state and returns the state items (not part of `items`). */
425
+ apply(c: StateContext): PlacedItem[];
426
+ /** Adjusts the palette roles (HSL) before the contrast rules run. */
427
+ adjustPalette?(roles: Record<string, Hsl>): void;
428
+ }
429
+ interface PlacementContext {
430
+ make(room: Room, type: string, rect: Rect, front: Vec2, extra?: Json): PlacedItem;
431
+ add(item: PlacedItem): PlacedItem;
432
+ placeOnFloor(room: Room, type: string, rng: Rng, opts?: Json): Rect | null;
433
+ itemsOfRoom(room: Room): PlacedItem[];
434
+ solidsOfRoom(room: Room): Rect[];
435
+ gridOf(room: Room): Json;
436
+ extraSolids: Record<string, Rect[]>;
437
+ roomById(id: string): Room | undefined;
438
+ setIgnored(ids: Set<string> | null): void;
439
+ added: PlacedItem[];
440
+ }
441
+ interface PlacementKit {
442
+ MARGIN: number;
443
+ EPS: number;
444
+ r2(x: number): number;
445
+ clamp(x: number, a: number, b: number): number;
446
+ overlaps(a: Rect, b: Rect, e?: number): boolean;
447
+ inner(p: Rect): Rect;
448
+ inflate(r: Rect, e: number): Rect;
449
+ areaOf(r: Rect): number;
450
+ topOf(m: PlacedItem): number;
451
+ extent(size: Vec2, f: Vec2): Vec2;
452
+ insideUnion(r: Rect, inners: Rect[]): boolean;
453
+ usableParts(room: Room, extra?: number): Rect[];
454
+ zonesOfFloor(plan: Plan, floor: number): Rect[];
455
+ windowsOfRoom(plan: Plan, room: Room): Json[];
456
+ windowZone(j: Json, outside?: boolean): Rect;
457
+ roomAt(plan: Plan, u: number, v: number, floor: number): Room | null;
458
+ reachable(grid: Json, solids: Rect[], inflation: number): boolean;
459
+ createGrid(plan: Plan, room: Room, ignored?: Set<string> | null): Json;
460
+ clearRect(r: Rect, f: Vec2, clearance: number): Rect;
461
+ pickWeighted(rng: Rng, w: Weights): string;
462
+ shuffle<T>(a: T[], rng: Rng): T[];
463
+ facingRotation(f: Vec2, type: string): number;
464
+ cutIntervals(intervals: [number, number][], a: number, b: number): [number, number][];
465
+ blocksWindow(it: ItemDef, j: Json): boolean;
466
+ }
467
+ interface DecorPassContext {
468
+ plan: Plan;
469
+ items: PlacedItem[];
470
+ seed: number | string;
471
+ rng: Rng;
472
+ ctx: PlacementContext;
473
+ kit: PlacementKit;
474
+ catalog: Record<string, ItemDef>;
475
+ /** Decor profiles registered per style id. */
476
+ profiles: Record<string, Json>;
477
+ }
478
+ type DecorPass = (c: DecorPassContext) => void;
479
+ interface GroundOverlayRule {
480
+ /** Item category that triggers the overlay (e.g. `pool`). */
481
+ category: string;
482
+ /** Ground type drawn around it. */
483
+ ground: string;
484
+ /** Metres added around the trigger footprint. */
485
+ inflate: number;
486
+ /** Skip when the zone already uses this ground type. */
487
+ unlessGround?: string;
488
+ /** Merge all triggers of the zone into one rectangle. */
489
+ merge?: boolean;
490
+ }
491
+ interface RoomColorDef {
492
+ type: string;
493
+ /** Position in the colour stream, so legacy seeds keep their draws. */
494
+ order: number;
495
+ /** Wall `[hue, lightness]` for a style context. */
496
+ wall(c: PaletteContext): [number, number];
497
+ /** Fixed floor base `[hue, saturation, lightness]`; falls back to the style's general floor. */
498
+ floor?: [number, number, number];
499
+ /** Neutral rooms are capped to low saturation. */
500
+ neutral?: boolean;
501
+ }
502
+ interface Hsl {
503
+ h: number;
504
+ s: number;
505
+ l: number;
506
+ }
507
+ interface FloorplanLocale {
508
+ labels?: Record<string, string>;
509
+ templates?: Record<string, string>;
510
+ styles?: Record<string, string>;
511
+ facadeColors?: Record<string, string>;
512
+ zones?: Record<string, string>;
513
+ reasons?: Record<string, string>;
514
+ messages?: Record<string, string>;
515
+ ui?: Record<string, string>;
516
+ }
517
+
518
+ declare function registerItem(def: ItemInput): ItemDef;
519
+ declare function registerItems(list: ItemInput[]): void;
520
+ declare function registerLibrary(id: string, library: SlotLibrary): void;
521
+ declare function registerLibraryAlias(alias: string, id: string): void;
522
+ declare function registerTemplate<T extends TemplateDef>(t: T): T;
523
+ declare function registerStyle(style: StyleDef): void;
524
+ declare function registerPaletteStyle(id: string, def: PaletteStyleDef): void;
525
+ declare function registerRoomColors(list: RoomColorDef[]): void;
526
+ declare function registerDecorProfile(styleId: string, profile: Json): void;
527
+ declare function registerPass(name: string, run: DecorPass): void;
528
+ declare function registerGroundOverlay(rule: GroundOverlayRule): void;
529
+ declare function registerWallTop(id: string, height: number): void;
530
+ /** Legacy RNG stream names for rooms and items, so seeds recorded before the English ids still reproduce. */
531
+ declare function registerSeedKeys(keys: {
532
+ rooms?: Record<string, string>;
533
+ items?: Record<string, string>;
534
+ }): void;
535
+ /** Registers a house state. The engine only ships `normal`. */
536
+ declare function registerState(name: string, plugin: StatePlugin): void;
537
+ /** Default state draw when `options.state` is absent: `{ state: weight }` on its own seeded stream. */
538
+ declare function setStateDistribution(weights: Record<string, number> | null, seedKey?: string): void;
539
+ declare const listStates: () => string[];
540
+
541
+ /** Recorded slots (resolved positions) of every storey and of the lot. */
542
+ declare function slots(template: string | TemplateDef, options?: FloorplanOptions): Json[];
543
+ /** Generates a plan: building, lot, seeded item fill, decor, house state and palette. */
544
+ declare function generate(template: string | TemplateDef, options?: FloorplanOptions): Json;
545
+ /** Validates a result of `generate`; returns a list of messages (empty when valid). */
546
+ declare function validate(result: Json, options?: {
547
+ locale?: string;
548
+ }): string[];
549
+ /** Size limits and default size of a template (they can depend on options such as `tier`). */
550
+ declare function limitsOf(template: string | TemplateDef, options?: FloorplanOptions): {
551
+ limits: {
552
+ w: number[];
553
+ d: number[];
554
+ };
555
+ defaults: {
556
+ w: number;
557
+ d: number;
558
+ };
559
+ };
560
+ declare function listTemplates(locale?: string): {
561
+ id: string;
562
+ name: string;
563
+ use: string;
564
+ style: string;
565
+ limits: {
566
+ w: number[];
567
+ d: number[];
568
+ };
569
+ defaults: {
570
+ w: number;
571
+ d: number;
572
+ };
573
+ floors: number;
574
+ floorRange: [number, number] | null;
575
+ lot: boolean;
576
+ options: any;
577
+ }[];
578
+
579
+ type Namespace = keyof FloorplanLocale;
580
+ /** Registers (or extends) the strings of a language. Packs call this with their JSON files. */
581
+ declare function registerLocale(code: string, table: FloorplanLocale): void;
582
+ declare const listLocales: () => string[];
583
+ /** Looks a key up in a namespace. Falls back to English, then to the key itself. `{n}`-style variables are replaced. */
584
+ declare function translate(ns: Namespace, key: string, locale?: string, vars?: Record<string, string | number>): string;
585
+
586
+ /** Builders for the slot definitions of a room library. */
587
+ declare const slotKit: SlotKit;
588
+
589
+ /** Registers an urban zone (zoning rules). Returns the stored definition. */
590
+ declare function defineZone(zone: ZoneDef): ZoneDef;
591
+ declare const getZone: (id: string) => ZoneDef | undefined;
592
+ declare const listZones: () => ZoneDef[];
593
+ /** Marks ground types (e.g. `lawn`, `dirt`) that count towards the permeable area of a lot. */
594
+ declare function registerPermeableGround(...types: string[]): void;
595
+ /**
596
+ * Checks a generated lot against a zone and returns the violations (empty when compliant).
597
+ * `lot` is `result.lot` (may be null for apartments), `plan` is the result of `generate`.
598
+ */
599
+ declare function checkLot(zoneIn: string | ZoneDef, lot: Json, plan: Json): ZoneViolation[];
600
+
601
+ declare const overlaps: (a: Rect, b: Rect, e?: number) => boolean;
602
+ declare function openingZones(u: number, v: number, axis: 'u' | 'v', width: number, depth: number): Rect[];
603
+
604
+ /** Keep-out zone of a window (inside, or outside for the lot). */
605
+ declare function windowZone(j: Json, outside?: boolean): Rect;
606
+
607
+ declare const version = "0.1.0";
608
+ /**
609
+ * The engine as a single object. Content packs take it as an argument (`register(engine)`), so that
610
+ * several bundles (ESM or IIFE) always fill the same registries.
611
+ */
612
+ declare const engine: {
613
+ version: string;
614
+ generate: typeof generate;
615
+ slots: typeof slots;
616
+ validate: typeof validate;
617
+ palette: typeof palette;
618
+ limitsOf: typeof limitsOf;
619
+ listTemplates: typeof listTemplates;
620
+ listStates: () => string[];
621
+ registerItem: typeof registerItem;
622
+ registerItems: typeof registerItems;
623
+ registerLibrary: typeof registerLibrary;
624
+ registerLibraryAlias: typeof registerLibraryAlias;
625
+ registerTemplate: typeof registerTemplate;
626
+ registerStyle: typeof registerStyle;
627
+ registerPaletteStyle: typeof registerPaletteStyle;
628
+ registerRoomColors: typeof registerRoomColors;
629
+ registerDecorProfile: typeof registerDecorProfile;
630
+ registerPass: typeof registerPass;
631
+ registerGroundOverlay: typeof registerGroundOverlay;
632
+ registerWallTop: typeof registerWallTop;
633
+ registerSeedKeys: typeof registerSeedKeys;
634
+ registerState: typeof registerState;
635
+ setStateDistribution: typeof setStateDistribution;
636
+ registerLocale: typeof registerLocale;
637
+ defineZone: typeof defineZone;
638
+ getZone: (id: string) => ZoneDef | undefined;
639
+ listZones: () => ZoneDef[];
640
+ checkLot: typeof checkLot;
641
+ registerPermeableGround: typeof registerPermeableGround;
642
+ slotKit: SlotKit;
643
+ translate: typeof translate;
644
+ listLocales: () => string[];
645
+ templates: Record<string, TemplateDef>;
646
+ catalog: Record<string, ItemDef>;
647
+ libraries: Record<string, SlotLibrary>;
648
+ styles: Record<string, StyleDef>;
649
+ createRng: (seed: string | number, key: string) => Rng;
650
+ mulberry32: typeof mulberry32;
651
+ hashString: typeof hashString;
652
+ overlaps: (a: Rect, b: Rect, e?: number) => boolean;
653
+ windowZone: typeof windowZone;
654
+ openingZones: typeof openingZones;
655
+ color: {
656
+ lstar: (n: number) => number;
657
+ hex: (n: number) => string;
658
+ hsl: (n: number) => Hsl;
659
+ HIGH_SATURATION: number;
660
+ MIN_WALL_FLOOR_CONTRAST: number;
661
+ MIN_FABRIC_FLOOR_CONTRAST: number;
662
+ };
663
+ constants: {
664
+ WALL_THICKNESS: number;
665
+ DOOR_CLEARANCE: number;
666
+ };
667
+ };
668
+ type FloorplanEngine = typeof engine;
669
+
670
+ export { type Anchor, type BoundaryRule, type DecorPass, type DecorPassContext, type DoorDef, type FacingRule, type FloorDef, type FloorplanEngine, type FloorplanLocale, type FloorplanOptions, type GateCfg, type GroundOverlayRule, type Hsl, type ItemColor, type ItemDef, type ItemInput, type Json, type LotConfig, type MeshFront, type Mount, type PaletteDraw, type PaletteEarly, type PaletteStyleDef, type PlacedItem, type PlacementContext, type PlacementKit, type Plan, type Rect, type Room, type RoomColorDef, type RoomDef, type Side, type Slot, type SlotDef, type SlotKit, type SlotLibrary, type StateContext, type StatePlugin, type StyleDef, type TemplateDef, type Vec2, type Weights, type WindowDef, type ZoneAdjustment, type ZoneDef, type ZoneViolation, type ZoningReport, checkLot, createRng, defineZone, engine, generate, getZone, hashString, limitsOf, listLocales, listStates, listTemplates, listZones, mulberry32, openingZones, overlaps, palette, registerDecorProfile, registerGroundOverlay, registerItem, registerItems, registerLibrary, registerLibraryAlias, registerLocale, registerPaletteStyle, registerPass, registerPermeableGround, registerRoomColors, registerSeedKeys, registerState, registerStyle, registerTemplate, registerWallTop, setStateDistribution, slotKit, slots, translate, validate, version, windowZone };