forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
obelisk.js.d.ts
228 lines (172 loc) · 6.63 KB
/
obelisk.js.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
// Type definitions for obelisk.js v1.1.0
// Project: https://github.com/nosir/obelisk.js/
// Definitions by: Brian Drupieski <https://github.com/bdrupieski/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module obelisk {
export var version: string;
export var author: string;
export class Matrix {
constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
a: number;
b: number;
c: number;
d: number;
tx: number;
ty: number;
}
export class Point {
constructor(x?: number, y?: number);
x: number;
y: number;
}
export class Point3D {
constructor(x?: number, y?: number, z?: number);
x: number;
y: number;
z: number;
toGlobalCoordinates(offset?: obelisk.Point): obelisk.Point;
}
export class ColorGeom {
static get32(color: number): number;
static applyBrightness(color: number, brightness: number, highlight?: boolean): number;
}
export class ColorPattern {
static GRASS_GREEN: number;
static YELLOW: number;
static WINE_RED: number;
static PINK: number;
static PURPLE: number;
static BLUE: number;
static GRAY: number;
static BLACK: number;
static FINE_COLORS: number[];
static getRandomComfortableColor(): number;
}
export class CanvasTool {
static getPixel(imageData: ImageData, x: number, y: number): number;
}
export class CanvasManager {
static defaultCanvas: HTMLCanvasElement;
static getDefaultCanvas(): HTMLCanvasElement;
static getNewCanvas(): HTMLCanvasElement;
}
export class AbstractColor {
constructor();
inner: number;
border: number;
borderHighlight: number;
left: number;
right: number;
horizontal: number;
leftSlope: number;
rightSlope: number;
}
export class CubeColor extends AbstractColor {
constructor(border?: number, borderHighlight?: number, left?: number, right?: number, horizontal?: number);
BRIGHTNESS_GAIN: number;
getByHorizontalColor(horizontal: number): CubeColor;
}
export class PyramidColor extends AbstractColor {
constructor(border?: number, borderHighlight?: number, left?: number, right?: number);
BRIGHTNESS_GAIN: number;
getByRightColor(horizontal: number): PyramidColor;
}
export class SideColor extends AbstractColor {
constructor(border?: number, inner?: number);
BRIGHTNESS_GAIN: number;
getByInnerColor(inner: number): SideColor;
}
export class SlopeColor extends AbstractColor {
constructor(border?: number, borderHighlight?: number, left?: number, right?: number, leftSlope?: number, rightSlope?: number);
BRIGHTNESS_GAIN: number;
getByHorizontalColor(horizontal: number): SlopeColor;
}
export class AbstractDimension {
constructor();
xAxis: number;
yAxis: number;
zAxis: number;
tall: boolean;
}
export class BrickDimension extends AbstractDimension {
constructor(xAxis?: number, yAxis?: number);
}
export class CubeDimension extends AbstractDimension {
constructor(xAxis?: number, yAxis?: number, zAxis?: number);
}
export class PyramidDimension extends AbstractDimension {
constructor(axis?: number, tall?: boolean);
}
export class SideXDimension extends AbstractDimension {
constructor(xAxis?: number, zAxis?: number);
}
export class SideYDimension extends AbstractDimension {
constructor(yAxis?: number, zAxis?: number);
}
export class SlopeDimension extends AbstractDimension {
constructor(xAxis?: number, yAxis?: number);
}
export class BitmapData {
constructor(w: number, h: number, useDefaultCanvas?: boolean);
imageData: ImageData;
canvas: HTMLCanvasElement;
context : CanvasRenderingContext2D;
setPixel(posX: number, posY: number, color: number): void;
setPixelByIndex(index: number, color: number): void;
checkPixelAvailable(x: number, y: number): boolean;
floodFill(posX: number, posY: number, color: number): void;
}
export class PixelObject {
constructor(primitive: AbstractPrimitive, point3D?: Point3D);
x: number;
y: number;
canvas: HTMLCanvasElement;
}
export class PixelView {
constructor(canvas: HTMLCanvasElement, point?: Point);
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
point: Point;
renderObject(primitive: AbstractPrimitive, point3D?: Point3D): void;
clear(): void;
}
export class AbstractPrimitive {
constructor();
canvas: HTMLCanvasElement;
w: number;
h: number;
dimension: AbstractDimension;
color: AbstractColor;
border: boolean;
bitmapData: BitmapData;
useDefaultCanvas: boolean;
matrix: Matrix;
}
export class Brick extends AbstractPrimitive {
constructor(dimension?: BrickDimension, color?: SideColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class Cube extends AbstractPrimitive {
constructor(dimension?: CubeDimension, color?: CubeColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class Pyramid extends AbstractPrimitive {
constructor(dimension?: PyramidDimension, color?: PyramidColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class SideX extends AbstractPrimitive {
constructor(dimension?: SideXDimension, color?: SideColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class SideY extends AbstractPrimitive {
constructor(dimension?: SideYDimension, color?: SideColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class SlopeEast extends AbstractPrimitive {
constructor(dimension?: SlopeDimension, color?: SlopeColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class SlopeNorth extends AbstractPrimitive {
constructor(dimension?: SlopeDimension, color?: SlopeColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class SlopeSouth extends AbstractPrimitive {
constructor(dimension?: SlopeDimension, color?: SlopeColor, border?: boolean, useDefaultCanvas?: boolean);
}
export class SlopeWest extends AbstractPrimitive {
constructor(dimension?: SlopeDimension, color?: SlopeColor, border?: boolean, useDefaultCanvas?: boolean);
}
}