From defd8050f4a8910983db2e75abcd79af9defc699 Mon Sep 17 00:00:00 2001 From: qucchia Date: Thu, 21 Jul 2022 12:36:05 +0200 Subject: [PATCH] =?UTF-8?q?Define=20types=20for=20=E2=80=98g=E2=80=99=20an?= =?UTF-8?q?d=20=E2=80=98WIDGETS=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/types/main.d.ts | 2 ++ typescript/types/other.d.ts | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 typescript/types/other.d.ts diff --git a/typescript/types/main.d.ts b/typescript/types/main.d.ts index 37bb9a4d1..aead3d64d 100644 --- a/typescript/types/main.d.ts +++ b/typescript/types/main.d.ts @@ -1,3 +1,5 @@ +/// + /** * Class containing [micro:bit's](https://www.espruino.com/MicroBit) utility functions. * @url http://www.espruino.com/Reference#Microbit diff --git a/typescript/types/other.d.ts b/typescript/types/other.d.ts new file mode 100644 index 000000000..83aafa56e --- /dev/null +++ b/typescript/types/other.d.ts @@ -0,0 +1,9 @@ +declare const g: typeof Graphics; + +type WidgetArea = "tl" | "tr" | "bl" | "br"; +type Widget = { + area: WidgetArea; + width: number; + draw: (this: { x: number; y: number }) => void; +}; +declare const WIDGETS: { [key: string]: Widget };