This repository has been archived on 2022-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
zeropod/src/menu/menu.ts

18 lines
461 B
TypeScript

import { MenuConfig, MenuPrinter } from './interface';
import { ConsolePrinter } from './console';
import { OledPrinter } from './oled';
export class Menu {
private _printer: MenuPrinter;
constructor(config: MenuConfig[], isConsole: boolean = false) {
this._printer = isConsole
? new ConsolePrinter(config)
: new OledPrinter(config);
}
public async getSelection(): Promise<MenuConfig> {
return this._printer.getSelection();
}
}