blob: 1caa10f0e8aa5ac3592a00299934ca48fc418593 [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 Lubick006a6f32018-10-19 14:34:34 -040053 initFonts: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050054 multiplyByAlpha: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040055 setCurrentContext: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040056
57 // private API (i.e. things declared in the bindings that we use
58 // in the pre-js file)
Kevin Lubick52b9f372018-12-04 13:57:36 -050059 _MakeImage: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040060 _MakeImageShader: function() {},
61 _MakeLinearGradientShader: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040062 _MakeRadialGradientShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040063 _MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040064 _MakeSkVertices: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050065 _MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050066 _decodeImage: function() {},
Kevin Lubickea905ec2018-11-30 14:05:58 -050067 _getRasterDirectSurface: function() {},
Kevin Lubick134be1d2018-10-30 15:05:04 -040068 _getRasterN32PremulSurface: function() {},
69 _getWebGLSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040070
Kevin Lubick1a05fce2018-11-20 12:51:16 -050071 // The testing object is meant to expose internal functions
72 // for more fine-grained testing, e.g. parseColor
73 _testing: {},
74
Kevin Lubick217056c2018-09-20 17:39:31 -040075 // Objects and properties on CanvasKit
76
Kevin Lubick006a6f32018-10-19 14:34:34 -040077 SkCanvas: {
78 // public API (from C++ bindings)
79 clear: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -050080 concat: function() {},
81 clipRect: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050082 clipPath: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050083 drawImage: function() {},
84 drawImageRect: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040085 drawPaint: function() {},
86 drawPath: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050087 drawRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050088 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050089 drawText: function() {},
90 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040091 flush: 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() {},
102 _setMatrix: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400103 delete: function() {},
104 },
105
106 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500107 // public API (from C++ bindings)
108 height: function() {},
109 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300110 // private API
111 _encodeToData: function() {},
112 _encodeToDataWithFormat: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400113 },
114
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500115 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500116 identity: function() {},
117 mapPoints: function() {},
118 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500119 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500120 scaled: function() {},
121 skewed: function() {},
122 translated: function() {},
123 },
124
125 SkPaint: {
126 // public API (from C++ bindings)
127 /** @return {CanvasKit.SkPaint} */
128 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500129 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500130 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500131 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500132 getStrokeCap: function() {},
133 getStrokeJoin: function() {},
134 getStrokeMiter: function() {},
135 getStrokeWidth: function() {},
136 getTextSize: function() {},
137 measureText: function() {},
138 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500139 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500140 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500141 setFilterQuality: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500142 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500143 setPathEffect: function() {},
144 setShader: function() {},
145 setStrokeCap: function() {},
146 setStrokeJoin: function() {},
147 setStrokeMiter: function() {},
148 setStrokeWidth: function() {},
149 setStyle: function() {},
150 setTextSize: function() {},
151
152 //private API
153 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500154 },
155
Kevin Lubick006a6f32018-10-19 14:34:34 -0400156 SkPath: {
157 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500158 computeTightBounds: function() {},
159 /** @return {CanvasKit.SkPath} */
160 copy: function() {},
161 countPoints: function() {},
162 equals: function() {},
163 getBounds: function() {},
164 getFillType: function() {},
165 getPoint: function() {},
166 setFillType: function() {},
167 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400168
169 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500170 _addArc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400171 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500172 _addRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300173 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400174 _arcTo: function() {},
175 _close: function() {},
176 _conicTo: function() {},
177 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400178 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400179 _lineTo: function() {},
180 _moveTo: function() {},
181 _op: function() {},
182 _quadTo: function() {},
183 _rect: function() {},
184 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400185 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400186 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400187 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400188 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500189 dump: function() {},
190 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400191 },
192
193 SkRect: {
194 fLeft: {},
195 fTop: {},
196 fRight: {},
197 fBottom: {},
198 },
199
200 SkSurface: {
201 // public API (from C++ bindings)
202 /** @return {CanvasKit.SkCanvas} */
203 getCanvas: function() {},
204 /** @return {CanvasKit.SkImage} */
205 makeImageSnapshot: function() {},
206
207 // private API
208 _flush: function() {},
209 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400210 delete: function() {},
211 },
212
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400213 SkVertices: {
214 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500215 bounds: function() {},
216 mode: function() {},
217 uniqueID: function() {},
218 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400219
220 // private API
221 /** @return {CanvasKit.SkVertices} */
222 _applyBones: function() {},
223 },
224
Kevin Lubick006a6f32018-10-19 14:34:34 -0400225 // Constants and Enums
226 gpu: {},
227 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400228
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500229 TRANSPARENT: {},
230 RED: {},
231 BLUE: {},
232 YELLOW: {},
233 CYAN: {},
234 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500235 WHITE: {},
236
237 AlphaType: {
238 Opaque: {},
239 Premul: {},
240 Unpremul: {},
241 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500242
243 BlendMode: {
244 Clear: {},
245 Src: {},
246 Dst: {},
247 SrcOver: {},
248 DstOver: {},
249 SrcIn: {},
250 DstIn: {},
251 SrcOut: {},
252 DstOut: {},
253 SrcATop: {},
254 DstATop: {},
255 Xor: {},
256 Plus: {},
257 Modulate: {},
258 Screen: {},
259 Overlay: {},
260 Darken: {},
261 Lighten: {},
262 ColorDodge: {},
263 ColorBurn: {},
264 HardLight: {},
265 SoftLight: {},
266 Difference: {},
267 Exclusion: {},
268 Multiply: {},
269 Hue: {},
270 Saturation: {},
271 Color: {},
272 Luminosity: {},
273 },
274
275 BlurStyle: {
276 Normal: {},
277 Solid: {},
278 Outer: {},
279 Inner: {},
280 },
281
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500282 ClipOp: {
283 Difference: {},
284 Intersect: {},
285 },
286
Kevin Lubickea905ec2018-11-30 14:05:58 -0500287 ColorType: {
288 Alpha_8: {},
289 RGB_565: {},
290 ARGB_4444: {},
291 RGBA_8888: {},
292 RGB_888x: {},
293 BGRA_8888: {},
294 RGBA_1010102: {},
295 RGB_101010x: {},
296 Gray_8: {},
297 RGBA_F16: {},
298 RGBA_F32: {},
299 },
300
Kevin Lubick006a6f32018-10-19 14:34:34 -0400301 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500302 Winding: {},
303 EvenOdd: {},
304 InverseWinding: {},
305 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400306 },
307
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500308 FilterQuality: {
309 None: {},
310 Low: {},
311 Medium: {},
312 High: {},
313 },
314
Alexander Khovansky3e119332018-11-15 02:01:19 +0300315 ImageFormat: {
316 PNG: {},
317 JPEG: {},
318 },
319
Kevin Lubickb9db3902018-11-26 11:47:54 -0500320 PaintStyle: {
321 Fill: {},
322 Stroke: {},
323 StrokeAndFill: {},
324 },
325
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500326 PathOp: {
327 Difference: {},
328 Intersect: {},
329 Union: {},
330 XOR: {},
331 ReverseDifference: {},
332 },
333
Kevin Lubickb9db3902018-11-26 11:47:54 -0500334 StrokeCap: {
335 Butt: {},
336 Round: {},
337 Square: {},
338 },
339
340 StrokeJoin: {
341 Miter: {},
342 Round: {},
343 Bevel: {},
344 },
345
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500346 TileMode: {
347 Clamp: {},
348 Repeat: {},
349 Mirror: {},
350 },
351
352 VertexMode: {
353 Triangles: {},
354 TrianglesStrip: {},
355 TriangleFan: {},
356 },
357
Kevin Lubick006a6f32018-10-19 14:34:34 -0400358 // Things Enscriptem adds for us
359
Kevin Lubick53965c92018-10-11 08:51:55 -0400360 /** Represents the heap of the WASM code
361 * @type {ArrayBuffer}
362 */
363 buffer: {},
364 /**
365 * @type {Float32Array}
366 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400367 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400368 /**
369 * @type {Uint8Array}
370 */
371 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400372 /**
373 * @type {Uint16Array}
374 */
375 HEAPU16: {},
376 /**
377 * @type {Int32Array}
378 */
379 HEAP32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400380
Kevin Lubick006a6f32018-10-19 14:34:34 -0400381 _malloc: function() {},
382 _free: function() {},
383 onRuntimeInitialized: function() {},
384};
Kevin Lubick217056c2018-09-20 17:39:31 -0400385
Kevin Lubick006a6f32018-10-19 14:34:34 -0400386// Public API things that are newly declared in the JS should go here.
387// It's not enough to declare them above, because closure can still erase them
388// unless they go on the prototype.
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500389CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400390CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500391CanvasKit.SkPath.prototype.addRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300392CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400393CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400394CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400395CanvasKit.SkPath.prototype.conicTo = function() {};
396CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400397CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400398CanvasKit.SkPath.prototype.lineTo = function() {};
399CanvasKit.SkPath.prototype.moveTo = function() {};
400CanvasKit.SkPath.prototype.op = function() {};
401CanvasKit.SkPath.prototype.quadTo = function() {};
402CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400403CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400404CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400405CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400406CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400407
Kevin Lubick53965c92018-10-11 08:51:55 -0400408CanvasKit.SkSurface.prototype.flush = function() {};
Kevin Lubick5b90b842018-10-17 07:57:18 -0400409CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400410
Kevin Lubick12c0e502018-11-28 12:51:56 -0500411/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400412CanvasKit.SkVertices.prototype.applyBones = function() {};
413
Alexander Khovansky3e119332018-11-15 02:01:19 +0300414CanvasKit.SkImage.prototype.encodeToData = function() {};
415
Kevin Lubick52b9f372018-12-04 13:57:36 -0500416/** @return {Uint8Array} */
417CanvasKit.SkCanvas.prototype.readPixels = function() {};
418CanvasKit.SkCanvas.prototype.writePixels = function() {};
419
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400420// Define StrokeOpts object
421var StrokeOpts = {};
422StrokeOpts.prototype.width;
423StrokeOpts.prototype.miter_limit;
424StrokeOpts.prototype.cap;
425StrokeOpts.prototype.join;
426
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500427// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500428var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500429HTMLCanvas.prototype.decodeImage = function() {};
430HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500431HTMLCanvas.prototype.getContext = function() {};
432HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500433
434var CanvasRenderingContext2D = {};
435CanvasRenderingContext2D.prototype.addHitRegion = function() {};
436CanvasRenderingContext2D.prototype.arc = function() {};
437CanvasRenderingContext2D.prototype.arcTo = function() {};
438CanvasRenderingContext2D.prototype.beginPath = function() {};
439CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
440CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500441CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500442CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500443CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500444CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500445CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
446CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500447CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500448CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500449CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500450CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500451CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500452CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500453CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500454CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500455CanvasRenderingContext2D.prototype.lineTo = function() {};
456CanvasRenderingContext2D.prototype.measureText = function() {};
457CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500458CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500459CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
460CanvasRenderingContext2D.prototype.rect = function() {};
461CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
462CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500463CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500464CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500465CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500466CanvasRenderingContext2D.prototype.scale = function() {};
467CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500468CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500469CanvasRenderingContext2D.prototype.setTransform = function() {};
470CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500471CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500472CanvasRenderingContext2D.prototype.strokeText = function() {};
473CanvasRenderingContext2D.prototype.transform = function() {};
474CanvasRenderingContext2D.prototype.translate = function() {};
475
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500476var LinearCanvasGradient = {};
477LinearCanvasGradient.prototype.addColorStop = function() {};
478var RadialCanvasGradient = {};
479RadialCanvasGradient.prototype.addColorStop = function() {};
480
Kevin Lubick52b9f372018-12-04 13:57:36 -0500481var ImageData = {
482 /**
483 * @type {Uint8ClampedArray}
484 */
485 data: {},
486 height: {},
487 width: {},
488};
489
Kevin Lubick217056c2018-09-20 17:39:31 -0400490// 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 -0500491function loadWebAssemblyModule() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500492
493var DOMMatrix = {};