blob: 4be2d7dce08f45c793c7085294ab53f4b00dbaa0 [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
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500347 SkPathEffect: {
348 MakeDash: function() {},
349 },
350
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500351 SkParticleEffect: {
352 // public API (from C++ bindings)
353 draw: function() {},
354 getEffectUniform: function() {},
355 getEffectUniformCount: function() {},
356 getEffectUniformFloatCount: function() {},
357 getEffectUniformName: function() {},
358 getParticleUniformCount: function() {},
359 getParticleUniformFloatCount: function() {},
360 getParticleUniformName: function() {},
361 getParticleUniform: function() {},
362 setPosition: function() {},
363 setRate: function() {},
364 start: function() {},
365 update: function() {},
366
367 // private API (from C++ bindings)
368 _effectUniformPtr: function() {},
369 _particleUniformPtr: function() {},
370 },
371
Kevin Lubick006a6f32018-10-19 14:34:34 -0400372 SkPath: {
373 // public API (from C++ bindings)
Kevin Lubickb9db3902018-11-26 11:47:54 -0500374 computeTightBounds: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500375 contains: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500376 /** @return {CanvasKit.SkPath} */
377 copy: function() {},
378 countPoints: function() {},
379 equals: function() {},
380 getBounds: function() {},
381 getFillType: function() {},
382 getPoint: function() {},
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500383 isEmpty: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500384 isVolatile: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500385 reset: function() {},
386 rewind: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500387 setFillType: function() {},
Kevin Lubick2b79d1c2018-12-14 16:10:38 -0500388 setIsVolatile: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500389 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400390
391 // private API
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500392 _addArc: function() {},
Kevin Lubicke384df42019-08-26 15:48:09 -0400393 _addOval: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400394 _addPath: function() {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500395 _addRect: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500396 _addPoly: function() {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500397 _addRoundRect: function() {},
Alexander Khovansky3e119332018-11-15 02:01:19 +0300398 _arc: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400399 _arcTo: function() {},
400 _close: function() {},
401 _conicTo: function() {},
402 _cubicTo: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400403 _dash: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400404 _lineTo: function() {},
405 _moveTo: function() {},
406 _op: function() {},
407 _quadTo: function() {},
Kevin Lubick79b71342019-11-01 14:36:52 -0400408 _rArcTo: function() {},
409 _rConicTo: function() {},
410 _rCubicTo: function() {},
411 _rLineTo: function() {},
412 _rMoveTo: function() {},
413 _rQuadTo: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400414 _rect: function() {},
415 _simplify: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400416 _stroke: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400417 _transform: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400418 _trim: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400419 delete: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500420 dump: function() {},
421 dumpHex: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400422 },
423
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400424 SkPathMeasure: {
425 getLength: function() {},
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500426 getSegment: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400427 getPosTan: function() {},
428 isClosed: function() {},
429 nextContour: function() {},
430 },
431
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400432 SkPicture: {
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500433 serialize: function() {},
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400434 },
435
436 SkPictureRecorder: {
437 beginRecording: function() {},
438 finishRecordingAsPicture: function() {},
439 },
440
Kevin Lubick006a6f32018-10-19 14:34:34 -0400441 SkRect: {
442 fLeft: {},
443 fTop: {},
444 fRight: {},
445 fBottom: {},
446 },
447
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400448 SkRRect: {
449 rect: {},
Kevin Lubick7d644e12019-09-11 14:22:22 -0400450 rx1: {},
451 ry1: {},
452 rx2: {},
453 ry2: {},
454 rx3: {},
455 ry3: {},
456 rx4: {},
457 ry4: {},
Kevin Lubick2e5fe352019-09-03 12:59:06 -0400458 },
459
Kevin Lubick62836902019-12-09 09:04:26 -0500460 SkShader: {
461 Blend: function() {},
462 Color: function() {},
463 Empty: function() {},
464 Lerp: function() {},
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500465 MakeTwoPointConicalGradient: function() {},
466 MakeLinearGradient: function() {},
467 MakeRadialGradient: function() {},
Kevin Lubick62836902019-12-09 09:04:26 -0500468
469 _Blend: function() {},
470 _Lerp: function() {},
471 },
472
Kevin Lubick006a6f32018-10-19 14:34:34 -0400473 SkSurface: {
474 // public API (from C++ bindings)
475 /** @return {CanvasKit.SkCanvas} */
476 getCanvas: function() {},
477 /** @return {CanvasKit.SkImage} */
478 makeImageSnapshot: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -0500479 makeSurface: function() {},
Kevin Lubickcd544662019-03-22 15:41:36 -0400480 grContext: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400481
482 // private API
483 _flush: function() {},
484 _getRasterN32PremulSurface: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400485 delete: function() {},
486 },
487
Kevin Lubickec4903d2019-01-14 08:36:08 -0500488 SkTextBlob: {
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400489 // public API (both C++ and JS bindings)
490 MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500491 MakeFromText: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400492 MakeOnPath: function() {},
493 // private API (from C++ bindings)
494 _MakeFromRSXform: function() {},
Kevin Lubickec4903d2019-01-14 08:36:08 -0500495 _MakeFromText: function() {},
496 },
497
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500498 // These are defined in interface.js
499 SkVector: {
500 add: function() {},
501 sub: function() {},
502 dot: function() {},
503 cross: function() {},
504 normalize: function() {},
505 mulScalar: function() {},
506 length: function() {},
507 lengthSquared: function() {},
Nathaniel Nifongcc5415a2020-02-23 14:26:33 -0500508 dist: function() {},
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500509 },
510
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400511 SkVertices: {
512 // public API (from C++ bindings)
Kevin Lubick12c0e502018-11-28 12:51:56 -0500513 bounds: function() {},
514 mode: function() {},
515 uniqueID: function() {},
516 vertexCount: function() {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400517
518 // private API
519 /** @return {CanvasKit.SkVertices} */
520 _applyBones: function() {},
521 },
522
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400523 _SkVerticesBuilder: {
524 // public API (from C++ bindings)
525 boneIndices: function() {},
526 boneWeights: function() {},
527 colors: function() {},
528 detach: function() {},
529 indices: function() {},
530 positions: function() {},
531 texCoords: function() {},
532 },
533
Kevin Lubick369f6a52019-10-03 11:22:08 -0400534 TextStyle: function() {},
535
Kevin Lubick006a6f32018-10-19 14:34:34 -0400536 // Constants and Enums
537 gpu: {},
538 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400539
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500540 TRANSPARENT: {},
541 RED: {},
542 BLUE: {},
543 YELLOW: {},
544 CYAN: {},
545 BLACK: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500546 WHITE: {},
547
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500548 MOVE_VERB: {},
549 LINE_VERB: {},
550 QUAD_VERB: {},
551 CONIC_VERB: {},
552 CUBIC_VERB: {},
553 CLOSE_VERB: {},
554
Kevin Lubick369f6a52019-10-03 11:22:08 -0400555 NoDecoration: {},
556 UnderlineDecoration: {},
557 OverlineDecoration: {},
558 LineThroughDecoration: {},
559
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400560 SaveLayerInitWithPrevious: {},
561 SaveLayerF16ColorType: {},
562
Kevin Lubick369f6a52019-10-03 11:22:08 -0400563 Affinity: {
564 Upstream: {},
565 Downstream: {},
566 },
567
Kevin Lubickea905ec2018-11-30 14:05:58 -0500568 AlphaType: {
569 Opaque: {},
570 Premul: {},
571 Unpremul: {},
572 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500573
574 BlendMode: {
575 Clear: {},
576 Src: {},
577 Dst: {},
578 SrcOver: {},
579 DstOver: {},
580 SrcIn: {},
581 DstIn: {},
582 SrcOut: {},
583 DstOut: {},
584 SrcATop: {},
585 DstATop: {},
586 Xor: {},
587 Plus: {},
588 Modulate: {},
589 Screen: {},
590 Overlay: {},
591 Darken: {},
592 Lighten: {},
593 ColorDodge: {},
594 ColorBurn: {},
595 HardLight: {},
596 SoftLight: {},
597 Difference: {},
598 Exclusion: {},
599 Multiply: {},
600 Hue: {},
601 Saturation: {},
602 Color: {},
603 Luminosity: {},
604 },
605
606 BlurStyle: {
607 Normal: {},
608 Solid: {},
609 Outer: {},
610 Inner: {},
611 },
612
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500613 ClipOp: {
614 Difference: {},
615 Intersect: {},
616 },
617
Kevin Lubickea905ec2018-11-30 14:05:58 -0500618 ColorType: {
619 Alpha_8: {},
620 RGB_565: {},
621 ARGB_4444: {},
622 RGBA_8888: {},
623 RGB_888x: {},
624 BGRA_8888: {},
625 RGBA_1010102: {},
626 RGB_101010x: {},
627 Gray_8: {},
628 RGBA_F16: {},
629 RGBA_F32: {},
630 },
631
Kevin Lubick006a6f32018-10-19 14:34:34 -0400632 FillType: {
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500633 Winding: {},
634 EvenOdd: {},
635 InverseWinding: {},
636 InverseEvenOdd: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400637 },
638
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500639 FilterQuality: {
640 None: {},
641 Low: {},
642 Medium: {},
643 High: {},
644 },
645
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400646 FontSlant: {
647 Upright: {},
648 Italic: {},
649 Oblique: {},
650 },
651
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500652 FontHinting: {
653 None: {},
654 Slight: {},
655 Normal: {},
656 Full: {},
657 },
658
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400659 FontWeight: {
660 Invisible: {},
661 Thin: {},
662 ExtraLight: {},
663 Light: {},
664 Normal: {},
665 Medium: {},
666 SemiBold: {},
667 Bold: {},
668 ExtraBold: {},
669 Black: {},
670 ExtraBlack: {},
671 },
672
673 FontWidth: {
674 UltraCondensed: {},
675 ExtraCondensed: {},
676 Condensed: {},
677 SemiCondensed: {},
678 Normal: {},
679 SemiExpanded: {},
680 Expanded: {},
681 ExtraExpanded: {},
682 UltraExpanded: {},
683 },
684
Alexander Khovansky3e119332018-11-15 02:01:19 +0300685 ImageFormat: {
686 PNG: {},
687 JPEG: {},
688 },
689
Kevin Lubickb9db3902018-11-26 11:47:54 -0500690 PaintStyle: {
691 Fill: {},
692 Stroke: {},
693 StrokeAndFill: {},
694 },
695
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500696 PathOp: {
697 Difference: {},
698 Intersect: {},
699 Union: {},
700 XOR: {},
701 ReverseDifference: {},
702 },
703
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500704 PointMode: {
705 Points: {},
706 Lines: {},
707 Polygon: {},
708 },
709
Kevin Lubick369f6a52019-10-03 11:22:08 -0400710 RectHeightStyle: {
711 Tight: {},
712 Max: {},
Kevin Lubick4a5f4f22019-11-20 08:27:10 -0500713 IncludeLineSpacingMiddle: {},
714 IncludeLineSpacingTop: {},
715 IncludeLineSpacingBottom: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400716 },
717
718 RectWidthStyle: {
719 Tight: {},
720 Max: {},
721 },
722
Kevin Lubickb9db3902018-11-26 11:47:54 -0500723 StrokeCap: {
724 Butt: {},
725 Round: {},
726 Square: {},
727 },
728
729 StrokeJoin: {
730 Miter: {},
731 Round: {},
732 Bevel: {},
733 },
734
Kevin Lubick369f6a52019-10-03 11:22:08 -0400735 TextAlign: {
736 Left: {},
737 Right: {},
738 Center: {},
739 Justify: {},
740 Start: {},
741 End: {},
742 },
743
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400744 TextDirection: {
745 LTR: {},
746 RTL: {},
747 },
748
Kevin Lubickec4903d2019-01-14 08:36:08 -0500749 TextEncoding: {
750 UTF8: {},
751 UTF16: {},
752 UTF32: {},
753 GlyphID: {},
754 },
755
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500756 TileMode: {
757 Clamp: {},
758 Repeat: {},
759 Mirror: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -0500760 Decal: {},
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500761 },
762
763 VertexMode: {
764 Triangles: {},
765 TrianglesStrip: {},
766 TriangleFan: {},
767 },
768
Kevin Lubick006a6f32018-10-19 14:34:34 -0400769 // Things Enscriptem adds for us
770
Kevin Lubick53965c92018-10-11 08:51:55 -0400771 /**
772 * @type {Float32Array}
773 */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400774 HEAPF32: {},
Kevin Lubick53965c92018-10-11 08:51:55 -0400775 /**
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400776 * @type {Float64Array}
777 */
778 HEAPF64: {},
779 /**
Kevin Lubick53965c92018-10-11 08:51:55 -0400780 * @type {Uint8Array}
781 */
782 HEAPU8: {},
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400783 /**
784 * @type {Uint16Array}
785 */
786 HEAPU16: {},
787 /**
Kevin Lubickf5ea37f2019-02-28 10:06:18 -0500788 * @type {Uint32Array}
789 */
790 HEAPU32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400791 /**
792 * @type {Int8Array}
793 */
794 HEAP8: {},
795 /**
796 * @type {Int16Array}
797 */
798 HEAP16: {},
799 /**
800 * @type {Int32Array}
801 */
802 HEAP32: {},
803
Kevin Lubick006a6f32018-10-19 14:34:34 -0400804 _malloc: function() {},
805 _free: function() {},
806 onRuntimeInitialized: function() {},
807};
Kevin Lubick217056c2018-09-20 17:39:31 -0400808
Kevin Lubick006a6f32018-10-19 14:34:34 -0400809// Public API things that are newly declared in the JS should go here.
810// It's not enough to declare them above, because closure can still erase them
811// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400812CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
813
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500814CanvasKit.SkPath.prototype.addArc = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400815CanvasKit.SkPath.prototype.addOval = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400816CanvasKit.SkPath.prototype.addPath = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500817CanvasKit.SkPath.prototype.addPoly = function() {};
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500818CanvasKit.SkPath.prototype.addRect = function() {};
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500819CanvasKit.SkPath.prototype.addRoundRect = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300820CanvasKit.SkPath.prototype.arc = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400821CanvasKit.SkPath.prototype.arcTo = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400822CanvasKit.SkPath.prototype.close = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400823CanvasKit.SkPath.prototype.conicTo = function() {};
824CanvasKit.SkPath.prototype.cubicTo = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400825CanvasKit.SkPath.prototype.dash = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400826CanvasKit.SkPath.prototype.lineTo = function() {};
827CanvasKit.SkPath.prototype.moveTo = function() {};
Kevin Lubicke384df42019-08-26 15:48:09 -0400828CanvasKit.SkPath.prototype.offset = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400829CanvasKit.SkPath.prototype.op = function() {};
830CanvasKit.SkPath.prototype.quadTo = function() {};
Kevin Lubick79b71342019-11-01 14:36:52 -0400831CanvasKit.SkPath.prototype.rArcTo = function() {};
832CanvasKit.SkPath.prototype.rConicTo = function() {};
833CanvasKit.SkPath.prototype.rCubicTo = function() {};
834CanvasKit.SkPath.prototype.rLineTo = function() {};
835CanvasKit.SkPath.prototype.rMoveTo = function() {};
836CanvasKit.SkPath.prototype.rQuadTo = function() {};
Kevin Lubick006a6f32018-10-19 14:34:34 -0400837CanvasKit.SkPath.prototype.rect = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400838CanvasKit.SkPath.prototype.simplify = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400839CanvasKit.SkPath.prototype.stroke = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400840CanvasKit.SkPath.prototype.transform = function() {};
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400841CanvasKit.SkPath.prototype.trim = function() {};
Kevin Lubick217056c2018-09-20 17:39:31 -0400842
Kevin Lubicka4f218d2020-01-14 08:39:09 -0500843CanvasKit.SkPicture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400844
Kevin Lubick5b90b842018-10-17 07:57:18 -0400845CanvasKit.SkSurface.prototype.dispose = function() {};
Kevin Lubick359a7e32019-03-19 09:34:37 -0400846CanvasKit.SkSurface.prototype.flush = function() {};
847CanvasKit.SkSurface.prototype.requestAnimationFrame = function() {};
Bryce Thomas2c5b8562020-01-22 13:49:41 -0800848CanvasKit.SkSurface.prototype.drawOnce = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400849CanvasKit.SkSurface.prototype.captureFrameAsSkPicture = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400850
Kevin Lubick12c0e502018-11-28 12:51:56 -0500851/** @return {CanvasKit.SkVertices} */
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400852CanvasKit.SkVertices.prototype.applyBones = function() {};
853
Alexander Khovansky3e119332018-11-15 02:01:19 +0300854CanvasKit.SkImage.prototype.encodeToData = function() {};
Kevin Lubicka064c282019-04-04 09:28:53 -0400855CanvasKit.SkImage.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300856
Kevin Lubickee91c072019-03-29 10:39:52 -0400857CanvasKit.SkCanvas.prototype.drawAtlas = function() {};
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500858CanvasKit.SkCanvas.prototype.drawPoints = function() {};
Kevin Lubickec4903d2019-01-14 08:36:08 -0500859CanvasKit.SkCanvas.prototype.drawText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500860/** @return {Uint8Array} */
861CanvasKit.SkCanvas.prototype.readPixels = function() {};
862CanvasKit.SkCanvas.prototype.writePixels = function() {};
863
Kevin Lubickddd0a332018-12-12 10:35:13 -0500864CanvasKit.SkFontMgr.prototype.MakeTypefaceFromData = function() {};
865
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400866CanvasKit.SkFont.prototype.getWidths = function() {};
867
868CanvasKit.RSXFormBuilder.prototype.build = function() {};
869CanvasKit.RSXFormBuilder.prototype.delete = function() {};
870CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -0400871CanvasKit.RSXFormBuilder.prototype.set = function() {};
872
873CanvasKit.SkColorBuilder.prototype.build = function() {};
874CanvasKit.SkColorBuilder.prototype.delete = function() {};
875CanvasKit.SkColorBuilder.prototype.push = function() {};
876CanvasKit.SkColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400877
Kevin Lubickf3d6c362020-01-06 08:11:52 -0500878CanvasKit.SkRuntimeEffect.prototype.makeShader = function() {};
Kevin Lubickecd87622020-02-22 07:37:33 -0500879CanvasKit.SkRuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500880
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500881CanvasKit.SkParticleEffect.prototype.effectUniforms = function() {};
882CanvasKit.SkParticleEffect.prototype.particleUniforms = function() {};
883
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400884// Define StrokeOpts object
885var StrokeOpts = {};
886StrokeOpts.prototype.width;
887StrokeOpts.prototype.miter_limit;
888StrokeOpts.prototype.cap;
889StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500890StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400891
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500892// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -0500893var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500894HTMLCanvas.prototype.decodeImage = function() {};
895HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500896HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -0500897HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -0500898HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500899HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500900
901var CanvasRenderingContext2D = {};
902CanvasRenderingContext2D.prototype.addHitRegion = function() {};
903CanvasRenderingContext2D.prototype.arc = function() {};
904CanvasRenderingContext2D.prototype.arcTo = function() {};
905CanvasRenderingContext2D.prototype.beginPath = function() {};
906CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
907CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500908CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500909CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500910CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500911CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500912CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500913CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500914CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500915CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500916CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500917CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500918CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500919CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500920CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500921CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500922CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -0500923CanvasRenderingContext2D.prototype.isPointInPath = function() {};
924CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500925CanvasRenderingContext2D.prototype.lineTo = function() {};
926CanvasRenderingContext2D.prototype.measureText = function() {};
927CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -0500928CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500929CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
930CanvasRenderingContext2D.prototype.rect = function() {};
931CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
932CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500933CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500934CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500935CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500936CanvasRenderingContext2D.prototype.scale = function() {};
937CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500938CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500939CanvasRenderingContext2D.prototype.setTransform = function() {};
940CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -0500941CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -0500942CanvasRenderingContext2D.prototype.strokeText = function() {};
943CanvasRenderingContext2D.prototype.transform = function() {};
944CanvasRenderingContext2D.prototype.translate = function() {};
945
Kevin Lubicka40f8322018-12-17 16:01:36 -0500946var Path2D = {};
947Path2D.prototype.addPath = function() {};
948Path2D.prototype.arc = function() {};
949Path2D.prototype.arcTo = function() {};
950Path2D.prototype.bezierCurveTo = function() {};
951Path2D.prototype.closePath = function() {};
952Path2D.prototype.ellipse = function() {};
953Path2D.prototype.lineTo = function() {};
954Path2D.prototype.moveTo = function() {};
955Path2D.prototype.quadraticCurveTo = function() {};
956Path2D.prototype.rect = function() {};
957
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500958var LinearCanvasGradient = {};
959LinearCanvasGradient.prototype.addColorStop = function() {};
960var RadialCanvasGradient = {};
961RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -0500962var CanvasPattern = {};
963CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500964
Kevin Lubick52b9f372018-12-04 13:57:36 -0500965var ImageData = {
966 /**
967 * @type {Uint8ClampedArray}
968 */
969 data: {},
970 height: {},
971 width: {},
972};
973
Kevin Lubickd29edd72018-12-07 08:29:52 -0500974var DOMMatrix = {
975 a: {},
976 b: {},
977 c: {},
978 d: {},
979 e: {},
980 f: {},
981};
982
Kevin Lubick217056c2018-09-20 17:39:31 -0400983// 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 -0500984function loadWebAssemblyModule() {};