blob: 47913b61a3df0ebbad5da8dbc438969864abd30f [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 Lubick421ba882020-10-15 13:07:33 -0400607 // public API (from JS)
608 MakeBlend: function() {},
609 MakeColor: function() {},
610 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400611 MakeLinearGradient: function() {},
612 MakeRadialGradient: function() {},
613 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700614 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400615
616 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400617 _MakeColor: function() {},
618 _MakeLinearGradient: function() {},
619 _MakeRadialGradient: function() {},
620 _MakeSweepGradient: function() {},
621 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500622 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400623
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400624 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500625 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400626 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500627 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400628 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400629
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600631 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400632 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400634 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400635
Kevin Lubickf8823b52020-09-03 10:02:10 -0400636 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400637 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400638 makeImageSnapshot: function() {},
639 },
640
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 // private API
642 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400643 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500644 delete: function() {},
645 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500646
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400647 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500648 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400649 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500650 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400651 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500652 MakeFromText: function() {},
653 MakeOnPath: function() {},
654 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400655 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400657 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 _MakeFromText: function() {},
659 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500660
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400662 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500663 add: function() {},
664 sub: function() {},
665 dot: function() {},
666 cross: function() {},
667 normalize: function() {},
668 mulScalar: function() {},
669 length: function() {},
670 lengthSquared: function() {},
671 dist: function() {},
672 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400673
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400674 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500675 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500676 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400677
678 prototype: {
679 bounds: function() {},
680 },
681 // private API (from C++ bindings)
682
683 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500684 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400685
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400686 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500687 colors: function() {},
688 detach: function() {},
689 indices: function() {},
690 positions: function() {},
691 texCoords: function() {},
692 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400693
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500694 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400695
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500696 // Constants and Enums
697 gpu: {},
698 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400701 BLACK: {},
702 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500703 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400704 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 BLUE: {},
706 YELLOW: {},
707 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400708 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500709
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500710 MOVE_VERB: {},
711 LINE_VERB: {},
712 QUAD_VERB: {},
713 CONIC_VERB: {},
714 CUBIC_VERB: {},
715 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500716
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500717 NoDecoration: {},
718 UnderlineDecoration: {},
719 OverlineDecoration: {},
720 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400721
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 SaveLayerInitWithPrevious: {},
723 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 Affinity: {
726 Upstream: {},
727 Downstream: {},
728 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 AlphaType: {
731 Opaque: {},
732 Premul: {},
733 Unpremul: {},
734 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500735
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500736 BlendMode: {
737 Clear: {},
738 Src: {},
739 Dst: {},
740 SrcOver: {},
741 DstOver: {},
742 SrcIn: {},
743 DstIn: {},
744 SrcOut: {},
745 DstOut: {},
746 SrcATop: {},
747 DstATop: {},
748 Xor: {},
749 Plus: {},
750 Modulate: {},
751 Screen: {},
752 Overlay: {},
753 Darken: {},
754 Lighten: {},
755 ColorDodge: {},
756 ColorBurn: {},
757 HardLight: {},
758 SoftLight: {},
759 Difference: {},
760 Exclusion: {},
761 Multiply: {},
762 Hue: {},
763 Saturation: {},
764 Color: {},
765 Luminosity: {},
766 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500767
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500768 BlurStyle: {
769 Normal: {},
770 Solid: {},
771 Outer: {},
772 Inner: {},
773 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500774
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500775 ClipOp: {
776 Difference: {},
777 Intersect: {},
778 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500779
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500780 ColorType: {
781 Alpha_8: {},
782 RGB_565: {},
783 ARGB_4444: {},
784 RGBA_8888: {},
785 RGB_888x: {},
786 BGRA_8888: {},
787 RGBA_1010102: {},
788 RGB_101010x: {},
789 Gray_8: {},
790 RGBA_F16: {},
791 RGBA_F32: {},
792 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500793
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500794 FillType: {
795 Winding: {},
796 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500797 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400798
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500799 FilterQuality: {
800 None: {},
801 Low: {},
802 Medium: {},
803 High: {},
804 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500805
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500806 FontSlant: {
807 Upright: {},
808 Italic: {},
809 Oblique: {},
810 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400811
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500812 FontHinting: {
813 None: {},
814 Slight: {},
815 Normal: {},
816 Full: {},
817 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500818
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500819 FontWeight: {
820 Invisible: {},
821 Thin: {},
822 ExtraLight: {},
823 Light: {},
824 Normal: {},
825 Medium: {},
826 SemiBold: {},
827 Bold: {},
828 ExtraBold: {},
829 Black: {},
830 ExtraBlack: {},
831 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400832
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500833 FontWidth: {
834 UltraCondensed: {},
835 ExtraCondensed: {},
836 Condensed: {},
837 SemiCondensed: {},
838 Normal: {},
839 SemiExpanded: {},
840 Expanded: {},
841 ExtraExpanded: {},
842 UltraExpanded: {},
843 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400844
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500845 ImageFormat: {
846 PNG: {},
847 JPEG: {},
848 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300849
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500850 PaintStyle: {
851 Fill: {},
852 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500853 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500854
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500855 PathOp: {
856 Difference: {},
857 Intersect: {},
858 Union: {},
859 XOR: {},
860 ReverseDifference: {},
861 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500862
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500863 PointMode: {
864 Points: {},
865 Lines: {},
866 Polygon: {},
867 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500868
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500869 RectHeightStyle: {
870 Tight: {},
871 Max: {},
872 IncludeLineSpacingMiddle: {},
873 IncludeLineSpacingTop: {},
874 IncludeLineSpacingBottom: {},
875 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400876
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500877 RectWidthStyle: {
878 Tight: {},
879 Max: {},
880 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400881
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500882 StrokeCap: {
883 Butt: {},
884 Round: {},
885 Square: {},
886 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500887
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500888 StrokeJoin: {
889 Miter: {},
890 Round: {},
891 Bevel: {},
892 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500893
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500894 TextAlign: {
895 Left: {},
896 Right: {},
897 Center: {},
898 Justify: {},
899 Start: {},
900 End: {},
901 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400902
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500903 TextDirection: {
904 LTR: {},
905 RTL: {},
906 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400907
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700908 DecorationStyle: {
909 Solid: {},
910 Double: {},
911 Dotted: {},
912 Dashed: {},
913 Wavy: {},
914 },
915
916 PlaceholderAlignment: {
917 Baseline: {},
918 AboveBaseline: {},
919 BelowBaseline: {},
920 Top: {},
921 Bottom: {},
922 Middle: {},
923 },
924
925 TextBaseline: {
926 Alphabetic: {},
927 Ideographic: {},
928 },
929
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500930 TileMode: {
931 Clamp: {},
932 Repeat: {},
933 Mirror: {},
934 Decal: {},
935 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500936
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500937 VertexMode: {
938 Triangles: {},
939 TrianglesStrip: {},
940 TriangleFan: {},
941 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500942
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500943 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400944
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500945 /**
946 * @type {Float32Array}
947 */
948 HEAPF32: {},
949 /**
950 * @type {Float64Array}
951 */
952 HEAPF64: {},
953 /**
954 * @type {Uint8Array}
955 */
956 HEAPU8: {},
957 /**
958 * @type {Uint16Array}
959 */
960 HEAPU16: {},
961 /**
962 * @type {Uint32Array}
963 */
964 HEAPU32: {},
965 /**
966 * @type {Int8Array}
967 */
968 HEAP8: {},
969 /**
970 * @type {Int16Array}
971 */
972 HEAP16: {},
973 /**
974 * @type {Int32Array}
975 */
976 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400977
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500978 _malloc: function() {},
979 _free: function() {},
980 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400981};
Kevin Lubick217056c2018-09-20 17:39:31 -0400982
Kevin Lubick006a6f32018-10-19 14:34:34 -0400983// Public API things that are newly declared in the JS should go here.
984// It's not enough to declare them above, because closure can still erase them
985// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400986CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700987CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400988
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400989CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400990
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400991CanvasKit.Surface.prototype.dispose = function() {};
992CanvasKit.Surface.prototype.flush = function() {};
993CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
994CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400995
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400996CanvasKit.Image.prototype.encodeToData = function() {};
997CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300998
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400999CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001000
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001001CanvasKit.RSXFormBuilder.prototype.build = function() {};
1002CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1003CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001004CanvasKit.RSXFormBuilder.prototype.set = function() {};
1005
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001006CanvasKit.ColorBuilder.prototype.build = function() {};
1007CanvasKit.ColorBuilder.prototype.delete = function() {};
1008CanvasKit.ColorBuilder.prototype.push = function() {};
1009CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001010
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001011CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1012CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001013
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001014CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1015CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001016
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001017// Define StrokeOpts object
1018var StrokeOpts = {};
1019StrokeOpts.prototype.width;
1020StrokeOpts.prototype.miter_limit;
1021StrokeOpts.prototype.cap;
1022StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001023StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001024
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001025// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001026var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001027HTMLCanvas.prototype.decodeImage = function() {};
1028HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001029HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001030HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001031HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001032HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001033
Elliot Evans28796192020-06-15 12:53:27 -06001034var ImageBitmapRenderingContext = {};
1035ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1036
Kevin Lubickb9db3902018-11-26 11:47:54 -05001037var CanvasRenderingContext2D = {};
1038CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1039CanvasRenderingContext2D.prototype.arc = function() {};
1040CanvasRenderingContext2D.prototype.arcTo = function() {};
1041CanvasRenderingContext2D.prototype.beginPath = function() {};
1042CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1043CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001044CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001045CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001046CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001047CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001048CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001049CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001050CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001051CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001052CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001053CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001054CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001055CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001056CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001057CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001058CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001059CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1060CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001061CanvasRenderingContext2D.prototype.lineTo = function() {};
1062CanvasRenderingContext2D.prototype.measureText = function() {};
1063CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001064CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001065CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1066CanvasRenderingContext2D.prototype.rect = function() {};
1067CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1068CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001069CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001070CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001071CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001072CanvasRenderingContext2D.prototype.scale = function() {};
1073CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001074CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001075CanvasRenderingContext2D.prototype.setTransform = function() {};
1076CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001077CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001078CanvasRenderingContext2D.prototype.strokeText = function() {};
1079CanvasRenderingContext2D.prototype.transform = function() {};
1080CanvasRenderingContext2D.prototype.translate = function() {};
1081
Kevin Lubicka40f8322018-12-17 16:01:36 -05001082var Path2D = {};
1083Path2D.prototype.addPath = function() {};
1084Path2D.prototype.arc = function() {};
1085Path2D.prototype.arcTo = function() {};
1086Path2D.prototype.bezierCurveTo = function() {};
1087Path2D.prototype.closePath = function() {};
1088Path2D.prototype.ellipse = function() {};
1089Path2D.prototype.lineTo = function() {};
1090Path2D.prototype.moveTo = function() {};
1091Path2D.prototype.quadraticCurveTo = function() {};
1092Path2D.prototype.rect = function() {};
1093
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001094var LinearCanvasGradient = {};
1095LinearCanvasGradient.prototype.addColorStop = function() {};
1096var RadialCanvasGradient = {};
1097RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001098var CanvasPattern = {};
1099CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001100
Kevin Lubick52b9f372018-12-04 13:57:36 -05001101var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001102 /**
1103 * @type {Uint8ClampedArray}
1104 */
1105 data: {},
1106 height: {},
1107 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001108};
1109
Kevin Lubickd29edd72018-12-07 08:29:52 -05001110var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001111 a: {},
1112 b: {},
1113 c: {},
1114 d: {},
1115 e: {},
1116 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001117};
1118
Kevin Lubick217056c2018-09-20 17:39:31 -04001119// 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 -05001120function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001121
1122// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1123// to override it in the puppeteer tests
1124var LibraryEGL = {
1125 contextAttributes: {
1126 majorVersion: {}
1127 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001128}