blob: 9c8d1f3577f95785ff44ffc871631f05644a1e3b [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 LTRBRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050031 XYWHRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -040032 LTRBiRect: function() {},
33 XYWHiRect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050034 RRectXY: function() {},
35 /** @return {ImageData} */
36 ImageData: function() {},
Kevin Lubick543f3522019-03-08 10:04:28 -050037
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050038 GetWebGLContext: function() {},
39 MakeBlurMaskFilter: function() {},
40 MakeCanvas: function() {},
41 MakeCanvasSurface: function() {},
42 MakeGrContext: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040043 /** @return {CanvasKit.AnimatedImage} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050044 MakeAnimatedImageFromEncoded: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040045 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050046 MakeImage: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040047 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050048 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060049 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050050 MakeOnScreenGLSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050051 MakeRenderTarget: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040052 MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050053 MakeSWCanvasSurface: function() {},
54 MakeManagedAnimation: function() {},
55 MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040056 MakeVertices: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050057 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050058 MakeWebGLCanvasSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040060 MallocGlyphIDs: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040061 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 computeTonalColors: function() {},
63 currentContext: function() {},
64 getColorComponents: function() {},
65 getDecodeCacheLimitBytes: function() {},
66 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040067 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050068 multiplyByAlpha: function() {},
69 parseColorString: function() {},
70 setCurrentContext: function() {},
71 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040072
Kevin Lubicke70af512020-05-14 14:50:54 -040073 // Defined by emscripten.
74 createContext:function() {},
75
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050076 // private API (i.e. things declared in the bindings that we use
77 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040078 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050079 _MakeImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 _MakeManagedAnimation: function() {},
81 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040082 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050083 _decodeAnimatedImage: function() {},
84 _decodeImage: function() {},
85 _drawShapedText: function() {},
86 _getRasterDirectSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040087
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050088 // The testing object is meant to expose internal functions
89 // for more fine-grained testing, e.g. parseColor
90 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050091
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050092 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040093
Kevin Lubickf8823b52020-09-03 10:02:10 -040094 Animation: {
95 prototype: {
96 render: function() {},
97 },
98 _render: function() {},
99 },
100
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500101 GrContext: {
102 // public API (from C++ bindings)
103 getResourceCacheLimitBytes: function() {},
104 getResourceCacheUsageBytes: function() {},
105 releaseResourcesAndAbandonContext: function() {},
106 setResourceCacheLimitBytes: function() {},
107 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400108
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400109 ManagedAnimation: {
110 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400111 render: function() {},
112 seek: function() {},
113 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400114 setColor: function() {},
115 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400116 _render: function() {},
117 _seek: function() {},
118 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400119 },
120
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500121 Paragraph: {
122 // public API (from C++ bindings)
123 didExceedMaxLines: function() {},
124 getAlphabeticBaseline: function() {},
125 getGlyphPositionAtCoordinate: function() {},
126 getHeight: function() {},
127 getIdeographicBaseline: function() {},
128 getLongestLine: function() {},
129 getMaxIntrinsicWidth: function() {},
130 getMaxWidth: function() {},
131 getMinIntrinsicWidth: function() {},
132 getWordBoundary: function() {},
133 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400134
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500135 // private API
136 /** @return {Float32Array} */
137 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700138 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500139 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400140
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400141 ParagraphBuilder: {
142 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700143 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400144 addText: function() {},
145 build: function() {},
146 pop: function() {},
147
148 prototype: {
149 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400150 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700151 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400152 },
153
154 // private API
155 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700156 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400157 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400158 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700159 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400160 },
161
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400162 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500163 // public API (from C++ bindings)
164 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500165
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500166 // private API
167 _makeShader: function() {},
168 _makeShaderWithChildren: function() {},
169 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500170
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500171 ParagraphStyle: function() {},
172 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400173 ColorBuilder: function() {},
174 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400175
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500176 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400177 prototype: {
178 getBounds: function() {},
179 },
180 // private API (from C++ bindings)
181 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500182 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500183
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400184 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500185 // public API (from C++ bindings)
186 decodeNextFrame: function() {},
187 getFrameCount: function() {},
188 getRepetitionCount: function() {},
189 height: function() {},
190 reset: function() {},
191 width: function() {},
192 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400193
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400194 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500195 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500196 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400198 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500199 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400200 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500201 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500202 drawPaint: function() {},
203 drawParagraph: function() {},
204 drawPath: function() {},
205 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400206 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500207 drawText: function() {},
208 drawTextBlob: function() {},
209 drawVertices: function() {},
210 flush: function() {},
211 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500212 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400213 markCTM: function() {},
214 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500215 restore: function() {},
216 restoreToCount: function() {},
217 rotate: function() {},
218 save: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500219 scale: function() {},
220 skew: function() {},
221 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400222
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400223 prototype: {
224 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000225 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400226 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000227 concat44: function() {}, // deprecated
228 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400229 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000230 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400231 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400232 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000233 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400234 drawImageNine: function() {},
235 drawImageRect: function() {},
236 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000237 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400238 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000239 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400240 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000241 drawText: function() {},
242 findMarkedCTM: function() {},
243 getLocalToDevice: function() {},
244 getTotalMatrix: function() {},
245 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400246 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000247 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400248 },
249
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500250 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400251 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000252 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400253 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400254 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400255 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500256 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400257 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000258 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400259 _drawImageNine: function() {},
260 _drawImageRect: function() {},
261 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500262 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400263 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000264 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400265 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500266 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000267 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000268 _getLocalToDevice: function() {},
269 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500270 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400271 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500272 _writePixels: function() {},
273 delete: function() {},
274 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400275
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400276 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500277 // public API (from C++ bindings and JS interface)
278 MakeBlend: function() {},
279 MakeCompose: function() {},
280 MakeLerp: function() {},
281 MakeLinearToSRGBGamma: function() {},
282 MakeMatrix: function() {},
283 MakeSRGBToLinearGamma: function() {},
284 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400285 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500286 _makeMatrix: function() {},
287 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400288
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400289 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500290 concat: function() {},
291 identity: function() {},
292 postTranslate: function() {},
293 rotated: function() {},
294 scaled: function() {},
295 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400296
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400297 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400298 Equals: function() {},
299 SRGB: {},
300 DISPLAY_P3: {},
301 ADOBE_RGB: {},
302 // private API (from C++ bindings)
303 _MakeSRGB: function() {},
304 _MakeDisplayP3: function() {},
305 _MakeAdobeRGB: function() {},
306 },
307
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400308 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500309 next: function() {},
310 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500311
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400312 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500313 getPosTan: function() {},
314 getSegment: function() {},
315 isClosed: function() {},
316 length: function() {},
317 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500318
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400319 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500320 // public API (from C++ bindings)
321 getScaleX: function() {},
322 getSize: function() {},
323 getSkewX: function() {},
324 getTypeface: function() {},
325 measureText: function() {},
326 setHinting: function() {},
327 setLinearMetrics: function() {},
328 setScaleX: function() {},
329 setSize: function() {},
330 setSkewX: function() {},
331 setSubpixel: function() {},
332 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400333
334 prototype: {
335 getGlyphBounds: function() {},
336 getGlyphIDs: function() {},
337 getGlyphWidths: function() {},
338 getWidths: function() {},
339 },
340
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500341 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400342 _getGlyphIDs: function() {},
343 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500344 _getWidths: function() {},
345 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500346
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400347 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500348 // public API (from C++ and JS bindings)
349 FromData: function() {},
350 RefDefault: function() {},
351 countFamilies: function() {},
352 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500353
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500354 // private API
355 _makeTypefaceFromData: function() {},
356 _fromData: function() {},
357 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500358
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700359 TypefaceFontProvider: {
360 // public API (from C++ and JS bindings)
361 Make: function() {},
362 registerFont: function() {},
363
364 // private API
365 _registerFont: function() {},
366 },
367
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400368 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500369 // public API (from C++ bindings)
370 height: function() {},
371 width: function() {},
372 // private API
373 _encodeToData: function() {},
374 _encodeToDataWithFormat: function() {},
375 _makeShader: function() {},
376 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400377
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400378 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500379 MakeBlur: function() {},
380 MakeColorFilter: function() {},
381 MakeCompose: function() {},
382 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400383
384 // private API
385 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500386 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400387
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500388 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400389 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500390 identity: function() {},
391 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400392 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500393 multiply: function() {},
394 rotatedUnitSinCos: function() {},
395 rotated: function() {},
396 scaled: function() {},
397 translated: function() {},
398 lookat: function() {},
399 perspective: function() {},
400 rc: function() {},
401 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400402 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500403 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500404
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400405 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500406 identity: function() {},
407 invert: function() {},
408 mapPoints: function() {},
409 multiply: function() {},
410 rotated: function() {},
411 scaled: function() {},
412 skewed: function() {},
413 translated: function() {},
414 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500415
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400416 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500417 MakeBlur: function() {},
418 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400419
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400420 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500421 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400422 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500423 copy: function() {},
424 getBlendMode: function() {},
425 getColor: function() {},
426 getFilterQuality: function() {},
427 getStrokeCap: function() {},
428 getStrokeJoin: function() {},
429 getStrokeMiter: function() {},
430 getStrokeWidth: function() {},
431 setAntiAlias: function() {},
432 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400433 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500434 setFilterQuality: function() {},
435 setImageFilter: function() {},
436 setMaskFilter: function() {},
437 setPathEffect: function() {},
438 setShader: function() {},
439 setStrokeCap: function() {},
440 setStrokeJoin: function() {},
441 setStrokeMiter: function() {},
442 setStrokeWidth: function() {},
443 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500444
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400445 prototype: {
446 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400447 setColorComponents: function() {},
448 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400449 },
450
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500451 // Private API
452 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400453 _getColor: function() {},
454 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500455 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500456
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400457 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400458 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500459 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400460 MakeDiscrete: function() {},
461
462 // Private C++ API
463 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500464 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500465
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400466 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500467 // public API (from C++ bindings)
468 draw: function() {},
469 getEffectUniform: function() {},
470 getEffectUniformCount: function() {},
471 getEffectUniformFloatCount: function() {},
472 getEffectUniformName: function() {},
473 getParticleUniformCount: function() {},
474 getParticleUniformFloatCount: function() {},
475 getParticleUniformName: function() {},
476 getParticleUniform: function() {},
477 setPosition: function() {},
478 setRate: function() {},
479 start: function() {},
480 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500481
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500482 // private API (from C++ bindings)
483 _effectUniformPtr: function() {},
484 _particleUniformPtr: function() {},
485 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500486
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400487 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400488 // public API (from C++ and JS bindings)
489 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400490 MakeFromSVGString: function() {},
491 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400492 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500493 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400494 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500495 copy: function() {},
496 countPoints: function() {},
497 equals: function() {},
498 getBounds: function() {},
499 getFillType: function() {},
500 getPoint: function() {},
501 isEmpty: function() {},
502 isVolatile: function() {},
503 reset: function() {},
504 rewind: function() {},
505 setFillType: function() {},
506 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400507 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500508 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400509
Kevin Lubickf8823b52020-09-03 10:02:10 -0400510 prototype: {
511 addArc: function() {},
512 addOval: function() {},
513 addPath: function() {},
514 addPoly: function() {},
515 addRect: function() {},
516 addRRect: function() {},
517 addVerbsPointsWeights: function() {},
518 arc: function() {},
519 arcToOval: function() {},
520 arcToRotated: function() {},
521 arcToTangent: function() {},
522 close: function() {},
523 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400524 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400525 cubicTo: function() {},
526 dash: function() {},
527 lineTo: function() {},
528 moveTo: function() {},
529 offset: function() {},
530 op: function() {},
531 quadTo: function() {},
532 rArcTo: function() {},
533 rConicTo: function() {},
534 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400535 rLineTo: function() {},
536 rMoveTo: function() {},
537 rQuadTo: function() {},
538 simplify: function() {},
539 stroke: function() {},
540 transform: function() {},
541 trim: function() {},
542 },
543
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500544 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400545 _MakeFromCmds: function() {},
546 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500547 _addArc: function() {},
548 _addOval: function() {},
549 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000550 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400551 _addRect: function() {},
552 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400553 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400554 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000555 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400556 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500557 _close: function() {},
558 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400559 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500560 _cubicTo: function() {},
561 _dash: function() {},
562 _lineTo: function() {},
563 _moveTo: function() {},
564 _op: function() {},
565 _quadTo: function() {},
566 _rArcTo: function() {},
567 _rConicTo: function() {},
568 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400569 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500570 _rLineTo: function() {},
571 _rMoveTo: function() {},
572 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500573 _simplify: function() {},
574 _stroke: function() {},
575 _transform: function() {},
576 _trim: function() {},
577 delete: function() {},
578 dump: function() {},
579 dumpHex: function() {},
580 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400581
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400582 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500583 getLength: function() {},
584 getSegment: function() {},
585 getPosTan: function() {},
586 isClosed: function() {},
587 nextContour: function() {},
588 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400589
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400590 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500591 serialize: function() {},
592 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400593
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400594 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500595 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400596 prototype: {
597 beginRecording: function() {},
598 },
599 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500600 },
Kevin Lubick62836902019-12-09 09:04:26 -0500601
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400602 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400603 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 Blend: function() {},
605 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500606 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400607 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400608 MakeBlend: function() {},
609 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400610 MakeFractalNoise: function() {},
611 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400612 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400613 MakeLinearGradient: function() {},
614 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700615 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400616 MakeTurbulence: function() {},
617 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400618
619 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400620 _MakeColor: function() {},
621 _MakeLinearGradient: function() {},
622 _MakeRadialGradient: function() {},
623 _MakeSweepGradient: function() {},
624 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500625 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400626
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400627 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500628 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400629 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400631 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400632
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600634 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400635 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500636 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400637 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400638
Kevin Lubickf8823b52020-09-03 10:02:10 -0400639 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400640 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400641 makeImageSnapshot: function() {},
642 },
643
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 // private API
645 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400646 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500647 delete: function() {},
648 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500649
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400650 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500651 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400652 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400654 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500655 MakeFromText: function() {},
656 MakeOnPath: function() {},
657 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400658 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500659 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400660 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 _MakeFromText: function() {},
662 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500663
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500664 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400665 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500666 add: function() {},
667 sub: function() {},
668 dot: function() {},
669 cross: function() {},
670 normalize: function() {},
671 mulScalar: function() {},
672 length: function() {},
673 lengthSquared: function() {},
674 dist: function() {},
675 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400676
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400677 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500678 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400680
681 prototype: {
682 bounds: function() {},
683 },
684 // private API (from C++ bindings)
685
686 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500687 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400688
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400689 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500690 colors: function() {},
691 detach: function() {},
692 indices: function() {},
693 positions: function() {},
694 texCoords: function() {},
695 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400696
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500697 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400698
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500699 // Constants and Enums
700 gpu: {},
701 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400702
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500703 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400704 BLACK: {},
705 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500706 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400707 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 BLUE: {},
709 YELLOW: {},
710 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400711 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500712
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 MOVE_VERB: {},
714 LINE_VERB: {},
715 QUAD_VERB: {},
716 CONIC_VERB: {},
717 CUBIC_VERB: {},
718 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500719
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500720 NoDecoration: {},
721 UnderlineDecoration: {},
722 OverlineDecoration: {},
723 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 SaveLayerInitWithPrevious: {},
726 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400727
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500728 Affinity: {
729 Upstream: {},
730 Downstream: {},
731 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400732
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 AlphaType: {
734 Opaque: {},
735 Premul: {},
736 Unpremul: {},
737 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500738
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500739 BlendMode: {
740 Clear: {},
741 Src: {},
742 Dst: {},
743 SrcOver: {},
744 DstOver: {},
745 SrcIn: {},
746 DstIn: {},
747 SrcOut: {},
748 DstOut: {},
749 SrcATop: {},
750 DstATop: {},
751 Xor: {},
752 Plus: {},
753 Modulate: {},
754 Screen: {},
755 Overlay: {},
756 Darken: {},
757 Lighten: {},
758 ColorDodge: {},
759 ColorBurn: {},
760 HardLight: {},
761 SoftLight: {},
762 Difference: {},
763 Exclusion: {},
764 Multiply: {},
765 Hue: {},
766 Saturation: {},
767 Color: {},
768 Luminosity: {},
769 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500770
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500771 BlurStyle: {
772 Normal: {},
773 Solid: {},
774 Outer: {},
775 Inner: {},
776 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500777
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500778 ClipOp: {
779 Difference: {},
780 Intersect: {},
781 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500782
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500783 ColorType: {
784 Alpha_8: {},
785 RGB_565: {},
786 ARGB_4444: {},
787 RGBA_8888: {},
788 RGB_888x: {},
789 BGRA_8888: {},
790 RGBA_1010102: {},
791 RGB_101010x: {},
792 Gray_8: {},
793 RGBA_F16: {},
794 RGBA_F32: {},
795 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500796
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500797 FillType: {
798 Winding: {},
799 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500800 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 FilterQuality: {
803 None: {},
804 Low: {},
805 Medium: {},
806 High: {},
807 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500808
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500809 FontSlant: {
810 Upright: {},
811 Italic: {},
812 Oblique: {},
813 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400814
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500815 FontHinting: {
816 None: {},
817 Slight: {},
818 Normal: {},
819 Full: {},
820 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500821
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500822 FontWeight: {
823 Invisible: {},
824 Thin: {},
825 ExtraLight: {},
826 Light: {},
827 Normal: {},
828 Medium: {},
829 SemiBold: {},
830 Bold: {},
831 ExtraBold: {},
832 Black: {},
833 ExtraBlack: {},
834 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400835
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500836 FontWidth: {
837 UltraCondensed: {},
838 ExtraCondensed: {},
839 Condensed: {},
840 SemiCondensed: {},
841 Normal: {},
842 SemiExpanded: {},
843 Expanded: {},
844 ExtraExpanded: {},
845 UltraExpanded: {},
846 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400847
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500848 ImageFormat: {
849 PNG: {},
850 JPEG: {},
851 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300852
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500853 PaintStyle: {
854 Fill: {},
855 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500856 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500857
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500858 PathOp: {
859 Difference: {},
860 Intersect: {},
861 Union: {},
862 XOR: {},
863 ReverseDifference: {},
864 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500865
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500866 PointMode: {
867 Points: {},
868 Lines: {},
869 Polygon: {},
870 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500871
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500872 RectHeightStyle: {
873 Tight: {},
874 Max: {},
875 IncludeLineSpacingMiddle: {},
876 IncludeLineSpacingTop: {},
877 IncludeLineSpacingBottom: {},
878 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400879
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500880 RectWidthStyle: {
881 Tight: {},
882 Max: {},
883 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400884
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500885 StrokeCap: {
886 Butt: {},
887 Round: {},
888 Square: {},
889 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500890
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500891 StrokeJoin: {
892 Miter: {},
893 Round: {},
894 Bevel: {},
895 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500896
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500897 TextAlign: {
898 Left: {},
899 Right: {},
900 Center: {},
901 Justify: {},
902 Start: {},
903 End: {},
904 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400905
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500906 TextDirection: {
907 LTR: {},
908 RTL: {},
909 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400910
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700911 DecorationStyle: {
912 Solid: {},
913 Double: {},
914 Dotted: {},
915 Dashed: {},
916 Wavy: {},
917 },
918
919 PlaceholderAlignment: {
920 Baseline: {},
921 AboveBaseline: {},
922 BelowBaseline: {},
923 Top: {},
924 Bottom: {},
925 Middle: {},
926 },
927
928 TextBaseline: {
929 Alphabetic: {},
930 Ideographic: {},
931 },
932
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500933 TileMode: {
934 Clamp: {},
935 Repeat: {},
936 Mirror: {},
937 Decal: {},
938 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500939
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500940 VertexMode: {
941 Triangles: {},
942 TrianglesStrip: {},
943 TriangleFan: {},
944 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500945
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500946 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400947
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500948 /**
949 * @type {Float32Array}
950 */
951 HEAPF32: {},
952 /**
953 * @type {Float64Array}
954 */
955 HEAPF64: {},
956 /**
957 * @type {Uint8Array}
958 */
959 HEAPU8: {},
960 /**
961 * @type {Uint16Array}
962 */
963 HEAPU16: {},
964 /**
965 * @type {Uint32Array}
966 */
967 HEAPU32: {},
968 /**
969 * @type {Int8Array}
970 */
971 HEAP8: {},
972 /**
973 * @type {Int16Array}
974 */
975 HEAP16: {},
976 /**
977 * @type {Int32Array}
978 */
979 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400980
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500981 _malloc: function() {},
982 _free: function() {},
983 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400984};
Kevin Lubick217056c2018-09-20 17:39:31 -0400985
Kevin Lubick006a6f32018-10-19 14:34:34 -0400986// Public API things that are newly declared in the JS should go here.
987// It's not enough to declare them above, because closure can still erase them
988// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400989CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700990CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400991
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400992CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400993
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400994CanvasKit.Surface.prototype.dispose = function() {};
995CanvasKit.Surface.prototype.flush = function() {};
996CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
997CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400998
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400999CanvasKit.Image.prototype.encodeToData = function() {};
1000CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +03001001
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001002CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001003
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001004CanvasKit.RSXFormBuilder.prototype.build = function() {};
1005CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1006CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001007CanvasKit.RSXFormBuilder.prototype.set = function() {};
1008
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001009CanvasKit.ColorBuilder.prototype.build = function() {};
1010CanvasKit.ColorBuilder.prototype.delete = function() {};
1011CanvasKit.ColorBuilder.prototype.push = function() {};
1012CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001013
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001014CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1015CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001016
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001017CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1018CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001019
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001020// Define StrokeOpts object
1021var StrokeOpts = {};
1022StrokeOpts.prototype.width;
1023StrokeOpts.prototype.miter_limit;
1024StrokeOpts.prototype.cap;
1025StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001026StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001027
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001028// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001029var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001030HTMLCanvas.prototype.decodeImage = function() {};
1031HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001032HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001033HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001034HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001035HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001036
Elliot Evans28796192020-06-15 12:53:27 -06001037var ImageBitmapRenderingContext = {};
1038ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1039
Kevin Lubickb9db3902018-11-26 11:47:54 -05001040var CanvasRenderingContext2D = {};
1041CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1042CanvasRenderingContext2D.prototype.arc = function() {};
1043CanvasRenderingContext2D.prototype.arcTo = function() {};
1044CanvasRenderingContext2D.prototype.beginPath = function() {};
1045CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1046CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001047CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001048CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001049CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001050CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001051CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001052CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001053CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001054CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001055CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001056CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001057CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001058CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001059CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001060CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001061CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001062CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1063CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001064CanvasRenderingContext2D.prototype.lineTo = function() {};
1065CanvasRenderingContext2D.prototype.measureText = function() {};
1066CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001067CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001068CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1069CanvasRenderingContext2D.prototype.rect = function() {};
1070CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1071CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001072CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001073CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001074CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001075CanvasRenderingContext2D.prototype.scale = function() {};
1076CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001077CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001078CanvasRenderingContext2D.prototype.setTransform = function() {};
1079CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001080CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001081CanvasRenderingContext2D.prototype.strokeText = function() {};
1082CanvasRenderingContext2D.prototype.transform = function() {};
1083CanvasRenderingContext2D.prototype.translate = function() {};
1084
Kevin Lubicka40f8322018-12-17 16:01:36 -05001085var Path2D = {};
1086Path2D.prototype.addPath = function() {};
1087Path2D.prototype.arc = function() {};
1088Path2D.prototype.arcTo = function() {};
1089Path2D.prototype.bezierCurveTo = function() {};
1090Path2D.prototype.closePath = function() {};
1091Path2D.prototype.ellipse = function() {};
1092Path2D.prototype.lineTo = function() {};
1093Path2D.prototype.moveTo = function() {};
1094Path2D.prototype.quadraticCurveTo = function() {};
1095Path2D.prototype.rect = function() {};
1096
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001097var LinearCanvasGradient = {};
1098LinearCanvasGradient.prototype.addColorStop = function() {};
1099var RadialCanvasGradient = {};
1100RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001101var CanvasPattern = {};
1102CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001103
Kevin Lubick52b9f372018-12-04 13:57:36 -05001104var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001105 /**
1106 * @type {Uint8ClampedArray}
1107 */
1108 data: {},
1109 height: {},
1110 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001111};
1112
Kevin Lubickd29edd72018-12-07 08:29:52 -05001113var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001114 a: {},
1115 b: {},
1116 c: {},
1117 d: {},
1118 e: {},
1119 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001120};
1121
Kevin Lubick217056c2018-09-20 17:39:31 -04001122// 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 -05001123function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001124
1125// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1126// to override it in the puppeteer tests
1127var LibraryEGL = {
1128 contextAttributes: {
1129 majorVersion: {}
1130 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001131}