blob: c8635b14ce2271385b7416fafdca136640c2b8a3 [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() {},
87 _getRasterDirectSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040088
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050089 // The testing object is meant to expose internal functions
90 // for more fine-grained testing, e.g. parseColor
91 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -050092
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050093 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -040094
Kevin Lubickf8823b52020-09-03 10:02:10 -040095 Animation: {
96 prototype: {
97 render: function() {},
98 },
99 _render: function() {},
100 },
101
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500102 GrContext: {
103 // public API (from C++ bindings)
104 getResourceCacheLimitBytes: function() {},
105 getResourceCacheUsageBytes: function() {},
106 releaseResourcesAndAbandonContext: function() {},
107 setResourceCacheLimitBytes: function() {},
108 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400109
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400110 ManagedAnimation: {
111 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400112 render: function() {},
113 seek: function() {},
114 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400115 setColor: function() {},
116 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400117 _render: function() {},
118 _seek: function() {},
119 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400120 },
121
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500122 Paragraph: {
123 // public API (from C++ bindings)
124 didExceedMaxLines: function() {},
125 getAlphabeticBaseline: function() {},
126 getGlyphPositionAtCoordinate: function() {},
127 getHeight: function() {},
128 getIdeographicBaseline: function() {},
129 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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500220 scale: function() {},
221 skew: function() {},
222 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400223
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400224 prototype: {
225 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000226 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400227 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000228 concat44: function() {}, // deprecated
229 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400230 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000231 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400232 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400233 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000234 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400235 drawImageNine: function() {},
236 drawImageRect: function() {},
237 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000238 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400239 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000240 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400241 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000242 drawText: function() {},
243 findMarkedCTM: function() {},
244 getLocalToDevice: function() {},
245 getTotalMatrix: function() {},
246 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400247 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000248 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400249 },
250
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500251 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400252 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000253 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400254 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400255 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400256 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500257 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400258 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000259 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400260 _drawImageNine: function() {},
261 _drawImageRect: function() {},
262 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500263 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400264 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000265 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400266 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500267 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000268 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000269 _getLocalToDevice: function() {},
270 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500271 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400272 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500273 _writePixels: function() {},
274 delete: function() {},
275 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400276
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400277 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500278 // public API (from C++ bindings and JS interface)
279 MakeBlend: function() {},
280 MakeCompose: function() {},
281 MakeLerp: function() {},
282 MakeLinearToSRGBGamma: function() {},
283 MakeMatrix: function() {},
284 MakeSRGBToLinearGamma: function() {},
285 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400286 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500287 _makeMatrix: function() {},
288 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400289
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400290 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500291 concat: function() {},
292 identity: function() {},
293 postTranslate: function() {},
294 rotated: function() {},
295 scaled: function() {},
296 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400297
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400298 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400299 Equals: function() {},
300 SRGB: {},
301 DISPLAY_P3: {},
302 ADOBE_RGB: {},
303 // private API (from C++ bindings)
304 _MakeSRGB: function() {},
305 _MakeDisplayP3: function() {},
306 _MakeAdobeRGB: function() {},
307 },
308
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400309 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500310 next: function() {},
311 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500312
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400313 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500314 getPosTan: function() {},
315 getSegment: function() {},
316 isClosed: function() {},
317 length: function() {},
318 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500319
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400320 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500321 // public API (from C++ bindings)
322 getScaleX: function() {},
323 getSize: function() {},
324 getSkewX: function() {},
325 getTypeface: function() {},
326 measureText: function() {},
327 setHinting: function() {},
328 setLinearMetrics: function() {},
329 setScaleX: function() {},
330 setSize: function() {},
331 setSkewX: function() {},
332 setSubpixel: function() {},
333 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400334
335 prototype: {
336 getGlyphBounds: function() {},
337 getGlyphIDs: function() {},
338 getGlyphWidths: function() {},
339 getWidths: function() {},
340 },
341
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500342 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400343 _getGlyphIDs: function() {},
344 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500345 _getWidths: function() {},
346 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500347
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400348 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500349 // public API (from C++ and JS bindings)
350 FromData: function() {},
351 RefDefault: function() {},
352 countFamilies: function() {},
353 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500354
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500355 // private API
356 _makeTypefaceFromData: function() {},
357 _fromData: function() {},
358 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500359
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700360 TypefaceFontProvider: {
361 // public API (from C++ and JS bindings)
362 Make: function() {},
363 registerFont: function() {},
364
365 // private API
366 _registerFont: function() {},
367 },
368
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400369 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500370 // public API (from C++ bindings)
371 height: function() {},
372 width: function() {},
373 // private API
374 _encodeToData: function() {},
375 _encodeToDataWithFormat: function() {},
376 _makeShader: function() {},
377 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400378
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400379 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500380 MakeBlur: function() {},
381 MakeColorFilter: function() {},
382 MakeCompose: function() {},
383 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400384
385 // private API
386 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500387 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400388
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500389 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400390 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500391 identity: function() {},
392 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400393 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 multiply: function() {},
395 rotatedUnitSinCos: function() {},
396 rotated: function() {},
397 scaled: function() {},
398 translated: function() {},
399 lookat: function() {},
400 perspective: function() {},
401 rc: function() {},
402 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400403 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500404 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500405
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400406 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500407 identity: function() {},
408 invert: function() {},
409 mapPoints: function() {},
410 multiply: function() {},
411 rotated: function() {},
412 scaled: function() {},
413 skewed: function() {},
414 translated: function() {},
415 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500416
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400417 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500418 MakeBlur: function() {},
419 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400420
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400421 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500422 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400423 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500424 copy: function() {},
425 getBlendMode: function() {},
426 getColor: function() {},
427 getFilterQuality: function() {},
428 getStrokeCap: function() {},
429 getStrokeJoin: function() {},
430 getStrokeMiter: function() {},
431 getStrokeWidth: function() {},
432 setAntiAlias: function() {},
433 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400434 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500435 setFilterQuality: function() {},
436 setImageFilter: function() {},
437 setMaskFilter: function() {},
438 setPathEffect: function() {},
439 setShader: function() {},
440 setStrokeCap: function() {},
441 setStrokeJoin: function() {},
442 setStrokeMiter: function() {},
443 setStrokeWidth: function() {},
444 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500445
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400446 prototype: {
447 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400448 setColorComponents: function() {},
449 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400450 },
451
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500452 // Private API
453 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400454 _getColor: function() {},
455 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500456 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500457
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400458 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400459 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500460 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400461 MakeDiscrete: function() {},
462
463 // Private C++ API
464 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500465 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500466
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400467 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500468 // public API (from C++ bindings)
469 draw: function() {},
470 getEffectUniform: function() {},
471 getEffectUniformCount: function() {},
472 getEffectUniformFloatCount: function() {},
473 getEffectUniformName: function() {},
474 getParticleUniformCount: function() {},
475 getParticleUniformFloatCount: function() {},
476 getParticleUniformName: function() {},
477 getParticleUniform: function() {},
478 setPosition: function() {},
479 setRate: function() {},
480 start: function() {},
481 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500482
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500483 // private API (from C++ bindings)
484 _effectUniformPtr: function() {},
485 _particleUniformPtr: function() {},
486 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500487
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400488 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400489 // public API (from C++ and JS bindings)
490 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400491 MakeFromSVGString: function() {},
492 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400493 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500494 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400495 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500496 copy: function() {},
497 countPoints: function() {},
498 equals: function() {},
499 getBounds: function() {},
500 getFillType: function() {},
501 getPoint: function() {},
502 isEmpty: function() {},
503 isVolatile: function() {},
504 reset: function() {},
505 rewind: function() {},
506 setFillType: function() {},
507 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400508 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500509 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400510
Kevin Lubickf8823b52020-09-03 10:02:10 -0400511 prototype: {
512 addArc: function() {},
513 addOval: function() {},
514 addPath: function() {},
515 addPoly: function() {},
516 addRect: function() {},
517 addRRect: function() {},
518 addVerbsPointsWeights: function() {},
519 arc: function() {},
520 arcToOval: function() {},
521 arcToRotated: function() {},
522 arcToTangent: function() {},
523 close: function() {},
524 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400525 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400526 cubicTo: function() {},
527 dash: function() {},
528 lineTo: function() {},
529 moveTo: function() {},
530 offset: function() {},
531 op: function() {},
532 quadTo: function() {},
533 rArcTo: function() {},
534 rConicTo: function() {},
535 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400536 rLineTo: function() {},
537 rMoveTo: function() {},
538 rQuadTo: function() {},
539 simplify: function() {},
540 stroke: function() {},
541 transform: function() {},
542 trim: function() {},
543 },
544
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500545 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400546 _MakeFromCmds: function() {},
547 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500548 _addArc: function() {},
549 _addOval: function() {},
550 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000551 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400552 _addRect: function() {},
553 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400554 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400555 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000556 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400557 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500558 _close: function() {},
559 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400560 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500561 _cubicTo: function() {},
562 _dash: function() {},
563 _lineTo: function() {},
564 _moveTo: function() {},
565 _op: function() {},
566 _quadTo: function() {},
567 _rArcTo: function() {},
568 _rConicTo: function() {},
569 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400570 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500571 _rLineTo: function() {},
572 _rMoveTo: function() {},
573 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500574 _simplify: function() {},
575 _stroke: function() {},
576 _transform: function() {},
577 _trim: function() {},
578 delete: function() {},
579 dump: function() {},
580 dumpHex: function() {},
581 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400582
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400583 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500584 getLength: function() {},
585 getSegment: function() {},
586 getPosTan: function() {},
587 isClosed: function() {},
588 nextContour: function() {},
589 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400590
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400591 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500592 serialize: function() {},
593 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400594
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400595 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500596 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400597 prototype: {
598 beginRecording: function() {},
599 },
600 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500601 },
Kevin Lubick62836902019-12-09 09:04:26 -0500602
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400603 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400604 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500605 Blend: function() {},
606 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500607 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400608 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400609 MakeBlend: function() {},
610 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400611 MakeFractalNoise: function() {},
612 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400613 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400614 MakeLinearGradient: function() {},
615 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700616 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400617 MakeTurbulence: function() {},
618 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400619
620 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400621 _MakeColor: function() {},
622 _MakeLinearGradient: function() {},
623 _MakeRadialGradient: function() {},
624 _MakeSweepGradient: function() {},
625 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500626 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400627
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400628 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500629 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400630 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500631 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400632 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400633
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500634 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600635 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400636 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500637 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400638 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400639
Kevin Lubickf8823b52020-09-03 10:02:10 -0400640 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400641 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400642 makeImageSnapshot: function() {},
643 },
644
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500645 // private API
646 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400647 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500648 delete: function() {},
649 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500650
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400651 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500652 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400653 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500654 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400655 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500656 MakeFromText: function() {},
657 MakeOnPath: function() {},
658 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400659 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500660 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400661 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500662 _MakeFromText: function() {},
663 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500664
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500665 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400666 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500667 add: function() {},
668 sub: function() {},
669 dot: function() {},
670 cross: function() {},
671 normalize: function() {},
672 mulScalar: function() {},
673 length: function() {},
674 lengthSquared: function() {},
675 dist: function() {},
676 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400677
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400678 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500680 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400681
682 prototype: {
683 bounds: function() {},
684 },
685 // private API (from C++ bindings)
686
687 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500688 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400689
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400690 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500691 colors: function() {},
692 detach: function() {},
693 indices: function() {},
694 positions: function() {},
695 texCoords: function() {},
696 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400697
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500698 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400699
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500700 // Constants and Enums
701 gpu: {},
702 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400703
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400705 BLACK: {},
706 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500707 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400708 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500709 BLUE: {},
710 YELLOW: {},
711 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400712 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500713
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500714 MOVE_VERB: {},
715 LINE_VERB: {},
716 QUAD_VERB: {},
717 CONIC_VERB: {},
718 CUBIC_VERB: {},
719 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500720
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500721 NoDecoration: {},
722 UnderlineDecoration: {},
723 OverlineDecoration: {},
724 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400725
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 SaveLayerInitWithPrevious: {},
727 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400728
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500729 Affinity: {
730 Upstream: {},
731 Downstream: {},
732 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400733
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500734 AlphaType: {
735 Opaque: {},
736 Premul: {},
737 Unpremul: {},
738 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500739
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500740 BlendMode: {
741 Clear: {},
742 Src: {},
743 Dst: {},
744 SrcOver: {},
745 DstOver: {},
746 SrcIn: {},
747 DstIn: {},
748 SrcOut: {},
749 DstOut: {},
750 SrcATop: {},
751 DstATop: {},
752 Xor: {},
753 Plus: {},
754 Modulate: {},
755 Screen: {},
756 Overlay: {},
757 Darken: {},
758 Lighten: {},
759 ColorDodge: {},
760 ColorBurn: {},
761 HardLight: {},
762 SoftLight: {},
763 Difference: {},
764 Exclusion: {},
765 Multiply: {},
766 Hue: {},
767 Saturation: {},
768 Color: {},
769 Luminosity: {},
770 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500771
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500772 BlurStyle: {
773 Normal: {},
774 Solid: {},
775 Outer: {},
776 Inner: {},
777 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500778
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500779 ClipOp: {
780 Difference: {},
781 Intersect: {},
782 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500783
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500784 ColorType: {
785 Alpha_8: {},
786 RGB_565: {},
787 ARGB_4444: {},
788 RGBA_8888: {},
789 RGB_888x: {},
790 BGRA_8888: {},
791 RGBA_1010102: {},
792 RGB_101010x: {},
793 Gray_8: {},
794 RGBA_F16: {},
795 RGBA_F32: {},
796 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500797
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500798 FillType: {
799 Winding: {},
800 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500801 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400802
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500803 FilterQuality: {
804 None: {},
805 Low: {},
806 Medium: {},
807 High: {},
808 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500809
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500810 FontSlant: {
811 Upright: {},
812 Italic: {},
813 Oblique: {},
814 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 FontHinting: {
817 None: {},
818 Slight: {},
819 Normal: {},
820 Full: {},
821 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500822
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500823 FontWeight: {
824 Invisible: {},
825 Thin: {},
826 ExtraLight: {},
827 Light: {},
828 Normal: {},
829 Medium: {},
830 SemiBold: {},
831 Bold: {},
832 ExtraBold: {},
833 Black: {},
834 ExtraBlack: {},
835 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400836
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500837 FontWidth: {
838 UltraCondensed: {},
839 ExtraCondensed: {},
840 Condensed: {},
841 SemiCondensed: {},
842 Normal: {},
843 SemiExpanded: {},
844 Expanded: {},
845 ExtraExpanded: {},
846 UltraExpanded: {},
847 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400848
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500849 ImageFormat: {
850 PNG: {},
851 JPEG: {},
852 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300853
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500854 PaintStyle: {
855 Fill: {},
856 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500857 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500858
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500859 PathOp: {
860 Difference: {},
861 Intersect: {},
862 Union: {},
863 XOR: {},
864 ReverseDifference: {},
865 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500866
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500867 PointMode: {
868 Points: {},
869 Lines: {},
870 Polygon: {},
871 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500872
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500873 RectHeightStyle: {
874 Tight: {},
875 Max: {},
876 IncludeLineSpacingMiddle: {},
877 IncludeLineSpacingTop: {},
878 IncludeLineSpacingBottom: {},
879 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400880
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500881 RectWidthStyle: {
882 Tight: {},
883 Max: {},
884 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400885
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500886 StrokeCap: {
887 Butt: {},
888 Round: {},
889 Square: {},
890 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500891
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500892 StrokeJoin: {
893 Miter: {},
894 Round: {},
895 Bevel: {},
896 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500897
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500898 TextAlign: {
899 Left: {},
900 Right: {},
901 Center: {},
902 Justify: {},
903 Start: {},
904 End: {},
905 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400906
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500907 TextDirection: {
908 LTR: {},
909 RTL: {},
910 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400911
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700912 DecorationStyle: {
913 Solid: {},
914 Double: {},
915 Dotted: {},
916 Dashed: {},
917 Wavy: {},
918 },
919
920 PlaceholderAlignment: {
921 Baseline: {},
922 AboveBaseline: {},
923 BelowBaseline: {},
924 Top: {},
925 Bottom: {},
926 Middle: {},
927 },
928
929 TextBaseline: {
930 Alphabetic: {},
931 Ideographic: {},
932 },
933
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500934 TileMode: {
935 Clamp: {},
936 Repeat: {},
937 Mirror: {},
938 Decal: {},
939 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500940
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500941 VertexMode: {
942 Triangles: {},
943 TrianglesStrip: {},
944 TriangleFan: {},
945 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500946
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500947 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400948
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500949 /**
950 * @type {Float32Array}
951 */
952 HEAPF32: {},
953 /**
954 * @type {Float64Array}
955 */
956 HEAPF64: {},
957 /**
958 * @type {Uint8Array}
959 */
960 HEAPU8: {},
961 /**
962 * @type {Uint16Array}
963 */
964 HEAPU16: {},
965 /**
966 * @type {Uint32Array}
967 */
968 HEAPU32: {},
969 /**
970 * @type {Int8Array}
971 */
972 HEAP8: {},
973 /**
974 * @type {Int16Array}
975 */
976 HEAP16: {},
977 /**
978 * @type {Int32Array}
979 */
980 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400981
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500982 _malloc: function() {},
983 _free: function() {},
984 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400985};
Kevin Lubick217056c2018-09-20 17:39:31 -0400986
Kevin Lubick006a6f32018-10-19 14:34:34 -0400987// Public API things that are newly declared in the JS should go here.
988// It's not enough to declare them above, because closure can still erase them
989// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400990CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700991CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400992
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400993CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400994
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400995CanvasKit.Surface.prototype.dispose = function() {};
996CanvasKit.Surface.prototype.flush = function() {};
997CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
998CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400999
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001000CanvasKit.Image.prototype.encodeToData = function() {};
1001CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +03001002
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001003CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001004
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001005CanvasKit.RSXFormBuilder.prototype.build = function() {};
1006CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1007CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001008CanvasKit.RSXFormBuilder.prototype.set = function() {};
1009
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001010CanvasKit.ColorBuilder.prototype.build = function() {};
1011CanvasKit.ColorBuilder.prototype.delete = function() {};
1012CanvasKit.ColorBuilder.prototype.push = function() {};
1013CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001014
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001015CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1016CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001017
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001018CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1019CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001020
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001021// Define StrokeOpts object
1022var StrokeOpts = {};
1023StrokeOpts.prototype.width;
1024StrokeOpts.prototype.miter_limit;
1025StrokeOpts.prototype.cap;
1026StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001027StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001028
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001029// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001030var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001031HTMLCanvas.prototype.decodeImage = function() {};
1032HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001033HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001034HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001035HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001036HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001037
Elliot Evans28796192020-06-15 12:53:27 -06001038var ImageBitmapRenderingContext = {};
1039ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1040
Kevin Lubickb9db3902018-11-26 11:47:54 -05001041var CanvasRenderingContext2D = {};
1042CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1043CanvasRenderingContext2D.prototype.arc = function() {};
1044CanvasRenderingContext2D.prototype.arcTo = function() {};
1045CanvasRenderingContext2D.prototype.beginPath = function() {};
1046CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1047CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001048CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001049CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001050CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001051CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001052CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001053CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001054CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001055CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001056CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001057CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001058CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001059CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001060CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001061CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001062CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001063CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1064CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001065CanvasRenderingContext2D.prototype.lineTo = function() {};
1066CanvasRenderingContext2D.prototype.measureText = function() {};
1067CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001068CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001069CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1070CanvasRenderingContext2D.prototype.rect = function() {};
1071CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1072CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001073CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001074CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001075CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001076CanvasRenderingContext2D.prototype.scale = function() {};
1077CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001078CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001079CanvasRenderingContext2D.prototype.setTransform = function() {};
1080CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001081CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001082CanvasRenderingContext2D.prototype.strokeText = function() {};
1083CanvasRenderingContext2D.prototype.transform = function() {};
1084CanvasRenderingContext2D.prototype.translate = function() {};
1085
Kevin Lubicka40f8322018-12-17 16:01:36 -05001086var Path2D = {};
1087Path2D.prototype.addPath = function() {};
1088Path2D.prototype.arc = function() {};
1089Path2D.prototype.arcTo = function() {};
1090Path2D.prototype.bezierCurveTo = function() {};
1091Path2D.prototype.closePath = function() {};
1092Path2D.prototype.ellipse = function() {};
1093Path2D.prototype.lineTo = function() {};
1094Path2D.prototype.moveTo = function() {};
1095Path2D.prototype.quadraticCurveTo = function() {};
1096Path2D.prototype.rect = function() {};
1097
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001098var LinearCanvasGradient = {};
1099LinearCanvasGradient.prototype.addColorStop = function() {};
1100var RadialCanvasGradient = {};
1101RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001102var CanvasPattern = {};
1103CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001104
Kevin Lubick52b9f372018-12-04 13:57:36 -05001105var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001106 /**
1107 * @type {Uint8ClampedArray}
1108 */
1109 data: {},
1110 height: {},
1111 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001112};
1113
Kevin Lubickd29edd72018-12-07 08:29:52 -05001114var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001115 a: {},
1116 b: {},
1117 c: {},
1118 d: {},
1119 e: {},
1120 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001121};
1122
Kevin Lubick217056c2018-09-20 17:39:31 -04001123// 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 -05001124function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001125
1126// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1127// to override it in the puppeteer tests
1128var LibraryEGL = {
1129 contextAttributes: {
1130 majorVersion: {}
1131 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001132}