import { BufferLocation, BufferSize, Char, Color } from "./base.ts"; /** * Display protocol, to allow the UI to draw things on "screen" */ export class Display { /** * Init the display (will be the first method called) */ async init(): Promise { } /** * Restore the display as before *init* */ async uninit(): Promise { } /** * Get the current grid size */ async getSize(): Promise { return { w: 0, h: 0 }; } /** * Setup the palette for color display * * If the display supports the whole RGB range, it may return the array as-is. * If the display only supports a limited palette, it may return only supported colors. * * From this call forward, colors will be received by numbered index in the returned array. */ async setupPalette(colors: readonly Color[]): Promise { return []; } /** * Set the cursor visibility */ async setCursorVisibility(visible: boolean): Promise { } /** * Flush the display */ async flush(): Promise { } /** * Draw a single character on screen */ async setChar(at: BufferLocation, char: Char): Promise { } /** * Get the keys pressed since last call */ async getKeyStrokes(): Promise { return []; } }