From: Ian Jackson Date: Sat, 3 Apr 2021 21:58:23 +0000 (+0100) Subject: js: Introduce Rect type alias X-Git-Tag: otter-0.5.0~216 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b41443b17374b11d9611f0f8e814a99936fce6cf;p=otter.git js: Introduce Rect type alias Signed-off-by: Ian Jackson --- 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 = {