lunchpad
Version:
interface for the novation launchpad mini, for node and the browser
29 lines (28 loc) • 1.13 kB
TypeScript
import EventEmitter from 'eventemitter3';
import Color from './Color';
export type Board = Color[][];
export type Functions = [Color, Color, Color, Color, Color, Color, Color, Color];
declare abstract class LaunchpadBase extends EventEmitter {
private squares;
private functionX;
private functionY;
abstract _setSquare(x: number, y: number, color: Color): void;
abstract _setFunctionX(x: number, color: Color): void;
abstract _setFunctionY(x: number, color: Color): void;
abstract _flush(): void;
constructor();
clearSquares(): this;
clearAll(): this;
getSquare(x: number, y: number): Color;
setSquare(x: number, y: number, color: Color): this;
getFunctionX(x: number): Color;
setFunctionX(x: number, color: Color): this;
getFunctionY(y: number): Color;
setFunctionY(y: number, color: Color): this;
flush(): void;
_selectSquare(x: number, y: number): void;
_selectFunctionX(x: number): void;
_selectFunctionY(y: number): void;
updateBoard(squares?: Board, functionX?: Functions, functionY?: Functions): this;
}
export default LaunchpadBase;