blob: 3280cb348880c84f6cf8b479f971c0a97075fd40 [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 Lubickb9db3902018-11-26 11:47:54 -0500177 setFillType: function() {},
178 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400179
180 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500181 _addArc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400182 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500183 _addRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300184 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400185 _arcTo: function() {},
186 _close: function() {},
187 _conicTo: function() {},
188 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400189 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400190 _lineTo: function() {},
191 _moveTo: function() {},
192 _op: function() {},
193 _quadTo: function() {},
194 _rect: function() {},
195 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400196 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400197 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400198 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400199 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500200 dump: function() {},
201 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400202 },
203
204 SkRect: {
205 fLeft: {},
206 fTop: {},
207 fRight: {},
208 fBottom: {},
209 },
210
211 SkSurface: {
212 // public API (from C++ bindings)
213 /** @return {CanvasKit.SkCanvas} */
214 getCanvas: function() {},
215 /** @return {CanvasKit.SkImage} */
216 makeImageSnapshot: function() {},
217
218 // private API
219 _flush: function() {},
220 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400221 delete: function() {},
222 },
223
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400224 SkVertices: {
225 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500226 bounds: function() {},
227 mode: function() {},
228 uniqueID: function() {},
229 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400230
231 // private API
232 /** @return {CanvasKit.SkVertices} */
233 _applyBones: function() {},
234 },
235
Kevin Lubick006a6f32018-10-19 14:34:34 -0400236 // Constants and Enums
237 gpu: {},
238 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400239
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500240 TRANSPARENT: {},
241 RED: {},
242 BLUE: {},
243 YELLOW: {},
244 CYAN: {},
245 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500246 WHITE: {},
247
248 AlphaType: {
249 Opaque: {},
250 Premul: {},
251 Unpremul: {},
252 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500253
254 BlendMode: {
255 Clear: {},
256 Src: {},
257 Dst: {},
258 SrcOver: {},
259 DstOver: {},
260 SrcIn: {},
261 DstIn: {},
262 SrcOut: {},
263 DstOut: {},
264 SrcATop: {},
265 DstATop: {},
266 Xor: {},
267 Plus: {},
268 Modulate: {},
269 Screen: {},
270 Overlay: {},
271 Darken: {},
272 Lighten: {},
273 ColorDodge: {},
274 ColorBurn: {},
275 HardLight: {},
276 SoftLight: {},
277 Difference: {},
278 Exclusion: {},
279 Multiply: {},
280 Hue: {},
281 Saturation: {},
282 Color: {},
283 Luminosity: {},
284 },
285
286 BlurStyle: {
287 Normal: {},
288 Solid: {},
289 Outer: {},
290 Inner: {},
291 },
292
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500293 ClipOp: {
294 Difference: {},
295 Intersect: {},
296 },
297
Kevin Lubickea905ec2018-11-30 14:05:58 -0500298 ColorType: {
299 Alpha_8: {},
300 RGB_565: {},
301 ARGB_4444: {},
302 RGBA_8888: {},
303 RGB_888x: {},
304 BGRA_8888: {},
305 RGBA_1010102: {},
306 RGB_101010x: {},
307 Gray_8: {},
308 RGBA_F16: {},
309 RGBA_F32: {},
310 },
311
Kevin Lubick006a6f32018-10-19 14:34:34 -0400312 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500313 Winding: {},
314 EvenOdd: {},
315 InverseWinding: {},
316 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400317 },
318
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500319 FilterQuality: {
320 None: {},
321 Low: {},
322 Medium: {},
323 High: {},
324 },
325
Alexander Khovansky3e119332018-11-15 02:01:19 +0300326 ImageFormat: {
327 PNG: {},
328 JPEG: {},
329 },
330
Kevin Lubickb9db3902018-11-26 11:47:54 -0500331 PaintStyle: {
332 Fill: {},
333 Stroke: {},
334 StrokeAndFill: {},
335 },
336
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500337 PathOp: {
338 Difference: {},
339 Intersect: {},
340 Union: {},
341 XOR: {},
342 ReverseDifference: {},
343 },
344
Kevin Lubickb9db3902018-11-26 11:47:54 -0500345 StrokeCap: {
346 Butt: {},
347 Round: {},
348 Square: {},
349 },
350
351 StrokeJoin: {
352 Miter: {},
353 Round: {},
354 Bevel: {},
355 },
356
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500357 TileMode: {
358 Clamp: {},
359 Repeat: {},
360 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500361 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500362 },
363
364 VertexMode: {
365 Triangles: {},
366 TrianglesStrip: {},
367 TriangleFan: {},
368 },
369
Kevin Lubick006a6f32018-10-19 14:34:34 -0400370 // Things Enscriptem adds for us
371
Kevin Lubick53965c92018-10-11 08:51:55 -0400372 /** Represents the heap of the WASM code
373 * @type {ArrayBuffer}
374 */
375 buffer: {},
376 /**
377 * @type {Float32Array}
378 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400379 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400380 /**
381 * @type {Uint8Array}
382 */
383 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400384 /**
385 * @type {Uint16Array}
386 */
387 HEAPU16: {},
388 /**
389 * @type {Int32Array}
390 */
391 HEAP32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400392
Kevin Lubick006a6f32018-10-19 14:34:34 -0400393 _malloc: function() {},
394 _free: function() {},
395 onRuntimeInitialized: function() {},
396};
Kevin Lubick217056c2018-09-20 17:39:31 -0400397
Kevin Lubick006a6f32018-10-19 14:34:34 -0400398// Public API things that are newly declared in the JS should go here.
399// It's not enough to declare them above, because closure can still erase them
400// unless they go on the prototype.
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500401CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400402CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500403CanvasKit.SkPath.prototype.addRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300404CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400405CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400406CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400407CanvasKit.SkPath.prototype.conicTo = function() {};
408CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400409CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400410CanvasKit.SkPath.prototype.lineTo = function() {};
411CanvasKit.SkPath.prototype.moveTo = function() {};
412CanvasKit.SkPath.prototype.op = function() {};
413CanvasKit.SkPath.prototype.quadTo = function() {};
414CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400415CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400416CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400417CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400418CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400419
Kevin Lubick53965c92018-10-11 08:51:55 -0400420CanvasKit.SkSurface.prototype.flush = function() {};
Kevin Lubick5b90b842018-10-17 07:57:18 -0400421CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400422
Kevin Lubick12c0e502018-11-28 12:51:56 -0500423/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400424CanvasKit.SkVertices.prototype.applyBones = function() {};
425
Alexander Khovansky3e119332018-11-15 02:01:19 +0300426CanvasKit.SkImage.prototype.encodeToData = function() {};
427
Kevin Lubick52b9f372018-12-04 13:57:36 -0500428/** @return {Uint8Array} */
429CanvasKit.SkCanvas.prototype.readPixels = function() {};
430CanvasKit.SkCanvas.prototype.writePixels = function() {};
431
Kevin Lubickddd0a332018-12-12 10:35:13 -0500432CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
433
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400434// Define StrokeOpts object
435var StrokeOpts = {};
436StrokeOpts.prototype.width;
437StrokeOpts.prototype.miter_limit;
438StrokeOpts.prototype.cap;
439StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500440StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400441
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500442// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500443var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500444HTMLCanvas.prototype.decodeImage = function() {};
445HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500446HTMLCanvas.prototype.getContext = function() {};
447HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500448
449var CanvasRenderingContext2D = {};
450CanvasRenderingContext2D.prototype.addHitRegion = function() {};
451CanvasRenderingContext2D.prototype.arc = function() {};
452CanvasRenderingContext2D.prototype.arcTo = function() {};
453CanvasRenderingContext2D.prototype.beginPath = function() {};
454CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
455CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500456CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500457CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500458CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500459CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500460CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500461CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500462CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500463CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500464CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500465CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500466CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500467CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500468CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500469CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500470CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500471CanvasRenderingContext2D.prototype.isPointInPath = function() {};
472CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500473CanvasRenderingContext2D.prototype.lineTo = function() {};
474CanvasRenderingContext2D.prototype.measureText = function() {};
475CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500476CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500477CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
478CanvasRenderingContext2D.prototype.rect = function() {};
479CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
480CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500481CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500482CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500483CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500484CanvasRenderingContext2D.prototype.scale = function() {};
485CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500486CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500487CanvasRenderingContext2D.prototype.setTransform = function() {};
488CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500489CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500490CanvasRenderingContext2D.prototype.strokeText = function() {};
491CanvasRenderingContext2D.prototype.transform = function() {};
492CanvasRenderingContext2D.prototype.translate = function() {};
493
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500494var LinearCanvasGradient = {};
495LinearCanvasGradient.prototype.addColorStop = function() {};
496var RadialCanvasGradient = {};
497RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500498var CanvasPattern = {};
499CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500500
Kevin Lubick52b9f372018-12-04 13:57:36 -0500501var ImageData = {
502 /**
503 * @type {Uint8ClampedArray}
504 */
505 data: {},
506 height: {},
507 width: {},
508};
509
Kevin Lubickd29edd72018-12-07 08:29:52 -0500510var DOMMatrix = {
511 a: {},
512 b: {},
513 c: {},
514 d: {},
515 e: {},
516 f: {},
517};
518
Kevin Lubick217056c2018-09-20 17:39:31 -0400519// 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 -0500520function loadWebAssemblyModule() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500521
522var DOMMatrix = {};