Define types for ‘g’ and ‘WIDGETS’

master
qucchia 2022-07-21 12:36:05 +02:00
parent 194827a947
commit defd8050f4
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,5 @@
/// <reference path="other.d.ts" />
/** /**
* Class containing [micro:bit's](https://www.espruino.com/MicroBit) utility functions. * Class containing [micro:bit's](https://www.espruino.com/MicroBit) utility functions.
* @url http://www.espruino.com/Reference#Microbit * @url http://www.espruino.com/Reference#Microbit

9
typescript/types/other.d.ts vendored Normal file
View File

@ -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 };