blob: f4882c376b86cf42a7b63b14e1f8b818ba65f451 [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 Lubickddd0a332018-12-12 10:35:13 -0500107 SkFontMgr: {
108 // public API (from C++ bindings)
109 RefDefault: function() {},
110 countFamilies: function() {},
111
112 // private API
113 _makeTypefaceFromData: function() {},
114 },
115
Kevin Lubick006a6f32018-10-19 14:34:34 -0400116 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500117 // public API (from C++ bindings)
118 height: function() {},
119 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300120 // private API
121 _encodeToData: function() {},
122 _encodeToDataWithFormat: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400123 },
124
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500125 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500126 identity: function() {},
127 mapPoints: function() {},
128 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500129 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500130 scaled: function() {},
131 skewed: function() {},
132 translated: function() {},
133 },
134
135 SkPaint: {
136 // public API (from C++ bindings)
137 /** @return {CanvasKit.SkPaint} */
138 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500139 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500140 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500141 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500142 getStrokeCap: function() {},
143 getStrokeJoin: function() {},
144 getStrokeMiter: function() {},
145 getStrokeWidth: function() {},
146 getTextSize: function() {},
147 measureText: function() {},
148 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500149 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500150 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500151 setFilterQuality: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500152 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500153 setPathEffect: function() {},
154 setShader: function() {},
155 setStrokeCap: function() {},
156 setStrokeJoin: function() {},
157 setStrokeMiter: function() {},
158 setStrokeWidth: function() {},
159 setStyle: function() {},
160 setTextSize: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500161 setTypeface: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500162
163 //private API
164 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500165 },
166
Kevin Lubick006a6f32018-10-19 14:34:34 -0400167 SkPath: {
168 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500169 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500170 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500171 /** @return {CanvasKit.SkPath} */
172 copy: function() {},
173 countPoints: function() {},
174 equals: function() {},
175 getBounds: function() {},
176 getFillType: function() {},
177 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500178 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500179 isVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500180 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500181 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500182 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400183
184 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500185 _addArc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400186 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500187 _addRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300188 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400189 _arcTo: function() {},
190 _close: function() {},
191 _conicTo: function() {},
192 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400193 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400194 _lineTo: function() {},
195 _moveTo: function() {},
196 _op: function() {},
197 _quadTo: function() {},
198 _rect: function() {},
199 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400200 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400201 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400202 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400203 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500204 dump: function() {},
205 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400206 },
207
208 SkRect: {
209 fLeft: {},
210 fTop: {},
211 fRight: {},
212 fBottom: {},
213 },
214
215 SkSurface: {
216 // public API (from C++ bindings)
217 /** @return {CanvasKit.SkCanvas} */
218 getCanvas: function() {},
219 /** @return {CanvasKit.SkImage} */
220 makeImageSnapshot: function() {},
221
222 // private API
223 _flush: function() {},
224 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400225 delete: function() {},
226 },
227
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400228 SkVertices: {
229 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500230 bounds: function() {},
231 mode: function() {},
232 uniqueID: function() {},
233 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400234
235 // private API
236 /** @return {CanvasKit.SkVertices} */
237 _applyBones: function() {},
238 },
239
Kevin Lubick006a6f32018-10-19 14:34:34 -0400240 // Constants and Enums
241 gpu: {},
242 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400243
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500244 TRANSPARENT: {},
245 RED: {},
246 BLUE: {},
247 YELLOW: {},
248 CYAN: {},
249 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500250 WHITE: {},
251
252 AlphaType: {
253 Opaque: {},
254 Premul: {},
255 Unpremul: {},
256 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500257
258 BlendMode: {
259 Clear: {},
260 Src: {},
261 Dst: {},
262 SrcOver: {},
263 DstOver: {},
264 SrcIn: {},
265 DstIn: {},
266 SrcOut: {},
267 DstOut: {},
268 SrcATop: {},
269 DstATop: {},
270 Xor: {},
271 Plus: {},
272 Modulate: {},
273 Screen: {},
274 Overlay: {},
275 Darken: {},
276 Lighten: {},
277 ColorDodge: {},
278 ColorBurn: {},
279 HardLight: {},
280 SoftLight: {},
281 Difference: {},
282 Exclusion: {},
283 Multiply: {},
284 Hue: {},
285 Saturation: {},
286 Color: {},
287 Luminosity: {},
288 },
289
290 BlurStyle: {
291 Normal: {},
292 Solid: {},
293 Outer: {},
294 Inner: {},
295 },
296
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500297 ClipOp: {
298 Difference: {},
299 Intersect: {},
300 },
301
Kevin Lubickea905ec2018-11-30 14:05:58 -0500302 ColorType: {
303 Alpha_8: {},
304 RGB_565: {},
305 ARGB_4444: {},
306 RGBA_8888: {},
307 RGB_888x: {},
308 BGRA_8888: {},
309 RGBA_1010102: {},
310 RGB_101010x: {},
311 Gray_8: {},
312 RGBA_F16: {},
313 RGBA_F32: {},
314 },
315
Kevin Lubick006a6f32018-10-19 14:34:34 -0400316 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500317 Winding: {},
318 EvenOdd: {},
319 InverseWinding: {},
320 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400321 },
322
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500323 FilterQuality: {
324 None: {},
325 Low: {},
326 Medium: {},
327 High: {},
328 },
329
Alexander Khovansky3e119332018-11-15 02:01:19 +0300330 ImageFormat: {
331 PNG: {},
332 JPEG: {},
333 },
334
Kevin Lubickb9db3902018-11-26 11:47:54 -0500335 PaintStyle: {
336 Fill: {},
337 Stroke: {},
338 StrokeAndFill: {},
339 },
340
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500341 PathOp: {
342 Difference: {},
343 Intersect: {},
344 Union: {},
345 XOR: {},
346 ReverseDifference: {},
347 },
348
Kevin Lubickb9db3902018-11-26 11:47:54 -0500349 StrokeCap: {
350 Butt: {},
351 Round: {},
352 Square: {},
353 },
354
355 StrokeJoin: {
356 Miter: {},
357 Round: {},
358 Bevel: {},
359 },
360
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500361 TileMode: {
362 Clamp: {},
363 Repeat: {},
364 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500365 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500366 },
367
368 VertexMode: {
369 Triangles: {},
370 TrianglesStrip: {},
371 TriangleFan: {},
372 },
373
Kevin Lubick006a6f32018-10-19 14:34:34 -0400374 // Things Enscriptem adds for us
375
Kevin Lubick53965c92018-10-11 08:51:55 -0400376 /** Represents the heap of the WASM code
377 * @type {ArrayBuffer}
378 */
379 buffer: {},
380 /**
381 * @type {Float32Array}
382 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400383 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400384 /**
385 * @type {Uint8Array}
386 */
387 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400388 /**
389 * @type {Uint16Array}
390 */
391 HEAPU16: {},
392 /**
393 * @type {Int32Array}
394 */
395 HEAP32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400396
Kevin Lubick006a6f32018-10-19 14:34:34 -0400397 _malloc: function() {},
398 _free: function() {},
399 onRuntimeInitialized: function() {},
400};
Kevin Lubick217056c2018-09-20 17:39:31 -0400401
Kevin Lubick006a6f32018-10-19 14:34:34 -0400402// Public API things that are newly declared in the JS should go here.
403// It's not enough to declare them above, because closure can still erase them
404// unless they go on the prototype.
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500405CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400406CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500407CanvasKit.SkPath.prototype.addRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300408CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400409CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400410CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400411CanvasKit.SkPath.prototype.conicTo = function() {};
412CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400413CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400414CanvasKit.SkPath.prototype.lineTo = function() {};
415CanvasKit.SkPath.prototype.moveTo = function() {};
416CanvasKit.SkPath.prototype.op = function() {};
417CanvasKit.SkPath.prototype.quadTo = function() {};
418CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400419CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400420CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400421CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400422CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400423
Kevin Lubick53965c92018-10-11 08:51:55 -0400424CanvasKit.SkSurface.prototype.flush = function() {};
Kevin Lubick5b90b842018-10-17 07:57:18 -0400425CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400426
Kevin Lubick12c0e502018-11-28 12:51:56 -0500427/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400428CanvasKit.SkVertices.prototype.applyBones = function() {};
429
Alexander Khovansky3e119332018-11-15 02:01:19 +0300430CanvasKit.SkImage.prototype.encodeToData = function() {};
431
Kevin Lubick52b9f372018-12-04 13:57:36 -0500432/** @return {Uint8Array} */
433CanvasKit.SkCanvas.prototype.readPixels = function() {};
434CanvasKit.SkCanvas.prototype.writePixels = function() {};
435
Kevin Lubickddd0a332018-12-12 10:35:13 -0500436CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
437
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400438// Define StrokeOpts object
439var StrokeOpts = {};
440StrokeOpts.prototype.width;
441StrokeOpts.prototype.miter_limit;
442StrokeOpts.prototype.cap;
443StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500444StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400445
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500446// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500447var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500448HTMLCanvas.prototype.decodeImage = function() {};
449HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500450HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500451HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500452HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500453HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500454
455var CanvasRenderingContext2D = {};
456CanvasRenderingContext2D.prototype.addHitRegion = function() {};
457CanvasRenderingContext2D.prototype.arc = function() {};
458CanvasRenderingContext2D.prototype.arcTo = function() {};
459CanvasRenderingContext2D.prototype.beginPath = function() {};
460CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
461CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500462CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500463CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500464CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500465CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500466CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500467CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500468CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500469CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500470CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500471CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500472CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500473CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500474CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500475CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500476CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500477CanvasRenderingContext2D.prototype.isPointInPath = function() {};
478CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500479CanvasRenderingContext2D.prototype.lineTo = function() {};
480CanvasRenderingContext2D.prototype.measureText = function() {};
481CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500482CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500483CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
484CanvasRenderingContext2D.prototype.rect = function() {};
485CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
486CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500487CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500488CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500489CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500490CanvasRenderingContext2D.prototype.scale = function() {};
491CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500492CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500493CanvasRenderingContext2D.prototype.setTransform = function() {};
494CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500495CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500496CanvasRenderingContext2D.prototype.strokeText = function() {};
497CanvasRenderingContext2D.prototype.transform = function() {};
498CanvasRenderingContext2D.prototype.translate = function() {};
499
Kevin Lubicka40f8322018-12-17 16:01:36 -0500500var Path2D = {};
501Path2D.prototype.addPath = function() {};
502Path2D.prototype.arc = function() {};
503Path2D.prototype.arcTo = function() {};
504Path2D.prototype.bezierCurveTo = function() {};
505Path2D.prototype.closePath = function() {};
506Path2D.prototype.ellipse = function() {};
507Path2D.prototype.lineTo = function() {};
508Path2D.prototype.moveTo = function() {};
509Path2D.prototype.quadraticCurveTo = function() {};
510Path2D.prototype.rect = function() {};
511
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500512var LinearCanvasGradient = {};
513LinearCanvasGradient.prototype.addColorStop = function() {};
514var RadialCanvasGradient = {};
515RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500516var CanvasPattern = {};
517CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500518
Kevin Lubick52b9f372018-12-04 13:57:36 -0500519var ImageData = {
520 /**
521 * @type {Uint8ClampedArray}
522 */
523 data: {},
524 height: {},
525 width: {},
526};
527
Kevin Lubickd29edd72018-12-07 08:29:52 -0500528var DOMMatrix = {
529 a: {},
530 b: {},
531 c: {},
532 d: {},
533 e: {},
534 f: {},
535};
536
Kevin Lubick217056c2018-09-20 17:39:31 -0400537// 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 -0500538function loadWebAssemblyModule() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500539
540var DOMMatrix = {};