You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
624 B

/// <reference path="embind.d.ts" />
declare const Module: embind.EmbindModule;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const CanvasKit = Module; // lets other files use this alias to declare new public APIs.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace load {
type CallbackFn = () => void;
const toLoad: CallbackFn[] = [];
export const afterLoad = (callback: CallbackFn): void => {
toLoad.push(callback);
};
Module.onRuntimeInitialized = () => {
console.log('runtime initialized');
toLoad.forEach(((callback) => callback()));
};
}