@scm-js/plugin-api 1.8.0 → 1.9.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/index.d.ts +34 -6
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -800,9 +800,21 @@ export interface IsomCheck {
|
|
|
800
800
|
/** Rects whose tiles are not what their ISOM resolves to (doodad tiles are excused). */
|
|
801
801
|
mismatched: number;
|
|
802
802
|
}
|
|
803
|
-
/**
|
|
803
|
+
/**
|
|
804
|
+
* `checkIsom` with what a rebuild would do about it — the verdict the palette, Check Map
|
|
805
|
+
* and the Repair plugin draw from.
|
|
806
|
+
*
|
|
807
|
+
* The two numbers measure opposite directions and are not inverses: `mismatched` is the
|
|
808
|
+
* lattice failing to reproduce the tiles, while a rebuild votes a lattice out of the
|
|
809
|
+
* tiles. A rebuild converges in one pass and leaves `inherent` behind for good, because
|
|
810
|
+
* hand-placed tiles, blends and another editor's ground are not terrain any lattice
|
|
811
|
+
* describes. Reporting `mismatched` alone therefore recommended a repair that could not
|
|
812
|
+
* move the number, on every map with terrain like that.
|
|
813
|
+
*/
|
|
804
814
|
export interface IsomReport extends IsomCheck {
|
|
805
|
-
/**
|
|
815
|
+
/** Of `mismatched`, the rects a rebuild would leave: terrain no lattice describes. */
|
|
816
|
+
inherent: number;
|
|
817
|
+
/** A rebuild would bring more than `STALE_ISOM_SHARE` of the rects back in step. */
|
|
806
818
|
stale: boolean;
|
|
807
819
|
}
|
|
808
820
|
export interface LocationStringChange {
|
|
@@ -1663,6 +1675,13 @@ export interface HistoryEdit {
|
|
|
1663
1675
|
* removes the section again rather than leaving an all-zero one behind.
|
|
1664
1676
|
*/
|
|
1665
1677
|
createdIsom?: Uint16Array;
|
|
1678
|
+
/**
|
|
1679
|
+
* Set when the edit rebuilt an existing lattice from the tiles, which is the one edit
|
|
1680
|
+
* to `isom` the ISOM health is re-measured after: a brush stroke keeps the two in step
|
|
1681
|
+
* by construction and is deliberately not measured (`useIsomStatus`), and measuring
|
|
1682
|
+
* costs a second rebuild.
|
|
1683
|
+
*/
|
|
1684
|
+
rebuiltIsom?: boolean;
|
|
1666
1685
|
/** Unit placements, moves and deletions (see editor/units.ts). */
|
|
1667
1686
|
units?: UnitChange[];
|
|
1668
1687
|
/**
|
|
@@ -3114,10 +3133,19 @@ export interface TerrainApi {
|
|
|
3114
3133
|
/** Whether the open map carries an ISOM section the isometric brush can work on. */
|
|
3115
3134
|
hasIsom(): boolean;
|
|
3116
3135
|
/**
|
|
3117
|
-
* How well the ISOM describes the tiles
|
|
3118
|
-
*
|
|
3119
|
-
*
|
|
3120
|
-
* and
|
|
3136
|
+
* How well the ISOM describes the tiles, and what rebuilding it would do about that:
|
|
3137
|
+
* `rects` measured, `mismatched` among them, `inherent` of those a rebuild would leave
|
|
3138
|
+
* behind (terrain no lattice describes — hand-placed tiles, blends, another editor's
|
|
3139
|
+
* ground), and `stale` when a rebuild would bring more than the palette's threshold
|
|
3140
|
+
* back in step. Null when the map has no ISOM (`hasIsom`) or no map is open. Waits for
|
|
3141
|
+
* the tileset graphics to load and rejects when they are missing.
|
|
3142
|
+
*
|
|
3143
|
+
* Offer `tx.rebuildIsom` on `stale`, not on `mismatched`: the two measure opposite
|
|
3144
|
+
* directions, a rebuild converges in one pass, and `inherent` never goes away.
|
|
3145
|
+
*
|
|
3146
|
+
* @example
|
|
3147
|
+
* const r = await api.terrain.checkIsom();
|
|
3148
|
+
* if (r?.stale) await api.document.edit("Rebuild ISOM", (tx) => { tx.rebuildIsom(); });
|
|
3121
3149
|
*/
|
|
3122
3150
|
checkIsom(): Promise<IsomReport | null>;
|
|
3123
3151
|
tileInfo(id: number): TileInfo | null;
|