blob: f0851757bf6d7f36dd415cce0fefd671080d86d2 [file] [log] [blame]
import {CanvasKitInit as CKInit} from "canvaskit-wasm";
// Right now, CanvasKitInit is exported from canvaskit-wasm in value space, not type space.
// As such, we need to use "type of" to be able to describe the type of this function in the
// global scope.
declare const CanvasKitInit: typeof CKInit;
async function init() {
const CK = await CanvasKitInit({
locateFile: (file: string) => "node_modules/canvaskit-wasm/bin/" + file
});
const color = CK.Color(1,2,3,4);
console.log(color);
}
init();