mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-09-03 04:03:46 +08:00
.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,7 +4,6 @@
|
||||
#///////////////////////////
|
||||
docs/
|
||||
node_modules/
|
||||
temp/
|
||||
#//////////////////////////
|
||||
# NPM
|
||||
#//////////////////////////
|
||||
|
||||
@@ -38,6 +38,7 @@ export default class ImageUtil {
|
||||
public static imageToBase64(url: string, callback?: (dataURL: string) => void): Promise<string> {
|
||||
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);
|
||||
|
||||
3
temp/declarations/cc.custom-macro.d.ts
vendored
Normal file
3
temp/declarations/cc.custom-macro.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare module "cc/userland/macro" {
|
||||
|
||||
}
|
||||
8
temp/declarations/cc.d.ts
vendored
Normal file
8
temp/declarations/cc.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
/// <reference path="D:\CocosDashboard_1.0.6\resources\.editors\Creator\3.6.0\resources\resources\3d\engine\bin\.declarations\cc.d.ts"/>
|
||||
|
||||
/**
|
||||
* @deprecated Global variable `cc` was dropped since 3.0. Use ES6 module syntax to import Cocos Creator APIs.
|
||||
*/
|
||||
declare const cc: never;
|
||||
|
||||
125
temp/declarations/cc.env.d.ts
vendored
Normal file
125
temp/declarations/cc.env.d.ts
vendored
Normal file
@@ -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;
|
||||
|
||||
}
|
||||
1
temp/declarations/jsb.d.ts
vendored
Normal file
1
temp/declarations/jsb.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference path="D:\CocosDashboard_1.0.6\resources\.editors\Creator\3.6.0\resources\resources\3d\engine\@types\jsb.d.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';
|
||||
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';
|
||||
Reference in New Issue
Block a user