blob: 57a4306786674eadc46c81c9aba629c7878dcef3 [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 Lubick61ef7b22018-11-27 13:26:59 -050042 MakeRadialGradientShader: function() {},
43 MakeSWCanvasSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040044 MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040045 MakeSkVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040046 MakeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050047 /** @return {RadialCanvasGradient} */
48 MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050049 MakeWebGLCanvasSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040050 currentContext: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050051 getColorComponents: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050052 getSkDataBytes: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050053 multiplyByAlpha: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040054 setCurrentContext: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040055
56 // private API (i.e. things declared in the bindings that we use
57 // in the pre-js file)
Kevin Lubick52b9f372018-12-04 13:57:36 -050058 _MakeImage: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040059 _MakeImageShader: function() {},
60 _MakeLinearGradientShader: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040061 _MakeRadialGradientShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040062 _MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040063 _MakeSkVertices: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050064 _MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050065 _decodeImage: function() {},
Kevin Lubickea905ec2018-11-30 14:05:58 -050066 _getRasterDirectSurface: function() {},
Kevin Lubick134be1d2018-10-30 15:05:04 -040067 _getRasterN32PremulSurface: function() {},
68 _getWebGLSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040069
Kevin Lubick1a05fce2018-11-20 12:51:16 -050070 // The testing object is meant to expose internal functions
71 // for more fine-grained testing, e.g. parseColor
72 _testing: {},
73
Kevin Lubick217056c2018-09-20 17:39:31 -040074 // Objects and properties on CanvasKit
75
Kevin Lubick006a6f32018-10-19 14:34:34 -040076 SkCanvas: {
77 // public API (from C++ bindings)
78 clear: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050079 clipPath: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -050080 clipRect: function() {},
81 concat: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050082 drawImage: function() {},
83 drawImageRect: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040084 drawPaint: function() {},
85 drawPath: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050086 drawRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050087 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050088 drawText: function() {},
89 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040090 flush: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -050091 getTotalMatrix: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050092 restore: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040093 rotate: function() {},
94 save: function() {},
95 scale: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040096 skew: function() {},
97 translate: function() {},
98
99 // private API
Kevin Lubick52b9f372018-12-04 13:57:36 -0500100 _readPixels: function() {},
101 _writePixels: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400102 delete: function() {},
103 },
104
Kevin Lubickddd0a332018-12-12 10:35:13 -0500105 SkFontMgr: {
106 // public API (from C++ bindings)
107 RefDefault: function() {},
108 countFamilies: function() {},
109
110 // private API
111 _makeTypefaceFromData: function() {},
112 },
113
Kevin Lubick006a6f32018-10-19 14:34:34 -0400114 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500115 // public API (from C++ bindings)
116 height: function() {},
117 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300118 // private API
119 _encodeToData: function() {},
120 _encodeToDataWithFormat: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400121 },
122
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500123 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500124 identity: function() {},
125 mapPoints: function() {},
126 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500127 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500128 scaled: function() {},
129 skewed: function() {},
130 translated: function() {},
131 },
132
133 SkPaint: {
134 // public API (from C++ bindings)
135 /** @return {CanvasKit.SkPaint} */
136 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500137 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500138 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500139 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500140 getStrokeCap: function() {},
141 getStrokeJoin: function() {},
142 getStrokeMiter: function() {},
143 getStrokeWidth: function() {},
144 getTextSize: function() {},
145 measureText: function() {},
146 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500147 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500148 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500149 setFilterQuality: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500150 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500151 setPathEffect: function() {},
152 setShader: function() {},
153 setStrokeCap: function() {},
154 setStrokeJoin: function() {},
155 setStrokeMiter: function() {},
156 setStrokeWidth: function() {},
157 setStyle: function() {},
158 setTextSize: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500159 setTypeface: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500160
161 //private API
162 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500163 },
164
Kevin Lubick006a6f32018-10-19 14:34:34 -0400165 SkPath: {
166 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500167 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500168 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500169 /** @return {CanvasKit.SkPath} */
170 copy: function() {},
171 countPoints: function() {},
172 equals: function() {},
173 getBounds: function() {},
174 getFillType: function() {},
175 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500176 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500177 isVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500178 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500179 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500180 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400181
182 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500183 _addArc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400184 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500185 _addRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300186 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400187 _arcTo: function() {},
188 _close: function() {},
189 _conicTo: function() {},
190 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400191 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400192 _lineTo: function() {},
193 _moveTo: function() {},
194 _op: function() {},
195 _quadTo: function() {},
196 _rect: function() {},
197 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400198 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400199 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400200 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400201 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500202 dump: function() {},
203 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400204 },
205
206 SkRect: {
207 fLeft: {},
208 fTop: {},
209 fRight: {},
210 fBottom: {},
211 },
212
213 SkSurface: {
214 // public API (from C++ bindings)
215 /** @return {CanvasKit.SkCanvas} */
216 getCanvas: function() {},
217 /** @return {CanvasKit.SkImage} */
218 makeImageSnapshot: function() {},
219
220 // private API
221 _flush: function() {},
222 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400223 delete: function() {},
224 },
225
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400226 SkVertices: {
227 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500228 bounds: function() {},
229 mode: function() {},
230 uniqueID: function() {},
231 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400232
233 // private API
234 /** @return {CanvasKit.SkVertices} */
235 _applyBones: function() {},
236 },
237
Kevin Lubick006a6f32018-10-19 14:34:34 -0400238 // Constants and Enums
239 gpu: {},
240 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400241
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500242 TRANSPARENT: {},
243 RED: {},
244 BLUE: {},
245 YELLOW: {},
246 CYAN: {},
247 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500248 WHITE: {},
249
250 AlphaType: {
251 Opaque: {},
252 Premul: {},
253 Unpremul: {},
254 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500255
256 BlendMode: {
257 Clear: {},
258 Src: {},
259 Dst: {},
260 SrcOver: {},
261 DstOver: {},
262 SrcIn: {},
263 DstIn: {},
264 SrcOut: {},
265 DstOut: {},
266 SrcATop: {},
267 DstATop: {},
268 Xor: {},
269 Plus: {},
270 Modulate: {},
271 Screen: {},
272 Overlay: {},
273 Darken: {},
274 Lighten: {},
275 ColorDodge: {},
276 ColorBurn: {},
277 HardLight: {},
278 SoftLight: {},
279 Difference: {},
280 Exclusion: {},
281 Multiply: {},
282 Hue: {},
283 Saturation: {},
284 Color: {},
285 Luminosity: {},
286 },
287
288 BlurStyle: {
289 Normal: {},
290 Solid: {},
291 Outer: {},
292 Inner: {},
293 },
294
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500295 ClipOp: {
296 Difference: {},
297 Intersect: {},
298 },
299
Kevin Lubickea905ec2018-11-30 14:05:58 -0500300 ColorType: {
301 Alpha_8: {},
302 RGB_565: {},
303 ARGB_4444: {},
304 RGBA_8888: {},
305 RGB_888x: {},
306 BGRA_8888: {},
307 RGBA_1010102: {},
308 RGB_101010x: {},
309 Gray_8: {},
310 RGBA_F16: {},
311 RGBA_F32: {},
312 },
313
Kevin Lubick006a6f32018-10-19 14:34:34 -0400314 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500315 Winding: {},
316 EvenOdd: {},
317 InverseWinding: {},
318 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400319 },
320
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500321 FilterQuality: {
322 None: {},
323 Low: {},
324 Medium: {},
325 High: {},
326 },
327
Alexander Khovansky3e119332018-11-15 02:01:19 +0300328 ImageFormat: {
329 PNG: {},
330 JPEG: {},
331 },
332
Kevin Lubickb9db3902018-11-26 11:47:54 -0500333 PaintStyle: {
334 Fill: {},
335 Stroke: {},
336 StrokeAndFill: {},
337 },
338
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500339 PathOp: {
340 Difference: {},
341 Intersect: {},
342 Union: {},
343 XOR: {},
344 ReverseDifference: {},
345 },
346
Kevin Lubickb9db3902018-11-26 11:47:54 -0500347 StrokeCap: {
348 Butt: {},
349 Round: {},
350 Square: {},
351 },
352
353 StrokeJoin: {
354 Miter: {},
355 Round: {},
356 Bevel: {},
357 },
358
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500359 TileMode: {
360 Clamp: {},
361 Repeat: {},
362 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500363 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500364 },
365
366 VertexMode: {
367 Triangles: {},
368 TrianglesStrip: {},
369 TriangleFan: {},
370 },
371
Kevin Lubick006a6f32018-10-19 14:34:34 -0400372 // Things Enscriptem adds for us
373
Kevin Lubick53965c92018-10-11 08:51:55 -0400374 /** Represents the heap of the WASM code
375 * @type {ArrayBuffer}
376 */
377 buffer: {},
378 /**
379 * @type {Float32Array}
380 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400381 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400382 /**
383 * @type {Uint8Array}
384 */
385 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400386 /**
387 * @type {Uint16Array}
388 */
389 HEAPU16: {},
390 /**
391 * @type {Int32Array}
392 */
393 HEAP32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400394
Kevin Lubick006a6f32018-10-19 14:34:34 -0400395 _malloc: function() {},
396 _free: function() {},
397 onRuntimeInitialized: function() {},
398};
Kevin Lubick217056c2018-09-20 17:39:31 -0400399
Kevin Lubick006a6f32018-10-19 14:34:34 -0400400// Public API things that are newly declared in the JS should go here.
401// It's not enough to declare them above, because closure can still erase them
402// unless they go on the prototype.
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500403CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400404CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500405CanvasKit.SkPath.prototype.addRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300406CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400407CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400408CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400409CanvasKit.SkPath.prototype.conicTo = function() {};
410CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400411CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400412CanvasKit.SkPath.prototype.lineTo = function() {};
413CanvasKit.SkPath.prototype.moveTo = function() {};
414CanvasKit.SkPath.prototype.op = function() {};
415CanvasKit.SkPath.prototype.quadTo = function() {};
416CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400417CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400418CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400419CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400420CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400421
Kevin Lubick53965c92018-10-11 08:51:55 -0400422CanvasKit.SkSurface.prototype.flush = function() {};
Kevin Lubick5b90b842018-10-17 07:57:18 -0400423CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400424
Kevin Lubick12c0e502018-11-28 12:51:56 -0500425/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400426CanvasKit.SkVertices.prototype.applyBones = function() {};
427
Alexander Khovansky3e119332018-11-15 02:01:19 +0300428CanvasKit.SkImage.prototype.encodeToData = function() {};
429
Kevin Lubick52b9f372018-12-04 13:57:36 -0500430/** @return {Uint8Array} */
431CanvasKit.SkCanvas.prototype.readPixels = function() {};
432CanvasKit.SkCanvas.prototype.writePixels = function() {};
433
Kevin Lubickddd0a332018-12-12 10:35:13 -0500434CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
435
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400436// Define StrokeOpts object
437var StrokeOpts = {};
438StrokeOpts.prototype.width;
439StrokeOpts.prototype.miter_limit;
440StrokeOpts.prototype.cap;
441StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500442StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400443
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500444// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500445var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500446HTMLCanvas.prototype.decodeImage = function() {};
447HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500448HTMLCanvas.prototype.getContext = function() {};
449HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500450
451var CanvasRenderingContext2D = {};
452CanvasRenderingContext2D.prototype.addHitRegion = function() {};
453CanvasRenderingContext2D.prototype.arc = function() {};
454CanvasRenderingContext2D.prototype.arcTo = function() {};
455CanvasRenderingContext2D.prototype.beginPath = function() {};
456CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
457CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500458CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500459CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500460CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500461CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500462CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500463CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500464CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500465CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500466CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500467CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500468CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500469CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500470CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500471CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500472CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500473CanvasRenderingContext2D.prototype.isPointInPath = function() {};
474CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500475CanvasRenderingContext2D.prototype.lineTo = function() {};
476CanvasRenderingContext2D.prototype.measureText = function() {};
477CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500478CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500479CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
480CanvasRenderingContext2D.prototype.rect = function() {};
481CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
482CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500483CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500484CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500485CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500486CanvasRenderingContext2D.prototype.scale = function() {};
487CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500488CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500489CanvasRenderingContext2D.prototype.setTransform = function() {};
490CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500491CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500492CanvasRenderingContext2D.prototype.strokeText = function() {};
493CanvasRenderingContext2D.prototype.transform = function() {};
494CanvasRenderingContext2D.prototype.translate = function() {};
495
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500496var LinearCanvasGradient = {};
497LinearCanvasGradient.prototype.addColorStop = function() {};
498var RadialCanvasGradient = {};
499RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500500var CanvasPattern = {};
501CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500502
Kevin Lubick52b9f372018-12-04 13:57:36 -0500503var ImageData = {
504 /**
505 * @type {Uint8ClampedArray}
506 */
507 data: {},
508 height: {},
509 width: {},
510};
511
Kevin Lubickd29edd72018-12-07 08:29:52 -0500512var DOMMatrix = {
513 a: {},
514 b: {},
515 c: {},
516 d: {},
517 e: {},
518 f: {},
519};
520
Kevin Lubick217056c2018-09-20 17:39:31 -0400521// 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 -0500522function loadWebAssemblyModule() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500523
524var DOMMatrix = {};