Skip to content

Commit

Permalink
Merge pull request #148 from GreenAsJade/declare_goban_canvas_interface
Browse files Browse the repository at this point in the history
Add an interface declaration for GobanCanvas
  • Loading branch information
anoek authored Jan 31, 2024
2 parents 2ce9e11 + 4d39cc7 commit 744e68d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/GobanCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,33 @@ interface ViewPortInterface {

const HOT_PINK = "#ff69b4";

export class GobanCanvas extends GobanCore {
interface GobanCanvasInterface {
engine: GoEngine;
move_tree_container?: HTMLElement;

clearAnalysisDrawing(): void;
drawPenMarks(pen_marks: MoveTreePenMarks): void;
enablePen(): void;
disablePen(): void;
setByoYomiLabel(label: string): void;

move_tree_bindCanvasEvents(canvas: HTMLCanvasElement): void;
move_tree_redraw(no_warp?: boolean): void;
setMoveTreeContainer(container: HTMLElement): void;

showMessage(
message_id_or_error: MessageID,
parameters?: { [key: string]: any },
timeout?: number,
): void;
clearMessage(): void;

drawSquare(i: number, j: number): void;

destroy(): void;
}

export class GobanCanvas extends GobanCore implements GobanCanvasInterface {
public engine: GoEngine;
private parent: HTMLElement;
//private board_div: HTMLElement;
Expand Down

0 comments on commit 744e68d

Please sign in to comment.