mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
7bc135e1c7
* adjust init process * fix bugs * restructure * tweak * delete useless code * fix ci * support more platform and fix some bugs * mark internal * tweak * add docs * add docs and little adjustment * fix bugs * adjust decorator execute order fix mesh error * fix bugs * revert some change * revert auto-generated code * revert auto-generated code
14 lines
516 B
TypeScript
14 lines
516 B
TypeScript
declare const require: (path: string) => Promise<void>;
|
|
|
|
export function findCanvas (): { frame: HTMLDivElement, container: HTMLDivElement, canvas: HTMLCanvasElement } {
|
|
const container = document.createElement('div');
|
|
const frame = document.documentElement as HTMLDivElement;
|
|
const canvas = window.__canvas;
|
|
return { frame, canvas, container };
|
|
}
|
|
|
|
export function loadJsFile (path: string): Promise<void> {
|
|
// eslint-disable-next-line import/no-dynamic-require
|
|
return require(`${path}`);
|
|
}
|