-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.d.ts
56 lines (44 loc) · 1.15 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export default class Canvas {
/**
Create a new canvas with the given dimensions.
@param width - must be multiple of 2, defaults to stdout columns.
@param height - must be multiple of 4, defaults to stdout rows.
*/
constructor(width?: number, height?: number);
/**
Width of the canvas.
*/
width: number;
/**
Height of the canvas.
*/
height: number;
/**
Remove all points on the canvas.
*/
clear(): void;
/**
It uses braille characters to represent points, so every line has length of w/2, and the string contains h/4 lines.
@param delimiter - defaults to \n.
@returns the current content of the canvas, as a delimiter-delimited string.
*/
frame(delimiter?: string): string;
/**
Draw point on canvas at the given position.
@param x - Horizontal position.
@param y - Vertical position.
*/
set(x: number, y: number): void;
/**
Delete point on canvas at the given position.
@param x - Horizontal position.
@param y - Vertical position.
*/
unset(x: number, y: number): void;
/**
Toggle point on canvas at the given position.
@param x - Horizontal position.
@param y - Vertical position.
*/
toggle(x: number, y: number): void;
}