blob: d1ebc0aac8434942822a3a75a639aff4e7fc20f8 [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() {},
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050065 deleteContext: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050066 getColorComponents: function() {},
67 getDecodeCacheLimitBytes: function() {},
68 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040069 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050070 multiplyByAlpha: function() {},
71 parseColorString: function() {},
72 setCurrentContext: function() {},
73 setDecodeCacheLimitBytes: function() {},
Kevin Lubick217056c2018-09-20 17:39:31 -040074
Kevin Lubicke70af512020-05-14 14:50:54 -040075 // Defined by emscripten.
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050076 createContext: function() {},
Kevin Lubicke70af512020-05-14 14:50:54 -040077
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050078 // private API (i.e. things declared in the bindings that we use
79 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040080 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050082 _MakeManagedAnimation: function() {},
83 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040084 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050085 _decodeAnimatedImage: function() {},
86 _decodeImage: function() {},
87 _drawShapedText: 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() {},
Kevin Lubicke677f4a2020-11-04 09:46:22 -0500129 getLineMetrics: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500130 getLongestLine: function() {},
131 getMaxIntrinsicWidth: function() {},
132 getMaxWidth: function() {},
133 getMinIntrinsicWidth: function() {},
134 getWordBoundary: function() {},
135 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400136
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500137 // private API
138 /** @return {Float32Array} */
139 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700140 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500141 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400142
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400143 ParagraphBuilder: {
144 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700145 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400146 addText: function() {},
147 build: function() {},
148 pop: function() {},
149
150 prototype: {
151 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400152 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700153 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400154 },
155
156 // private API
157 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700158 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400159 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400160 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700161 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400162 },
163
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400164 RuntimeEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500165 // public API (from C++ bindings)
166 Make: function() {},
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500167
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500168 // private API
169 _makeShader: function() {},
170 _makeShaderWithChildren: function() {},
171 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500172
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500173 ParagraphStyle: function() {},
174 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400175 ColorBuilder: function() {},
176 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400177
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500178 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400179 prototype: {
180 getBounds: function() {},
181 },
182 // private API (from C++ bindings)
183 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500184 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500185
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400186 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500187 // public API (from C++ bindings)
188 decodeNextFrame: function() {},
189 getFrameCount: function() {},
190 getRepetitionCount: function() {},
191 height: function() {},
192 reset: function() {},
193 width: function() {},
194 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400195
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400196 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500197 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500198 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500199 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400200 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500201 drawImage: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500202 drawImageCubic: function() {},
203 drawImageOptions: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400204 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500205 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500206 drawPaint: function() {},
207 drawParagraph: function() {},
208 drawPath: function() {},
209 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400210 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500211 drawText: function() {},
212 drawTextBlob: function() {},
213 drawVertices: function() {},
214 flush: function() {},
215 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500216 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400217 markCTM: function() {},
218 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500219 restore: function() {},
220 restoreToCount: function() {},
221 rotate: function() {},
222 save: function() {},
Kevin Lubick9fe83912020-11-03 17:08:34 -0500223 saveLayerPaint: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500224 scale: function() {},
225 skew: function() {},
226 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400227
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400228 prototype: {
229 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000230 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400231 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000232 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400233 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000234 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400235 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400236 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000237 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400238 drawImageNine: function() {},
239 drawImageRect: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500240 drawImageRectCubic: function() {},
241 drawImageRectOptions: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400242 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000243 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400244 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000245 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400246 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000247 drawText: function() {},
248 findMarkedCTM: function() {},
249 getLocalToDevice: function() {},
250 getTotalMatrix: function() {},
251 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400252 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000253 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400254 },
255
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500256 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400257 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000258 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400259 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400260 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400261 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500262 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400263 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000264 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400265 _drawImageNine: function() {},
266 _drawImageRect: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500267 _drawImageRectCubic: function() {},
268 _drawImageRectOptions: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400269 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500270 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400271 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000272 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400273 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500274 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000275 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000276 _getLocalToDevice: function() {},
277 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500278 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400279 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500280 _writePixels: function() {},
281 delete: function() {},
282 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400283
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400284 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500285 // public API (from C++ bindings and JS interface)
286 MakeBlend: function() {},
287 MakeCompose: function() {},
288 MakeLerp: function() {},
289 MakeLinearToSRGBGamma: function() {},
290 MakeMatrix: function() {},
291 MakeSRGBToLinearGamma: function() {},
292 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400293 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500294 _makeMatrix: function() {},
295 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400296
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400297 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500298 concat: function() {},
299 identity: function() {},
300 postTranslate: function() {},
301 rotated: function() {},
302 scaled: function() {},
303 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400304
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400305 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400306 Equals: function() {},
307 SRGB: {},
308 DISPLAY_P3: {},
309 ADOBE_RGB: {},
310 // private API (from C++ bindings)
311 _MakeSRGB: function() {},
312 _MakeDisplayP3: function() {},
313 _MakeAdobeRGB: function() {},
314 },
315
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400316 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500317 next: function() {},
318 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500319
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400320 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500321 getPosTan: function() {},
322 getSegment: function() {},
323 isClosed: function() {},
324 length: function() {},
325 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500326
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400327 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500328 // public API (from C++ bindings)
329 getScaleX: function() {},
330 getSize: function() {},
331 getSkewX: function() {},
332 getTypeface: function() {},
333 measureText: function() {},
334 setHinting: function() {},
335 setLinearMetrics: function() {},
336 setScaleX: function() {},
337 setSize: function() {},
338 setSkewX: function() {},
339 setSubpixel: function() {},
340 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400341
342 prototype: {
343 getGlyphBounds: function() {},
344 getGlyphIDs: function() {},
345 getGlyphWidths: function() {},
346 getWidths: function() {},
347 },
348
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500349 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400350 _getGlyphIDs: function() {},
351 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500352 _getWidths: function() {},
353 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500354
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400355 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500356 // public API (from C++ and JS bindings)
357 FromData: function() {},
358 RefDefault: function() {},
359 countFamilies: function() {},
360 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500361
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500362 // private API
363 _makeTypefaceFromData: function() {},
364 _fromData: function() {},
365 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500366
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700367 TypefaceFontProvider: {
368 // public API (from C++ and JS bindings)
369 Make: function() {},
370 registerFont: function() {},
371
372 // private API
373 _registerFont: function() {},
374 },
375
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400376 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500377 // public API (from C++ bindings)
Kevin Lubickae0d3ff2020-11-18 11:23:15 -0500378 getColorSpace: function() {},
379 getImageInfo: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500380 makeCopyWithDefaultMipmaps: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500381 height: function() {},
382 width: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500383
384 prototype: {
385 encodeToData: function() {},
386 makeShaderCubic: function() {},
387 makeShaderOptions: function() {},
388 },
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500389 // private API
390 _encodeToData: function() {},
391 _encodeToDataWithFormat: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500392 _makeShaderCubic: function() {},
393 _makeShaderOptions: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500394 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400395
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400396 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500397 MakeBlur: function() {},
398 MakeColorFilter: function() {},
399 MakeCompose: function() {},
400 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400401
402 // private API
403 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500404 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400405
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500406 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400407 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500408 identity: function() {},
409 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400410 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500411 multiply: function() {},
412 rotatedUnitSinCos: function() {},
413 rotated: function() {},
414 scaled: function() {},
415 translated: function() {},
416 lookat: function() {},
417 perspective: function() {},
418 rc: function() {},
419 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400420 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500421 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500422
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400423 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500424 identity: function() {},
425 invert: function() {},
426 mapPoints: function() {},
427 multiply: function() {},
428 rotated: function() {},
429 scaled: function() {},
430 skewed: function() {},
431 translated: function() {},
432 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500433
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400434 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500435 MakeBlur: function() {},
436 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400437
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400438 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500439 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400440 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500441 copy: function() {},
442 getBlendMode: function() {},
443 getColor: function() {},
444 getFilterQuality: function() {},
445 getStrokeCap: function() {},
446 getStrokeJoin: function() {},
447 getStrokeMiter: function() {},
448 getStrokeWidth: function() {},
449 setAntiAlias: function() {},
450 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400451 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500452 setFilterQuality: function() {},
453 setImageFilter: function() {},
454 setMaskFilter: function() {},
455 setPathEffect: function() {},
456 setShader: function() {},
457 setStrokeCap: function() {},
458 setStrokeJoin: function() {},
459 setStrokeMiter: function() {},
460 setStrokeWidth: function() {},
461 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500462
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400463 prototype: {
464 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400465 setColorComponents: function() {},
466 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400467 },
468
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500469 // Private API
470 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400471 _getColor: function() {},
472 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500473 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500474
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400475 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400476 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500477 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400478 MakeDiscrete: function() {},
479
480 // Private C++ API
481 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500482 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500483
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400484 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500485 // public API (from C++ bindings)
486 draw: function() {},
487 getEffectUniform: function() {},
488 getEffectUniformCount: function() {},
489 getEffectUniformFloatCount: function() {},
490 getEffectUniformName: function() {},
491 getParticleUniformCount: function() {},
492 getParticleUniformFloatCount: function() {},
493 getParticleUniformName: function() {},
494 getParticleUniform: function() {},
495 setPosition: function() {},
496 setRate: function() {},
497 start: function() {},
498 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500499
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500500 // private API (from C++ bindings)
501 _effectUniformPtr: function() {},
502 _particleUniformPtr: function() {},
503 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500504
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400505 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400506 // public API (from C++ and JS bindings)
507 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400508 MakeFromSVGString: function() {},
509 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400510 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500511 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400512 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500513 copy: function() {},
514 countPoints: function() {},
515 equals: function() {},
516 getBounds: function() {},
517 getFillType: function() {},
518 getPoint: function() {},
519 isEmpty: function() {},
520 isVolatile: function() {},
521 reset: function() {},
522 rewind: function() {},
523 setFillType: function() {},
524 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400525 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500526 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400527
Kevin Lubickf8823b52020-09-03 10:02:10 -0400528 prototype: {
529 addArc: function() {},
530 addOval: function() {},
531 addPath: function() {},
532 addPoly: function() {},
533 addRect: function() {},
534 addRRect: function() {},
535 addVerbsPointsWeights: function() {},
536 arc: function() {},
537 arcToOval: function() {},
538 arcToRotated: function() {},
539 arcToTangent: function() {},
540 close: function() {},
541 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400542 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400543 cubicTo: function() {},
544 dash: function() {},
545 lineTo: function() {},
546 moveTo: function() {},
547 offset: function() {},
548 op: function() {},
549 quadTo: function() {},
550 rArcTo: function() {},
551 rConicTo: function() {},
552 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400553 rLineTo: function() {},
554 rMoveTo: function() {},
555 rQuadTo: function() {},
556 simplify: function() {},
557 stroke: function() {},
558 transform: function() {},
559 trim: function() {},
560 },
561
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500562 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400563 _MakeFromCmds: function() {},
564 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500565 _addArc: function() {},
566 _addOval: function() {},
567 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000568 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400569 _addRect: function() {},
570 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400571 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400572 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000573 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400574 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500575 _close: function() {},
576 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400577 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500578 _cubicTo: function() {},
579 _dash: function() {},
580 _lineTo: function() {},
581 _moveTo: function() {},
582 _op: function() {},
583 _quadTo: function() {},
584 _rArcTo: function() {},
585 _rConicTo: function() {},
586 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400587 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500588 _rLineTo: function() {},
589 _rMoveTo: function() {},
590 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500591 _simplify: function() {},
592 _stroke: function() {},
593 _transform: function() {},
594 _trim: function() {},
595 delete: function() {},
596 dump: function() {},
597 dumpHex: function() {},
598 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400599
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400600 PathMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500601 getLength: function() {},
602 getSegment: function() {},
603 getPosTan: function() {},
604 isClosed: function() {},
605 nextContour: function() {},
606 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400607
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400608 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500609 serialize: function() {},
610 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400611
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400612 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500613 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400614 prototype: {
615 beginRecording: function() {},
616 },
617 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500618 },
Kevin Lubick62836902019-12-09 09:04:26 -0500619
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400620 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400621 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500622 Blend: function() {},
623 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500624 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400625 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400626 MakeBlend: function() {},
627 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400628 MakeFractalNoise: function() {},
629 MakeImprovedNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400630 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400631 MakeLinearGradient: function() {},
632 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700633 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400634 MakeTurbulence: function() {},
635 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400636
637 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400638 _MakeColor: function() {},
639 _MakeLinearGradient: function() {},
640 _MakeRadialGradient: function() {},
641 _MakeSweepGradient: function() {},
642 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500643 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400644
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400645 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500646 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400647 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500648 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400649 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400650
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500651 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600652 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400653 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500654 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400655 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400656
Kevin Lubickf8823b52020-09-03 10:02:10 -0400657 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400658 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400659 makeImageSnapshot: function() {},
660 },
661
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500662 // private API
663 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400664 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500665 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500666 delete: function() {},
667 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500668
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400669 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500670 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400671 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500672 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400673 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500674 MakeFromText: function() {},
675 MakeOnPath: function() {},
676 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400677 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500678 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400679 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500680 _MakeFromText: function() {},
681 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500682
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500683 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400684 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500685 add: function() {},
686 sub: function() {},
687 dot: function() {},
688 cross: function() {},
689 normalize: function() {},
690 mulScalar: function() {},
691 length: function() {},
692 lengthSquared: function() {},
693 dist: function() {},
694 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400695
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400696 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500697 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500698 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400699
700 prototype: {
701 bounds: function() {},
702 },
703 // private API (from C++ bindings)
704
705 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500706 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400707
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400708 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500709 colors: function() {},
710 detach: function() {},
711 indices: function() {},
712 positions: function() {},
713 texCoords: function() {},
714 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400715
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500716 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400717
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500718 // Constants and Enums
719 gpu: {},
720 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400721
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500722 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400723 BLACK: {},
724 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400726 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500727 BLUE: {},
728 YELLOW: {},
729 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400730 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500731
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500732 MOVE_VERB: {},
733 LINE_VERB: {},
734 QUAD_VERB: {},
735 CONIC_VERB: {},
736 CUBIC_VERB: {},
737 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500738
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500739 NoDecoration: {},
740 UnderlineDecoration: {},
741 OverlineDecoration: {},
742 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400743
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500744 SaveLayerInitWithPrevious: {},
745 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400746
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500747 Affinity: {
748 Upstream: {},
749 Downstream: {},
750 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400751
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500752 AlphaType: {
753 Opaque: {},
754 Premul: {},
755 Unpremul: {},
756 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500757
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500758 BlendMode: {
759 Clear: {},
760 Src: {},
761 Dst: {},
762 SrcOver: {},
763 DstOver: {},
764 SrcIn: {},
765 DstIn: {},
766 SrcOut: {},
767 DstOut: {},
768 SrcATop: {},
769 DstATop: {},
770 Xor: {},
771 Plus: {},
772 Modulate: {},
773 Screen: {},
774 Overlay: {},
775 Darken: {},
776 Lighten: {},
777 ColorDodge: {},
778 ColorBurn: {},
779 HardLight: {},
780 SoftLight: {},
781 Difference: {},
782 Exclusion: {},
783 Multiply: {},
784 Hue: {},
785 Saturation: {},
786 Color: {},
787 Luminosity: {},
788 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500789
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500790 BlurStyle: {
791 Normal: {},
792 Solid: {},
793 Outer: {},
794 Inner: {},
795 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500796
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500797 ClipOp: {
798 Difference: {},
799 Intersect: {},
800 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500801
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500802 ColorType: {
803 Alpha_8: {},
804 RGB_565: {},
805 ARGB_4444: {},
806 RGBA_8888: {},
807 RGB_888x: {},
808 BGRA_8888: {},
809 RGBA_1010102: {},
810 RGB_101010x: {},
811 Gray_8: {},
812 RGBA_F16: {},
813 RGBA_F32: {},
814 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500815
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500816 FillType: {
817 Winding: {},
818 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500819 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400820
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500821 FilterQuality: {
822 None: {},
823 Low: {},
824 Medium: {},
825 High: {},
826 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500827
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500828 FontSlant: {
829 Upright: {},
830 Italic: {},
831 Oblique: {},
832 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400833
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500834 FontHinting: {
835 None: {},
836 Slight: {},
837 Normal: {},
838 Full: {},
839 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500840
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500841 FontWeight: {
842 Invisible: {},
843 Thin: {},
844 ExtraLight: {},
845 Light: {},
846 Normal: {},
847 Medium: {},
848 SemiBold: {},
849 Bold: {},
850 ExtraBold: {},
851 Black: {},
852 ExtraBlack: {},
853 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400854
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500855 FontWidth: {
856 UltraCondensed: {},
857 ExtraCondensed: {},
858 Condensed: {},
859 SemiCondensed: {},
860 Normal: {},
861 SemiExpanded: {},
862 Expanded: {},
863 ExtraExpanded: {},
864 UltraExpanded: {},
865 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400866
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500867 ImageFormat: {
868 PNG: {},
869 JPEG: {},
870 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300871
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500872 PaintStyle: {
873 Fill: {},
874 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500875 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500876
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500877 PathOp: {
878 Difference: {},
879 Intersect: {},
880 Union: {},
881 XOR: {},
882 ReverseDifference: {},
883 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500884
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500885 PointMode: {
886 Points: {},
887 Lines: {},
888 Polygon: {},
889 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500890
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500891 RectHeightStyle: {
892 Tight: {},
893 Max: {},
894 IncludeLineSpacingMiddle: {},
895 IncludeLineSpacingTop: {},
896 IncludeLineSpacingBottom: {},
897 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400898
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500899 RectWidthStyle: {
900 Tight: {},
901 Max: {},
902 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400903
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500904 StrokeCap: {
905 Butt: {},
906 Round: {},
907 Square: {},
908 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500909
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500910 StrokeJoin: {
911 Miter: {},
912 Round: {},
913 Bevel: {},
914 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500915
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500916 TextAlign: {
917 Left: {},
918 Right: {},
919 Center: {},
920 Justify: {},
921 Start: {},
922 End: {},
923 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400924
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500925 TextDirection: {
926 LTR: {},
927 RTL: {},
928 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400929
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700930 DecorationStyle: {
931 Solid: {},
932 Double: {},
933 Dotted: {},
934 Dashed: {},
935 Wavy: {},
936 },
937
938 PlaceholderAlignment: {
939 Baseline: {},
940 AboveBaseline: {},
941 BelowBaseline: {},
942 Top: {},
943 Bottom: {},
944 Middle: {},
945 },
946
947 TextBaseline: {
948 Alphabetic: {},
949 Ideographic: {},
950 },
951
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500952 TileMode: {
953 Clamp: {},
954 Repeat: {},
955 Mirror: {},
956 Decal: {},
957 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500958
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500959 VertexMode: {
960 Triangles: {},
961 TrianglesStrip: {},
962 TriangleFan: {},
963 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500964
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500965 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400966
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500967 /**
968 * @type {Float32Array}
969 */
970 HEAPF32: {},
971 /**
972 * @type {Float64Array}
973 */
974 HEAPF64: {},
975 /**
976 * @type {Uint8Array}
977 */
978 HEAPU8: {},
979 /**
980 * @type {Uint16Array}
981 */
982 HEAPU16: {},
983 /**
984 * @type {Uint32Array}
985 */
986 HEAPU32: {},
987 /**
988 * @type {Int8Array}
989 */
990 HEAP8: {},
991 /**
992 * @type {Int16Array}
993 */
994 HEAP16: {},
995 /**
996 * @type {Int32Array}
997 */
998 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -0400999
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001000 _malloc: function() {},
1001 _free: function() {},
1002 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -04001003};
Kevin Lubick217056c2018-09-20 17:39:31 -04001004
Kevin Lubick006a6f32018-10-19 14:34:34 -04001005// Public API things that are newly declared in the JS should go here.
1006// It's not enough to declare them above, because closure can still erase them
1007// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -04001008CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -07001009CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -04001010
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001011CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -04001012
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001013CanvasKit.Surface.prototype.dispose = function() {};
1014CanvasKit.Surface.prototype.flush = function() {};
1015CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1016CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001017
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001018CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001019
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001020CanvasKit.RSXFormBuilder.prototype.build = function() {};
1021CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1022CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001023CanvasKit.RSXFormBuilder.prototype.set = function() {};
1024
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001025CanvasKit.ColorBuilder.prototype.build = function() {};
1026CanvasKit.ColorBuilder.prototype.delete = function() {};
1027CanvasKit.ColorBuilder.prototype.push = function() {};
1028CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001029
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001030CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1031CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001032
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001033CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1034CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001035
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001036// Define StrokeOpts object
1037var StrokeOpts = {};
1038StrokeOpts.prototype.width;
1039StrokeOpts.prototype.miter_limit;
1040StrokeOpts.prototype.cap;
1041StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001042StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001043
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001044// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001045var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001046HTMLCanvas.prototype.decodeImage = function() {};
1047HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001048HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001049HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001050HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001051HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001052
Elliot Evans28796192020-06-15 12:53:27 -06001053var ImageBitmapRenderingContext = {};
1054ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1055
Kevin Lubickb9db3902018-11-26 11:47:54 -05001056var CanvasRenderingContext2D = {};
1057CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1058CanvasRenderingContext2D.prototype.arc = function() {};
1059CanvasRenderingContext2D.prototype.arcTo = function() {};
1060CanvasRenderingContext2D.prototype.beginPath = function() {};
1061CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1062CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001063CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001064CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001065CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001066CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001067CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001068CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001069CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001070CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001071CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001072CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001073CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001074CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001075CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001076CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001077CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001078CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1079CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001080CanvasRenderingContext2D.prototype.lineTo = function() {};
1081CanvasRenderingContext2D.prototype.measureText = function() {};
1082CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001083CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001084CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1085CanvasRenderingContext2D.prototype.rect = function() {};
1086CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1087CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001088CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001089CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001090CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001091CanvasRenderingContext2D.prototype.scale = function() {};
1092CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001093CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001094CanvasRenderingContext2D.prototype.setTransform = function() {};
1095CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001096CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001097CanvasRenderingContext2D.prototype.strokeText = function() {};
1098CanvasRenderingContext2D.prototype.transform = function() {};
1099CanvasRenderingContext2D.prototype.translate = function() {};
1100
Kevin Lubicka40f8322018-12-17 16:01:36 -05001101var Path2D = {};
1102Path2D.prototype.addPath = function() {};
1103Path2D.prototype.arc = function() {};
1104Path2D.prototype.arcTo = function() {};
1105Path2D.prototype.bezierCurveTo = function() {};
1106Path2D.prototype.closePath = function() {};
1107Path2D.prototype.ellipse = function() {};
1108Path2D.prototype.lineTo = function() {};
1109Path2D.prototype.moveTo = function() {};
1110Path2D.prototype.quadraticCurveTo = function() {};
1111Path2D.prototype.rect = function() {};
1112
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001113var LinearCanvasGradient = {};
1114LinearCanvasGradient.prototype.addColorStop = function() {};
1115var RadialCanvasGradient = {};
1116RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001117var CanvasPattern = {};
1118CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001119
Kevin Lubick52b9f372018-12-04 13:57:36 -05001120var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001121 /**
1122 * @type {Uint8ClampedArray}
1123 */
1124 data: {},
1125 height: {},
1126 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001127};
1128
Kevin Lubickd29edd72018-12-07 08:29:52 -05001129var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001130 a: {},
1131 b: {},
1132 c: {},
1133 d: {},
1134 e: {},
1135 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001136};
1137
Kevin Lubick217056c2018-09-20 17:39:31 -04001138// 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 -05001139function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001140
1141// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1142// to override it in the puppeteer tests
1143var LibraryEGL = {
1144 contextAttributes: {
1145 majorVersion: {}
1146 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001147}