blob: 04837a33014434074e3980175d7536f73906cbc4 [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() {},
51 MakePathFromCmds: function() {},
52 MakePathFromOp: function() {},
53 MakePathFromSVGString: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050054 MakeRenderTarget: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040055 MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050056 MakeSWCanvasSurface: function() {},
57 MakeManagedAnimation: function() {},
58 MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040059 MakeVertices: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050060 MakeSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050061 MakeWebGLCanvasSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040063 MallocGlyphIDs: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040064 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050065 computeTonalColors: function() {},
66 currentContext: function() {},
67 getColorComponents: function() {},
68 getDecodeCacheLimitBytes: function() {},
69 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040070 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050071 multiplyByAlpha: function() {},
72 parseColorString: function() {},
73 setCurrentContext: function() {},
74 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040075
Kevin Lubicke70af512020-05-14 14:50:54 -040076 // Defined by emscripten.
77 createContext:function() {},
78
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050079 // private API (i.e. things declared in the bindings that we use
80 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040081 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050082 _MakeImage: function() {},
83 _MakeLinearGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050084 _MakeRadialGradientShader: function() {},
Dan Field3d44f732020-03-16 09:17:30 -070085 _MakeSweepGradientShader: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050086 _MakeManagedAnimation: function() {},
87 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040088 _MakePicture: function() {},
89 _MakeVertices: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050090 _MakeTwoPointConicalGradientShader: function() {},
91 _decodeAnimatedImage: function() {},
92 _decodeImage: function() {},
93 _drawShapedText: function() {},
94 _getRasterDirectSurface: function() {},
95 _getRasterN32PremulSurface: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040096
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050097 // The testing object is meant to expose internal functions
98 // for more fine-grained testing, e.g. parseColor
99 _testing: {},
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500100
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500101 // Objects and properties on CanvasKit
Kevin Lubick217056c2018-09-20 17:39:31 -0400102
Kevin Lubickf8823b52020-09-03 10:02:10 -0400103 Animation: {
104 prototype: {
105 render: function() {},
106 },
107 _render: function() {},
108 },
109
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500110 GrContext: {
111 // public API (from C++ bindings)
112 getResourceCacheLimitBytes: function() {},
113 getResourceCacheUsageBytes: function() {},
114 releaseResourcesAndAbandonContext: function() {},
115 setResourceCacheLimitBytes: function() {},
116 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400117
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400118 ManagedAnimation: {
119 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400120 render: function() {},
121 seek: function() {},
122 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400123 setColor: function() {},
124 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400125 _render: function() {},
126 _seek: function() {},
127 _seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400128 },
129
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 Paragraph: {
131 // public API (from C++ bindings)
132 didExceedMaxLines: function() {},
133 getAlphabeticBaseline: function() {},
134 getGlyphPositionAtCoordinate: function() {},
135 getHeight: function() {},
136 getIdeographicBaseline: function() {},
137 getLongestLine: function() {},
138 getMaxIntrinsicWidth: function() {},
139 getMaxWidth: function() {},
140 getMinIntrinsicWidth: function() {},
141 getWordBoundary: function() {},
142 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400143
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500144 // private API
145 /** @return {Float32Array} */
146 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700147 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500148 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400149
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400150 ParagraphBuilder: {
151 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700152 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400153 addText: function() {},
154 build: function() {},
155 pop: function() {},
156
157 prototype: {
158 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
163 // private API
164 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700165 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400166 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400167 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700168 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400169 },
170
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400171 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500172 // public API (from C++ bindings)
173 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500174
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500175 // private API
176 _makeShader: function() {},
177 _makeShaderWithChildren: function() {},
178 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500179
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500180 ParagraphStyle: function() {},
181 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400182 ColorBuilder: function() {},
183 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400184
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500185 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400186 prototype: {
187 getBounds: function() {},
188 },
189 // private API (from C++ bindings)
190 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500191 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500192
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400193 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500194 // public API (from C++ bindings)
195 decodeNextFrame: function() {},
196 getFrameCount: function() {},
197 getRepetitionCount: function() {},
198 height: function() {},
199 reset: function() {},
200 width: function() {},
201 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400202
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400203 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500204 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500206 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400207 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500208 drawImage: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400209 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500210 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500211 drawPaint: function() {},
212 drawParagraph: function() {},
213 drawPath: function() {},
214 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400215 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500216 drawText: function() {},
217 drawTextBlob: function() {},
218 drawVertices: function() {},
219 flush: function() {},
220 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500221 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400222 markCTM: function() {},
223 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500224 restore: function() {},
225 restoreToCount: function() {},
226 rotate: function() {},
227 save: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500228 scale: function() {},
229 skew: function() {},
230 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400231
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400232 prototype: {
233 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000234 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400235 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000236 concat44: function() {}, // deprecated
237 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400238 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000239 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400240 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400241 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000242 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400243 drawImageNine: function() {},
244 drawImageRect: function() {},
245 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000246 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400247 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000248 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400249 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000250 drawText: function() {},
251 findMarkedCTM: function() {},
252 getLocalToDevice: function() {},
253 getTotalMatrix: function() {},
254 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400255 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000256 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400257 },
258
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500259 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400260 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000261 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400262 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400263 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400264 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500265 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400266 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000267 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400268 _drawImageNine: function() {},
269 _drawImageRect: function() {},
270 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500271 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400272 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000273 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400274 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500275 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000276 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000277 _getLocalToDevice: function() {},
278 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500279 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400280 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500281 _writePixels: function() {},
282 delete: function() {},
283 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400284
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400285 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500286 // public API (from C++ bindings and JS interface)
287 MakeBlend: function() {},
288 MakeCompose: function() {},
289 MakeLerp: function() {},
290 MakeLinearToSRGBGamma: function() {},
291 MakeMatrix: function() {},
292 MakeSRGBToLinearGamma: function() {},
293 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400294 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500295 _makeMatrix: function() {},
296 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400297
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400298 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500299 concat: function() {},
300 identity: function() {},
301 postTranslate: function() {},
302 rotated: function() {},
303 scaled: function() {},
304 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400305
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400306 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400307 Equals: function() {},
308 SRGB: {},
309 DISPLAY_P3: {},
310 ADOBE_RGB: {},
311 // private API (from C++ bindings)
312 _MakeSRGB: function() {},
313 _MakeDisplayP3: function() {},
314 _MakeAdobeRGB: function() {},
315 },
316
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400317 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500318 next: function() {},
319 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500320
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400321 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500322 getPosTan: function() {},
323 getSegment: function() {},
324 isClosed: function() {},
325 length: function() {},
326 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500327
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400328 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500329 // public API (from C++ bindings)
330 getScaleX: function() {},
331 getSize: function() {},
332 getSkewX: function() {},
333 getTypeface: function() {},
334 measureText: function() {},
335 setHinting: function() {},
336 setLinearMetrics: function() {},
337 setScaleX: function() {},
338 setSize: function() {},
339 setSkewX: function() {},
340 setSubpixel: function() {},
341 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400342
343 prototype: {
344 getGlyphBounds: function() {},
345 getGlyphIDs: function() {},
346 getGlyphWidths: function() {},
347 getWidths: function() {},
348 },
349
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500350 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400351 _getGlyphIDs: function() {},
352 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500353 _getWidths: function() {},
354 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500355
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400356 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500357 // public API (from C++ and JS bindings)
358 FromData: function() {},
359 RefDefault: function() {},
360 countFamilies: function() {},
361 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500362
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500363 // private API
364 _makeTypefaceFromData: function() {},
365 _fromData: function() {},
366 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500367
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700368 TypefaceFontProvider: {
369 // public API (from C++ and JS bindings)
370 Make: function() {},
371 registerFont: function() {},
372
373 // private API
374 _registerFont: function() {},
375 },
376
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400377 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500378 // public API (from C++ bindings)
379 height: function() {},
380 width: function() {},
381 // private API
382 _encodeToData: function() {},
383 _encodeToDataWithFormat: function() {},
384 _makeShader: function() {},
385 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400386
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400387 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500388 MakeBlur: function() {},
389 MakeColorFilter: function() {},
390 MakeCompose: function() {},
391 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400392
393 // private API
394 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500395 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400396
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500397 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400398 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500399 identity: function() {},
400 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400401 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500402 multiply: function() {},
403 rotatedUnitSinCos: function() {},
404 rotated: function() {},
405 scaled: function() {},
406 translated: function() {},
407 lookat: function() {},
408 perspective: function() {},
409 rc: function() {},
410 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400411 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500412 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500413
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400414 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500415 identity: function() {},
416 invert: function() {},
417 mapPoints: function() {},
418 multiply: function() {},
419 rotated: function() {},
420 scaled: function() {},
421 skewed: function() {},
422 translated: function() {},
423 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500424
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400425 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500426 MakeBlur: function() {},
427 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400428
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400429 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500430 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400431 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500432 copy: function() {},
433 getBlendMode: function() {},
434 getColor: function() {},
435 getFilterQuality: function() {},
436 getStrokeCap: function() {},
437 getStrokeJoin: function() {},
438 getStrokeMiter: function() {},
439 getStrokeWidth: function() {},
440 setAntiAlias: function() {},
441 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400442 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500443 setFilterQuality: function() {},
444 setImageFilter: function() {},
445 setMaskFilter: function() {},
446 setPathEffect: function() {},
447 setShader: function() {},
448 setStrokeCap: function() {},
449 setStrokeJoin: function() {},
450 setStrokeMiter: function() {},
451 setStrokeWidth: function() {},
452 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500453
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400454 prototype: {
455 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400456 setColorComponents: function() {},
457 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400458 },
459
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500460 // Private API
461 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400462 _getColor: function() {},
463 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500464 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500465
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400466 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400467 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500468 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400469 MakeDiscrete: function() {},
470
471 // Private C++ API
472 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500473 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500474
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400475 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500476 // public API (from C++ bindings)
477 draw: function() {},
478 getEffectUniform: function() {},
479 getEffectUniformCount: function() {},
480 getEffectUniformFloatCount: function() {},
481 getEffectUniformName: function() {},
482 getParticleUniformCount: function() {},
483 getParticleUniformFloatCount: function() {},
484 getParticleUniformName: function() {},
485 getParticleUniform: function() {},
486 setPosition: function() {},
487 setRate: function() {},
488 start: function() {},
489 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500490
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500491 // private API (from C++ bindings)
492 _effectUniformPtr: function() {},
493 _particleUniformPtr: function() {},
494 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500495
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400496 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400497 // public API (from C++ and JS bindings)
498 MakeFromCmds: function() {},
499 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500500 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400501 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500502 copy: function() {},
503 countPoints: function() {},
504 equals: function() {},
505 getBounds: function() {},
506 getFillType: function() {},
507 getPoint: function() {},
508 isEmpty: function() {},
509 isVolatile: function() {},
510 reset: function() {},
511 rewind: function() {},
512 setFillType: function() {},
513 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400514 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500515 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400516
Kevin Lubickf8823b52020-09-03 10:02:10 -0400517 prototype: {
518 addArc: function() {},
519 addOval: function() {},
520 addPath: function() {},
521 addPoly: function() {},
522 addRect: function() {},
523 addRRect: function() {},
524 addVerbsPointsWeights: function() {},
525 arc: function() {},
526 arcToOval: function() {},
527 arcToRotated: function() {},
528 arcToTangent: function() {},
529 close: function() {},
530 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400531 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400532 cubicTo: function() {},
533 dash: function() {},
534 lineTo: function() {},
535 moveTo: function() {},
536 offset: function() {},
537 op: function() {},
538 quadTo: function() {},
539 rArcTo: function() {},
540 rConicTo: function() {},
541 rCubicTo: function() {},
542 rect: function() {},
543 rLineTo: function() {},
544 rMoveTo: function() {},
545 rQuadTo: function() {},
546 simplify: function() {},
547 stroke: function() {},
548 transform: function() {},
549 trim: function() {},
550 },
551
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500552 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400553 _MakeFromCmds: function() {},
554 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500555 _addArc: function() {},
556 _addOval: function() {},
557 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000558 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400559 _addRect: function() {},
560 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400561 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400562 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000563 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400564 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500565 _close: function() {},
566 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400567 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500568 _cubicTo: function() {},
569 _dash: function() {},
570 _lineTo: function() {},
571 _moveTo: function() {},
572 _op: function() {},
573 _quadTo: function() {},
574 _rArcTo: function() {},
575 _rConicTo: function() {},
576 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400577 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500578 _rLineTo: function() {},
579 _rMoveTo: function() {},
580 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500581 _simplify: function() {},
582 _stroke: function() {},
583 _transform: function() {},
584 _trim: function() {},
585 delete: function() {},
586 dump: function() {},
587 dumpHex: function() {},
588 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400589
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400590 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500591 getLength: function() {},
592 getSegment: function() {},
593 getPosTan: function() {},
594 isClosed: function() {},
595 nextContour: function() {},
596 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400597
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400598 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500599 serialize: function() {},
600 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400601
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400602 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500603 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400604 prototype: {
605 beginRecording: function() {},
606 },
607 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500608 },
Kevin Lubick62836902019-12-09 09:04:26 -0500609
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400610 Shader: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500611 Blend: function() {},
612 Color: function() {},
613 Empty: function() {},
614 Lerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400615 MakeLinearGradient: function() {},
616 MakeRadialGradient: function() {},
617 MakeTwoPointConicalGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700618 MakeSweepGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400619
620 // private API (from C++ bindings)
621 _Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500622 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400623
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400624 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500625 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400626 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500627 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400628 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400629
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600631 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400632 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500633 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400634 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400635
Kevin Lubickf8823b52020-09-03 10:02:10 -0400636 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400637 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400638 makeImageSnapshot: function() {},
639 },
640
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500641 // private API
642 _flush: function() {},
643 _getRasterN32PremulSurface: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400644 _makeImageSnapshot: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500645 delete: function() {},
646 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500647
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400648 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500649 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400650 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500651 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400652 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 MakeFromText: function() {},
654 MakeOnPath: function() {},
655 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400656 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500657 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400658 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500659 _MakeFromText: function() {},
660 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500661
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500662 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400663 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500664 add: function() {},
665 sub: function() {},
666 dot: function() {},
667 cross: function() {},
668 normalize: function() {},
669 mulScalar: function() {},
670 length: function() {},
671 lengthSquared: function() {},
672 dist: function() {},
673 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400674
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400675 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500676 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500677 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400678
679 prototype: {
680 bounds: function() {},
681 },
682 // private API (from C++ bindings)
683
684 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500685 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400686
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400687 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500688 colors: function() {},
689 detach: function() {},
690 indices: function() {},
691 positions: function() {},
692 texCoords: function() {},
693 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400694
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500695 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400696
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500697 // Constants and Enums
698 gpu: {},
699 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400700
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500701 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400702 BLACK: {},
703 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400705 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500706 BLUE: {},
707 YELLOW: {},
708 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400709 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500710
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500711 MOVE_VERB: {},
712 LINE_VERB: {},
713 QUAD_VERB: {},
714 CONIC_VERB: {},
715 CUBIC_VERB: {},
716 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 NoDecoration: {},
719 UnderlineDecoration: {},
720 OverlineDecoration: {},
721 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400722
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500723 SaveLayerInitWithPrevious: {},
724 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400725
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 Affinity: {
727 Upstream: {},
728 Downstream: {},
729 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400730
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500731 AlphaType: {
732 Opaque: {},
733 Premul: {},
734 Unpremul: {},
735 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500736
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500737 BlendMode: {
738 Clear: {},
739 Src: {},
740 Dst: {},
741 SrcOver: {},
742 DstOver: {},
743 SrcIn: {},
744 DstIn: {},
745 SrcOut: {},
746 DstOut: {},
747 SrcATop: {},
748 DstATop: {},
749 Xor: {},
750 Plus: {},
751 Modulate: {},
752 Screen: {},
753 Overlay: {},
754 Darken: {},
755 Lighten: {},
756 ColorDodge: {},
757 ColorBurn: {},
758 HardLight: {},
759 SoftLight: {},
760 Difference: {},
761 Exclusion: {},
762 Multiply: {},
763 Hue: {},
764 Saturation: {},
765 Color: {},
766 Luminosity: {},
767 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500768
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500769 BlurStyle: {
770 Normal: {},
771 Solid: {},
772 Outer: {},
773 Inner: {},
774 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500775
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500776 ClipOp: {
777 Difference: {},
778 Intersect: {},
779 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500780
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500781 ColorType: {
782 Alpha_8: {},
783 RGB_565: {},
784 ARGB_4444: {},
785 RGBA_8888: {},
786 RGB_888x: {},
787 BGRA_8888: {},
788 RGBA_1010102: {},
789 RGB_101010x: {},
790 Gray_8: {},
791 RGBA_F16: {},
792 RGBA_F32: {},
793 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500794
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500795 FillType: {
796 Winding: {},
797 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500798 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400799
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500800 FilterQuality: {
801 None: {},
802 Low: {},
803 Medium: {},
804 High: {},
805 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500806
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500807 FontSlant: {
808 Upright: {},
809 Italic: {},
810 Oblique: {},
811 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400812
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500813 FontHinting: {
814 None: {},
815 Slight: {},
816 Normal: {},
817 Full: {},
818 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500819
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500820 FontWeight: {
821 Invisible: {},
822 Thin: {},
823 ExtraLight: {},
824 Light: {},
825 Normal: {},
826 Medium: {},
827 SemiBold: {},
828 Bold: {},
829 ExtraBold: {},
830 Black: {},
831 ExtraBlack: {},
832 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400833
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500834 FontWidth: {
835 UltraCondensed: {},
836 ExtraCondensed: {},
837 Condensed: {},
838 SemiCondensed: {},
839 Normal: {},
840 SemiExpanded: {},
841 Expanded: {},
842 ExtraExpanded: {},
843 UltraExpanded: {},
844 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400845
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500846 ImageFormat: {
847 PNG: {},
848 JPEG: {},
849 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300850
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500851 PaintStyle: {
852 Fill: {},
853 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500854 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500855
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500856 PathOp: {
857 Difference: {},
858 Intersect: {},
859 Union: {},
860 XOR: {},
861 ReverseDifference: {},
862 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500863
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500864 PointMode: {
865 Points: {},
866 Lines: {},
867 Polygon: {},
868 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500869
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500870 RectHeightStyle: {
871 Tight: {},
872 Max: {},
873 IncludeLineSpacingMiddle: {},
874 IncludeLineSpacingTop: {},
875 IncludeLineSpacingBottom: {},
876 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400877
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500878 RectWidthStyle: {
879 Tight: {},
880 Max: {},
881 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400882
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500883 StrokeCap: {
884 Butt: {},
885 Round: {},
886 Square: {},
887 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500888
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500889 StrokeJoin: {
890 Miter: {},
891 Round: {},
892 Bevel: {},
893 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500894
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500895 TextAlign: {
896 Left: {},
897 Right: {},
898 Center: {},
899 Justify: {},
900 Start: {},
901 End: {},
902 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400903
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500904 TextDirection: {
905 LTR: {},
906 RTL: {},
907 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400908
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700909 DecorationStyle: {
910 Solid: {},
911 Double: {},
912 Dotted: {},
913 Dashed: {},
914 Wavy: {},
915 },
916
917 PlaceholderAlignment: {
918 Baseline: {},
919 AboveBaseline: {},
920 BelowBaseline: {},
921 Top: {},
922 Bottom: {},
923 Middle: {},
924 },
925
926 TextBaseline: {
927 Alphabetic: {},
928 Ideographic: {},
929 },
930
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500931 TileMode: {
932 Clamp: {},
933 Repeat: {},
934 Mirror: {},
935 Decal: {},
936 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500937
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500938 VertexMode: {
939 Triangles: {},
940 TrianglesStrip: {},
941 TriangleFan: {},
942 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500943
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500944 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400945
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500946 /**
947 * @type {Float32Array}
948 */
949 HEAPF32: {},
950 /**
951 * @type {Float64Array}
952 */
953 HEAPF64: {},
954 /**
955 * @type {Uint8Array}
956 */
957 HEAPU8: {},
958 /**
959 * @type {Uint16Array}
960 */
961 HEAPU16: {},
962 /**
963 * @type {Uint32Array}
964 */
965 HEAPU32: {},
966 /**
967 * @type {Int8Array}
968 */
969 HEAP8: {},
970 /**
971 * @type {Int16Array}
972 */
973 HEAP16: {},
974 /**
975 * @type {Int32Array}
976 */
977 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400978
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500979 _malloc: function() {},
980 _free: function() {},
981 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400982};
Kevin Lubick217056c2018-09-20 17:39:31 -0400983
Kevin Lubick006a6f32018-10-19 14:34:34 -0400984// Public API things that are newly declared in the JS should go here.
985// It's not enough to declare them above, because closure can still erase them
986// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -0400987CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700988CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -0400989
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400990CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400991
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400992CanvasKit.Surface.prototype.dispose = function() {};
993CanvasKit.Surface.prototype.flush = function() {};
994CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
995CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -0400996
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400997CanvasKit.Image.prototype.encodeToData = function() {};
998CanvasKit.Image.prototype.makeShader = function() {};
Alexander Khovansky3e119332018-11-15 02:01:19 +0300999
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001000CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001001
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001002CanvasKit.RSXFormBuilder.prototype.build = function() {};
1003CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1004CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001005CanvasKit.RSXFormBuilder.prototype.set = function() {};
1006
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001007CanvasKit.ColorBuilder.prototype.build = function() {};
1008CanvasKit.ColorBuilder.prototype.delete = function() {};
1009CanvasKit.ColorBuilder.prototype.push = function() {};
1010CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001011
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001012CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1013CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001014
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001015CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1016CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001017
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001018// Define StrokeOpts object
1019var StrokeOpts = {};
1020StrokeOpts.prototype.width;
1021StrokeOpts.prototype.miter_limit;
1022StrokeOpts.prototype.cap;
1023StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001024StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001025
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001026// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001027var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001028HTMLCanvas.prototype.decodeImage = function() {};
1029HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001030HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001031HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001032HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001033HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001034
Elliot Evans28796192020-06-15 12:53:27 -06001035var ImageBitmapRenderingContext = {};
1036ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1037
Kevin Lubickb9db3902018-11-26 11:47:54 -05001038var CanvasRenderingContext2D = {};
1039CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1040CanvasRenderingContext2D.prototype.arc = function() {};
1041CanvasRenderingContext2D.prototype.arcTo = function() {};
1042CanvasRenderingContext2D.prototype.beginPath = function() {};
1043CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1044CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001045CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001046CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001047CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001048CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001049CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001050CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001051CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001052CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001053CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001054CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001055CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001056CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001057CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001058CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001059CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001060CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1061CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001062CanvasRenderingContext2D.prototype.lineTo = function() {};
1063CanvasRenderingContext2D.prototype.measureText = function() {};
1064CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001065CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001066CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1067CanvasRenderingContext2D.prototype.rect = function() {};
1068CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1069CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001070CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001071CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001072CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001073CanvasRenderingContext2D.prototype.scale = function() {};
1074CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001075CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001076CanvasRenderingContext2D.prototype.setTransform = function() {};
1077CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001078CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001079CanvasRenderingContext2D.prototype.strokeText = function() {};
1080CanvasRenderingContext2D.prototype.transform = function() {};
1081CanvasRenderingContext2D.prototype.translate = function() {};
1082
Kevin Lubicka40f8322018-12-17 16:01:36 -05001083var Path2D = {};
1084Path2D.prototype.addPath = function() {};
1085Path2D.prototype.arc = function() {};
1086Path2D.prototype.arcTo = function() {};
1087Path2D.prototype.bezierCurveTo = function() {};
1088Path2D.prototype.closePath = function() {};
1089Path2D.prototype.ellipse = function() {};
1090Path2D.prototype.lineTo = function() {};
1091Path2D.prototype.moveTo = function() {};
1092Path2D.prototype.quadraticCurveTo = function() {};
1093Path2D.prototype.rect = function() {};
1094
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001095var LinearCanvasGradient = {};
1096LinearCanvasGradient.prototype.addColorStop = function() {};
1097var RadialCanvasGradient = {};
1098RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001099var CanvasPattern = {};
1100CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001101
Kevin Lubick52b9f372018-12-04 13:57:36 -05001102var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001103 /**
1104 * @type {Uint8ClampedArray}
1105 */
1106 data: {},
1107 height: {},
1108 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001109};
1110
Kevin Lubickd29edd72018-12-07 08:29:52 -05001111var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001112 a: {},
1113 b: {},
1114 c: {},
1115 d: {},
1116 e: {},
1117 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001118};
1119
Kevin Lubick217056c2018-09-20 17:39:31 -04001120// 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 -05001121function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001122
1123// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1124// to override it in the puppeteer tests
1125var LibraryEGL = {
1126 contextAttributes: {
1127 majorVersion: {}
1128 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001129}