From b41443b17374b11d9611f0f8e814a99936fce6cf Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 3 Apr 2021 22:58:23 +0100 Subject: [PATCH] js: Introduce Rect type alias Signed-off-by: Ian Jackson --- templates/script.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index abd6d096..fbc386fc 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -40,6 +40,7 @@ type PieceId = string; type PlayerId = string; type Pos = [number, number]; +type Rect = [Pos, Pos]; type ClientSeq = number; type Generation = number; type UoKind = 'Client' | "Global"| "Piece" | "ClientExtra" | "GlobalExtra"; @@ -80,7 +81,7 @@ type PieceInfo = { queued_moves : number, last_seen_moved : DOMHighResTimeStamp | null, // non-0 means halo'd held_us_inoccult: boolean, - bbox: [Pos, Pos], + bbox: Rect, } let wasm : InitOutput; @@ -1323,7 +1324,7 @@ type PreparedPieceState = { uos: UoDescription[], moveable: PieceMoveable, occregion: string | null, - bbox: [Pos, Pos], + bbox: Rect, } pieceops.ModifyQuiet = function @@ -1435,7 +1436,7 @@ function redisplay_held_ancillaries() { type PreparedPieceImage = { svg: string, uos: UoDescription[], - bbox: [Pos, Pos], + bbox: Rect, } type TransmitUpdateEntry_Image = { -- 2.30.2