blob: 81a3778a7072c37146c50c56bd9841aa5a384efe [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 = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
27 Color: function() {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -040028 Color4f: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -040029 ColorAsInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050030 /** @return {CanvasKit.SkRect} */
31 LTRBRect: function() {},
32 /** @return {CanvasKit.SkRect} */
33 XYWHRect: function() {},
34 /** @return {CanvasKit.SkRRect} */
35 RRectXY: function() {},
36 /** @return {ImageData} */
37 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050038
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050039 GetWebGLContext: function() {},
40 MakeBlurMaskFilter: function() {},
41 MakeCanvas: function() {},
42 MakeCanvasSurface: function() {},
43 MakeGrContext: function() {},
44 /** @return {CanvasKit.SkAnimatedImage} */
45 MakeAnimatedImageFromEncoded: function() {},
46 /** @return {CanvasKit.SkImage} */
47 MakeImage: function() {},
48 /** @return {CanvasKit.SkImage} */
49 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060050 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050051 MakeOnScreenGLSurface: function() {},
52 MakePathFromCmds: function() {},
53 MakePathFromOp: function() {},
54 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050055 MakeRenderTarget: function() {},
56 MakeSkPicture: function() {},
57 MakeSWCanvasSurface: function() {},
58 MakeManagedAnimation: function() {},
59 MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 MakeSkVertices: function() {},
61 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 MakeWebGLCanvasSurface: function() {},
63 /** @return {TypedArray} */
64 Malloc: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040065 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050066 computeTonalColors: function() {},
67 currentContext: function() {},
68 getColorComponents: function() {},
69 getDecodeCacheLimitBytes: function() {},
70 getDecodeCacheUsageBytes: function() {},
71 getSkDataBytes: function() {},
72 multiplyByAlpha: function() {},
73 parseColorString: function() {},
74 setCurrentContext: function() {},
75 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040076
Kevin Lubicke70af512020-05-14 14:50:54 -040077 // Defined by emscripten.
78 createContext:function() {},
79
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 // private API (i.e. things declared in the bindings that we use
81 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040082 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050083 _MakeImage: function() {},
84 _MakeLinearGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050085 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070086 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050087 _MakeManagedAnimation: function() {},
88 _MakeParticles: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050089 _MakeSkPicture: function() {},
90 _MakeSkVertices: function() {},
91 _MakeTwoPointConicalGradientShader: function() {},
92 _decodeAnimatedImage: function() {},
93 _decodeImage: function() {},
94 _drawShapedText: function() {},
95 _getRasterDirectSurface: function() {},
96 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040097
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050098 // The testing object is meant to expose internal functions
99 // for more fine-grained testing, e.g. parseColor
100 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500101
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500102 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400103
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500104 GrContext: {
105 // public API (from C++ bindings)
106 getResourceCacheLimitBytes: function() {},
107 getResourceCacheUsageBytes: function() {},
108 releaseResourcesAndAbandonContext: function() {},
109 setResourceCacheLimitBytes: function() {},
110 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400111
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400112 ManagedAnimation: {
113 prototype: {
114 setColor: function() {},
115 },
116 },
117
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500118 Paragraph: {
119 // public API (from C++ bindings)
120 didExceedMaxLines: function() {},
121 getAlphabeticBaseline: function() {},
122 getGlyphPositionAtCoordinate: function() {},
123 getHeight: function() {},
124 getIdeographicBaseline: function() {},
125 getLongestLine: function() {},
126 getMaxIntrinsicWidth: function() {},
127 getMaxWidth: function() {},
128 getMinIntrinsicWidth: function() {},
129 getWordBoundary: function() {},
130 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400131
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500132 // private API
133 /** @return {Float32Array} */
134 _getRectsForRange: function() {},
135 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400136
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400137 ParagraphBuilder: {
138 Make: function() {},
139 addText: function() {},
140 build: function() {},
141 pop: function() {},
142
143 prototype: {
144 pushStyle: function() {},
145 },
146
147 // private API
148 _Make: function() {},
149 _pushStyle: function() {},
150 },
151
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500152 SkRuntimeEffect: {
153 // public API (from C++ bindings)
154 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500155
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500156 // private API
157 _makeShader: function() {},
158 _makeShaderWithChildren: function() {},
159 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500160
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500161 ParagraphStyle: function() {},
162 RSXFormBuilder: function() {},
163 SkColorBuilder: function() {},
164 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400165
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500166 ShapedText: {
167 // public API (from C++ bindings)
168 getBounds: function() {},
169 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500170
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500171 SkAnimatedImage: {
172 // public API (from C++ bindings)
173 decodeNextFrame: function() {},
174 getFrameCount: function() {},
175 getRepetitionCount: function() {},
176 height: function() {},
177 reset: function() {},
178 width: function() {},
179 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400180
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500181 SkCanvas: {
182 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500183 clipPath: function() {},
184 clipRRect: function() {},
185 clipRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500186 drawAnimatedImage: function() {},
187 drawArc: function() {},
188 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400189 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500190 drawDRRect: function() {},
191 drawImage: function() {},
192 drawImageNine: function() {},
193 drawImageRect: function() {},
194 drawLine: function() {},
195 drawOval: function() {},
196 drawPaint: function() {},
197 drawParagraph: function() {},
198 drawPath: function() {},
199 drawPicture: function() {},
200 drawRRect: function() {},
201 drawRect: function() {},
202 drawRoundRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawText: function() {},
204 drawTextBlob: function() {},
205 drawVertices: function() {},
206 flush: function() {},
207 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400209 markCTM: function() {},
210 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500211 restore: function() {},
212 restoreToCount: function() {},
213 rotate: function() {},
214 save: function() {},
Kevin Lubick7957d532020-03-16 18:08:32 +0000215 saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500216 scale: function() {},
217 skew: function() {},
218 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400219
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400220 prototype: {
221 clear: function() {},
222 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400223 drawColorComponents: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400224 drawShadow: function() {},
225 },
226
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500227 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400228 _clear: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400229 _concat: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500230 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400231 _drawColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500232 _drawPoints: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400233 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500234 _drawSimpleText: function() {},
Kevin Lubickc1d08982020-04-06 13:52:15 -0400235 _getLocalToCamera: function() {},
236 _getLocalToDevice: function() {},
237 _getLocalToWorld: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400238 _getTotalMatrix: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400239 _findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500240 _readPixels: function() {},
241 _writePixels: function() {},
242 delete: function() {},
243 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400244
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500245 SkColorFilter: {
246 // public API (from C++ bindings and JS interface)
247 MakeBlend: function() {},
248 MakeCompose: function() {},
249 MakeLerp: function() {},
250 MakeLinearToSRGBGamma: function() {},
251 MakeMatrix: function() {},
252 MakeSRGBToLinearGamma: function() {},
253 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400254 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500255 _makeMatrix: function() {},
256 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400257
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500258 SkColorMatrix: {
259 concat: function() {},
260 identity: function() {},
261 postTranslate: function() {},
262 rotated: function() {},
263 scaled: function() {},
264 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400265
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400266 SkColorSpace: {
267 Equals: function() {},
268 SRGB: {},
269 DISPLAY_P3: {},
270 ADOBE_RGB: {},
271 // private API (from C++ bindings)
272 _MakeSRGB: function() {},
273 _MakeDisplayP3: function() {},
274 _MakeAdobeRGB: function() {},
275 },
276
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500277 SkContourMeasureIter: {
278 next: function() {},
279 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500280
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500281 SkContourMeasure: {
282 getPosTan: function() {},
283 getSegment: function() {},
284 isClosed: function() {},
285 length: function() {},
286 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500287
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500288 SkFont: {
289 // public API (from C++ bindings)
290 getScaleX: function() {},
291 getSize: function() {},
292 getSkewX: function() {},
293 getTypeface: function() {},
294 measureText: function() {},
295 setHinting: function() {},
296 setLinearMetrics: function() {},
297 setScaleX: function() {},
298 setSize: function() {},
299 setSkewX: function() {},
300 setSubpixel: function() {},
301 setTypeface: function() {},
302 // private API (from C++ bindings)
303 _getWidths: function() {},
304 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500305
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500306 SkFontMgr: {
307 // public API (from C++ and JS bindings)
308 FromData: function() {},
309 RefDefault: function() {},
310 countFamilies: function() {},
311 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500312
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500313 // private API
314 _makeTypefaceFromData: function() {},
315 _fromData: function() {},
316 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500317
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500318 SkImage: {
319 // public API (from C++ bindings)
320 height: function() {},
321 width: function() {},
322 // private API
323 _encodeToData: function() {},
324 _encodeToDataWithFormat: function() {},
325 _makeShader: function() {},
326 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400327
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500328 SkImageFilter: {
329 MakeBlur: function() {},
330 MakeColorFilter: function() {},
331 MakeCompose: function() {},
332 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400333
334 // private API
335 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500336 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400337
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500338 // These are defined in interface.js
339 SkM44: {
340 identity: function() {},
341 invert: function() {},
342 multiply: function() {},
343 rotatedUnitSinCos: function() {},
344 rotated: function() {},
345 scaled: function() {},
346 translated: function() {},
347 lookat: function() {},
348 perspective: function() {},
349 rc: function() {},
350 transpose: function() {},
351 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500352
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500353 SkMatrix: {
354 identity: function() {},
355 invert: function() {},
356 mapPoints: function() {},
357 multiply: function() {},
358 rotated: function() {},
359 scaled: function() {},
360 skewed: function() {},
361 translated: function() {},
362 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500363
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500364 SkMaskFilter: {
365 MakeBlur: function() {},
366 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400367
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500368 SkPaint: {
369 // public API (from C++ bindings)
370 /** @return {CanvasKit.SkPaint} */
371 copy: function() {},
372 getBlendMode: function() {},
373 getColor: function() {},
374 getFilterQuality: function() {},
375 getStrokeCap: function() {},
376 getStrokeJoin: function() {},
377 getStrokeMiter: function() {},
378 getStrokeWidth: function() {},
379 setAntiAlias: function() {},
380 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400381 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500382 setFilterQuality: function() {},
383 setImageFilter: function() {},
384 setMaskFilter: function() {},
385 setPathEffect: function() {},
386 setShader: function() {},
387 setStrokeCap: function() {},
388 setStrokeJoin: function() {},
389 setStrokeMiter: function() {},
390 setStrokeWidth: function() {},
391 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500392
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400393 prototype: {
394 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400395 setColorComponents: function() {},
396 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400397 },
398
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500399 // Private API
400 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400401 _getColor: function() {},
402 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500403 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500404
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500405 SkPathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400406 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400408 MakeDiscrete: function() {},
409
410 // Private C++ API
411 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500412 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500413
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500414 SkParticleEffect: {
415 // public API (from C++ bindings)
416 draw: function() {},
417 getEffectUniform: function() {},
418 getEffectUniformCount: function() {},
419 getEffectUniformFloatCount: function() {},
420 getEffectUniformName: function() {},
421 getParticleUniformCount: function() {},
422 getParticleUniformFloatCount: function() {},
423 getParticleUniformName: function() {},
424 getParticleUniform: function() {},
425 setPosition: function() {},
426 setRate: function() {},
427 start: function() {},
428 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500429
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500430 // private API (from C++ bindings)
431 _effectUniformPtr: function() {},
432 _particleUniformPtr: function() {},
433 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500434
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500435 SkPath: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400436 // public API (from C++ and JS bindings)
437 MakeFromCmds: function() {},
438 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500439 computeTightBounds: function() {},
440 contains: function() {},
441 /** @return {CanvasKit.SkPath} */
442 copy: function() {},
443 countPoints: function() {},
444 equals: function() {},
445 getBounds: function() {},
446 getFillType: function() {},
447 getPoint: function() {},
448 isEmpty: function() {},
449 isVolatile: function() {},
450 reset: function() {},
451 rewind: function() {},
452 setFillType: function() {},
453 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400454 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500455 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400456
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500457 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400458 _MakeFromCmds: function() {},
459 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500460 _addArc: function() {},
461 _addOval: function() {},
462 _addPath: function() {},
463 _addRect: function() {},
464 _addPoly: function() {},
465 _addRoundRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400466 _addVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500467 _arc: function() {},
468 _arcTo: function() {},
469 _close: function() {},
470 _conicTo: function() {},
471 _cubicTo: function() {},
472 _dash: function() {},
473 _lineTo: function() {},
474 _moveTo: function() {},
475 _op: function() {},
476 _quadTo: function() {},
477 _rArcTo: function() {},
478 _rConicTo: function() {},
479 _rCubicTo: function() {},
480 _rLineTo: function() {},
481 _rMoveTo: function() {},
482 _rQuadTo: function() {},
483 _rect: function() {},
484 _simplify: function() {},
485 _stroke: function() {},
486 _transform: function() {},
487 _trim: function() {},
488 delete: function() {},
489 dump: function() {},
490 dumpHex: function() {},
491 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400492
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500493 SkPathMeasure: {
494 getLength: function() {},
495 getSegment: function() {},
496 getPosTan: function() {},
497 isClosed: function() {},
498 nextContour: function() {},
499 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400500
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500501 SkPicture: {
502 serialize: function() {},
503 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400504
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500505 SkPictureRecorder: {
506 beginRecording: function() {},
507 finishRecordingAsPicture: function() {},
508 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400509
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500510 SkRect: {
511 fLeft: {},
512 fTop: {},
513 fRight: {},
514 fBottom: {},
515 },
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400516
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500517 SkRRect: {
518 rect: {},
519 rx1: {},
520 ry1: {},
521 rx2: {},
522 ry2: {},
523 rx3: {},
524 ry3: {},
525 rx4: {},
526 ry4: {},
527 },
Kevin Lubick62836902019-12-09 09:04:26 -0500528
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500529 SkShader: {
530 Blend: function() {},
531 Color: function() {},
532 Empty: function() {},
533 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400534 MakeLinearGradient: function() {},
535 MakeRadialGradient: function() {},
536 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700537 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400538
539 // private API (from C++ bindings)
540 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500541 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400542
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500543 SkSurface: {
544 // public API (from C++ bindings)
545 /** @return {CanvasKit.SkCanvas} */
546 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400547 imageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 /** @return {CanvasKit.SkImage} */
549 makeImageSnapshot: function() {},
550 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600551 sampleCnt: function() {},
Nathaniel Nifongce1648f2020-05-11 08:24:16 -0400552 reportBackendType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500553 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400554
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500555 // private API
556 _flush: function() {},
557 _getRasterN32PremulSurface: function() {},
558 delete: function() {},
559 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500560
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500561 SkTextBlob: {
562 // public API (both C++ and JS bindings)
563 MakeFromRSXform: function() {},
564 MakeFromText: function() {},
565 MakeOnPath: function() {},
566 // private API (from C++ bindings)
567 _MakeFromRSXform: function() {},
568 _MakeFromText: function() {},
569 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500570
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500571 // These are defined in interface.js
572 SkVector: {
573 add: function() {},
574 sub: function() {},
575 dot: function() {},
576 cross: function() {},
577 normalize: function() {},
578 mulScalar: function() {},
579 length: function() {},
580 lengthSquared: function() {},
581 dist: function() {},
582 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400583
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500584 SkVertices: {
585 // public API (from C++ bindings)
586 bounds: function() {},
587 mode: function() {},
588 uniqueID: function() {},
589 vertexCount: function() {},
590 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400591
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500592 _SkVerticesBuilder: {
593 colors: function() {},
594 detach: function() {},
595 indices: function() {},
596 positions: function() {},
597 texCoords: function() {},
598 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400599
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500600 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400601
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500602 // Constants and Enums
603 gpu: {},
604 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400605
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500606 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400607 BLACK: {},
608 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400610 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500611 BLUE: {},
612 YELLOW: {},
613 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400614 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500615
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500616 MOVE_VERB: {},
617 LINE_VERB: {},
618 QUAD_VERB: {},
619 CONIC_VERB: {},
620 CUBIC_VERB: {},
621 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500622
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500623 NoDecoration: {},
624 UnderlineDecoration: {},
625 OverlineDecoration: {},
626 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400627
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500628 SaveLayerInitWithPrevious: {},
629 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400630
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 Affinity: {
632 Upstream: {},
633 Downstream: {},
634 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400635
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 AlphaType: {
637 Opaque: {},
638 Premul: {},
639 Unpremul: {},
640 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500641
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500642 BlendMode: {
643 Clear: {},
644 Src: {},
645 Dst: {},
646 SrcOver: {},
647 DstOver: {},
648 SrcIn: {},
649 DstIn: {},
650 SrcOut: {},
651 DstOut: {},
652 SrcATop: {},
653 DstATop: {},
654 Xor: {},
655 Plus: {},
656 Modulate: {},
657 Screen: {},
658 Overlay: {},
659 Darken: {},
660 Lighten: {},
661 ColorDodge: {},
662 ColorBurn: {},
663 HardLight: {},
664 SoftLight: {},
665 Difference: {},
666 Exclusion: {},
667 Multiply: {},
668 Hue: {},
669 Saturation: {},
670 Color: {},
671 Luminosity: {},
672 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500673
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500674 BlurStyle: {
675 Normal: {},
676 Solid: {},
677 Outer: {},
678 Inner: {},
679 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500680
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500681 ClipOp: {
682 Difference: {},
683 Intersect: {},
684 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500685
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500686 ColorType: {
687 Alpha_8: {},
688 RGB_565: {},
689 ARGB_4444: {},
690 RGBA_8888: {},
691 RGB_888x: {},
692 BGRA_8888: {},
693 RGBA_1010102: {},
694 RGB_101010x: {},
695 Gray_8: {},
696 RGBA_F16: {},
697 RGBA_F32: {},
698 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 FillType: {
701 Winding: {},
702 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500703 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400704
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 FilterQuality: {
706 None: {},
707 Low: {},
708 Medium: {},
709 High: {},
710 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500711
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500712 FontSlant: {
713 Upright: {},
714 Italic: {},
715 Oblique: {},
716 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 FontHinting: {
719 None: {},
720 Slight: {},
721 Normal: {},
722 Full: {},
723 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 FontWeight: {
726 Invisible: {},
727 Thin: {},
728 ExtraLight: {},
729 Light: {},
730 Normal: {},
731 Medium: {},
732 SemiBold: {},
733 Bold: {},
734 ExtraBold: {},
735 Black: {},
736 ExtraBlack: {},
737 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400738
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500739 FontWidth: {
740 UltraCondensed: {},
741 ExtraCondensed: {},
742 Condensed: {},
743 SemiCondensed: {},
744 Normal: {},
745 SemiExpanded: {},
746 Expanded: {},
747 ExtraExpanded: {},
748 UltraExpanded: {},
749 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400750
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500751 ImageFormat: {
752 PNG: {},
753 JPEG: {},
754 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300755
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500756 PaintStyle: {
757 Fill: {},
758 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500759 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500760
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500761 PathOp: {
762 Difference: {},
763 Intersect: {},
764 Union: {},
765 XOR: {},
766 ReverseDifference: {},
767 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500768
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500769 PointMode: {
770 Points: {},
771 Lines: {},
772 Polygon: {},
773 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500774
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500775 RectHeightStyle: {
776 Tight: {},
777 Max: {},
778 IncludeLineSpacingMiddle: {},
779 IncludeLineSpacingTop: {},
780 IncludeLineSpacingBottom: {},
781 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400782
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500783 RectWidthStyle: {
784 Tight: {},
785 Max: {},
786 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 StrokeCap: {
789 Butt: {},
790 Round: {},
791 Square: {},
792 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500793
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500794 StrokeJoin: {
795 Miter: {},
796 Round: {},
797 Bevel: {},
798 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500799
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500800 TextAlign: {
801 Left: {},
802 Right: {},
803 Center: {},
804 Justify: {},
805 Start: {},
806 End: {},
807 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400808
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500809 TextDirection: {
810 LTR: {},
811 RTL: {},
812 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400813
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 TileMode: {
815 Clamp: {},
816 Repeat: {},
817 Mirror: {},
818 Decal: {},
819 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500820
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500821 VertexMode: {
822 Triangles: {},
823 TrianglesStrip: {},
824 TriangleFan: {},
825 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500826
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500827 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400828
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500829 /**
830 * @type {Float32Array}
831 */
832 HEAPF32: {},
833 /**
834 * @type {Float64Array}
835 */
836 HEAPF64: {},
837 /**
838 * @type {Uint8Array}
839 */
840 HEAPU8: {},
841 /**
842 * @type {Uint16Array}
843 */
844 HEAPU16: {},
845 /**
846 * @type {Uint32Array}
847 */
848 HEAPU32: {},
849 /**
850 * @type {Int8Array}
851 */
852 HEAP8: {},
853 /**
854 * @type {Int16Array}
855 */
856 HEAP16: {},
857 /**
858 * @type {Int32Array}
859 */
860 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400861
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500862 _malloc: function() {},
863 _free: function() {},
864 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400865};
Kevin Lubick217056c2018-09-20 17:39:31 -0400866
Kevin Lubick006a6f32018-10-19 14:34:34 -0400867// Public API things that are newly declared in the JS should go here.
868// It's not enough to declare them above, because closure can still erase them
869// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400870CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
871
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500872CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400873CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400874CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500875CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500876CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500877CanvasKit.SkPath.prototype.addRoundRect = function() {};
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400878CanvasKit.SkPath.prototype.addVerbsPointsWeights = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300879CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400880CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400881CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400882CanvasKit.SkPath.prototype.conicTo = function() {};
883CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400884CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400885CanvasKit.SkPath.prototype.lineTo = function() {};
886CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400887CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400888CanvasKit.SkPath.prototype.op = function() {};
889CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400890CanvasKit.SkPath.prototype.rArcTo = function() {};
891CanvasKit.SkPath.prototype.rConicTo = function() {};
892CanvasKit.SkPath.prototype.rCubicTo = function() {};
893CanvasKit.SkPath.prototype.rLineTo = function() {};
894CanvasKit.SkPath.prototype.rMoveTo = function() {};
895CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400896CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400897CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400898CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400899CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400900CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400901
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500902CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400903
Kevin Lubick5b90b842018-10-17 07:57:18 -0400904CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400905CanvasKit.SkSurface.prototype.flush = function() {};
906CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800907CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400908CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400909
Alexander Khovansky3e119332018-11-15 02:01:19 +0300910CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400911CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300912
Kevin Lubick6bffe392020-04-02 15:24:15 -0400913CanvasKit.SkCanvas.prototype.concat = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400914CanvasKit.SkCanvas.prototype.concat44 = function() {}; // deprecated
Kevin Lubickee91c072019-03-29 10:39:52 -0400915CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500916CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500917CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubickc1d08982020-04-06 13:52:15 -0400918CanvasKit.SkCanvas.prototype.getLocalToCamera = function() {};
919CanvasKit.SkCanvas.prototype.getLocalToDevice = function() {};
920CanvasKit.SkCanvas.prototype.getLocalToWorld = function() {};
Kevin Lubick6bffe392020-04-02 15:24:15 -0400921CanvasKit.SkCanvas.prototype.getTotalMatrix = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500922/** @return {Uint8Array} */
923CanvasKit.SkCanvas.prototype.readPixels = function() {};
924CanvasKit.SkCanvas.prototype.writePixels = function() {};
925
Kevin Lubickddd0a332018-12-12 10:35:13 -0500926CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
927
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400928CanvasKit.SkFont.prototype.getWidths = function() {};
929
930CanvasKit.RSXFormBuilder.prototype.build = function() {};
931CanvasKit.RSXFormBuilder.prototype.delete = function() {};
932CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400933CanvasKit.RSXFormBuilder.prototype.set = function() {};
934
935CanvasKit.SkColorBuilder.prototype.build = function() {};
936CanvasKit.SkColorBuilder.prototype.delete = function() {};
937CanvasKit.SkColorBuilder.prototype.push = function() {};
938CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400939
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500940CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500941CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500942
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500943CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
944CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
945
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400946// Define StrokeOpts object
947var StrokeOpts = {};
948StrokeOpts.prototype.width;
949StrokeOpts.prototype.miter_limit;
950StrokeOpts.prototype.cap;
951StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500952StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400953
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500954// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500955var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500956HTMLCanvas.prototype.decodeImage = function() {};
957HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500958HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500959HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500960HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500961HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500962
Elliot Evans28796192020-06-15 12:53:27 -0600963var ImageBitmapRenderingContext = {};
964ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
965
Kevin Lubickb9db3902018-11-26 11:47:54 -0500966var CanvasRenderingContext2D = {};
967CanvasRenderingContext2D.prototype.addHitRegion = function() {};
968CanvasRenderingContext2D.prototype.arc = function() {};
969CanvasRenderingContext2D.prototype.arcTo = function() {};
970CanvasRenderingContext2D.prototype.beginPath = function() {};
971CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
972CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500973CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500974CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500975CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500976CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500977CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500978CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500979CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500980CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500981CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500982CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500983CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500984CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500985CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500986CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500987CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500988CanvasRenderingContext2D.prototype.isPointInPath = function() {};
989CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500990CanvasRenderingContext2D.prototype.lineTo = function() {};
991CanvasRenderingContext2D.prototype.measureText = function() {};
992CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500993CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500994CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
995CanvasRenderingContext2D.prototype.rect = function() {};
996CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
997CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500998CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500999CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001000CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001001CanvasRenderingContext2D.prototype.scale = function() {};
1002CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001003CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001004CanvasRenderingContext2D.prototype.setTransform = function() {};
1005CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001006CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001007CanvasRenderingContext2D.prototype.strokeText = function() {};
1008CanvasRenderingContext2D.prototype.transform = function() {};
1009CanvasRenderingContext2D.prototype.translate = function() {};
1010
Kevin Lubicka40f8322018-12-17 16:01:36 -05001011var Path2D = {};
1012Path2D.prototype.addPath = function() {};
1013Path2D.prototype.arc = function() {};
1014Path2D.prototype.arcTo = function() {};
1015Path2D.prototype.bezierCurveTo = function() {};
1016Path2D.prototype.closePath = function() {};
1017Path2D.prototype.ellipse = function() {};
1018Path2D.prototype.lineTo = function() {};
1019Path2D.prototype.moveTo = function() {};
1020Path2D.prototype.quadraticCurveTo = function() {};
1021Path2D.prototype.rect = function() {};
1022
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001023var LinearCanvasGradient = {};
1024LinearCanvasGradient.prototype.addColorStop = function() {};
1025var RadialCanvasGradient = {};
1026RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001027var CanvasPattern = {};
1028CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001029
Kevin Lubick52b9f372018-12-04 13:57:36 -05001030var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001031 /**
1032 * @type {Uint8ClampedArray}
1033 */
1034 data: {},
1035 height: {},
1036 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001037};
1038
Kevin Lubickd29edd72018-12-07 08:29:52 -05001039var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001040 a: {},
1041 b: {},
1042 c: {},
1043 d: {},
1044 e: {},
1045 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001046};
1047
Kevin Lubick217056c2018-09-20 17:39:31 -04001048// 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 -05001049function loadWebAssemblyModule() {};