• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/// <reference path="load.ts" />
2/// <reference path="../bindings/core.d.ts" />
3/// <reference path="public_api.d.ts" />
4// eslint-disable-next-line @typescript-eslint/no-unused-vars
5namespace Core {
6  // Module is the C++ module with the private (and some public) bindings on it.
7  declare const Module: core.Bindings;
8  declare const CanvasKit: public_api.CanvasKit;
9  load.afterLoad(() => {
10    /**
11     * This function says hello
12     *
13     * @param x some number
14     * @param y some other number
15     * @ts sayHello(x: number, y: number): void;
16     */
17    CanvasKit.sayHello = (x: number, y: number) => {
18      console.log('hello', Module._privateFunction(x, y));
19    };
20
21    /**
22     * This sets the name twice for good measure.
23     * @param name some param
24     * @ts Something::setName(name: string): void;
25     */
26    CanvasKit.Something.prototype.setName = function setName(name: string) {
27      this._setName(name + name);
28    };
29  });
30}
31