blob: 473b4e18bcc02fbf364aca337b6f5942f8aa94e6 [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() {},
Kevin Lubicka8f4c912020-11-04 07:23:37 -050058 MakeRasterDirectSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 MakeWebGLCanvasSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040061 MallocGlyphIDs: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040062 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050063 computeTonalColors: function() {},
64 currentContext: function() {},
65 getColorComponents: function() {},
66 getDecodeCacheLimitBytes: function() {},
67 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040068 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050069 multiplyByAlpha: function() {},
70 parseColorString: function() {},
71 setCurrentContext: function() {},
72 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040073
Kevin Lubicke70af512020-05-14 14:50:54 -040074 // Defined by emscripten.
75 createContext:function() {},
76
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050077 // private API (i.e. things declared in the bindings that we use
78 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040079 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 _MakeImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeManagedAnimation: function() {},
82 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040083 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050084 _decodeAnimatedImage: function() {},
85 _decodeImage: function() {},
86 _drawShapedText: 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() {},
Kevin Lubicke677f4a2020-11-04 09:46:22 -0500128 getLineMetrics: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500129 getLongestLine: function() {},
130 getMaxIntrinsicWidth: function() {},
131 getMaxWidth: function() {},
132 getMinIntrinsicWidth: function() {},
133 getWordBoundary: function() {},
134 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400135
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500136 // private API
137 /** @return {Float32Array} */
138 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700139 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500140 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400141
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400142 ParagraphBuilder: {
143 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700144 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400145 addText: function() {},
146 build: function() {},
147 pop: function() {},
148
149 prototype: {
150 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400151 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700152 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400153 },
154
155 // private API
156 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700157 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400158 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400159 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700160 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400161 },
162
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400163 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500164 // public API (from C++ bindings)
165 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500166
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500167 // private API
168 _makeShader: function() {},
169 _makeShaderWithChildren: function() {},
170 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500171
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500172 ParagraphStyle: function() {},
173 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400174 ColorBuilder: function() {},
175 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400176
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500177 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400178 prototype: {
179 getBounds: function() {},
180 },
181 // private API (from C++ bindings)
182 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500183 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500184
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400185 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500186 // public API (from C++ bindings)
187 decodeNextFrame: function() {},
188 getFrameCount: function() {},
189 getRepetitionCount: function() {},
190 height: function() {},
191 reset: function() {},
192 width: function() {},
193 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400194
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400195 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500196 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500198 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400199 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500200 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400201 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500202 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500203 drawPaint: function() {},
204 drawParagraph: function() {},
205 drawPath: function() {},
206 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400207 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 drawText: function() {},
209 drawTextBlob: function() {},
210 drawVertices: function() {},
211 flush: function() {},
212 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500213 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400214 markCTM: function() {},
215 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500216 restore: function() {},
217 restoreToCount: function() {},
218 rotate: function() {},
219 save: function() {},
Kevin Lubick9fe83912020-11-03 17:08:34 -0500220 saveLayerPaint: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500221 scale: function() {},
222 skew: function() {},
223 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400224
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400225 prototype: {
226 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000227 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400228 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000229 concat44: function() {}, // deprecated
230 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400231 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000232 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400233 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400234 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000235 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400236 drawImageNine: function() {},
237 drawImageRect: function() {},
238 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000239 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400240 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000241 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400242 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000243 drawText: function() {},
244 findMarkedCTM: function() {},
245 getLocalToDevice: function() {},
246 getTotalMatrix: function() {},
247 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400248 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000249 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400250 },
251
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500252 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400253 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000254 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400255 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400256 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400257 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500258 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400259 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000260 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400261 _drawImageNine: function() {},
262 _drawImageRect: function() {},
263 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500264 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400265 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000266 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400267 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500268 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000269 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000270 _getLocalToDevice: function() {},
271 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500272 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400273 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500274 _writePixels: function() {},
275 delete: function() {},
276 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400277
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400278 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500279 // public API (from C++ bindings and JS interface)
280 MakeBlend: function() {},
281 MakeCompose: function() {},
282 MakeLerp: function() {},
283 MakeLinearToSRGBGamma: function() {},
284 MakeMatrix: function() {},
285 MakeSRGBToLinearGamma: function() {},
286 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400287 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500288 _makeMatrix: function() {},
289 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400290
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400291 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500292 concat: function() {},
293 identity: function() {},
294 postTranslate: function() {},
295 rotated: function() {},
296 scaled: function() {},
297 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400298
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400299 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400300 Equals: function() {},
301 SRGB: {},
302 DISPLAY_P3: {},
303 ADOBE_RGB: {},
304 // private API (from C++ bindings)
305 _MakeSRGB: function() {},
306 _MakeDisplayP3: function() {},
307 _MakeAdobeRGB: function() {},
308 },
309
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400310 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500311 next: function() {},
312 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500313
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400314 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500315 getPosTan: function() {},
316 getSegment: function() {},
317 isClosed: function() {},
318 length: function() {},
319 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500320
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400321 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500322 // public API (from C++ bindings)
323 getScaleX: function() {},
324 getSize: function() {},
325 getSkewX: function() {},
326 getTypeface: function() {},
327 measureText: function() {},
328 setHinting: function() {},
329 setLinearMetrics: function() {},
330 setScaleX: function() {},
331 setSize: function() {},
332 setSkewX: function() {},
333 setSubpixel: function() {},
334 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400335
336 prototype: {
337 getGlyphBounds: function() {},
338 getGlyphIDs: function() {},
339 getGlyphWidths: function() {},
340 getWidths: function() {},
341 },
342
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500343 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400344 _getGlyphIDs: function() {},
345 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500346 _getWidths: function() {},
347 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500348
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400349 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 // public API (from C++ and JS bindings)
351 FromData: function() {},
352 RefDefault: function() {},
353 countFamilies: function() {},
354 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500355
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500356 // private API
357 _makeTypefaceFromData: function() {},
358 _fromData: function() {},
359 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500360
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700361 TypefaceFontProvider: {
362 // public API (from C++ and JS bindings)
363 Make: function() {},
364 registerFont: function() {},
365
366 // private API
367 _registerFont: function() {},
368 },
369
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400370 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500371 // public API (from C++ bindings)
Kevin Lubickae0d3ff2020-11-18 11:23:15 -0500372 getColorSpace: function() {},
373 getImageInfo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500374 height: function() {},
375 width: function() {},
376 // private API
377 _encodeToData: function() {},
378 _encodeToDataWithFormat: function() {},
379 _makeShader: function() {},
380 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400381
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400382 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500383 MakeBlur: function() {},
384 MakeColorFilter: function() {},
385 MakeCompose: function() {},
386 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400387
388 // private API
389 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500390 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400391
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500392 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400393 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 identity: function() {},
395 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400396 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500397 multiply: function() {},
398 rotatedUnitSinCos: function() {},
399 rotated: function() {},
400 scaled: function() {},
401 translated: function() {},
402 lookat: function() {},
403 perspective: function() {},
404 rc: function() {},
405 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400406 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500408
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400409 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500410 identity: function() {},
411 invert: function() {},
412 mapPoints: function() {},
413 multiply: function() {},
414 rotated: function() {},
415 scaled: function() {},
416 skewed: function() {},
417 translated: function() {},
418 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500419
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400420 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500421 MakeBlur: function() {},
422 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400423
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400424 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500425 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400426 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500427 copy: function() {},
428 getBlendMode: function() {},
429 getColor: function() {},
430 getFilterQuality: function() {},
431 getStrokeCap: function() {},
432 getStrokeJoin: function() {},
433 getStrokeMiter: function() {},
434 getStrokeWidth: function() {},
435 setAntiAlias: function() {},
436 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400437 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500438 setFilterQuality: function() {},
439 setImageFilter: function() {},
440 setMaskFilter: function() {},
441 setPathEffect: function() {},
442 setShader: function() {},
443 setStrokeCap: function() {},
444 setStrokeJoin: function() {},
445 setStrokeMiter: function() {},
446 setStrokeWidth: function() {},
447 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500448
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400449 prototype: {
450 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400451 setColorComponents: function() {},
452 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400453 },
454
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500455 // Private API
456 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400457 _getColor: function() {},
458 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500459 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500460
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400461 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400462 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500463 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400464 MakeDiscrete: function() {},
465
466 // Private C++ API
467 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500468 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500469
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400470 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500471 // public API (from C++ bindings)
472 draw: function() {},
473 getEffectUniform: function() {},
474 getEffectUniformCount: function() {},
475 getEffectUniformFloatCount: function() {},
476 getEffectUniformName: function() {},
477 getParticleUniformCount: function() {},
478 getParticleUniformFloatCount: function() {},
479 getParticleUniformName: function() {},
480 getParticleUniform: function() {},
481 setPosition: function() {},
482 setRate: function() {},
483 start: function() {},
484 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500485
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500486 // private API (from C++ bindings)
487 _effectUniformPtr: function() {},
488 _particleUniformPtr: function() {},
489 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500490
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400491 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400492 // public API (from C++ and JS bindings)
493 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400494 MakeFromSVGString: function() {},
495 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400496 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500497 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400498 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500499 copy: function() {},
500 countPoints: function() {},
501 equals: function() {},
502 getBounds: function() {},
503 getFillType: function() {},
504 getPoint: function() {},
505 isEmpty: function() {},
506 isVolatile: function() {},
507 reset: function() {},
508 rewind: function() {},
509 setFillType: function() {},
510 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400511 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500512 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400513
Kevin Lubickf8823b52020-09-03 10:02:10 -0400514 prototype: {
515 addArc: function() {},
516 addOval: function() {},
517 addPath: function() {},
518 addPoly: function() {},
519 addRect: function() {},
520 addRRect: function() {},
521 addVerbsPointsWeights: function() {},
522 arc: function() {},
523 arcToOval: function() {},
524 arcToRotated: function() {},
525 arcToTangent: function() {},
526 close: function() {},
527 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400528 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400529 cubicTo: function() {},
530 dash: function() {},
531 lineTo: function() {},
532 moveTo: function() {},
533 offset: function() {},
534 op: function() {},
535 quadTo: function() {},
536 rArcTo: function() {},
537 rConicTo: function() {},
538 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400539 rLineTo: function() {},
540 rMoveTo: function() {},
541 rQuadTo: function() {},
542 simplify: function() {},
543 stroke: function() {},
544 transform: function() {},
545 trim: function() {},
546 },
547
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400549 _MakeFromCmds: function() {},
550 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500551 _addArc: function() {},
552 _addOval: function() {},
553 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000554 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400555 _addRect: function() {},
556 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400557 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400558 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000559 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400560 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500561 _close: function() {},
562 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400563 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500564 _cubicTo: function() {},
565 _dash: function() {},
566 _lineTo: function() {},
567 _moveTo: function() {},
568 _op: function() {},
569 _quadTo: function() {},
570 _rArcTo: function() {},
571 _rConicTo: function() {},
572 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400573 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500574 _rLineTo: function() {},
575 _rMoveTo: function() {},
576 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500577 _simplify: function() {},
578 _stroke: function() {},
579 _transform: function() {},
580 _trim: function() {},
581 delete: function() {},
582 dump: function() {},
583 dumpHex: function() {},
584 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400585
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400586 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500587 getLength: function() {},
588 getSegment: function() {},
589 getPosTan: function() {},
590 isClosed: function() {},
591 nextContour: function() {},
592 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400593
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400594 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500595 serialize: function() {},
596 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400597
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400598 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500599 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400600 prototype: {
601 beginRecording: function() {},
602 },
603 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 },
Kevin Lubick62836902019-12-09 09:04:26 -0500605
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400606 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400607 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 Blend: function() {},
609 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500610 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400611 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400612 MakeBlend: function() {},
613 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400614 MakeFractalNoise: function() {},
615 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400616 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400617 MakeLinearGradient: function() {},
618 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700619 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400620 MakeTurbulence: function() {},
621 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400622
623 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400624 _MakeColor: function() {},
625 _MakeLinearGradient: function() {},
626 _MakeRadialGradient: function() {},
627 _MakeSweepGradient: function() {},
628 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500629 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400630
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400631 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500632 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400633 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500634 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400635 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400636
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500637 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600638 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400639 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500640 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400641 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400642
Kevin Lubickf8823b52020-09-03 10:02:10 -0400643 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400644 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400645 makeImageSnapshot: function() {},
646 },
647
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500648 // private API
649 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400650 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500651 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500652 delete: function() {},
653 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500654
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400655 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400657 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400659 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500660 MakeFromText: function() {},
661 MakeOnPath: function() {},
662 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400663 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500664 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400665 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500666 _MakeFromText: function() {},
667 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500668
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400670 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500671 add: function() {},
672 sub: function() {},
673 dot: function() {},
674 cross: function() {},
675 normalize: function() {},
676 mulScalar: function() {},
677 length: function() {},
678 lengthSquared: function() {},
679 dist: function() {},
680 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400681
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400682 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500684 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400685
686 prototype: {
687 bounds: function() {},
688 },
689 // private API (from C++ bindings)
690
691 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400693
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400694 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500695 colors: function() {},
696 detach: function() {},
697 indices: function() {},
698 positions: function() {},
699 texCoords: function() {},
700 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400701
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500702 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400703
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 // Constants and Enums
705 gpu: {},
706 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400707
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400709 BLACK: {},
710 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400712 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 BLUE: {},
714 YELLOW: {},
715 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400716 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 MOVE_VERB: {},
719 LINE_VERB: {},
720 QUAD_VERB: {},
721 CONIC_VERB: {},
722 CUBIC_VERB: {},
723 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 NoDecoration: {},
726 UnderlineDecoration: {},
727 OverlineDecoration: {},
728 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400729
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500730 SaveLayerInitWithPrevious: {},
731 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400732
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500733 Affinity: {
734 Upstream: {},
735 Downstream: {},
736 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400737
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500738 AlphaType: {
739 Opaque: {},
740 Premul: {},
741 Unpremul: {},
742 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500743
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500744 BlendMode: {
745 Clear: {},
746 Src: {},
747 Dst: {},
748 SrcOver: {},
749 DstOver: {},
750 SrcIn: {},
751 DstIn: {},
752 SrcOut: {},
753 DstOut: {},
754 SrcATop: {},
755 DstATop: {},
756 Xor: {},
757 Plus: {},
758 Modulate: {},
759 Screen: {},
760 Overlay: {},
761 Darken: {},
762 Lighten: {},
763 ColorDodge: {},
764 ColorBurn: {},
765 HardLight: {},
766 SoftLight: {},
767 Difference: {},
768 Exclusion: {},
769 Multiply: {},
770 Hue: {},
771 Saturation: {},
772 Color: {},
773 Luminosity: {},
774 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500775
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500776 BlurStyle: {
777 Normal: {},
778 Solid: {},
779 Outer: {},
780 Inner: {},
781 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500782
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500783 ClipOp: {
784 Difference: {},
785 Intersect: {},
786 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500787
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500788 ColorType: {
789 Alpha_8: {},
790 RGB_565: {},
791 ARGB_4444: {},
792 RGBA_8888: {},
793 RGB_888x: {},
794 BGRA_8888: {},
795 RGBA_1010102: {},
796 RGB_101010x: {},
797 Gray_8: {},
798 RGBA_F16: {},
799 RGBA_F32: {},
800 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 FillType: {
803 Winding: {},
804 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500805 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400806
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500807 FilterQuality: {
808 None: {},
809 Low: {},
810 Medium: {},
811 High: {},
812 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500813
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500814 FontSlant: {
815 Upright: {},
816 Italic: {},
817 Oblique: {},
818 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400819
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500820 FontHinting: {
821 None: {},
822 Slight: {},
823 Normal: {},
824 Full: {},
825 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500826
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500827 FontWeight: {
828 Invisible: {},
829 Thin: {},
830 ExtraLight: {},
831 Light: {},
832 Normal: {},
833 Medium: {},
834 SemiBold: {},
835 Bold: {},
836 ExtraBold: {},
837 Black: {},
838 ExtraBlack: {},
839 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400840
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500841 FontWidth: {
842 UltraCondensed: {},
843 ExtraCondensed: {},
844 Condensed: {},
845 SemiCondensed: {},
846 Normal: {},
847 SemiExpanded: {},
848 Expanded: {},
849 ExtraExpanded: {},
850 UltraExpanded: {},
851 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400852
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500853 ImageFormat: {
854 PNG: {},
855 JPEG: {},
856 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300857
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500858 PaintStyle: {
859 Fill: {},
860 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500861 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500862
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500863 PathOp: {
864 Difference: {},
865 Intersect: {},
866 Union: {},
867 XOR: {},
868 ReverseDifference: {},
869 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500870
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500871 PointMode: {
872 Points: {},
873 Lines: {},
874 Polygon: {},
875 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500876
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500877 RectHeightStyle: {
878 Tight: {},
879 Max: {},
880 IncludeLineSpacingMiddle: {},
881 IncludeLineSpacingTop: {},
882 IncludeLineSpacingBottom: {},
883 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400884
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500885 RectWidthStyle: {
886 Tight: {},
887 Max: {},
888 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400889
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500890 StrokeCap: {
891 Butt: {},
892 Round: {},
893 Square: {},
894 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500895
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500896 StrokeJoin: {
897 Miter: {},
898 Round: {},
899 Bevel: {},
900 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500901
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500902 TextAlign: {
903 Left: {},
904 Right: {},
905 Center: {},
906 Justify: {},
907 Start: {},
908 End: {},
909 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400910
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500911 TextDirection: {
912 LTR: {},
913 RTL: {},
914 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400915
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700916 DecorationStyle: {
917 Solid: {},
918 Double: {},
919 Dotted: {},
920 Dashed: {},
921 Wavy: {},
922 },
923
924 PlaceholderAlignment: {
925 Baseline: {},
926 AboveBaseline: {},
927 BelowBaseline: {},
928 Top: {},
929 Bottom: {},
930 Middle: {},
931 },
932
933 TextBaseline: {
934 Alphabetic: {},
935 Ideographic: {},
936 },
937
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500938 TileMode: {
939 Clamp: {},
940 Repeat: {},
941 Mirror: {},
942 Decal: {},
943 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500944
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500945 VertexMode: {
946 Triangles: {},
947 TrianglesStrip: {},
948 TriangleFan: {},
949 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500950
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500951 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400952
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500953 /**
954 * @type {Float32Array}
955 */
956 HEAPF32: {},
957 /**
958 * @type {Float64Array}
959 */
960 HEAPF64: {},
961 /**
962 * @type {Uint8Array}
963 */
964 HEAPU8: {},
965 /**
966 * @type {Uint16Array}
967 */
968 HEAPU16: {},
969 /**
970 * @type {Uint32Array}
971 */
972 HEAPU32: {},
973 /**
974 * @type {Int8Array}
975 */
976 HEAP8: {},
977 /**
978 * @type {Int16Array}
979 */
980 HEAP16: {},
981 /**
982 * @type {Int32Array}
983 */
984 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400985
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500986 _malloc: function() {},
987 _free: function() {},
988 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400989};
Kevin Lubick217056c2018-09-20 17:39:31 -0400990
Kevin Lubick006a6f32018-10-19 14:34:34 -0400991// Public API things that are newly declared in the JS should go here.
992// It's not enough to declare them above, because closure can still erase them
993// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400994CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700995CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400996
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400997CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400998
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400999CanvasKit.Surface.prototype.dispose = function() {};
1000CanvasKit.Surface.prototype.flush = function() {};
1001CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1002CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001003
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001004CanvasKit.Image.prototype.encodeToData = function() {};
1005CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +03001006
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001007CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001008
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001009CanvasKit.RSXFormBuilder.prototype.build = function() {};
1010CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1011CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001012CanvasKit.RSXFormBuilder.prototype.set = function() {};
1013
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001014CanvasKit.ColorBuilder.prototype.build = function() {};
1015CanvasKit.ColorBuilder.prototype.delete = function() {};
1016CanvasKit.ColorBuilder.prototype.push = function() {};
1017CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001018
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001019CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1020CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001021
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001022CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1023CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001024
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001025// Define StrokeOpts object
1026var StrokeOpts = {};
1027StrokeOpts.prototype.width;
1028StrokeOpts.prototype.miter_limit;
1029StrokeOpts.prototype.cap;
1030StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001031StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001032
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001033// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001034var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001035HTMLCanvas.prototype.decodeImage = function() {};
1036HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001037HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001038HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001039HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001040HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001041
Elliot Evans28796192020-06-15 12:53:27 -06001042var ImageBitmapRenderingContext = {};
1043ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1044
Kevin Lubickb9db3902018-11-26 11:47:54 -05001045var CanvasRenderingContext2D = {};
1046CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1047CanvasRenderingContext2D.prototype.arc = function() {};
1048CanvasRenderingContext2D.prototype.arcTo = function() {};
1049CanvasRenderingContext2D.prototype.beginPath = function() {};
1050CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1051CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001052CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001053CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001054CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001055CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001056CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001057CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001058CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001059CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001060CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001061CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001062CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001063CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001064CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001065CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001066CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001067CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1068CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001069CanvasRenderingContext2D.prototype.lineTo = function() {};
1070CanvasRenderingContext2D.prototype.measureText = function() {};
1071CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001072CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001073CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1074CanvasRenderingContext2D.prototype.rect = function() {};
1075CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1076CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001077CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001078CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001079CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001080CanvasRenderingContext2D.prototype.scale = function() {};
1081CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001082CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001083CanvasRenderingContext2D.prototype.setTransform = function() {};
1084CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001085CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001086CanvasRenderingContext2D.prototype.strokeText = function() {};
1087CanvasRenderingContext2D.prototype.transform = function() {};
1088CanvasRenderingContext2D.prototype.translate = function() {};
1089
Kevin Lubicka40f8322018-12-17 16:01:36 -05001090var Path2D = {};
1091Path2D.prototype.addPath = function() {};
1092Path2D.prototype.arc = function() {};
1093Path2D.prototype.arcTo = function() {};
1094Path2D.prototype.bezierCurveTo = function() {};
1095Path2D.prototype.closePath = function() {};
1096Path2D.prototype.ellipse = function() {};
1097Path2D.prototype.lineTo = function() {};
1098Path2D.prototype.moveTo = function() {};
1099Path2D.prototype.quadraticCurveTo = function() {};
1100Path2D.prototype.rect = function() {};
1101
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001102var LinearCanvasGradient = {};
1103LinearCanvasGradient.prototype.addColorStop = function() {};
1104var RadialCanvasGradient = {};
1105RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001106var CanvasPattern = {};
1107CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001108
Kevin Lubick52b9f372018-12-04 13:57:36 -05001109var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001110 /**
1111 * @type {Uint8ClampedArray}
1112 */
1113 data: {},
1114 height: {},
1115 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001116};
1117
Kevin Lubickd29edd72018-12-07 08:29:52 -05001118var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001119 a: {},
1120 b: {},
1121 c: {},
1122 d: {},
1123 e: {},
1124 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001125};
1126
Kevin Lubick217056c2018-09-20 17:39:31 -04001127// 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 -05001128function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001129
1130// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1131// to override it in the puppeteer tests
1132var LibraryEGL = {
1133 contextAttributes: {
1134 majorVersion: {}
1135 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001136}