UNPKG

4.38 kBTypeScriptView Raw
1interface CanvasRenderingContext2D {
2 /**
3 * Render a circle.
4 *
5 * @param x - The position of the center on the x axis.
6 * @param y - The position of the center on the y axis.
7 * @param r - The radius of the circle.
8 */
9 circle(x: number, y: number, r: number): void;
10 /**
11 * Render a dashed line.
12 *
13 * @param x - The start position on the x axis.
14 * @param y - The start position on the y axis.
15 * @param x2 - The end position on the x axis.
16 * @param y2 - The end position on the y axis.
17 * @param pattern - List of lengths starting with line and then alternating between space and line.
18 *
19 * @author David Jordan
20 * @date 2012-08-08
21 * @remarks
22 * http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas
23 */
24 dashedLine(x: number, y: number, x2: number, y2: number, pattern: number[]): void;
25 /**
26 * Render an isometric cylinder.
27 *
28 * @param x - The position of the center on the x axis.
29 * @param y - The position of the center on the y axis.
30 * @param w - The width of the database.
31 * @param h - The height of the database.
32 *
33 * @remarks
34 * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
35 */
36 database(x: number, y: number, w: number, h: number): void;
37 /**
38 * Render a diamond.
39 *
40 * @param x - The position of the center on the x axis.
41 * @param y - The position of the center on the y axis.
42 * @param r - Half of the width and height of the diamond.
43 *
44 * @remarks
45 * http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/
46 */
47 diamond(x: number, y: number, r: number): void;
48 /**
49 * Render an ellipse.
50 *
51 * @param x - The position of the center on the x axis.
52 * @param y - The position of the center on the y axis.
53 * @param w - The width of the ellipse.
54 * @param h - The height of the ellipse.
55 *
56 * @remarks
57 * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
58 *
59 * Postfix '_vis' added to discern it from standard method ellipse().
60 */
61 ellipse_vis(x: number, y: number, w: number, h: number): void;
62 /**
63 * Render a hexagon.
64 *
65 * @param x - The position of the center on the x axis.
66 * @param y - The position of the center on the y axis.
67 * @param r - The radius of the hexagon.
68 */
69 hexagon(x: number, y: number, r: number): void;
70 /**
71 * Render a rectangle with rounded corners.
72 *
73 * @param x - The position of the center on the x axis.
74 * @param y - The position of the center on the y axis.
75 * @param w - The width of the rectangle.
76 * @param h - The height of the rectangle.
77 * @param r - The radius of the corners.
78 *
79 * @remarks
80 * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas
81 */
82 roundRect(x: number, y: number, w: number, h: number, r: number): void;
83 /**
84 * Render a square.
85 *
86 * @param x - The position of the center on the x axis.
87 * @param y - The position of the center on the y axis.
88 * @param r - Half of the width and height of the square.
89 */
90 square(x: number, y: number, r: number): void;
91 /**
92 * Render a star.
93 *
94 * @param x - The position of the center on the x axis.
95 * @param y - The position of the center on the y axis.
96 * @param r - The outer radius of the star.
97 */
98 star(x: number, y: number, r: number): void;
99 /**
100 * Render an equilateral triangle standing on a side.
101 *
102 * @param x - The position of the center on the x axis.
103 * @param y - The position of the center on the y axis.
104 * @param r - Half of the length of the sides.
105 *
106 * @remarks
107 * http://en.wikipedia.org/wiki/Equilateral_triangle
108 */
109 triangle(x: number, y: number, r: number): void;
110 /**
111 * Render an equilateral triangle standing on a vertex.
112 *
113 * @param x - The position of the center on the x axis.
114 * @param y - The position of the center on the y axis.
115 * @param r - Half of the length of the sides.
116 *
117 * @remarks
118 * http://en.wikipedia.org/wiki/Equilateral_triangle
119 */
120 triangleDown(x: number, y: number, r: number): void;
121}
122//# sourceMappingURL=shapes.d.ts.map
\No newline at end of file