blob: 9d807e9fe6b8a3d8fab5ecb30ce63acf5e0a3d9b [file] [log] [blame]
Kevin Lubick217056c2018-09-20 17:39:31 -04001/*
2 * This externs file prevents the Closure JS compiler from minifying away
3 * names of objects created by Emscripten.
4 * Basically, by defining empty objects and functions here, Closure will
5 * know not to rename them. This is needed because of our pre-js files,
6 * that is, the JS we hand-write to bundle into the output. That JS will be
7 * hit by the closure compiler and thus needs to know about what functions
8 * have special names and should not be minified.
9 *
10 * Emscripten does not support automatically generating an externs file, so we
11 * do it by hand. The general process is to write some JS code, and then put any
12 * calls to CanvasKit or related things in here. Running ./compile.sh and then
13 * looking at the minified results or running the Release trybot should
14 * verify nothing was missed. Optionally, looking directly at the minified
15 * pathkit.js can be useful when developing locally.
16 *
17 * Docs:
18 * https://github.com/cljsjs/packages/wiki/Creating-Externs
19 * https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
20 *
21 * Example externs:
22 * https://github.com/google/closure-compiler/tree/master/externs
23 */
24
25var CanvasKit = {
26 // public API (i.e. things we declare in the pre-js file)
Kevin Lubick006a6f32018-10-19 14:34:34 -040027 Color: function() {},
28 /** @return {CanvasKit.SkRect} */
29 LTRBRect: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050030 /** @return {CanvasKit.SkRect} */
31 XYWHRect: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -050032 /** @return {ImageData} */
33 ImageData: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050034 MakeBlurMaskFilter: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040035 MakeCanvas: function() {},
36 MakeCanvasSurface: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040037 MakeImageShader: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050038 /** @return {CanvasKit.SkImage} */
39 MakeImageFromEncoded: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050040 /** @return {LinearCanvasGradient} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040041 MakeLinearGradientShader: function() {},
Kevin Lubicka40f8322018-12-17 16:01:36 -050042 MakePathFromOp: function() {},
43 MakePathFromSVGString: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050044 MakeRadialGradientShader: function() {},
45 MakeSWCanvasSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040046 MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040047 MakeSkVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040048 MakeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050049 /** @return {RadialCanvasGradient} */
50 MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050051 MakeWebGLCanvasSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040052 currentContext: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050053 getColorComponents: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050054 getSkDataBytes: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050055 multiplyByAlpha: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040056 setCurrentContext: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040057
58 // private API (i.e. things declared in the bindings that we use
59 // in the pre-js file)
Kevin Lubick52b9f372018-12-04 13:57:36 -050060 _MakeImage: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040061 _MakeImageShader: function() {},
62 _MakeLinearGradientShader: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040063 _MakeRadialGradientShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040064 _MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040065 _MakeSkVertices: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050066 _MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050067 _decodeImage: function() {},
Kevin Lubickea905ec2018-11-30 14:05:58 -050068 _getRasterDirectSurface: function() {},
Kevin Lubick134be1d2018-10-30 15:05:04 -040069 _getRasterN32PremulSurface: function() {},
70 _getWebGLSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040071
Kevin Lubick1a05fce2018-11-20 12:51:16 -050072 // The testing object is meant to expose internal functions
73 // for more fine-grained testing, e.g. parseColor
74 _testing: {},
75
Kevin Lubick217056c2018-09-20 17:39:31 -040076 // Objects and properties on CanvasKit
77
Kevin Lubick006a6f32018-10-19 14:34:34 -040078 SkCanvas: {
79 // public API (from C++ bindings)
80 clear: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050081 clipPath: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -050082 clipRect: function() {},
83 concat: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050084 drawImage: function() {},
85 drawImageRect: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040086 drawPaint: function() {},
87 drawPath: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050088 drawRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050089 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050090 drawText: function() {},
91 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040092 flush: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -050093 getTotalMatrix: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050094 restore: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040095 rotate: function() {},
96 save: function() {},
97 scale: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040098 skew: function() {},
99 translate: function() {},
100
101 // private API
Kevin Lubick52b9f372018-12-04 13:57:36 -0500102 _readPixels: function() {},
103 _writePixels: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400104 delete: function() {},
105 },
106
Kevin Lubick35ac0382019-01-02 15:13:57 -0500107 SkFont: {
108 // public API (from C++ bindings)
109 getScaleX: function() {},
110 getSize: function() {},
111 getSkewX: function() {},
112 getTypeface: function() {},
113 measureText: function() {},
114 setScaleX: function() {},
115 setSize: function() {},
116 setSkewX: function() {},
117 setTypeface: function() {},
118 },
119
Kevin Lubickddd0a332018-12-12 10:35:13 -0500120 SkFontMgr: {
121 // public API (from C++ bindings)
122 RefDefault: function() {},
123 countFamilies: function() {},
124
125 // private API
126 _makeTypefaceFromData: function() {},
127 },
128
Kevin Lubick006a6f32018-10-19 14:34:34 -0400129 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500130 // public API (from C++ bindings)
131 height: function() {},
132 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300133 // private API
134 _encodeToData: function() {},
135 _encodeToDataWithFormat: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400136 },
137
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500138 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500139 identity: function() {},
140 mapPoints: function() {},
141 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500142 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500143 scaled: function() {},
144 skewed: function() {},
145 translated: function() {},
146 },
147
148 SkPaint: {
149 // public API (from C++ bindings)
150 /** @return {CanvasKit.SkPaint} */
151 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500152 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500153 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500154 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500155 getStrokeCap: function() {},
156 getStrokeJoin: function() {},
157 getStrokeMiter: function() {},
158 getStrokeWidth: function() {},
159 getTextSize: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500160 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500161 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500162 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500163 setFilterQuality: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500164 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500165 setPathEffect: function() {},
166 setShader: function() {},
167 setStrokeCap: function() {},
168 setStrokeJoin: function() {},
169 setStrokeMiter: function() {},
170 setStrokeWidth: function() {},
171 setStyle: function() {},
172 setTextSize: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500173 setTypeface: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500174
175 //private API
176 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500177 },
178
Kevin Lubick006a6f32018-10-19 14:34:34 -0400179 SkPath: {
180 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500181 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500182 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500183 /** @return {CanvasKit.SkPath} */
184 copy: function() {},
185 countPoints: function() {},
186 equals: function() {},
187 getBounds: function() {},
188 getFillType: function() {},
189 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500190 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500191 isVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500192 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500193 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500194 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400195
196 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500197 _addArc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400198 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500199 _addRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300200 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400201 _arcTo: function() {},
202 _close: function() {},
203 _conicTo: function() {},
204 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400205 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400206 _lineTo: function() {},
207 _moveTo: function() {},
208 _op: function() {},
209 _quadTo: function() {},
210 _rect: function() {},
211 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400212 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400213 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400214 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400215 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500216 dump: function() {},
217 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400218 },
219
220 SkRect: {
221 fLeft: {},
222 fTop: {},
223 fRight: {},
224 fBottom: {},
225 },
226
227 SkSurface: {
228 // public API (from C++ bindings)
229 /** @return {CanvasKit.SkCanvas} */
230 getCanvas: function() {},
231 /** @return {CanvasKit.SkImage} */
232 makeImageSnapshot: function() {},
233
234 // private API
235 _flush: function() {},
236 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400237 delete: function() {},
238 },
239
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400240 SkVertices: {
241 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500242 bounds: function() {},
243 mode: function() {},
244 uniqueID: function() {},
245 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400246
247 // private API
248 /** @return {CanvasKit.SkVertices} */
249 _applyBones: function() {},
250 },
251
Kevin Lubick006a6f32018-10-19 14:34:34 -0400252 // Constants and Enums
253 gpu: {},
254 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400255
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500256 TRANSPARENT: {},
257 RED: {},
258 BLUE: {},
259 YELLOW: {},
260 CYAN: {},
261 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500262 WHITE: {},
263
264 AlphaType: {
265 Opaque: {},
266 Premul: {},
267 Unpremul: {},
268 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500269
270 BlendMode: {
271 Clear: {},
272 Src: {},
273 Dst: {},
274 SrcOver: {},
275 DstOver: {},
276 SrcIn: {},
277 DstIn: {},
278 SrcOut: {},
279 DstOut: {},
280 SrcATop: {},
281 DstATop: {},
282 Xor: {},
283 Plus: {},
284 Modulate: {},
285 Screen: {},
286 Overlay: {},
287 Darken: {},
288 Lighten: {},
289 ColorDodge: {},
290 ColorBurn: {},
291 HardLight: {},
292 SoftLight: {},
293 Difference: {},
294 Exclusion: {},
295 Multiply: {},
296 Hue: {},
297 Saturation: {},
298 Color: {},
299 Luminosity: {},
300 },
301
302 BlurStyle: {
303 Normal: {},
304 Solid: {},
305 Outer: {},
306 Inner: {},
307 },
308
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500309 ClipOp: {
310 Difference: {},
311 Intersect: {},
312 },
313
Kevin Lubickea905ec2018-11-30 14:05:58 -0500314 ColorType: {
315 Alpha_8: {},
316 RGB_565: {},
317 ARGB_4444: {},
318 RGBA_8888: {},
319 RGB_888x: {},
320 BGRA_8888: {},
321 RGBA_1010102: {},
322 RGB_101010x: {},
323 Gray_8: {},
324 RGBA_F16: {},
325 RGBA_F32: {},
326 },
327
Kevin Lubick006a6f32018-10-19 14:34:34 -0400328 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500329 Winding: {},
330 EvenOdd: {},
331 InverseWinding: {},
332 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400333 },
334
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500335 FilterQuality: {
336 None: {},
337 Low: {},
338 Medium: {},
339 High: {},
340 },
341
Alexander Khovansky3e119332018-11-15 02:01:19 +0300342 ImageFormat: {
343 PNG: {},
344 JPEG: {},
345 },
346
Kevin Lubickb9db3902018-11-26 11:47:54 -0500347 PaintStyle: {
348 Fill: {},
349 Stroke: {},
350 StrokeAndFill: {},
351 },
352
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500353 PathOp: {
354 Difference: {},
355 Intersect: {},
356 Union: {},
357 XOR: {},
358 ReverseDifference: {},
359 },
360
Kevin Lubickb9db3902018-11-26 11:47:54 -0500361 StrokeCap: {
362 Butt: {},
363 Round: {},
364 Square: {},
365 },
366
367 StrokeJoin: {
368 Miter: {},
369 Round: {},
370 Bevel: {},
371 },
372
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500373 TileMode: {
374 Clamp: {},
375 Repeat: {},
376 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500377 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500378 },
379
380 VertexMode: {
381 Triangles: {},
382 TrianglesStrip: {},
383 TriangleFan: {},
384 },
385
Kevin Lubick006a6f32018-10-19 14:34:34 -0400386 // Things Enscriptem adds for us
387
Kevin Lubick53965c92018-10-11 08:51:55 -0400388 /** Represents the heap of the WASM code
389 * @type {ArrayBuffer}
390 */
391 buffer: {},
392 /**
393 * @type {Float32Array}
394 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400395 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400396 /**
397 * @type {Uint8Array}
398 */
399 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400400 /**
401 * @type {Uint16Array}
402 */
403 HEAPU16: {},
404 /**
405 * @type {Int32Array}
406 */
407 HEAP32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400408
Kevin Lubick006a6f32018-10-19 14:34:34 -0400409 _malloc: function() {},
410 _free: function() {},
411 onRuntimeInitialized: function() {},
412};
Kevin Lubick217056c2018-09-20 17:39:31 -0400413
Kevin Lubick006a6f32018-10-19 14:34:34 -0400414// Public API things that are newly declared in the JS should go here.
415// It's not enough to declare them above, because closure can still erase them
416// unless they go on the prototype.
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500417CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400418CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500419CanvasKit.SkPath.prototype.addRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300420CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400421CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400422CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400423CanvasKit.SkPath.prototype.conicTo = function() {};
424CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400425CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400426CanvasKit.SkPath.prototype.lineTo = function() {};
427CanvasKit.SkPath.prototype.moveTo = function() {};
428CanvasKit.SkPath.prototype.op = function() {};
429CanvasKit.SkPath.prototype.quadTo = function() {};
430CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400431CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400432CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400433CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400434CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400435
Kevin Lubick53965c92018-10-11 08:51:55 -0400436CanvasKit.SkSurface.prototype.flush = function() {};
Kevin Lubick5b90b842018-10-17 07:57:18 -0400437CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400438
Kevin Lubick12c0e502018-11-28 12:51:56 -0500439/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400440CanvasKit.SkVertices.prototype.applyBones = function() {};
441
Alexander Khovansky3e119332018-11-15 02:01:19 +0300442CanvasKit.SkImage.prototype.encodeToData = function() {};
443
Kevin Lubick52b9f372018-12-04 13:57:36 -0500444/** @return {Uint8Array} */
445CanvasKit.SkCanvas.prototype.readPixels = function() {};
446CanvasKit.SkCanvas.prototype.writePixels = function() {};
447
Kevin Lubickddd0a332018-12-12 10:35:13 -0500448CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
449
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400450// Define StrokeOpts object
451var StrokeOpts = {};
452StrokeOpts.prototype.width;
453StrokeOpts.prototype.miter_limit;
454StrokeOpts.prototype.cap;
455StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500456StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400457
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500458// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500459var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500460HTMLCanvas.prototype.decodeImage = function() {};
461HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500462HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500463HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500464HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500465HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500466
467var CanvasRenderingContext2D = {};
468CanvasRenderingContext2D.prototype.addHitRegion = function() {};
469CanvasRenderingContext2D.prototype.arc = function() {};
470CanvasRenderingContext2D.prototype.arcTo = function() {};
471CanvasRenderingContext2D.prototype.beginPath = function() {};
472CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
473CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500474CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500475CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500476CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500477CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500478CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500479CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500480CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500481CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500482CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500483CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500484CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500485CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500486CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500487CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500488CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500489CanvasRenderingContext2D.prototype.isPointInPath = function() {};
490CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500491CanvasRenderingContext2D.prototype.lineTo = function() {};
492CanvasRenderingContext2D.prototype.measureText = function() {};
493CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500494CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500495CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
496CanvasRenderingContext2D.prototype.rect = function() {};
497CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
498CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500499CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500500CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500501CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500502CanvasRenderingContext2D.prototype.scale = function() {};
503CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500504CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500505CanvasRenderingContext2D.prototype.setTransform = function() {};
506CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500507CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500508CanvasRenderingContext2D.prototype.strokeText = function() {};
509CanvasRenderingContext2D.prototype.transform = function() {};
510CanvasRenderingContext2D.prototype.translate = function() {};
511
Kevin Lubicka40f8322018-12-17 16:01:36 -0500512var Path2D = {};
513Path2D.prototype.addPath = function() {};
514Path2D.prototype.arc = function() {};
515Path2D.prototype.arcTo = function() {};
516Path2D.prototype.bezierCurveTo = function() {};
517Path2D.prototype.closePath = function() {};
518Path2D.prototype.ellipse = function() {};
519Path2D.prototype.lineTo = function() {};
520Path2D.prototype.moveTo = function() {};
521Path2D.prototype.quadraticCurveTo = function() {};
522Path2D.prototype.rect = function() {};
523
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500524var LinearCanvasGradient = {};
525LinearCanvasGradient.prototype.addColorStop = function() {};
526var RadialCanvasGradient = {};
527RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500528var CanvasPattern = {};
529CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500530
Kevin Lubick52b9f372018-12-04 13:57:36 -0500531var ImageData = {
532 /**
533 * @type {Uint8ClampedArray}
534 */
535 data: {},
536 height: {},
537 width: {},
538};
539
Kevin Lubickd29edd72018-12-07 08:29:52 -0500540var DOMMatrix = {
541 a: {},
542 b: {},
543 c: {},
544 d: {},
545 e: {},
546 f: {},
547};
548
Kevin Lubick217056c2018-09-20 17:39:31 -0400549// Not sure why this is needed - might be a bug in emsdk that this isn't properly declared.
Kevin Lubick6fccc9d2018-11-20 15:55:10 -0500550function loadWebAssemblyModule() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500551
552var DOMMatrix = {};