blob: c6d6e84226adbdeb5232db83f745b27303c12edb [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() {},
Kevin Lubicked962642021-02-02 08:18:11 -050098 size: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -040099 },
100 _render: function() {},
Kevin Lubicked962642021-02-02 08:18:11 -0500101 _size: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400102 },
103
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500104 GrContext: {
105 // public API (from C++ bindings)
106 getResourceCacheLimitBytes: function() {},
107 getResourceCacheUsageBytes: function() {},
108 releaseResourcesAndAbandonContext: function() {},
109 setResourceCacheLimitBytes: function() {},
110 },
Kevin Lubickcd544662019-03-22 15:41:36 -0400111
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400112 ManagedAnimation: {
113 prototype: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400114 render: function() {},
115 seek: function() {},
116 seekFrame: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400117 setColor: function() {},
Kevin Lubicked962642021-02-02 08:18:11 -0500118 size: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400119 },
Kevin Lubickf8823b52020-09-03 10:02:10 -0400120 _render: function() {},
121 _seek: function() {},
122 _seekFrame: function() {},
Kevin Lubicked962642021-02-02 08:18:11 -0500123 _size: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400124 },
125
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500126 Paragraph: {
127 // public API (from C++ bindings)
128 didExceedMaxLines: function() {},
129 getAlphabeticBaseline: function() {},
130 getGlyphPositionAtCoordinate: function() {},
131 getHeight: function() {},
132 getIdeographicBaseline: function() {},
Kevin Lubicke677f4a2020-11-04 09:46:22 -0500133 getLineMetrics: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500134 getLongestLine: function() {},
135 getMaxIntrinsicWidth: function() {},
136 getMaxWidth: function() {},
137 getMinIntrinsicWidth: function() {},
138 getWordBoundary: function() {},
139 layout: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400140
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500141 // private API
142 /** @return {Float32Array} */
143 _getRectsForRange: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700144 _getRectsForPlaceholders: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500145 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400146
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400147 ParagraphBuilder: {
148 Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700149 MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400150 addText: function() {},
151 build: function() {},
152 pop: function() {},
153
154 prototype: {
155 pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400156 pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700157 addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400158 },
159
160 // private API
161 _Make: function() {},
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700162 _MakeFromFontProvider: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400163 _pushStyle: function() {},
Nathaniel Nifonge09b3142020-08-04 09:06:54 -0400164 _pushPaintStyle: function() {},
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700165 _addPlaceholder: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400166 },
167
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400168 RuntimeEffect: {
Kevin Lubick70b67292021-02-03 11:26:12 -0500169 // public API (from JS bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500170 Make: function() {},
Brian Osmanf2f3d522021-02-03 16:12:09 -0500171 getUniform: function() {},
172 getUniformCount: function() {},
173 getUniformFloatCount: function() {},
174 getUniformName: function() {},
Kevin Lubick70b67292021-02-03 11:26:12 -0500175 prototype: {
176 makeShader: function() {},
177 makeShaderWithChildren: function() {},
178 },
179 // private API (from C++ bindings)
180 _Make: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500181 _makeShader: function() {},
182 _makeShaderWithChildren: function() {},
183 },
Kevin Lubick4b5b6452019-12-06 13:55:58 -0500184
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500185 ParagraphStyle: function() {},
186 RSXFormBuilder: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400187 ColorBuilder: function() {},
188 RectBuilder: function() {},
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400189
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500190 ShapedText: {
Kevin Lubickf8823b52020-09-03 10:02:10 -0400191 prototype: {
192 getBounds: function() {},
193 },
194 // private API (from C++ bindings)
195 _getBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500196 },
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500197
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400198 AnimatedImage: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500199 // public API (from C++ bindings)
200 decodeNextFrame: function() {},
201 getFrameCount: function() {},
202 getRepetitionCount: function() {},
203 height: function() {},
204 reset: function() {},
205 width: function() {},
206 },
Kevin Lubick6b921b72019-09-18 16:18:17 -0400207
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400208 Canvas: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500209 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500210 clipPath: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500211 drawCircle: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400212 drawColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500213 drawImage: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500214 drawImageCubic: function() {},
215 drawImageOptions: function() {},
Kevin Lubickc9bece22020-09-15 09:22:36 -0400216 drawImageAtCurrentFrame: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500217 drawLine: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500218 drawPaint: function() {},
219 drawParagraph: function() {},
220 drawPath: function() {},
221 drawPicture: function() {},
Kevin Lubicka1c21172020-09-03 08:31:52 -0400222 drawRect4f: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500223 drawText: function() {},
224 drawTextBlob: function() {},
225 drawVertices: function() {},
226 flush: function() {},
227 getSaveCount: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500228 makeSurface: function() {},
Nathaniel Nifong00de91c2020-05-06 16:22:33 -0400229 markCTM: function() {},
230 findMarkedCTM: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500231 restore: function() {},
232 restoreToCount: function() {},
233 rotate: function() {},
234 save: function() {},
Kevin Lubick9fe83912020-11-03 17:08:34 -0500235 saveLayerPaint: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500236 scale: function() {},
237 skew: function() {},
238 translate: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400239
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400240 prototype: {
241 clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000242 clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400243 clipRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000244 concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400245 drawArc: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000246 drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400247 drawColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400248 drawColorComponents: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000249 drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400250 drawImageNine: function() {},
251 drawImageRect: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500252 drawImageRectCubic: function() {},
253 drawImageRectOptions: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400254 drawOval: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000255 drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400256 drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000257 drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400258 drawShadow: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000259 drawText: function() {},
260 findMarkedCTM: function() {},
261 getLocalToDevice: function() {},
262 getTotalMatrix: function() {},
263 readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400264 saveLayer: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000265 writePixels : function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400266 },
267
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500268 // private API
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400269 _clear: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000270 _clipRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400271 _clipRect: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400272 _concat: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400273 _drawArc: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500274 _drawAtlas: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400275 _drawColor: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000276 _drawDRRect: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400277 _drawImageNine: function() {},
278 _drawImageRect: function() {},
Kevin Lubick72f40762020-12-16 16:00:55 -0500279 _drawImageRectCubic: function() {},
280 _drawImageRectOptions: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400281 _drawOval: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500282 _drawPoints: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400283 _drawRect: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000284 _drawRRect: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400285 _drawShadow: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500286 _drawSimpleText: function() {},
Michael Ludwig370de722020-09-02 21:20:44 +0000287 _findMarkedCTM: function() {},
Kevin Lubickbe728012020-09-03 11:57:12 +0000288 _getLocalToDevice: function() {},
289 _getTotalMatrix: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500290 _readPixels: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400291 _saveLayer: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500292 _writePixels: function() {},
293 delete: function() {},
294 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400295
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400296 ColorFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500297 // public API (from C++ bindings and JS interface)
298 MakeBlend: function() {},
299 MakeCompose: function() {},
300 MakeLerp: function() {},
301 MakeLinearToSRGBGamma: function() {},
302 MakeMatrix: function() {},
303 MakeSRGBToLinearGamma: function() {},
304 // private API (from C++ bindings)
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400305 _MakeBlend: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500306 _makeMatrix: function() {},
307 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400308
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400309 ColorMatrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500310 concat: function() {},
311 identity: function() {},
312 postTranslate: function() {},
313 rotated: function() {},
314 scaled: function() {},
315 },
Kevin Lubickd3729342019-09-12 11:11:25 -0400316
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400317 ColorSpace: {
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400318 Equals: function() {},
319 SRGB: {},
320 DISPLAY_P3: {},
321 ADOBE_RGB: {},
322 // private API (from C++ bindings)
323 _MakeSRGB: function() {},
324 _MakeDisplayP3: function() {},
325 _MakeAdobeRGB: function() {},
326 },
327
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400328 ContourMeasureIter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500329 next: function() {},
330 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500331
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400332 ContourMeasure: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500333 getSegment: function() {},
334 isClosed: function() {},
335 length: function() {},
Kevin Lubicke9e8e5d2021-02-02 10:21:24 -0500336 prototype: {
337 getPosTan: function() {},
338 },
339 _getPosTan: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500340 },
Kevin Lubicke59c1672019-11-20 14:17:53 -0500341
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400342 Font: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500343 // public API (from C++ bindings)
344 getScaleX: function() {},
345 getSize: function() {},
346 getSkewX: function() {},
347 getTypeface: function() {},
348 measureText: function() {},
349 setHinting: function() {},
350 setLinearMetrics: function() {},
351 setScaleX: function() {},
352 setSize: function() {},
353 setSkewX: function() {},
354 setSubpixel: function() {},
355 setTypeface: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400356
357 prototype: {
358 getGlyphBounds: function() {},
359 getGlyphIDs: function() {},
360 getGlyphWidths: function() {},
361 getWidths: function() {},
362 },
363
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500364 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400365 _getGlyphIDs: function() {},
366 _getGlyphWidthBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500367 _getWidths: function() {},
368 },
Kevin Lubick35ac0382019-01-02 15:13:57 -0500369
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400370 FontMgr: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500371 // public API (from C++ and JS bindings)
372 FromData: function() {},
373 RefDefault: function() {},
374 countFamilies: function() {},
375 getFamilyName: function() {},
Kevin Lubickddd0a332018-12-12 10:35:13 -0500376
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500377 // private API
378 _makeTypefaceFromData: function() {},
379 _fromData: function() {},
380 },
Kevin Lubickddd0a332018-12-12 10:35:13 -0500381
Harry Terkelsen10f019c2020-08-04 13:21:09 -0700382 TypefaceFontProvider: {
383 // public API (from C++ and JS bindings)
384 Make: function() {},
385 registerFont: function() {},
386
387 // private API
388 _registerFont: function() {},
389 },
390
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400391 Image: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500392 // public API (from C++ bindings)
Kevin Lubickae0d3ff2020-11-18 11:23:15 -0500393 getColorSpace: function() {},
394 getImageInfo: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500395 makeCopyWithDefaultMipmaps: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500396 height: function() {},
397 width: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500398
399 prototype: {
400 encodeToData: function() {},
401 makeShaderCubic: function() {},
402 makeShaderOptions: function() {},
403 },
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500404 // private API
405 _encodeToData: function() {},
406 _encodeToDataWithFormat: function() {},
Kevin Lubick652d7902020-12-11 14:51:36 -0500407 _makeShaderCubic: function() {},
408 _makeShaderOptions: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500409 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400410
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400411 ImageFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500412 MakeBlur: function() {},
413 MakeColorFilter: function() {},
414 MakeCompose: function() {},
415 MakeMatrixTransform: function() {},
Kevin Lubick6bffe392020-04-02 15:24:15 -0400416
417 // private API
418 _MakeMatrixTransform: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500419 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400420
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500421 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400422 M44: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500423 identity: function() {},
424 invert: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400425 mustInvert: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500426 multiply: function() {},
427 rotatedUnitSinCos: function() {},
428 rotated: function() {},
429 scaled: function() {},
430 translated: function() {},
431 lookat: function() {},
432 perspective: function() {},
433 rc: function() {},
434 transpose: function() {},
Nathaniel Nifong6130d502020-07-06 19:50:13 -0400435 setupCamera: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500436 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500437
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400438 Matrix: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500439 identity: function() {},
440 invert: function() {},
441 mapPoints: function() {},
442 multiply: function() {},
443 rotated: function() {},
444 scaled: function() {},
445 skewed: function() {},
446 translated: function() {},
447 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500448
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400449 MaskFilter: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500450 MakeBlur: function() {},
451 },
Kevin Lubick15b40232019-10-29 09:55:39 -0400452
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400453 Paint: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500454 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400455 /** @return {CanvasKit.Paint} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500456 copy: function() {},
457 getBlendMode: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500458 getFilterQuality: function() {},
459 getStrokeCap: function() {},
460 getStrokeJoin: function() {},
461 getStrokeMiter: function() {},
462 getStrokeWidth: function() {},
463 setAntiAlias: function() {},
464 setBlendMode: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400465 setColorInt: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500466 setFilterQuality: function() {},
467 setImageFilter: function() {},
468 setMaskFilter: function() {},
469 setPathEffect: function() {},
470 setShader: function() {},
471 setStrokeCap: function() {},
472 setStrokeJoin: function() {},
473 setStrokeMiter: function() {},
474 setStrokeWidth: function() {},
475 setStyle: function() {},
Kevin Lubickb9db3902018-11-26 11:47:54 -0500476
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400477 prototype: {
Kevin Lubicked962642021-02-02 08:18:11 -0500478 getColor: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400479 setColor: function() {},
Kevin Lubick93f1a382020-06-02 16:15:23 -0400480 setColorComponents: function() {},
481 setColorInt: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400482 },
483
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500484 // Private API
485 delete: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400486 _getColor: function() {},
487 _setColor: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500488 },
Kevin Lubick1a05fce2018-11-20 12:51:16 -0500489
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400490 PathEffect: {
Kevin Lubickf279c632020-03-18 09:53:55 -0400491 MakeCorner: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500492 MakeDash: function() {},
Kevin Lubickf279c632020-03-18 09:53:55 -0400493 MakeDiscrete: function() {},
494
495 // Private C++ API
496 _MakeDash: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500497 },
Nathaniel Nifong23b0ed92020-03-04 15:43:50 -0500498
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400499 ParticleEffect: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500500 // public API (from C++ bindings)
501 draw: function() {},
Brian Osman38316892021-01-29 14:32:09 -0500502 getUniform: function() {},
503 getUniformCount: function() {},
504 getUniformFloatCount: function() {},
505 getUniformName: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500506 setRate: function() {},
507 start: function() {},
508 update: function() {},
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500509
Kevin Lubicked962642021-02-02 08:18:11 -0500510 prototype: {
511 setPosition: function() {},
512 uniforms: function() {},
513 },
514
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500515 // private API (from C++ bindings)
Brian Osman38316892021-01-29 14:32:09 -0500516 _uniformPtr: function() {},
Kevin Lubicked962642021-02-02 08:18:11 -0500517 _setPosition: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500518 },
Kevin Lubickf8f9cd82020-02-21 08:26:59 -0500519
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400520 Path: {
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400521 // public API (from C++ and JS bindings)
522 MakeFromCmds: function() {},
Kevin Lubickffc20c22020-10-09 10:55:06 -0400523 MakeFromSVGString: function() {},
524 MakeFromOp: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400525 MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500526 contains: function() {},
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400527 /** @return {CanvasKit.Path} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500528 copy: function() {},
529 countPoints: function() {},
530 equals: function() {},
531 getBounds: function() {},
532 getFillType: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500533 isEmpty: function() {},
534 isVolatile: function() {},
535 reset: function() {},
536 rewind: function() {},
537 setFillType: function() {},
538 setIsVolatile: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400539 toCmds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500540 toSVGString: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400541
Kevin Lubickf8823b52020-09-03 10:02:10 -0400542 prototype: {
543 addArc: function() {},
544 addOval: function() {},
545 addPath: function() {},
546 addPoly: function() {},
547 addRect: function() {},
548 addRRect: function() {},
549 addVerbsPointsWeights: function() {},
550 arc: function() {},
551 arcToOval: function() {},
552 arcToRotated: function() {},
553 arcToTangent: function() {},
554 close: function() {},
555 conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400556 computeTightBounds: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400557 cubicTo: function() {},
558 dash: function() {},
Kevin Lubicked962642021-02-02 08:18:11 -0500559 getPoint: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400560 lineTo: function() {},
561 moveTo: function() {},
562 offset: function() {},
563 op: function() {},
564 quadTo: function() {},
565 rArcTo: function() {},
566 rConicTo: function() {},
567 rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400568 rLineTo: function() {},
569 rMoveTo: function() {},
570 rQuadTo: function() {},
571 simplify: function() {},
572 stroke: function() {},
573 transform: function() {},
574 trim: function() {},
575 },
576
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500577 // private API
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400578 _MakeFromCmds: function() {},
579 _MakeFromVerbsPointsWeights: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500580 _addArc: function() {},
581 _addOval: function() {},
582 _addPath: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000583 _addPoly: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400584 _addRect: function() {},
585 _addRRect: function() {},
Kevin Lubickd9b9e5e2020-06-23 16:58:10 -0400586 _addVerbsPointsWeights: function() {},
Nathaniel Nifongd0c9d0c2020-07-15 16:46:17 -0400587 _arcToOval: function() {},
Michael Ludwig1f49ceb2020-09-02 21:20:44 +0000588 _arcToRotated: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400589 _arcToTangent: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500590 _close: function() {},
591 _conicTo: function() {},
Kevin Lubick7d96c5c2020-10-01 10:55:16 -0400592 _computeTightBounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500593 _cubicTo: function() {},
594 _dash: function() {},
Kevin Lubicked962642021-02-02 08:18:11 -0500595 _getPoint: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500596 _lineTo: function() {},
597 _moveTo: function() {},
598 _op: function() {},
599 _quadTo: function() {},
600 _rArcTo: function() {},
601 _rConicTo: function() {},
602 _rCubicTo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400603 _rect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500604 _rLineTo: function() {},
605 _rMoveTo: function() {},
606 _rQuadTo: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500607 _simplify: function() {},
608 _stroke: function() {},
609 _transform: function() {},
610 _trim: function() {},
611 delete: function() {},
612 dump: function() {},
613 dumpHex: function() {},
614 },
Kevin Lubickd3cfbca2019-03-15 15:36:29 -0400615
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400616 Picture: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500617 serialize: function() {},
618 },
Kevin Lubickcc13fd32019-04-05 13:00:01 -0400619
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400620 PictureRecorder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500621 finishRecordingAsPicture: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400622 prototype: {
623 beginRecording: function() {},
624 },
625 _beginRecording: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500626 },
Kevin Lubick62836902019-12-09 09:04:26 -0500627
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400628 Shader: {
Kevin Lubick421ba882020-10-15 13:07:33 -0400629 // Deprecated names
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500630 Blend: function() {},
631 Color: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500632 Lerp: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400633 // public API (from JS / C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400634 MakeBlend: function() {},
635 MakeColor: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400636 MakeFractalNoise: function() {},
Kevin Lubick421ba882020-10-15 13:07:33 -0400637 MakeLerp: function() {},
Nathaniel Nifongd96c3c72020-03-09 10:50:43 -0400638 MakeLinearGradient: function() {},
639 MakeRadialGradient: function() {},
Dan Field3d44f732020-03-16 09:17:30 -0700640 MakeSweepGradient: function() {},
Kevin Lubick162d7572020-10-15 13:09:02 -0400641 MakeTurbulence: function() {},
642 MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong1bedbeb2020-05-04 16:46:17 -0400643
644 // private API (from C++ bindings)
Kevin Lubick421ba882020-10-15 13:07:33 -0400645 _MakeColor: function() {},
646 _MakeLinearGradient: function() {},
647 _MakeRadialGradient: function() {},
648 _MakeSweepGradient: function() {},
649 _MakeTwoPointConicalGradient: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500650 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400651
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400652 Surface: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500653 // public API (from C++ bindings)
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400654 /** @return {CanvasKit.Canvas} */
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500655 getCanvas: function() {},
Nathaniel Nifongb1ebbb12020-05-26 13:10:20 -0400656 imageInfo: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400657
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500658 makeSurface: function() {},
Chris Dalton312669e2020-06-19 09:45:57 -0600659 sampleCnt: function() {},
Nathaniel Nifong2d7afd42020-07-17 10:28:36 -0400660 reportBackendTypeIsGPU: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500661 grContext: {},
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -0400662 openGLversion: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400663
Kevin Lubickf8823b52020-09-03 10:02:10 -0400664 prototype: {
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400665 /** @return {CanvasKit.Image} */
Kevin Lubickf8823b52020-09-03 10:02:10 -0400666 makeImageSnapshot: function() {},
667 },
668
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500669 // private API
670 _flush: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400671 _makeImageSnapshot: function() {},
Kevin Lubick15d7a382020-11-11 16:48:30 -0500672 _makeRasterDirect: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500673 delete: function() {},
674 },
Kevin Lubickec4903d2019-01-14 08:36:08 -0500675
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400676 TextBlob: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500677 // public API (both C++ and JS bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400678 MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500679 MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400680 MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500681 MakeFromText: function() {},
682 MakeOnPath: function() {},
683 // private API (from C++ bindings)
Kevin Lubick30793852020-09-25 10:52:16 -0400684 _MakeFromGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500685 _MakeFromRSXform: function() {},
Kevin Lubick30793852020-09-25 10:52:16 -0400686 _MakeFromRSXformGlyphs: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500687 _MakeFromText: function() {},
688 },
Nathaniel Nifong77798b42020-02-21 17:15:22 -0500689
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500690 // These are defined in interface.js
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400691 Vector: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500692 add: function() {},
693 sub: function() {},
694 dot: function() {},
695 cross: function() {},
696 normalize: function() {},
697 mulScalar: function() {},
698 length: function() {},
699 lengthSquared: function() {},
700 dist: function() {},
701 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400702
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400703 Vertices: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500704 // public API (from C++ bindings)
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500705 uniqueID: function() {},
Kevin Lubickf8823b52020-09-03 10:02:10 -0400706
707 prototype: {
708 bounds: function() {},
709 },
710 // private API (from C++ bindings)
711
712 _bounds: function() {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500713 },
Kevin Lubickb5ae3b52018-11-03 07:51:19 -0400714
Kevin Lubick54c1b3d2020-10-07 16:09:22 -0400715 _VerticesBuilder: {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500716 colors: function() {},
717 detach: function() {},
718 indices: function() {},
719 positions: function() {},
720 texCoords: function() {},
721 },
Kevin Lubickd6ba7252019-06-03 14:38:05 -0400722
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500723 TextStyle: function() {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400724
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500725 // Constants and Enums
726 gpu: {},
727 skottie: {},
Kevin Lubick006a6f32018-10-19 14:34:34 -0400728
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500729 TRANSPARENT: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400730 BLACK: {},
731 WHITE: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500732 RED: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400733 GREEN: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500734 BLUE: {},
735 YELLOW: {},
736 CYAN: {},
Nathaniel Nifonge5d32542020-03-26 09:27:48 -0400737 MAGENTA: {},
Kevin Lubickea905ec2018-11-30 14:05:58 -0500738
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500739 MOVE_VERB: {},
740 LINE_VERB: {},
741 QUAD_VERB: {},
742 CONIC_VERB: {},
743 CUBIC_VERB: {},
744 CLOSE_VERB: {},
Kevin Lubickda3d8ac2019-01-07 11:08:55 -0500745
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500746 NoDecoration: {},
747 UnderlineDecoration: {},
748 OverlineDecoration: {},
749 LineThroughDecoration: {},
Kevin Lubick369f6a52019-10-03 11:22:08 -0400750
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500751 SaveLayerInitWithPrevious: {},
752 SaveLayerF16ColorType: {},
Kevin Lubick77d9b5c2019-10-29 10:48:26 -0400753
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500754 Affinity: {
755 Upstream: {},
756 Downstream: {},
757 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400758
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500759 AlphaType: {
760 Opaque: {},
761 Premul: {},
762 Unpremul: {},
763 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500764
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500765 BlendMode: {
766 Clear: {},
767 Src: {},
768 Dst: {},
769 SrcOver: {},
770 DstOver: {},
771 SrcIn: {},
772 DstIn: {},
773 SrcOut: {},
774 DstOut: {},
775 SrcATop: {},
776 DstATop: {},
777 Xor: {},
778 Plus: {},
779 Modulate: {},
780 Screen: {},
781 Overlay: {},
782 Darken: {},
783 Lighten: {},
784 ColorDodge: {},
785 ColorBurn: {},
786 HardLight: {},
787 SoftLight: {},
788 Difference: {},
789 Exclusion: {},
790 Multiply: {},
791 Hue: {},
792 Saturation: {},
793 Color: {},
794 Luminosity: {},
795 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500796
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500797 BlurStyle: {
798 Normal: {},
799 Solid: {},
800 Outer: {},
801 Inner: {},
802 },
Kevin Lubick61ef7b22018-11-27 13:26:59 -0500803
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500804 ClipOp: {
805 Difference: {},
806 Intersect: {},
807 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500808
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500809 ColorType: {
810 Alpha_8: {},
811 RGB_565: {},
812 ARGB_4444: {},
813 RGBA_8888: {},
814 RGB_888x: {},
815 BGRA_8888: {},
816 RGBA_1010102: {},
817 RGB_101010x: {},
818 Gray_8: {},
819 RGBA_F16: {},
820 RGBA_F32: {},
821 },
Kevin Lubickea905ec2018-11-30 14:05:58 -0500822
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500823 FillType: {
824 Winding: {},
825 EvenOdd: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500826 },
Kevin Lubick006a6f32018-10-19 14:34:34 -0400827
Kevin Lubick2d633492020-12-17 09:58:32 -0500828 FilterMode: {
829 Linear: {},
830 Nearest: {},
831 },
832
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500833 FilterQuality: {
834 None: {},
835 Low: {},
836 Medium: {},
837 High: {},
838 },
Kevin Lubick0a1293c2018-12-03 12:31:04 -0500839
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500840 FontSlant: {
841 Upright: {},
842 Italic: {},
843 Oblique: {},
844 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400845
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500846 FontHinting: {
847 None: {},
848 Slight: {},
849 Normal: {},
850 Full: {},
851 },
Kevin Lubickbde9fcc2020-02-28 08:09:08 -0500852
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500853 FontWeight: {
854 Invisible: {},
855 Thin: {},
856 ExtraLight: {},
857 Light: {},
858 Normal: {},
859 Medium: {},
860 SemiBold: {},
861 Bold: {},
862 ExtraBold: {},
863 Black: {},
864 ExtraBlack: {},
865 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400866
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500867 FontWidth: {
868 UltraCondensed: {},
869 ExtraCondensed: {},
870 Condensed: {},
871 SemiCondensed: {},
872 Normal: {},
873 SemiExpanded: {},
874 Expanded: {},
875 ExtraExpanded: {},
876 UltraExpanded: {},
877 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400878
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500879 ImageFormat: {
880 PNG: {},
881 JPEG: {},
882 },
Alexander Khovansky3e119332018-11-15 02:01:19 +0300883
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500884 PaintStyle: {
885 Fill: {},
886 Stroke: {},
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500887 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500888
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500889 PathOp: {
890 Difference: {},
891 Intersect: {},
892 Union: {},
893 XOR: {},
894 ReverseDifference: {},
895 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500896
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500897 PointMode: {
898 Points: {},
899 Lines: {},
900 Polygon: {},
901 },
Kevin Lubick37ab53e2019-11-11 10:06:08 -0500902
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500903 RectHeightStyle: {
904 Tight: {},
905 Max: {},
906 IncludeLineSpacingMiddle: {},
907 IncludeLineSpacingTop: {},
908 IncludeLineSpacingBottom: {},
909 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400910
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500911 RectWidthStyle: {
912 Tight: {},
913 Max: {},
914 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400915
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500916 StrokeCap: {
917 Butt: {},
918 Round: {},
919 Square: {},
920 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500921
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500922 StrokeJoin: {
923 Miter: {},
924 Round: {},
925 Bevel: {},
926 },
Kevin Lubickb9db3902018-11-26 11:47:54 -0500927
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500928 TextAlign: {
929 Left: {},
930 Right: {},
931 Center: {},
932 Justify: {},
933 Start: {},
934 End: {},
935 },
Kevin Lubick369f6a52019-10-03 11:22:08 -0400936
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500937 TextDirection: {
938 LTR: {},
939 RTL: {},
940 },
Kevin Lubickd3b1fe62019-10-21 10:50:26 -0400941
Harry Terkelsen223ffcd2020-10-02 15:24:13 -0700942 DecorationStyle: {
943 Solid: {},
944 Double: {},
945 Dotted: {},
946 Dashed: {},
947 Wavy: {},
948 },
949
950 PlaceholderAlignment: {
951 Baseline: {},
952 AboveBaseline: {},
953 BelowBaseline: {},
954 Top: {},
955 Bottom: {},
956 Middle: {},
957 },
958
959 TextBaseline: {
960 Alphabetic: {},
961 Ideographic: {},
962 },
963
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500964 TileMode: {
965 Clamp: {},
966 Repeat: {},
967 Mirror: {},
968 Decal: {},
969 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500970
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500971 VertexMode: {
972 Triangles: {},
973 TrianglesStrip: {},
974 TriangleFan: {},
975 },
Kevin Lubickeb2f6b02018-11-29 15:07:02 -0500976
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500977 // Things Enscriptem adds for us
Kevin Lubick006a6f32018-10-19 14:34:34 -0400978
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -0500979 /**
980 * @type {Float32Array}
981 */
982 HEAPF32: {},
983 /**
984 * @type {Float64Array}
985 */
986 HEAPF64: {},
987 /**
988 * @type {Uint8Array}
989 */
990 HEAPU8: {},
991 /**
992 * @type {Uint16Array}
993 */
994 HEAPU16: {},
995 /**
996 * @type {Uint32Array}
997 */
998 HEAPU32: {},
999 /**
1000 * @type {Int8Array}
1001 */
1002 HEAP8: {},
1003 /**
1004 * @type {Int16Array}
1005 */
1006 HEAP16: {},
1007 /**
1008 * @type {Int32Array}
1009 */
1010 HEAP32: {},
Kevin Lubickfa5a1382019-10-09 10:46:14 -04001011
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001012 _malloc: function() {},
1013 _free: function() {},
1014 onRuntimeInitialized: function() {},
Kevin Lubick006a6f32018-10-19 14:34:34 -04001015};
Kevin Lubick217056c2018-09-20 17:39:31 -04001016
Kevin Lubick006a6f32018-10-19 14:34:34 -04001017// Public API things that are newly declared in the JS should go here.
1018// It's not enough to declare them above, because closure can still erase them
1019// unless they go on the prototype.
Kevin Lubick369f6a52019-10-03 11:22:08 -04001020CanvasKit.Paragraph.prototype.getRectsForRange = function() {};
Harry Terkelsen223ffcd2020-10-02 15:24:13 -07001021CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {};
Kevin Lubick369f6a52019-10-03 11:22:08 -04001022
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001023CanvasKit.Picture.prototype.saveAsFile = function() {};
Kevin Lubickcc13fd32019-04-05 13:00:01 -04001024
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001025CanvasKit.Surface.prototype.dispose = function() {};
1026CanvasKit.Surface.prototype.flush = function() {};
1027CanvasKit.Surface.prototype.requestAnimationFrame = function() {};
1028CanvasKit.Surface.prototype.drawOnce = function() {};
Kevin Lubick53965c92018-10-11 08:51:55 -04001029
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001030CanvasKit.FontMgr.prototype.MakeTypefaceFromData = function() {};
Kevin Lubickddd0a332018-12-12 10:35:13 -05001031
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001032CanvasKit.RSXFormBuilder.prototype.build = function() {};
1033CanvasKit.RSXFormBuilder.prototype.delete = function() {};
1034CanvasKit.RSXFormBuilder.prototype.push = function() {};
Kevin Lubickee91c072019-03-29 10:39:52 -04001035CanvasKit.RSXFormBuilder.prototype.set = function() {};
1036
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001037CanvasKit.ColorBuilder.prototype.build = function() {};
1038CanvasKit.ColorBuilder.prototype.delete = function() {};
1039CanvasKit.ColorBuilder.prototype.push = function() {};
1040CanvasKit.ColorBuilder.prototype.set = function() {};
Kevin Lubickd3cfbca2019-03-15 15:36:29 -04001041
Kevin Lubick54c1b3d2020-10-07 16:09:22 -04001042CanvasKit.RuntimeEffect.prototype.makeShader = function() {};
1043CanvasKit.RuntimeEffect.prototype.makeShaderWithChildren = function() {};
Kevin Lubick4b5b6452019-12-06 13:55:58 -05001044
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001045// Define StrokeOpts object
1046var StrokeOpts = {};
1047StrokeOpts.prototype.width;
1048StrokeOpts.prototype.miter_limit;
1049StrokeOpts.prototype.cap;
1050StrokeOpts.prototype.join;
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001051StrokeOpts.prototype.precision;
Kevin Lubickb5ae3b52018-11-03 07:51:19 -04001052
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001053// Define everything created in the canvas2d spec here
Kevin Lubickb9db3902018-11-26 11:47:54 -05001054var HTMLCanvas = {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001055HTMLCanvas.prototype.decodeImage = function() {};
1056HTMLCanvas.prototype.dispose = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001057HTMLCanvas.prototype.getContext = function() {};
Kevin Lubick8e4a3312018-12-14 15:03:41 -05001058HTMLCanvas.prototype.loadFont = function() {};
Kevin Lubicka40f8322018-12-17 16:01:36 -05001059HTMLCanvas.prototype.makePath2D = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001060HTMLCanvas.prototype.toDataURL = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001061
Elliot Evans28796192020-06-15 12:53:27 -06001062var ImageBitmapRenderingContext = {};
1063ImageBitmapRenderingContext.prototype.transferFromImageBitmap = function() {};
1064
Kevin Lubickb9db3902018-11-26 11:47:54 -05001065var CanvasRenderingContext2D = {};
1066CanvasRenderingContext2D.prototype.addHitRegion = function() {};
1067CanvasRenderingContext2D.prototype.arc = function() {};
1068CanvasRenderingContext2D.prototype.arcTo = function() {};
1069CanvasRenderingContext2D.prototype.beginPath = function() {};
1070CanvasRenderingContext2D.prototype.bezierCurveTo = function() {};
1071CanvasRenderingContext2D.prototype.clearHitRegions = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001072CanvasRenderingContext2D.prototype.clearRect = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001073CanvasRenderingContext2D.prototype.clip = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001074CanvasRenderingContext2D.prototype.closePath = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001075CanvasRenderingContext2D.prototype.createImageData = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001076CanvasRenderingContext2D.prototype.createLinearGradient = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001077CanvasRenderingContext2D.prototype.createPattern = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001078CanvasRenderingContext2D.prototype.createRadialGradient = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001079CanvasRenderingContext2D.prototype.drawFocusIfNeeded = function() {};
Kevin Lubick0a1293c2018-12-03 12:31:04 -05001080CanvasRenderingContext2D.prototype.drawImage = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001081CanvasRenderingContext2D.prototype.ellipse = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001082CanvasRenderingContext2D.prototype.fill = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001083CanvasRenderingContext2D.prototype.fillRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001084CanvasRenderingContext2D.prototype.fillText = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001085CanvasRenderingContext2D.prototype.getImageData = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001086CanvasRenderingContext2D.prototype.getLineDash = function() {};
Kevin Lubick1646e7d2018-12-07 13:03:08 -05001087CanvasRenderingContext2D.prototype.isPointInPath = function() {};
1088CanvasRenderingContext2D.prototype.isPointInStroke = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001089CanvasRenderingContext2D.prototype.lineTo = function() {};
1090CanvasRenderingContext2D.prototype.measureText = function() {};
1091CanvasRenderingContext2D.prototype.moveTo = function() {};
Kevin Lubick52b9f372018-12-04 13:57:36 -05001092CanvasRenderingContext2D.prototype.putImageData = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001093CanvasRenderingContext2D.prototype.quadraticCurveTo = function() {};
1094CanvasRenderingContext2D.prototype.rect = function() {};
1095CanvasRenderingContext2D.prototype.removeHitRegion = function() {};
1096CanvasRenderingContext2D.prototype.resetTransform = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001097CanvasRenderingContext2D.prototype.restore = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001098CanvasRenderingContext2D.prototype.rotate = function() {};
Kevin Lubick61ef7b22018-11-27 13:26:59 -05001099CanvasRenderingContext2D.prototype.save = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001100CanvasRenderingContext2D.prototype.scale = function() {};
1101CanvasRenderingContext2D.prototype.scrollPathIntoView = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001102CanvasRenderingContext2D.prototype.setLineDash = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001103CanvasRenderingContext2D.prototype.setTransform = function() {};
1104CanvasRenderingContext2D.prototype.stroke = function() {};
Kevin Lubick12c0e502018-11-28 12:51:56 -05001105CanvasRenderingContext2D.prototype.strokeRect = function() {};
Kevin Lubickb9db3902018-11-26 11:47:54 -05001106CanvasRenderingContext2D.prototype.strokeText = function() {};
1107CanvasRenderingContext2D.prototype.transform = function() {};
1108CanvasRenderingContext2D.prototype.translate = function() {};
1109
Kevin Lubicka40f8322018-12-17 16:01:36 -05001110var Path2D = {};
1111Path2D.prototype.addPath = function() {};
1112Path2D.prototype.arc = function() {};
1113Path2D.prototype.arcTo = function() {};
1114Path2D.prototype.bezierCurveTo = function() {};
1115Path2D.prototype.closePath = function() {};
1116Path2D.prototype.ellipse = function() {};
1117Path2D.prototype.lineTo = function() {};
1118Path2D.prototype.moveTo = function() {};
1119Path2D.prototype.quadraticCurveTo = function() {};
1120Path2D.prototype.rect = function() {};
1121
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001122var LinearCanvasGradient = {};
1123LinearCanvasGradient.prototype.addColorStop = function() {};
1124var RadialCanvasGradient = {};
1125RadialCanvasGradient.prototype.addColorStop = function() {};
Kevin Lubickd29edd72018-12-07 08:29:52 -05001126var CanvasPattern = {};
1127CanvasPattern.prototype.setTransform = function() {};
Kevin Lubickeb2f6b02018-11-29 15:07:02 -05001128
Kevin Lubick52b9f372018-12-04 13:57:36 -05001129var ImageData = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001130 /**
1131 * @type {Uint8ClampedArray}
1132 */
1133 data: {},
1134 height: {},
1135 width: {},
Kevin Lubick52b9f372018-12-04 13:57:36 -05001136};
1137
Kevin Lubickd29edd72018-12-07 08:29:52 -05001138var DOMMatrix = {
Nathaniel Nifong6066a0c2020-03-05 10:27:14 -05001139 a: {},
1140 b: {},
1141 c: {},
1142 d: {},
1143 e: {},
1144 f: {},
Kevin Lubickd29edd72018-12-07 08:29:52 -05001145};
1146
Kevin Lubick217056c2018-09-20 17:39:31 -04001147// 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 -05001148function loadWebAssemblyModule() {};
Nathaniel Nifonga237f9e2020-07-17 15:20:44 -04001149
1150// This is a part of emscripten's webgl glue code. Preserving this attribute is necessary
1151// to override it in the puppeteer tests
1152var LibraryEGL = {
1153 contextAttributes: {
1154 majorVersion: {}
1155 }
Harry Terkelsen10f019c2020-08-04 13:21:09 -07001156}