blob: 19ac563f8b4c1c4618d9235cbfb571b5402284ba [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 = {
Kevin Lubick39284662020-02-20 10:29:55 -050026 // public API (i.e. things we declare in the pre-js file or in the cpp bindings)
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 Lubick7d644e12019-09-11 14:22:22 -040032 /** @return {CanvasKit.SkRRect} */
33 RRectXY: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -050034 /** @return {ImageData} */
35 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050036
37 GetWebGLContext: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050038 MakeBlurMaskFilter: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040039 MakeCanvas: function() {},
40 MakeCanvasSurface: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050041 MakeGrContext: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -040042 /** @return {CanvasKit.SkAnimatedImage} */
43 MakeAnimatedImageFromEncoded: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050044 /** @return {CanvasKit.SkImage} */
Kevin Lubickeda0b432019-12-02 08:26:48 -050045 MakeImage: function() {},
46 /** @return {CanvasKit.SkImage} */
Kevin Lubick0a1293c2018-12-03 12:31:04 -050047 MakeImageFromEncoded: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050048 /** @return {LinearCanvasGradient} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040049 MakeLinearGradientShader: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050050 MakeOnScreenGLSurface: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050051 MakePathFromCmds: function() {},
Kevin Lubicka40f8322018-12-17 16:01:36 -050052 MakePathFromOp: function() {},
53 MakePathFromSVGString: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050054 MakeRadialGradientShader: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050055 MakeRenderTarget: function() {},
Kevin Lubicka4f218d2020-01-14 08:39:09 -050056 MakeSkPicture: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050057 MakeSWCanvasSurface: function() {},
Kevin Lubickf5ea37f2019-02-28 10:06:18 -050058 MakeManagedAnimation: function() {},
Brian Osman2a490bc2019-11-27 13:36:40 -050059 MakeParticles: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040060 MakeSkDashPathEffect: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040061 MakeSkVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040062 MakeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050063 /** @return {RadialCanvasGradient} */
64 MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050065 MakeWebGLCanvasSurface: function() {},
Kevin Lubicke25df6c2019-10-22 09:04:32 -040066 /** @return {TypedArray} */
67 Malloc: function() {},
Kevin Lubick50f377e2019-09-11 15:23:00 -040068 /** @return {TonalColors} */
69 computeTonalColors: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040070 currentContext: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -050071 getColorComponents: function() {},
Florin Malita0d603d82019-11-25 13:45:28 -050072 getDecodeCacheLimitBytes: function() {},
73 getDecodeCacheUsageBytes: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050074 getSkDataBytes: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -050075 multiplyByAlpha: function() {},
Kevin Lubick39284662020-02-20 10:29:55 -050076 parseColorString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040077 setCurrentContext: function() {},
Florin Malita0d603d82019-11-25 13:45:28 -050078 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040079
80 // private API (i.e. things declared in the bindings that we use
81 // in the pre-js file)
Kevin Lubick52b9f372018-12-04 13:57:36 -050082 _MakeImage: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040083 _MakeLinearGradientShader: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -050084 _MakePathFromCmds: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040085 _MakeRadialGradientShader: function() {},
Kevin Lubickf5ea37f2019-02-28 10:06:18 -050086 _MakeManagedAnimation: function() {},
Brian Osman2a490bc2019-11-27 13:36:40 -050087 _MakeParticles: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -040088 _MakeSkDashPathEffect: function() {},
Kevin Lubicka4f218d2020-01-14 08:39:09 -050089 _MakeSkPicture: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -040090 _MakeSkVertices: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -050091 _MakeTwoPointConicalGradientShader: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -040092 _decodeAnimatedImage: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -050093 _decodeImage: function() {},
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -050094 _drawShapedText: function() {},
Kevin Lubickea905ec2018-11-30 14:05:58 -050095 _getRasterDirectSurface: function() {},
Kevin Lubick134be1d2018-10-30 15:05:04 -040096 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040097
Kevin Lubick1a05fce2018-11-20 12:51:16 -050098 // The testing object is meant to expose internal functions
99 // for more fine-grained testing, e.g. parseColor
100 _testing: {},
101
Kevin Lubick217056c2018-09-20 17:39:31 -0400102 // Objects and properties on CanvasKit
103
Kevin Lubickcd544662019-03-22 15:41:36 -0400104 GrContext: {
105 // public API (from C++ bindings)
106 getResourceCacheLimitBytes: function() {},
107 getResourceCacheUsageBytes: function() {},
Kevin Lubick92797982020-02-24 10:00:20 -0500108 releaseResourcesAndAbandonContext: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400109 setResourceCacheLimitBytes: function() {},
110 },
111
Kevin Lubick369f6a52019-10-03 11:22:08 -0400112 Paragraph: {
113 // public API (from C++ bindings)
Kevin Lubick04912672019-11-15 14:48:55 -0500114 didExceedMaxLines: function() {},
115 getAlphabeticBaseline: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400116 getGlyphPositionAtCoordinate: function() {},
Kevin Lubick04912672019-11-15 14:48:55 -0500117 getHeight: function() {},
118 getIdeographicBaseline: function() {},
119 getLongestLine: function() {},
120 getMaxIntrinsicWidth: function() {},
121 getMaxWidth: function() {},
122 getMinIntrinsicWidth: function() {},
123 getWordBoundary: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400124 layout: function() {},
125
126 // private API
127 /** @return {Float32Array} */
128 _getRectsForRange: function() {},
129 },
130
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500131 SkRuntimeEffect: {
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500132 // public API (from C++ bindings)
Brian Osman93de1622019-12-26 08:43:05 -0500133 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500134
135 // private API
Brian Osman93de1622019-12-26 08:43:05 -0500136 _makeShader: function() {},
Kevin Lubickecd87622020-02-22 07:37:33 -0500137 _makeShaderWithChildren: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500138 },
139
Kevin Lubick369f6a52019-10-03 11:22:08 -0400140 ParagraphStyle: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400141 RSXFormBuilder: function() {},
Kevin Lubickee91c072019-03-29 10:39:52 -0400142 SkColorBuilder: function() {},
143 SkRectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400144
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500145 ShapedText: {
146 // public API (from C++ bindings)
147 getBounds: function() {},
148 },
149
Kevin Lubick6b921b72019-09-18 16:18:17 -0400150 SkAnimatedImage: {
151 // public API (from C++ bindings)
Kevin Lubick6b921b72019-09-18 16:18:17 -0400152 decodeNextFrame: function() {},
Kevin Lubick47bd9f12019-11-08 06:55:15 -0800153 getFrameCount: function() {},
154 getRepetitionCount: function() {},
155 height: function() {},
156 reset: function() {},
157 width: function() {},
Kevin Lubick6b921b72019-09-18 16:18:17 -0400158 },
159
Kevin Lubick006a6f32018-10-19 14:34:34 -0400160 SkCanvas: {
161 // public API (from C++ bindings)
162 clear: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500163 clipPath: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400164 clipRRect: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500165 clipRect: function() {},
166 concat: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400167 drawAnimatedImage: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500168 drawArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400169 drawCircle: function() {},
Kevin Lubick6dbc4ed2019-10-22 09:43:34 -0400170 drawColor: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400171 drawDRRect: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500172 drawImage: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500173 drawImageNine: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500174 drawImageRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500175 drawLine: function() {},
176 drawOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400177 drawPaint: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400178 drawParagraph: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400179 drawPath: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400180 drawPicture: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400181 drawRRect: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500182 drawRect: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500183 drawRoundRect: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500184 drawShadow: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500185 drawText: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500186 drawTextBlob: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500187 drawVertices: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400188 flush: function() {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400189 getSaveCount: function() {},
Kevin Lubick5d5723c2018-12-07 10:09:11 -0500190 getTotalMatrix: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500191 makeSurface: function() {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500192 restore: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500193 restoreToCount: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400194 rotate: function() {},
195 save: function() {},
Kevin Lubickb3574c92019-03-06 08:25:36 -0500196 saveLayer: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400197 scale: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400198 skew: function() {},
199 translate: function() {},
200
201 // private API
Kevin Lubickee91c072019-03-29 10:39:52 -0400202 _drawAtlas: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500203 _drawPoints: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500204 _drawSimpleText: function() {},
Kevin Lubick52b9f372018-12-04 13:57:36 -0500205 _readPixels: function() {},
206 _writePixels: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400207 delete: function() {},
208 },
209
Kevin Lubickd3729342019-09-12 11:11:25 -0400210 SkColorFilter: {
211 // public API (from C++ bindings and JS interface)
212 MakeBlend: function() {},
213 MakeCompose: function() {},
214 MakeLerp: function() {},
215 MakeLinearToSRGBGamma: function() {},
216 MakeMatrix: function() {},
217 MakeSRGBToLinearGamma: function() {},
218 // private API (from C++ bindings)
219 _makeMatrix: function() {},
220 },
221
222 SkColorMatrix: {
223 concat: function() {},
224 identity: function() {},
225 postTranslate: function() {},
226 rotated: function() {},
227 scaled: function() {},
228 },
229
Kevin Lubicke59c1672019-11-20 14:17:53 -0500230 SkContourMeasureIter: {
231 next: function() {},
232 },
233
234 SkContourMeasure: {
235 getPosTan: function() {},
236 getSegment: function() {},
237 isClosed: function() {},
238 length: function() {},
239 },
240
Kevin Lubick35ac0382019-01-02 15:13:57 -0500241 SkFont: {
242 // public API (from C++ bindings)
243 getScaleX: function() {},
244 getSize: function() {},
245 getSkewX: function() {},
246 getTypeface: function() {},
247 measureText: function() {},
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500248 setHinting: function() {},
249 setLinearMetrics: function() {},
Kevin Lubick35ac0382019-01-02 15:13:57 -0500250 setScaleX: function() {},
251 setSize: function() {},
252 setSkewX: function() {},
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500253 setSubpixel: function() {},
Kevin Lubick35ac0382019-01-02 15:13:57 -0500254 setTypeface: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400255 // private API (from C++ bindings)
256 _getWidths: function() {},
Kevin Lubick35ac0382019-01-02 15:13:57 -0500257 },
258
Kevin Lubickddd0a332018-12-12 10:35:13 -0500259 SkFontMgr: {
Kevin Lubick61887c72019-09-26 13:20:50 -0400260 // public API (from C++ and JS bindings)
261 FromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500262 RefDefault: function() {},
263 countFamilies: function() {},
Kevin Lubick486aecf2020-01-15 13:49:53 -0500264 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500265
266 // private API
267 _makeTypefaceFromData: function() {},
Kevin Lubick61887c72019-09-26 13:20:50 -0400268 _fromData: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500269 },
270
Kevin Lubick006a6f32018-10-19 14:34:34 -0400271 SkImage: {
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500272 // public API (from C++ bindings)
273 height: function() {},
274 width: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300275 // private API
276 _encodeToData: function() {},
277 _encodeToDataWithFormat: function() {},
Kevin Lubicka064c282019-04-04 09:28:53 -0400278 _makeShader: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400279 },
280
Kevin Lubick15b40232019-10-29 09:55:39 -0400281 SkImageFilter: {
282 MakeBlur: function() {},
283 MakeColorFilter: function() {},
284 MakeCompose: function() {},
Kevin Lubickd2677192019-11-15 14:13:20 -0500285 MakeMatrixTransform: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400286 },
287
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500288 // These are defined in interface.js
289 SkM44: {
290 identity: function() {},
291 invert: function() {},
292 multiply: function() {},
293 rotatedUnitSinCos: function() {},
294 rotated: function() {},
295 scaled: function() {},
296 translated: function() {},
297 lookat: function() {},
298 perspective: function() {},
299 rc: function() {},
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500300 transpose: function() {},
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500301 },
302
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500303 SkMatrix: {
Kevin Lubickb9db3902018-11-26 11:47:54 -0500304 identity: function() {},
Kevin Lubickf3555182019-03-14 10:55:10 -0400305 invert: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500306 mapPoints: function() {},
307 multiply: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500308 rotated: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500309 scaled: function() {},
310 skewed: function() {},
311 translated: function() {},
312 },
313
Kevin Lubick15b40232019-10-29 09:55:39 -0400314 SkMaskFilter: {
315 MakeBlur: function() {},
316 },
317
Kevin Lubickb9db3902018-11-26 11:47:54 -0500318 SkPaint: {
319 // public API (from C++ bindings)
320 /** @return {CanvasKit.SkPaint} */
321 copy: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500322 getBlendMode: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500323 getColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500324 getFilterQuality: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500325 getStrokeCap: function() {},
326 getStrokeJoin: function() {},
327 getStrokeMiter: function() {},
328 getStrokeWidth: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500329 setAntiAlias: function() {},
Kevin Lubick12c0e502018-11-28 12:51:56 -0500330 setBlendMode: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500331 setColor: function() {},
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500332 setFilterQuality: function() {},
Kevin Lubick15b40232019-10-29 09:55:39 -0400333 setImageFilter: function() {},
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500334 setMaskFilter: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500335 setPathEffect: function() {},
336 setShader: function() {},
337 setStrokeCap: function() {},
338 setStrokeJoin: function() {},
339 setStrokeMiter: function() {},
340 setStrokeWidth: function() {},
341 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500342
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500343 // Private API
Kevin Lubickb9db3902018-11-26 11:47:54 -0500344 delete: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500345 },
346
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500347 SkParticleEffect: {
348 // public API (from C++ bindings)
349 draw: function() {},
350 getEffectUniform: function() {},
351 getEffectUniformCount: function() {},
352 getEffectUniformFloatCount: function() {},
353 getEffectUniformName: function() {},
354 getParticleUniformCount: function() {},
355 getParticleUniformFloatCount: function() {},
356 getParticleUniformName: function() {},
357 getParticleUniform: function() {},
358 setPosition: function() {},
359 setRate: function() {},
360 start: function() {},
361 update: function() {},
362
363 // private API (from C++ bindings)
364 _effectUniformPtr: function() {},
365 _particleUniformPtr: function() {},
366 },
367
Kevin Lubick006a6f32018-10-19 14:34:34 -0400368 SkPath: {
369 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500370 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500371 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500372 /** @return {CanvasKit.SkPath} */
373 copy: function() {},
374 countPoints: function() {},
375 equals: function() {},
376 getBounds: function() {},
377 getFillType: function() {},
378 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500379 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500380 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500381 reset: function() {},
382 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500383 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500384 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500385 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400386
387 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500388 _addArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400389 _addOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400390 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500391 _addRect: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500392 _addPoly: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500393 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300394 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400395 _arcTo: function() {},
396 _close: function() {},
397 _conicTo: function() {},
398 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400399 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400400 _lineTo: function() {},
401 _moveTo: function() {},
402 _op: function() {},
403 _quadTo: function() {},
Kevin Lubick79b71342019-11-01 14:36:52 -0400404 _rArcTo: function() {},
405 _rConicTo: function() {},
406 _rCubicTo: function() {},
407 _rLineTo: function() {},
408 _rMoveTo: function() {},
409 _rQuadTo: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400410 _rect: function() {},
411 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400412 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400413 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400414 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400415 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500416 dump: function() {},
417 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400418 },
419
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400420 SkPathMeasure: {
421 getLength: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500422 getSegment: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400423 getPosTan: function() {},
424 isClosed: function() {},
425 nextContour: function() {},
426 },
427
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400428 SkPicture: {
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500429 serialize: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400430 },
431
432 SkPictureRecorder: {
433 beginRecording: function() {},
434 finishRecordingAsPicture: function() {},
435 },
436
Kevin Lubick006a6f32018-10-19 14:34:34 -0400437 SkRect: {
438 fLeft: {},
439 fTop: {},
440 fRight: {},
441 fBottom: {},
442 },
443
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400444 SkRRect: {
445 rect: {},
Kevin Lubick7d644e12019-09-11 14:22:22 -0400446 rx1: {},
447 ry1: {},
448 rx2: {},
449 ry2: {},
450 rx3: {},
451 ry3: {},
452 rx4: {},
453 ry4: {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400454 },
455
Kevin Lubick62836902019-12-09 09:04:26 -0500456 SkShader: {
457 Blend: function() {},
458 Color: function() {},
459 Empty: function() {},
460 Lerp: function() {},
461
462 _Blend: function() {},
463 _Lerp: function() {},
464 },
465
Kevin Lubick006a6f32018-10-19 14:34:34 -0400466 SkSurface: {
467 // public API (from C++ bindings)
468 /** @return {CanvasKit.SkCanvas} */
469 getCanvas: function() {},
470 /** @return {CanvasKit.SkImage} */
471 makeImageSnapshot: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500472 makeSurface: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400473 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400474
475 // private API
476 _flush: function() {},
477 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400478 delete: function() {},
479 },
480
Kevin Lubickec4903d2019-01-14 08:36:08 -0500481 SkTextBlob: {
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400482 // public API (both C++ and JS bindings)
483 MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500484 MakeFromText: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400485 MakeOnPath: function() {},
486 // private API (from C++ bindings)
487 _MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500488 _MakeFromText: function() {},
489 },
490
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500491 // These are defined in interface.js
492 SkVector: {
493 add: function() {},
494 sub: function() {},
495 dot: function() {},
496 cross: function() {},
497 normalize: function() {},
498 mulScalar: function() {},
499 length: function() {},
500 lengthSquared: function() {},
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500501 dist: function() {},
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500502 },
503
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400504 SkVertices: {
505 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500506 bounds: function() {},
507 mode: function() {},
508 uniqueID: function() {},
509 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400510
511 // private API
512 /** @return {CanvasKit.SkVertices} */
513 _applyBones: function() {},
514 },
515
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400516 _SkVerticesBuilder: {
517 // public API (from C++ bindings)
518 boneIndices: function() {},
519 boneWeights: function() {},
520 colors: function() {},
521 detach: function() {},
522 indices: function() {},
523 positions: function() {},
524 texCoords: function() {},
525 },
526
Kevin Lubick369f6a52019-10-03 11:22:08 -0400527 TextStyle: function() {},
528
Kevin Lubick006a6f32018-10-19 14:34:34 -0400529 // Constants and Enums
530 gpu: {},
531 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400532
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500533 TRANSPARENT: {},
534 RED: {},
535 BLUE: {},
536 YELLOW: {},
537 CYAN: {},
538 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500539 WHITE: {},
540
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500541 MOVE_VERB: {},
542 LINE_VERB: {},
543 QUAD_VERB: {},
544 CONIC_VERB: {},
545 CUBIC_VERB: {},
546 CLOSE_VERB: {},
547
Kevin Lubick369f6a52019-10-03 11:22:08 -0400548 NoDecoration: {},
549 UnderlineDecoration: {},
550 OverlineDecoration: {},
551 LineThroughDecoration: {},
552
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400553 SaveLayerInitWithPrevious: {},
554 SaveLayerF16ColorType: {},
555
Kevin Lubick369f6a52019-10-03 11:22:08 -0400556 Affinity: {
557 Upstream: {},
558 Downstream: {},
559 },
560
Kevin Lubickea905ec2018-11-30 14:05:58 -0500561 AlphaType: {
562 Opaque: {},
563 Premul: {},
564 Unpremul: {},
565 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500566
567 BlendMode: {
568 Clear: {},
569 Src: {},
570 Dst: {},
571 SrcOver: {},
572 DstOver: {},
573 SrcIn: {},
574 DstIn: {},
575 SrcOut: {},
576 DstOut: {},
577 SrcATop: {},
578 DstATop: {},
579 Xor: {},
580 Plus: {},
581 Modulate: {},
582 Screen: {},
583 Overlay: {},
584 Darken: {},
585 Lighten: {},
586 ColorDodge: {},
587 ColorBurn: {},
588 HardLight: {},
589 SoftLight: {},
590 Difference: {},
591 Exclusion: {},
592 Multiply: {},
593 Hue: {},
594 Saturation: {},
595 Color: {},
596 Luminosity: {},
597 },
598
599 BlurStyle: {
600 Normal: {},
601 Solid: {},
602 Outer: {},
603 Inner: {},
604 },
605
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500606 ClipOp: {
607 Difference: {},
608 Intersect: {},
609 },
610
Kevin Lubickea905ec2018-11-30 14:05:58 -0500611 ColorType: {
612 Alpha_8: {},
613 RGB_565: {},
614 ARGB_4444: {},
615 RGBA_8888: {},
616 RGB_888x: {},
617 BGRA_8888: {},
618 RGBA_1010102: {},
619 RGB_101010x: {},
620 Gray_8: {},
621 RGBA_F16: {},
622 RGBA_F32: {},
623 },
624
Kevin Lubick006a6f32018-10-19 14:34:34 -0400625 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500626 Winding: {},
627 EvenOdd: {},
628 InverseWinding: {},
629 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400630 },
631
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500632 FilterQuality: {
633 None: {},
634 Low: {},
635 Medium: {},
636 High: {},
637 },
638
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400639 FontSlant: {
640 Upright: {},
641 Italic: {},
642 Oblique: {},
643 },
644
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500645 FontHinting: {
646 None: {},
647 Slight: {},
648 Normal: {},
649 Full: {},
650 },
651
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400652 FontWeight: {
653 Invisible: {},
654 Thin: {},
655 ExtraLight: {},
656 Light: {},
657 Normal: {},
658 Medium: {},
659 SemiBold: {},
660 Bold: {},
661 ExtraBold: {},
662 Black: {},
663 ExtraBlack: {},
664 },
665
666 FontWidth: {
667 UltraCondensed: {},
668 ExtraCondensed: {},
669 Condensed: {},
670 SemiCondensed: {},
671 Normal: {},
672 SemiExpanded: {},
673 Expanded: {},
674 ExtraExpanded: {},
675 UltraExpanded: {},
676 },
677
Alexander Khovansky3e119332018-11-15 02:01:19 +0300678 ImageFormat: {
679 PNG: {},
680 JPEG: {},
681 },
682
Kevin Lubickb9db3902018-11-26 11:47:54 -0500683 PaintStyle: {
684 Fill: {},
685 Stroke: {},
686 StrokeAndFill: {},
687 },
688
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500689 PathOp: {
690 Difference: {},
691 Intersect: {},
692 Union: {},
693 XOR: {},
694 ReverseDifference: {},
695 },
696
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500697 PointMode: {
698 Points: {},
699 Lines: {},
700 Polygon: {},
701 },
702
Kevin Lubick369f6a52019-10-03 11:22:08 -0400703 RectHeightStyle: {
704 Tight: {},
705 Max: {},
Kevin Lubick4a5f4f22019-11-20 08:27:10 -0500706 IncludeLineSpacingMiddle: {},
707 IncludeLineSpacingTop: {},
708 IncludeLineSpacingBottom: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400709 },
710
711 RectWidthStyle: {
712 Tight: {},
713 Max: {},
714 },
715
Kevin Lubickb9db3902018-11-26 11:47:54 -0500716 StrokeCap: {
717 Butt: {},
718 Round: {},
719 Square: {},
720 },
721
722 StrokeJoin: {
723 Miter: {},
724 Round: {},
725 Bevel: {},
726 },
727
Kevin Lubick369f6a52019-10-03 11:22:08 -0400728 TextAlign: {
729 Left: {},
730 Right: {},
731 Center: {},
732 Justify: {},
733 Start: {},
734 End: {},
735 },
736
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400737 TextDirection: {
738 LTR: {},
739 RTL: {},
740 },
741
Kevin Lubickec4903d2019-01-14 08:36:08 -0500742 TextEncoding: {
743 UTF8: {},
744 UTF16: {},
745 UTF32: {},
746 GlyphID: {},
747 },
748
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500749 TileMode: {
750 Clamp: {},
751 Repeat: {},
752 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500753 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500754 },
755
756 VertexMode: {
757 Triangles: {},
758 TrianglesStrip: {},
759 TriangleFan: {},
760 },
761
Kevin Lubick006a6f32018-10-19 14:34:34 -0400762 // Things Enscriptem adds for us
763
Kevin Lubick53965c92018-10-11 08:51:55 -0400764 /**
765 * @type {Float32Array}
766 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400767 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400768 /**
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400769 * @type {Float64Array}
770 */
771 HEAPF64: {},
772 /**
Kevin Lubick53965c92018-10-11 08:51:55 -0400773 * @type {Uint8Array}
774 */
775 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400776 /**
777 * @type {Uint16Array}
778 */
779 HEAPU16: {},
780 /**
Kevin Lubickf5ea37f2019-02-28 10:06:18 -0500781 * @type {Uint32Array}
782 */
783 HEAPU32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400784 /**
785 * @type {Int8Array}
786 */
787 HEAP8: {},
788 /**
789 * @type {Int16Array}
790 */
791 HEAP16: {},
792 /**
793 * @type {Int32Array}
794 */
795 HEAP32: {},
796
Kevin Lubick006a6f32018-10-19 14:34:34 -0400797 _malloc: function() {},
798 _free: function() {},
799 onRuntimeInitialized: function() {},
800};
Kevin Lubick217056c2018-09-20 17:39:31 -0400801
Kevin Lubick006a6f32018-10-19 14:34:34 -0400802// Public API things that are newly declared in the JS should go here.
803// It's not enough to declare them above, because closure can still erase them
804// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400805CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
806
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500807CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400808CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400809CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500810CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500811CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500812CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300813CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400814CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400815CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400816CanvasKit.SkPath.prototype.conicTo = function() {};
817CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400818CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400819CanvasKit.SkPath.prototype.lineTo = function() {};
820CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400821CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400822CanvasKit.SkPath.prototype.op = function() {};
823CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400824CanvasKit.SkPath.prototype.rArcTo = function() {};
825CanvasKit.SkPath.prototype.rConicTo = function() {};
826CanvasKit.SkPath.prototype.rCubicTo = function() {};
827CanvasKit.SkPath.prototype.rLineTo = function() {};
828CanvasKit.SkPath.prototype.rMoveTo = function() {};
829CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400830CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400831CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400832CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400833CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400834CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400835
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500836CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400837
Kevin Lubick5b90b842018-10-17 07:57:18 -0400838CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400839CanvasKit.SkSurface.prototype.flush = function() {};
840CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800841CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400842CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400843
Kevin Lubick12c0e502018-11-28 12:51:56 -0500844/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400845CanvasKit.SkVertices.prototype.applyBones = function() {};
846
Alexander Khovansky3e119332018-11-15 02:01:19 +0300847CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400848CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300849
Kevin Lubickee91c072019-03-29 10:39:52 -0400850CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500851CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500852CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500853/** @return {Uint8Array} */
854CanvasKit.SkCanvas.prototype.readPixels = function() {};
855CanvasKit.SkCanvas.prototype.writePixels = function() {};
856
Kevin Lubickddd0a332018-12-12 10:35:13 -0500857CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
858
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400859CanvasKit.SkFont.prototype.getWidths = function() {};
860
861CanvasKit.RSXFormBuilder.prototype.build = function() {};
862CanvasKit.RSXFormBuilder.prototype.delete = function() {};
863CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400864CanvasKit.RSXFormBuilder.prototype.set = function() {};
865
866CanvasKit.SkColorBuilder.prototype.build = function() {};
867CanvasKit.SkColorBuilder.prototype.delete = function() {};
868CanvasKit.SkColorBuilder.prototype.push = function() {};
869CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400870
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500871CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500872CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500873
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500874CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
875CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
876
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400877// Define StrokeOpts object
878var StrokeOpts = {};
879StrokeOpts.prototype.width;
880StrokeOpts.prototype.miter_limit;
881StrokeOpts.prototype.cap;
882StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500883StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400884
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500885// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500886var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500887HTMLCanvas.prototype.decodeImage = function() {};
888HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500889HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500890HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500891HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500892HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500893
894var CanvasRenderingContext2D = {};
895CanvasRenderingContext2D.prototype.addHitRegion = function() {};
896CanvasRenderingContext2D.prototype.arc = function() {};
897CanvasRenderingContext2D.prototype.arcTo = function() {};
898CanvasRenderingContext2D.prototype.beginPath = function() {};
899CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
900CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500901CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500902CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500903CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500904CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500905CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500906CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500907CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500908CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500909CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500910CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500911CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500912CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500913CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500914CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500915CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500916CanvasRenderingContext2D.prototype.isPointInPath = function() {};
917CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500918CanvasRenderingContext2D.prototype.lineTo = function() {};
919CanvasRenderingContext2D.prototype.measureText = function() {};
920CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500921CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500922CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
923CanvasRenderingContext2D.prototype.rect = function() {};
924CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
925CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500926CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500927CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500928CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500929CanvasRenderingContext2D.prototype.scale = function() {};
930CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500931CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500932CanvasRenderingContext2D.prototype.setTransform = function() {};
933CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500934CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500935CanvasRenderingContext2D.prototype.strokeText = function() {};
936CanvasRenderingContext2D.prototype.transform = function() {};
937CanvasRenderingContext2D.prototype.translate = function() {};
938
Kevin Lubicka40f8322018-12-17 16:01:36 -0500939var Path2D = {};
940Path2D.prototype.addPath = function() {};
941Path2D.prototype.arc = function() {};
942Path2D.prototype.arcTo = function() {};
943Path2D.prototype.bezierCurveTo = function() {};
944Path2D.prototype.closePath = function() {};
945Path2D.prototype.ellipse = function() {};
946Path2D.prototype.lineTo = function() {};
947Path2D.prototype.moveTo = function() {};
948Path2D.prototype.quadraticCurveTo = function() {};
949Path2D.prototype.rect = function() {};
950
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500951var LinearCanvasGradient = {};
952LinearCanvasGradient.prototype.addColorStop = function() {};
953var RadialCanvasGradient = {};
954RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500955var CanvasPattern = {};
956CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500957
Kevin Lubick52b9f372018-12-04 13:57:36 -0500958var ImageData = {
959 /**
960 * @type {Uint8ClampedArray}
961 */
962 data: {},
963 height: {},
964 width: {},
965};
966
Kevin Lubickd29edd72018-12-07 08:29:52 -0500967var DOMMatrix = {
968 a: {},
969 b: {},
970 c: {},
971 d: {},
972 e: {},
973 f: {},
974};
975
Kevin Lubick217056c2018-09-20 17:39:31 -0400976// 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 -0500977function loadWebAssemblyModule() {};