diff --git a/.gitignore b/.gitignore index 7a26f45..dcfd181 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ #/////////////////////////// docs/ node_modules/ -temp/ #////////////////////////// # NPM #////////////////////////// diff --git a/assets/core/utils/ImageUtil.ts b/assets/core/utils/ImageUtil.ts index 29fb760..ee2efc8 100644 --- a/assets/core/utils/ImageUtil.ts +++ b/assets/core/utils/ImageUtil.ts @@ -38,6 +38,7 @@ export default class ImageUtil { public static imageToBase64(url: string, callback?: (dataURL: string) => void): Promise { return new Promise(res => { let extname = /\.png|\.jpg|\.jpeg/.exec(url)?.[0]; + //@ts-ignore if (['.png', '.jpg', '.jpeg'].includes(extname)) { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d')!; @@ -71,6 +72,7 @@ export default class ImageUtil { const image = document.createElement('img'); image.src = base64; const texture = new Texture2D(); + //@ts-ignore texture.initWithElement(image); image.remove(); return texture; @@ -82,6 +84,7 @@ export default class ImageUtil { */ public static base64ToBlob(base64: string): Blob { const strings = base64.split(','); + //@ts-ignore const type = /image\/\w+|;/.exec(strings[0])[0]; const data = window.atob(strings[1]); const arrayBuffer = new ArrayBuffer(data.length); diff --git a/temp/declarations/cc.custom-macro.d.ts b/temp/declarations/cc.custom-macro.d.ts new file mode 100644 index 0000000..382e158 --- /dev/null +++ b/temp/declarations/cc.custom-macro.d.ts @@ -0,0 +1,3 @@ +declare module "cc/userland/macro" { + +} diff --git a/temp/declarations/cc.d.ts b/temp/declarations/cc.d.ts new file mode 100644 index 0000000..a2ab644 --- /dev/null +++ b/temp/declarations/cc.d.ts @@ -0,0 +1,8 @@ + + /// + + /** + * @deprecated Global variable `cc` was dropped since 3.0. Use ES6 module syntax to import Cocos Creator APIs. + */ + declare const cc: never; + \ No newline at end of file diff --git a/temp/declarations/cc.env.d.ts b/temp/declarations/cc.env.d.ts new file mode 100644 index 0000000..edaad34 --- /dev/null +++ b/temp/declarations/cc.env.d.ts @@ -0,0 +1,125 @@ +declare module 'cc/env'{ + /** + * Running in Web platform + */ + export const HTML5: boolean; + + /** + * Running in native platform (mobile app, desktop app, or simulator). + */ + export const NATIVE: boolean; + + /** + * Running in the Wechat's mini game. + */ + export const WECHAT: boolean; + + /** + * Running in the baidu's mini game. + */ + export const BAIDU: boolean; + + /** + * Running in the xiaomi's quick game. + */ + export const XIAOMI: boolean; + + /** + * Running in the alipay's mini game. + */ + export const ALIPAY: boolean; + + /** + * Running in the ByteDance's mini game. + */ + export const BYTEDANCE: boolean; + + /** + * Running in the oppo's quick game. + */ + export const OPPO: boolean; + + /** + * Running in the vivo's quick game. + */ + export const VIVO: boolean; + + /** + * Running in the huawei's quick game. + */ + export const HUAWEI: boolean; + + /** + * Running in the cocosplay. + */ + export const COCOSPLAY: boolean; + + /** + * Running in the qtt's quick game. + */ + export const QTT: boolean; + + /** + * Running in the linksure's quick game. + */ + export const LINKSURE: boolean; + + /** + * Running in the editor. + */ + export const EDITOR: boolean; + + /** + * Preview in browser or simulator. + */ + export const PREVIEW: boolean; + + /** + * Running in published project. + */ + export const BUILD: boolean; + + /** + * Running in the engine's unit test. + */ + export const TEST: boolean; + + /** + * Running debug mode. + */ + export const DEBUG: boolean; + + /** + * Running in the editor or preview. + */ + export const DEV: boolean; + + /** + * Running in mini game. + */ + export const MINIGAME: boolean; + + /** + * Running in runtime based environment. + */ + export const RUNTIME_BASED: boolean; + + /** + * Support JIT. + */ + export const SUPPORT_JIT: boolean; + + /** + * Running in environment where using JSB as the JavaScript interface binding scheme. + */ + export const JSB: boolean; + + /** + * The network access mode. + * - 0 Client + * - 1 ListenServer + * - 2 HostServer + */ + export const NET_MODE: number; + +} diff --git a/temp/declarations/jsb.d.ts b/temp/declarations/jsb.d.ts new file mode 100644 index 0000000..70dbc0e --- /dev/null +++ b/temp/declarations/jsb.d.ts @@ -0,0 +1 @@ +/// diff --git a/typedoc-index.ts b/typedoc-index.ts index 12ddbf4..c04d2ae 100644 --- a/typedoc-index.ts +++ b/typedoc-index.ts @@ -7,8 +7,6 @@ // 该文件用作typedoc的入口点模块——我们的API生成器 -export * from './assets/core/Oops'; -export * from './assets/core/Root'; export * from './assets/core/common/audio/AudioManager'; export * from './assets/core/common/audio/AudioEffect'; export * from './assets/core/common/audio/AudioMusic'; @@ -16,4 +14,39 @@ export * from './assets/core/common/event/EventDispatcher'; export * from './assets/core/common/event/EventMessage'; export * from './assets/core/common/event/MessageManager'; export * from './assets/core/common/loader/ResLoader'; -export * from './assets/core/common/log/Logger'; \ No newline at end of file +export * from './assets/core/common/log/Logger'; +export * from './assets/core/common/manager/RandomManager'; +export * from './assets/core/common/manager/TimerManager'; +export * from './assets/core/common/storage/EncryptUtil'; +export * from './assets/core/common/storage/StorageManager'; +export * from './assets/core/game/GameCollision'; +export * from './assets/core/game/GameComponent'; +export * from './assets/core/game/GameManager'; +export * from './assets/core/gui/layer/Defines'; +export * from './assets/core/gui/layer/DelegateComponent'; +export * from './assets/core/gui/layer/LayerDialog'; +export * from './assets/core/gui/layer/LayerManager'; +export * from './assets/core/gui/layer/LayerNotify'; +export * from './assets/core/gui/layer/LayerPopup'; +export * from './assets/core/gui/layer/LayerUI'; +export * from './assets/core/gui/layer/UIMap'; +export * from './assets/core/gui/prompt/CommonPrompt'; +export * from './assets/core/gui/prompt/LoadingIndicator'; +export * from './assets/core/gui/prompt/Notify'; +export * from './assets/core/gui/GUI'; +export * from './assets/core/utils/ArrayUtil'; +export * from './assets/core/utils/CameraUtil'; +export * from './assets/core/utils/ImageUtil'; +export * from './assets/core/utils/JsonUtil'; +export * from './assets/core/utils/LayerUtil'; +export * from './assets/core/utils/MathUtil'; +export * from './assets/core/utils/ObjectUtil'; +export * from './assets/core/utils/PhysicsUtil'; +export * from './assets/core/utils/PlatformUtil'; +export * from './assets/core/utils/RegexUtil'; +export * from './assets/core/utils/RotateUtil'; +export * from './assets/core/utils/StringUtil'; +export * from './assets/core/utils/Vec3Util'; +export * from './assets/core/utils/ViewUtil'; +export * from './assets/core/Oops'; +export * from './assets/core/Root'; \ No newline at end of file