blob: e4457981ab1aef2772b785fa0da7a8ed76eea746 [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 Lubickda3d8ac2019-01-07 11:08:55 -050042 MakePathFromCmds: function() {},
Kevin Lubicka40f8322018-12-17 16:01:36 -050043 MakePathFromOp: function() {},
44 MakePathFromSVGString: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050045 MakeRadialGradientShader: function() {},
46 MakeSWCanvasSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040047 MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040048 MakeSkVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040049 MakeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050050 /** @return {RadialCanvasGradient} */
51 MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050052 MakeWebGLCanvasSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040053 currentContext: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050054 getColorComponents: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050055 getSkDataBytes: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050056 multiplyByAlpha: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040057 setCurrentContext: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040058
59 // private API (i.e. things declared in the bindings that we use
60 // in the pre-js file)
Kevin Lubick52b9f372018-12-04 13:57:36 -050061 _MakeImage: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040062 _MakeImageShader: function() {},
63 _MakeLinearGradientShader: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050064 _MakePathFromCmds: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040065 _MakeRadialGradientShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040066 _MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040067 _MakeSkVertices: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050068 _MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050069 _decodeImage: function() {},
Kevin Lubickea905ec2018-11-30 14:05:58 -050070 _getRasterDirectSurface: function() {},
Kevin Lubick134be1d2018-10-30 15:05:04 -040071 _getRasterN32PremulSurface: function() {},
72 _getWebGLSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040073
Kevin Lubick1a05fce2018-11-20 12:51:16 -050074 // The testing object is meant to expose internal functions
75 // for more fine-grained testing, e.g. parseColor
76 _testing: {},
77
Kevin Lubick217056c2018-09-20 17:39:31 -040078 // Objects and properties on CanvasKit
79
Kevin Lubick006a6f32018-10-19 14:34:34 -040080 SkCanvas: {
81 // public API (from C++ bindings)
82 clear: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050083 clipPath: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -050084 clipRect: function() {},
85 concat: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050086 drawArc: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050087 drawImage: function() {},
88 drawImageRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050089 drawLine: function() {},
90 drawOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040091 drawPaint: function() {},
92 drawPath: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050093 drawRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050094 drawRoundRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050095 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050096 drawText: function() {},
97 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040098 flush: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -050099 getTotalMatrix: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500100 restore: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400101 rotate: function() {},
102 save: function() {},
103 scale: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400104 skew: function() {},
105 translate: function() {},
106
107 // private API
Kevin Lubick52b9f372018-12-04 13:57:36 -0500108 _readPixels: function() {},
109 _writePixels: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400110 delete: function() {},
111 },
112
Kevin Lubick35ac0382019-01-02 15:13:57 -0500113 SkFont: {
114 // public API (from C++ bindings)
115 getScaleX: function() {},
116 getSize: function() {},
117 getSkewX: function() {},
118 getTypeface: function() {},
119 measureText: function() {},
120 setScaleX: function() {},
121 setSize: function() {},
122 setSkewX: function() {},
123 setTypeface: function() {},
124 },
125
Kevin Lubickddd0a332018-12-12 10:35:13 -0500126 SkFontMgr: {
127 // public API (from C++ bindings)
128 RefDefault: function() {},
129 countFamilies: function() {},
130
131 // private API
132 _makeTypefaceFromData: function() {},
133 },
134
Kevin Lubick006a6f32018-10-19 14:34:34 -0400135 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500136 // public API (from C++ bindings)
137 height: function() {},
138 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300139 // private API
140 _encodeToData: function() {},
141 _encodeToDataWithFormat: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400142 },
143
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500144 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500145 identity: function() {},
146 mapPoints: function() {},
147 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500148 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500149 scaled: function() {},
150 skewed: function() {},
151 translated: function() {},
152 },
153
154 SkPaint: {
155 // public API (from C++ bindings)
156 /** @return {CanvasKit.SkPaint} */
157 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500158 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500159 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500160 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500161 getStrokeCap: function() {},
162 getStrokeJoin: function() {},
163 getStrokeMiter: function() {},
164 getStrokeWidth: function() {},
165 getTextSize: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500166 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500167 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500168 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500169 setFilterQuality: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500170 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500171 setPathEffect: function() {},
172 setShader: function() {},
173 setStrokeCap: function() {},
174 setStrokeJoin: function() {},
175 setStrokeMiter: function() {},
176 setStrokeWidth: function() {},
177 setStyle: function() {},
178 setTextSize: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500179 setTypeface: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500180
181 //private API
182 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500183 },
184
Kevin Lubick006a6f32018-10-19 14:34:34 -0400185 SkPath: {
186 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500187 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500188 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500189 /** @return {CanvasKit.SkPath} */
190 copy: function() {},
191 countPoints: function() {},
192 equals: function() {},
193 getBounds: function() {},
194 getFillType: function() {},
195 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500196 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500197 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500198 reset: function() {},
199 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500200 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500201 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500202 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400203
204 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500205 _addArc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400206 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500207 _addRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500208 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300209 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400210 _arcTo: function() {},
211 _close: function() {},
212 _conicTo: function() {},
213 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400214 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400215 _lineTo: function() {},
216 _moveTo: function() {},
217 _op: function() {},
218 _quadTo: function() {},
219 _rect: function() {},
220 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400221 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400222 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400223 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400224 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500225 dump: function() {},
226 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400227 },
228
229 SkRect: {
230 fLeft: {},
231 fTop: {},
232 fRight: {},
233 fBottom: {},
234 },
235
236 SkSurface: {
237 // public API (from C++ bindings)
238 /** @return {CanvasKit.SkCanvas} */
239 getCanvas: function() {},
240 /** @return {CanvasKit.SkImage} */
241 makeImageSnapshot: function() {},
242
243 // private API
244 _flush: function() {},
245 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400246 delete: function() {},
247 },
248
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400249 SkVertices: {
250 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500251 bounds: function() {},
252 mode: function() {},
253 uniqueID: function() {},
254 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400255
256 // private API
257 /** @return {CanvasKit.SkVertices} */
258 _applyBones: function() {},
259 },
260
Kevin Lubick006a6f32018-10-19 14:34:34 -0400261 // Constants and Enums
262 gpu: {},
263 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400264
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500265 TRANSPARENT: {},
266 RED: {},
267 BLUE: {},
268 YELLOW: {},
269 CYAN: {},
270 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500271 WHITE: {},
272
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500273 MOVE_VERB: {},
274 LINE_VERB: {},
275 QUAD_VERB: {},
276 CONIC_VERB: {},
277 CUBIC_VERB: {},
278 CLOSE_VERB: {},
279
Kevin Lubickea905ec2018-11-30 14:05:58 -0500280 AlphaType: {
281 Opaque: {},
282 Premul: {},
283 Unpremul: {},
284 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500285
286 BlendMode: {
287 Clear: {},
288 Src: {},
289 Dst: {},
290 SrcOver: {},
291 DstOver: {},
292 SrcIn: {},
293 DstIn: {},
294 SrcOut: {},
295 DstOut: {},
296 SrcATop: {},
297 DstATop: {},
298 Xor: {},
299 Plus: {},
300 Modulate: {},
301 Screen: {},
302 Overlay: {},
303 Darken: {},
304 Lighten: {},
305 ColorDodge: {},
306 ColorBurn: {},
307 HardLight: {},
308 SoftLight: {},
309 Difference: {},
310 Exclusion: {},
311 Multiply: {},
312 Hue: {},
313 Saturation: {},
314 Color: {},
315 Luminosity: {},
316 },
317
318 BlurStyle: {
319 Normal: {},
320 Solid: {},
321 Outer: {},
322 Inner: {},
323 },
324
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500325 ClipOp: {
326 Difference: {},
327 Intersect: {},
328 },
329
Kevin Lubickea905ec2018-11-30 14:05:58 -0500330 ColorType: {
331 Alpha_8: {},
332 RGB_565: {},
333 ARGB_4444: {},
334 RGBA_8888: {},
335 RGB_888x: {},
336 BGRA_8888: {},
337 RGBA_1010102: {},
338 RGB_101010x: {},
339 Gray_8: {},
340 RGBA_F16: {},
341 RGBA_F32: {},
342 },
343
Kevin Lubick006a6f32018-10-19 14:34:34 -0400344 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500345 Winding: {},
346 EvenOdd: {},
347 InverseWinding: {},
348 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400349 },
350
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500351 FilterQuality: {
352 None: {},
353 Low: {},
354 Medium: {},
355 High: {},
356 },
357
Alexander Khovansky3e119332018-11-15 02:01:19 +0300358 ImageFormat: {
359 PNG: {},
360 JPEG: {},
361 },
362
Kevin Lubickb9db3902018-11-26 11:47:54 -0500363 PaintStyle: {
364 Fill: {},
365 Stroke: {},
366 StrokeAndFill: {},
367 },
368
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500369 PathOp: {
370 Difference: {},
371 Intersect: {},
372 Union: {},
373 XOR: {},
374 ReverseDifference: {},
375 },
376
Kevin Lubickb9db3902018-11-26 11:47:54 -0500377 StrokeCap: {
378 Butt: {},
379 Round: {},
380 Square: {},
381 },
382
383 StrokeJoin: {
384 Miter: {},
385 Round: {},
386 Bevel: {},
387 },
388
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500389 TileMode: {
390 Clamp: {},
391 Repeat: {},
392 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500393 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500394 },
395
396 VertexMode: {
397 Triangles: {},
398 TrianglesStrip: {},
399 TriangleFan: {},
400 },
401
Kevin Lubick006a6f32018-10-19 14:34:34 -0400402 // Things Enscriptem adds for us
403
Kevin Lubick53965c92018-10-11 08:51:55 -0400404 /** Represents the heap of the WASM code
405 * @type {ArrayBuffer}
406 */
407 buffer: {},
408 /**
409 * @type {Float32Array}
410 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400411 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400412 /**
413 * @type {Uint8Array}
414 */
415 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400416 /**
417 * @type {Uint16Array}
418 */
419 HEAPU16: {},
420 /**
421 * @type {Int32Array}
422 */
423 HEAP32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400424
Kevin Lubick006a6f32018-10-19 14:34:34 -0400425 _malloc: function() {},
426 _free: function() {},
427 onRuntimeInitialized: function() {},
428};
Kevin Lubick217056c2018-09-20 17:39:31 -0400429
Kevin Lubick006a6f32018-10-19 14:34:34 -0400430// Public API things that are newly declared in the JS should go here.
431// It's not enough to declare them above, because closure can still erase them
432// unless they go on the prototype.
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500433CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400434CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500435CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500436CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300437CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400438CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400439CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400440CanvasKit.SkPath.prototype.conicTo = function() {};
441CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400442CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400443CanvasKit.SkPath.prototype.lineTo = function() {};
444CanvasKit.SkPath.prototype.moveTo = function() {};
445CanvasKit.SkPath.prototype.op = function() {};
446CanvasKit.SkPath.prototype.quadTo = function() {};
447CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400448CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400449CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400450CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400451CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400452
Kevin Lubick53965c92018-10-11 08:51:55 -0400453CanvasKit.SkSurface.prototype.flush = function() {};
Kevin Lubick5b90b842018-10-17 07:57:18 -0400454CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400455
Kevin Lubick12c0e502018-11-28 12:51:56 -0500456/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400457CanvasKit.SkVertices.prototype.applyBones = function() {};
458
Alexander Khovansky3e119332018-11-15 02:01:19 +0300459CanvasKit.SkImage.prototype.encodeToData = function() {};
460
Kevin Lubick52b9f372018-12-04 13:57:36 -0500461/** @return {Uint8Array} */
462CanvasKit.SkCanvas.prototype.readPixels = function() {};
463CanvasKit.SkCanvas.prototype.writePixels = function() {};
464
Kevin Lubickddd0a332018-12-12 10:35:13 -0500465CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
466
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400467// Define StrokeOpts object
468var StrokeOpts = {};
469StrokeOpts.prototype.width;
470StrokeOpts.prototype.miter_limit;
471StrokeOpts.prototype.cap;
472StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500473StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400474
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500475// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500476var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500477HTMLCanvas.prototype.decodeImage = function() {};
478HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500479HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500480HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500481HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500482HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500483
484var CanvasRenderingContext2D = {};
485CanvasRenderingContext2D.prototype.addHitRegion = function() {};
486CanvasRenderingContext2D.prototype.arc = function() {};
487CanvasRenderingContext2D.prototype.arcTo = function() {};
488CanvasRenderingContext2D.prototype.beginPath = function() {};
489CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
490CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500491CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500492CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500493CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500494CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500495CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500496CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500497CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500498CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500499CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500500CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500501CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500502CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500503CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500504CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500505CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500506CanvasRenderingContext2D.prototype.isPointInPath = function() {};
507CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500508CanvasRenderingContext2D.prototype.lineTo = function() {};
509CanvasRenderingContext2D.prototype.measureText = function() {};
510CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500511CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500512CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
513CanvasRenderingContext2D.prototype.rect = function() {};
514CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
515CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500516CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500517CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500518CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500519CanvasRenderingContext2D.prototype.scale = function() {};
520CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500521CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500522CanvasRenderingContext2D.prototype.setTransform = function() {};
523CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500524CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500525CanvasRenderingContext2D.prototype.strokeText = function() {};
526CanvasRenderingContext2D.prototype.transform = function() {};
527CanvasRenderingContext2D.prototype.translate = function() {};
528
Kevin Lubicka40f8322018-12-17 16:01:36 -0500529var Path2D = {};
530Path2D.prototype.addPath = function() {};
531Path2D.prototype.arc = function() {};
532Path2D.prototype.arcTo = function() {};
533Path2D.prototype.bezierCurveTo = function() {};
534Path2D.prototype.closePath = function() {};
535Path2D.prototype.ellipse = function() {};
536Path2D.prototype.lineTo = function() {};
537Path2D.prototype.moveTo = function() {};
538Path2D.prototype.quadraticCurveTo = function() {};
539Path2D.prototype.rect = function() {};
540
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500541var LinearCanvasGradient = {};
542LinearCanvasGradient.prototype.addColorStop = function() {};
543var RadialCanvasGradient = {};
544RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500545var CanvasPattern = {};
546CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500547
Kevin Lubick52b9f372018-12-04 13:57:36 -0500548var ImageData = {
549 /**
550 * @type {Uint8ClampedArray}
551 */
552 data: {},
553 height: {},
554 width: {},
555};
556
Kevin Lubickd29edd72018-12-07 08:29:52 -0500557var DOMMatrix = {
558 a: {},
559 b: {},
560 c: {},
561 d: {},
562 e: {},
563 f: {},
564};
565
Kevin Lubick217056c2018-09-20 17:39:31 -0400566// 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 -0500567function loadWebAssemblyModule() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500568
569var DOMMatrix = {};