@scm-js/plugin-api 1.65.0 → 1.67.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.
Files changed (2) hide show
  1. package/index.d.ts +48 -3
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -954,6 +954,16 @@ export interface UnitsDat {
954
954
  export interface FlingyDat {
955
955
  /** sprites.dat index. */
956
956
  sprite: Uint16Array;
957
+ /** The fastest the flingy moves, in 1/256 pixel a frame (a Zergling's 1408 is 5.5 pixels a frame). */
958
+ topSpeed: Uint32Array;
959
+ /** How quickly it reaches that speed, in the same units a frame. */
960
+ acceleration: Uint16Array;
961
+ /** How far before its goal it starts to slow down, in 1/256 pixel. */
962
+ haltDistance: Uint32Array;
963
+ /** How sharply it turns. */
964
+ turnRadius: Uint8Array;
965
+ /** 0 flingy.dat's own figures, 1 partially mobile or weapon, 2 iscript.bin's (a unit whose walk is animated). */
966
+ moveControl: Uint8Array;
957
967
  }
958
968
  export interface SpritesDat {
959
969
  /** images.dat index. */
@@ -1155,6 +1165,13 @@ export interface SyncFieldsOp {
1155
1165
  extended: boolean;
1156
1166
  encoding: TextEncoding;
1157
1167
  };
1168
+ /**
1169
+ * For each field in `set`, `fieldHash` of the value the change was made from — what the
1170
+ * sender's dialog showed. A receiver whose copy holds something else learns that the op
1171
+ * writes over a version its sender never saw (`Applied.overwritten`). Absent from ops
1172
+ * sent by older editors, which are then never reported as overwriting.
1173
+ */
1174
+ from?: Partial<Record<SyncField, string>>;
1158
1175
  }
1159
1176
  export interface SyncExtrasOp {
1160
1177
  kind: "extras";
@@ -1241,6 +1258,34 @@ export interface HistoryEdit {
1241
1258
  * redo atoms apply it with `applyTables`.
1242
1259
  */
1243
1260
  tables?: TablesEdit;
1261
+ /**
1262
+ * A change to the whole map — Resize / Crop, Change Tileset: the map as it stands on the
1263
+ * other side of the step (`WholeState`). Undo and redo swap it with the scenario's own and
1264
+ * keep what they took out here, so the entry always holds the side it is not on. An entry
1265
+ * with this part has no other: `applyEntry` leaves it alone, and the undo and redo atoms
1266
+ * apply it with `swapWholeState`.
1267
+ */
1268
+ whole?: WholeState;
1269
+ }
1270
+ /**
1271
+ * What a whole-map change replaces: the size, the tileset and every list or grid that is
1272
+ * laid out by the map's size. Held by reference, not copied — Resize and Change Tileset
1273
+ * build new arrays rather than writing into the old ones, and every later in-place edit is
1274
+ * on the undo stack above the entry, so by the time the entry is undone the arrays it took
1275
+ * out are exactly as it left them.
1276
+ */
1277
+ export interface WholeState {
1278
+ width: number;
1279
+ height: number;
1280
+ era: number;
1281
+ tiles: Uint16Array;
1282
+ editorTiles: Uint16Array;
1283
+ isom: Uint16Array | null;
1284
+ mask: Uint8Array | null;
1285
+ units: Scenario["units"];
1286
+ sprites: Scenario["sprites"];
1287
+ doodads: Scenario["doodads"];
1288
+ locations: Scenario["locations"];
1244
1289
  }
1245
1290
  /**
1246
1291
  * Why the map changed: an edit recorded in the history, an undo or redo of one, a dialog
@@ -2995,8 +3040,8 @@ export interface DocumentApi {
2995
3040
  launch?: boolean;
2996
3041
  }): Promise<TestMapOutcome | null>;
2997
3042
  /**
2998
- * Scenario ▸ Resize / Crop Map: a transaction outside the undo model that drops both
2999
- * history stacks (as the dialog does). Content keeps its place relative to `anchor`
3043
+ * Scenario ▸ Resize / Crop Map: one undo step, as the dialog is (on a shared map, where
3044
+ * it replaces everyone's map, both history stacks are dropped instead). Content keeps its place relative to `anchor`
3000
3045
  * (a 3 × 3 grid, row-major, 4 = centre, the default); the new ground is `terrainId`
3001
3046
  * (the tileset's default when omitted); objects outside the new bounds are dropped,
3002
3047
  * locations clamped unless `clampLocations` is false. Null with no map.
@@ -3006,7 +3051,7 @@ export interface DocumentApi {
3006
3051
  * Scenario ▸ Map Properties ▸ Tileset: change ERA and lay the terrain again with the
3007
3052
  * new tileset's terrain (tile numbers do not carry across tilesets; the doodads go with
3008
3053
  * them, everything else stays). Waits for the new graphics so the fill uses real tiles.
3009
- * Like `resize`, a transaction outside the undo model. Null with no map.
3054
+ * Like `resize`, one undo step (on a shared map, the history is dropped instead). Null with no map.
3010
3055
  */
3011
3056
  changeTileset(options: ChangeTilesetOptions): Promise<ChangeTilesetResult | null>;
3012
3057
  readonly extras: ExtrasApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-js/plugin-api",
3
- "version": "1.65.0",
3
+ "version": "1.67.0",
4
4
  "description": "Type declarations for the scmJS plugin API",
5
5
  "license": "MIT",
6
6
  "types": "index.d.ts",