blob: 451041ce0381fb3d1139a32b159d9c232d12fa61 [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() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050039 MakeCanvas: function() {},
40 MakeCanvasSurface: function() {},
41 MakeGrContext: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040042 /** @return {CanvasKit.AnimatedImage} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050043 MakeAnimatedImageFromEncoded: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040044 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050045 MakeImage: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040046 /** @return {CanvasKit.Image} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050047 MakeImageFromEncoded: function() {},
Elliot Evans28796192020-06-15 12:53:27 -060048 MakeImageFromCanvasImageSource: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050049 MakeOnScreenGLSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050050 MakeRenderTarget: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040051 MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050052 MakeSWCanvasSurface: function() {},
53 MakeManagedAnimation: function() {},
54 MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040055 MakeVertices: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050056 MakeSurface: function() {},
Kevin Lubicka8f4c912020-11-04 07:23:37 -050057 MakeRasterDirectSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050058 MakeWebGLCanvasSurface: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050059 Malloc: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -040060 MallocGlyphIDs: function() {},
Kevin Lubickcf118922020-05-28 14:43:38 -040061 Free: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050062 computeTonalColors: function() {},
63 currentContext: function() {},
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050064 deleteContext: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050065 getColorComponents: function() {},
66 getDecodeCacheLimitBytes: function() {},
67 getDecodeCacheUsageBytes: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040068 getDataBytes: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050069 multiplyByAlpha: function() {},
70 parseColorString: function() {},
71 setCurrentContext: function() {},
72 setDecodeCacheLimitBytes: function() {},
Kevin Lubickcbaea292021-01-13 14:16:58 -050073 getShadowLocalBounds: function() {},
Kevin Lubicke70af512020-05-14 14:50:54 -040074 // Defined by emscripten.
Kevin Lubickf7fdf1a2020-12-10 15:21:01 -050075 createContext: function() {},
Kevin Lubicke70af512020-05-14 14:50:54 -040076
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050077 // private API (i.e. things declared in the bindings that we use
78 // in the pre-js file)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -040079 _computeTonalColors: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050080 _MakeImage: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050081 _MakeManagedAnimation: function() {},
82 _MakeParticles: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -040083 _MakePicture: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -050084 _decodeAnimatedImage: function() {},
85 _decodeImage: function() {},
86 _drawShapedText: function() {},
Kevin Lubickcbaea292021-01-13 14:16:58 -050087 _getShadowLocalBounds: 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() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400629 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400630 MakeLinearGradient: function() {},
631 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700632 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400633 MakeTurbulence: function() {},
634 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400635
636 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400637 _MakeColor: function() {},
638 _MakeLinearGradient: function() {},
639 _MakeRadialGradient: function() {},
640 _MakeSweepGradient: function() {},
641 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500642 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400643
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400644 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500645 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400646 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500647 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400648 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400649
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500650 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600651 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400652 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400654 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400655
Kevin Lubickf8823b52020-09-03 10:02:10 -0400656 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400657 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400658 makeImageSnapshot: function() {},
659 },
660
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 // private API
662 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400663 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500664 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500665 delete: function() {},
666 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500667
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400668 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400670 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500671 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400672 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500673 MakeFromText: function() {},
674 MakeOnPath: function() {},
675 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400676 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500677 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400678 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 _MakeFromText: function() {},
680 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500681
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500682 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400683 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500684 add: function() {},
685 sub: function() {},
686 dot: function() {},
687 cross: function() {},
688 normalize: function() {},
689 mulScalar: function() {},
690 length: function() {},
691 lengthSquared: function() {},
692 dist: function() {},
693 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400694
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400695 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500696 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500697 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400698
699 prototype: {
700 bounds: function() {},
701 },
702 // private API (from C++ bindings)
703
704 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400706
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400707 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500708 colors: function() {},
709 detach: function() {},
710 indices: function() {},
711 positions: function() {},
712 texCoords: function() {},
713 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400714
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500715 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400716
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500717 // Constants and Enums
718 gpu: {},
719 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400720
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500721 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400722 BLACK: {},
723 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500724 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400725 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500726 BLUE: {},
727 YELLOW: {},
728 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400729 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500730
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500731 MOVE_VERB: {},
732 LINE_VERB: {},
733 QUAD_VERB: {},
734 CONIC_VERB: {},
735 CUBIC_VERB: {},
736 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500737
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500738 NoDecoration: {},
739 UnderlineDecoration: {},
740 OverlineDecoration: {},
741 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400742
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500743 SaveLayerInitWithPrevious: {},
744 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400745
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500746 Affinity: {
747 Upstream: {},
748 Downstream: {},
749 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400750
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500751 AlphaType: {
752 Opaque: {},
753 Premul: {},
754 Unpremul: {},
755 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500756
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500757 BlendMode: {
758 Clear: {},
759 Src: {},
760 Dst: {},
761 SrcOver: {},
762 DstOver: {},
763 SrcIn: {},
764 DstIn: {},
765 SrcOut: {},
766 DstOut: {},
767 SrcATop: {},
768 DstATop: {},
769 Xor: {},
770 Plus: {},
771 Modulate: {},
772 Screen: {},
773 Overlay: {},
774 Darken: {},
775 Lighten: {},
776 ColorDodge: {},
777 ColorBurn: {},
778 HardLight: {},
779 SoftLight: {},
780 Difference: {},
781 Exclusion: {},
782 Multiply: {},
783 Hue: {},
784 Saturation: {},
785 Color: {},
786 Luminosity: {},
787 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500788
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500789 BlurStyle: {
790 Normal: {},
791 Solid: {},
792 Outer: {},
793 Inner: {},
794 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500795
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500796 ClipOp: {
797 Difference: {},
798 Intersect: {},
799 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500800
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500801 ColorType: {
802 Alpha_8: {},
803 RGB_565: {},
804 ARGB_4444: {},
805 RGBA_8888: {},
806 RGB_888x: {},
807 BGRA_8888: {},
808 RGBA_1010102: {},
809 RGB_101010x: {},
810 Gray_8: {},
811 RGBA_F16: {},
812 RGBA_F32: {},
813 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500814
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500815 FillType: {
816 Winding: {},
817 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500818 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400819
Kevin Lubick2d633492020-12-17 09:58:32 -0500820 FilterMode: {
821 Linear: {},
822 Nearest: {},
823 },
824
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500825 FilterQuality: {
826 None: {},
827 Low: {},
828 Medium: {},
829 High: {},
830 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500831
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500832 FontSlant: {
833 Upright: {},
834 Italic: {},
835 Oblique: {},
836 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400837
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500838 FontHinting: {
839 None: {},
840 Slight: {},
841 Normal: {},
842 Full: {},
843 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500844
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500845 FontWeight: {
846 Invisible: {},
847 Thin: {},
848 ExtraLight: {},
849 Light: {},
850 Normal: {},
851 Medium: {},
852 SemiBold: {},
853 Bold: {},
854 ExtraBold: {},
855 Black: {},
856 ExtraBlack: {},
857 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400858
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500859 FontWidth: {
860 UltraCondensed: {},
861 ExtraCondensed: {},
862 Condensed: {},
863 SemiCondensed: {},
864 Normal: {},
865 SemiExpanded: {},
866 Expanded: {},
867 ExtraExpanded: {},
868 UltraExpanded: {},
869 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400870
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500871 ImageFormat: {
872 PNG: {},
873 JPEG: {},
874 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300875
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500876 PaintStyle: {
877 Fill: {},
878 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500879 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500880
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500881 PathOp: {
882 Difference: {},
883 Intersect: {},
884 Union: {},
885 XOR: {},
886 ReverseDifference: {},
887 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500888
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500889 PointMode: {
890 Points: {},
891 Lines: {},
892 Polygon: {},
893 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500894
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500895 RectHeightStyle: {
896 Tight: {},
897 Max: {},
898 IncludeLineSpacingMiddle: {},
899 IncludeLineSpacingTop: {},
900 IncludeLineSpacingBottom: {},
901 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400902
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500903 RectWidthStyle: {
904 Tight: {},
905 Max: {},
906 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400907
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500908 StrokeCap: {
909 Butt: {},
910 Round: {},
911 Square: {},
912 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500913
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500914 StrokeJoin: {
915 Miter: {},
916 Round: {},
917 Bevel: {},
918 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500919
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500920 TextAlign: {
921 Left: {},
922 Right: {},
923 Center: {},
924 Justify: {},
925 Start: {},
926 End: {},
927 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400928
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500929 TextDirection: {
930 LTR: {},
931 RTL: {},
932 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400933
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700934 DecorationStyle: {
935 Solid: {},
936 Double: {},
937 Dotted: {},
938 Dashed: {},
939 Wavy: {},
940 },
941
942 PlaceholderAlignment: {
943 Baseline: {},
944 AboveBaseline: {},
945 BelowBaseline: {},
946 Top: {},
947 Bottom: {},
948 Middle: {},
949 },
950
951 TextBaseline: {
952 Alphabetic: {},
953 Ideographic: {},
954 },
955
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500956 TileMode: {
957 Clamp: {},
958 Repeat: {},
959 Mirror: {},
960 Decal: {},
961 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500962
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500963 VertexMode: {
964 Triangles: {},
965 TrianglesStrip: {},
966 TriangleFan: {},
967 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500968
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500969 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400970
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500971 /**
972 * @type {Float32Array}
973 */
974 HEAPF32: {},
975 /**
976 * @type {Float64Array}
977 */
978 HEAPF64: {},
979 /**
980 * @type {Uint8Array}
981 */
982 HEAPU8: {},
983 /**
984 * @type {Uint16Array}
985 */
986 HEAPU16: {},
987 /**
988 * @type {Uint32Array}
989 */
990 HEAPU32: {},
991 /**
992 * @type {Int8Array}
993 */
994 HEAP8: {},
995 /**
996 * @type {Int16Array}
997 */
998 HEAP16: {},
999 /**
1000 * @type {Int32Array}
1001 */
1002 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -04001003
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001004 _malloc: function() {},
1005 _free: function() {},
1006 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -04001007};
Kevin Lubick217056c2018-09-20 17:39:31 -04001008
Kevin Lubick006a6f32018-10-19 14:34:34 -04001009// Public API things that are newly declared in the JS should go here.
1010// It's not enough to declare them above, because closure can still erase them
1011// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -04001012CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -07001013CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -04001014
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001015CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -04001016
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001017CanvasKit.Surface.prototype.dispose = function() {};
1018CanvasKit.Surface.prototype.flush = function() {};
1019CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1020CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001021
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001022CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001023
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001024CanvasKit.RSXFormBuilder.prototype.build = function() {};
1025CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1026CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001027CanvasKit.RSXFormBuilder.prototype.set = function() {};
1028
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001029CanvasKit.ColorBuilder.prototype.build = function() {};
1030CanvasKit.ColorBuilder.prototype.delete = function() {};
1031CanvasKit.ColorBuilder.prototype.push = function() {};
1032CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001033
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001034CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1035CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001036
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001037CanvasKit.ParticleEffect.prototype.effectUniforms = function() {};
1038CanvasKit.ParticleEffect.prototype.particleUniforms = function() {};
Kevin Lubickf8f9cd82020-02-21 08:26:59 -05001039
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001040// Define StrokeOpts object
1041var StrokeOpts = {};
1042StrokeOpts.prototype.width;
1043StrokeOpts.prototype.miter_limit;
1044StrokeOpts.prototype.cap;
1045StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001046StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001047
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001048// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001049var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001050HTMLCanvas.prototype.decodeImage = function() {};
1051HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001052HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001053HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001054HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001055HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001056
Elliot Evans28796192020-06-15 12:53:27 -06001057var ImageBitmapRenderingContext = {};
1058ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1059
Kevin Lubickb9db3902018-11-26 11:47:54 -05001060var CanvasRenderingContext2D = {};
1061CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1062CanvasRenderingContext2D.prototype.arc = function() {};
1063CanvasRenderingContext2D.prototype.arcTo = function() {};
1064CanvasRenderingContext2D.prototype.beginPath = function() {};
1065CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1066CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001067CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001068CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001069CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001070CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001071CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001072CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001073CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001074CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001075CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001076CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001077CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001078CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001079CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001080CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001081CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001082CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1083CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001084CanvasRenderingContext2D.prototype.lineTo = function() {};
1085CanvasRenderingContext2D.prototype.measureText = function() {};
1086CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001087CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001088CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1089CanvasRenderingContext2D.prototype.rect = function() {};
1090CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1091CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001092CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001093CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001094CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001095CanvasRenderingContext2D.prototype.scale = function() {};
1096CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001097CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001098CanvasRenderingContext2D.prototype.setTransform = function() {};
1099CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001100CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001101CanvasRenderingContext2D.prototype.strokeText = function() {};
1102CanvasRenderingContext2D.prototype.transform = function() {};
1103CanvasRenderingContext2D.prototype.translate = function() {};
1104
Kevin Lubicka40f8322018-12-17 16:01:36 -05001105var Path2D = {};
1106Path2D.prototype.addPath = function() {};
1107Path2D.prototype.arc = function() {};
1108Path2D.prototype.arcTo = function() {};
1109Path2D.prototype.bezierCurveTo = function() {};
1110Path2D.prototype.closePath = function() {};
1111Path2D.prototype.ellipse = function() {};
1112Path2D.prototype.lineTo = function() {};
1113Path2D.prototype.moveTo = function() {};
1114Path2D.prototype.quadraticCurveTo = function() {};
1115Path2D.prototype.rect = function() {};
1116
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001117var LinearCanvasGradient = {};
1118LinearCanvasGradient.prototype.addColorStop = function() {};
1119var RadialCanvasGradient = {};
1120RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001121var CanvasPattern = {};
1122CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001123
Kevin Lubick52b9f372018-12-04 13:57:36 -05001124var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001125 /**
1126 * @type {Uint8ClampedArray}
1127 */
1128 data: {},
1129 height: {},
1130 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001131};
1132
Kevin Lubickd29edd72018-12-07 08:29:52 -05001133var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001134 a: {},
1135 b: {},
1136 c: {},
1137 d: {},
1138 e: {},
1139 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001140};
1141
Kevin Lubick217056c2018-09-20 17:39:31 -04001142// 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 -05001143function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001144
1145// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1146// to override it in the puppeteer tests
1147var LibraryEGL = {
1148 contextAttributes: {
1149 majorVersion: {}
1150 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001151}