mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
2
JisolGameCocos/extensions/oops-plugin-excel-to-json/.gitignore
vendored
Normal file
2
JisolGameCocos/extensions/oops-plugin-excel-to-json/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
excel/
|
||||
excel
|
1201
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/editor.d.ts
vendored
Normal file
1201
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/editor.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
16092
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/electron.d.ts
vendored
Normal file
16092
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/electron.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
57
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/extension.d.ts
vendored
Normal file
57
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/extension.d.ts
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
declare namespace Editor {
|
||||
|
||||
namespace Interface {
|
||||
// ---- Package ---- start
|
||||
interface PackageInfo {
|
||||
debug: boolean;
|
||||
enable: boolean;
|
||||
info: PackageJson;
|
||||
invalid: boolean;
|
||||
name: string;
|
||||
path: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
interface PackageJson {
|
||||
name: string;
|
||||
version: string;
|
||||
|
||||
title?: string;
|
||||
author?: string;
|
||||
debug?: boolean;
|
||||
description?: string;
|
||||
main?: string;
|
||||
editor?: string;
|
||||
panel?: any;
|
||||
contributions?: { [key: string]: any };
|
||||
}
|
||||
// ---- Package ---- end
|
||||
|
||||
// ---- UI ---- start
|
||||
interface PanelInfo {
|
||||
template?: string;
|
||||
style?: string;
|
||||
listeners?: { [key: string]: () => {} };
|
||||
methods?: { [key: string]: Function };
|
||||
$?: { [key: string]: string };
|
||||
ready?(): void;
|
||||
update?(...args: any[]): void;
|
||||
beforeClose?(): void;
|
||||
close?(): void;
|
||||
}
|
||||
|
||||
namespace UIKit {
|
||||
interface UIPanelInfo extends PanelInfo {
|
||||
// 向上触发事件
|
||||
dispath(eventName: string, ...arg: any): void;
|
||||
}
|
||||
|
||||
interface EditorElementBase extends HTMLElement {
|
||||
value: any;
|
||||
dispath: (name: string, event: any) => void;
|
||||
}
|
||||
|
||||
}
|
||||
// ---- UI ---- end
|
||||
}
|
||||
}
|
2
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/index.d.ts
vendored
Normal file
2
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference path="./editor.d.ts"/>
|
||||
/// <reference path="./message.d.ts"/>
|
27
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/message.d.ts
vendored
Normal file
27
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/message.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import * as AssetDB from './packages/asset-db/@types/message';
|
||||
import * as Scene from './packages/scene/@types/message';
|
||||
import * as Engine from './packages/engine/@types/message';
|
||||
import * as Builder from './packages/builder/@types/public/message';
|
||||
import * as Programming from './packages/programming/@types/message';
|
||||
// import * as Extension from './packages/extension/@types/message';
|
||||
|
||||
declare global {
|
||||
interface EditorMessageContent {
|
||||
params: any[],
|
||||
result: any;
|
||||
}
|
||||
|
||||
interface EditorMessageMap {
|
||||
[x: string]: EditorMessageContent;
|
||||
}
|
||||
|
||||
interface EditorMessageMaps {
|
||||
[x: string]: EditorMessageMap;
|
||||
'asset-db': AssetDB.message;
|
||||
'scene': Scene.message;
|
||||
'engine': Engine.message;
|
||||
'builder': Builder.message;
|
||||
'programming': Programming.message,
|
||||
// 'extension': Extension.message;
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
|
||||
import { IInternalBuildOptions, IPolyFills, ISettings } from '@editor/library-type/packages/builder/@types/protect';
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface IUserSettings extends ISettings {
|
||||
orientation: IOrientation;
|
||||
}
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'alipay-mini-game': {
|
||||
deviceOrientation: IOrientation;
|
||||
remoteUrl: string;
|
||||
polyfills?: IPolyFills;
|
||||
}
|
||||
}
|
||||
}
|
73
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/android/@types/index.d.ts
vendored
Normal file
73
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/android/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
import { IInternalBuildOptions, InternalBuildResult } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'android': IOptions;
|
||||
native: {
|
||||
JobSystem: 'none' | 'tbb' | 'taskFlow';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type IAppABI = 'armeabi-v7a' | 'arm64-v8a' | 'x86' | 'x86_64';
|
||||
|
||||
export interface IOptions {
|
||||
packageName: string;
|
||||
orientation: {
|
||||
landscapeRight: boolean;
|
||||
landscapeLeft: boolean;
|
||||
portrait: boolean;
|
||||
upsideDown: boolean;
|
||||
},
|
||||
|
||||
apiLevel: string;
|
||||
appABIs: IAppABI[];
|
||||
|
||||
useDebugKeystore: boolean;
|
||||
keystorePath: string;
|
||||
keystorePassword: string;
|
||||
keystoreAlias: string;
|
||||
keystoreAliasPassword: string;
|
||||
|
||||
appBundle: boolean;
|
||||
androidInstant: boolean;
|
||||
remoteUrl: string;
|
||||
sdkPath: string;
|
||||
ndkPath: string;
|
||||
|
||||
swappy: boolean;
|
||||
|
||||
renderBackEnd: {
|
||||
vulkan: boolean;
|
||||
gles3: boolean;
|
||||
gles2: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IBuildResult extends InternalBuildResult {
|
||||
userFrameWorks: boolean; // 是否使用用户的配置数据
|
||||
}
|
||||
|
||||
export interface ICertificateSetting {
|
||||
country: string;
|
||||
state: string;
|
||||
locality: string;
|
||||
organizationalUnit: string;
|
||||
organization: string;
|
||||
email: string;
|
||||
certificatePath: string;
|
||||
|
||||
password: string; // 密钥密码
|
||||
confirmPassword: string; // 确认密钥密码
|
||||
|
||||
alias: string; // 密钥别名
|
||||
aliasPassword: string;
|
||||
confirmAliasPassword: string;
|
||||
|
||||
validity: number; // 有效期
|
||||
}
|
179
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/asset-db/@types/message.d.ts
vendored
Normal file
179
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/asset-db/@types/message.d.ts
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
import { AssetInfo, QueryAssetsOption, AssetOperationOption, AssetDBOptions, IAssetMeta } from './public';
|
||||
|
||||
export interface message extends EditorMessageMap {
|
||||
'query-ready': {
|
||||
params: [],
|
||||
result: boolean,
|
||||
},
|
||||
'create-asset': {
|
||||
params: [
|
||||
string,
|
||||
string | Buffer | null,
|
||||
] | [
|
||||
string,
|
||||
string | Buffer | null,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'import-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'copy-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'move-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'delete-asset': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'open-asset': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: void,
|
||||
},
|
||||
'save-asset': {
|
||||
params: [
|
||||
string,
|
||||
string | Buffer,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'save-asset-meta': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'reimport-asset': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'refresh-asset': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'query-asset-info': {
|
||||
params: [
|
||||
string, // uuid | url | path
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'query-asset-meta': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: IAssetMeta | null,
|
||||
},
|
||||
'query-path': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'query-url': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'query-uuid': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'query-assets': {
|
||||
params: [] | [
|
||||
QueryAssetsOption,
|
||||
],
|
||||
result: AssetInfo[],
|
||||
},
|
||||
'generate-available-url': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: string,
|
||||
},
|
||||
|
||||
// private
|
||||
|
||||
'query-asset-mtime': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'refresh': {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
'open-devtools': {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
'query-db-info': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: AssetDBOptions,
|
||||
},
|
||||
'create-asset-dialog': {
|
||||
params: [
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'init-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'query-all-importer': {
|
||||
params: [],
|
||||
result: string[],
|
||||
},
|
||||
'query-all-asset-types': {
|
||||
params: [],
|
||||
result: string[],
|
||||
},
|
||||
}
|
115
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/asset-db/@types/public.d.ts
vendored
Normal file
115
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/asset-db/@types/public.d.ts
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
// Basic information about the resource
|
||||
// 资源的基础信息
|
||||
export interface AssetInfo {
|
||||
// Asset name
|
||||
// 资源名字
|
||||
name: string;
|
||||
// Asset display name
|
||||
// 资源用于显示的名字
|
||||
displayName: string;
|
||||
// URL
|
||||
source: string;
|
||||
// loader 加载的层级地址
|
||||
path: string;
|
||||
// loader 加载地址会去掉扩展名,这个参数不去掉
|
||||
url: string;
|
||||
// 绝对路径
|
||||
file: string;
|
||||
// 资源的唯一 ID
|
||||
uuid: string;
|
||||
// 使用的导入器名字
|
||||
importer: string;
|
||||
// 类型
|
||||
type: string;
|
||||
// 是否是文件夹
|
||||
isDirectory: boolean;
|
||||
// 导入资源的 map
|
||||
library: { [key: string]: string };
|
||||
// 子资源 map
|
||||
subAssets: { [key: string]: AssetInfo };
|
||||
// 是否显示
|
||||
visible: boolean;
|
||||
// 是否只读
|
||||
readonly: boolean;
|
||||
|
||||
// 虚拟资源可以实例化成实体的话,会带上这个扩展名
|
||||
instantiation?: string;
|
||||
// 跳转指向资源
|
||||
redirect?: IRedirectInfo;
|
||||
// 继承类型
|
||||
extends?: string[];
|
||||
// 是否导入完成
|
||||
imported: boolean;
|
||||
// 是否导入失败
|
||||
invalid: boolean;
|
||||
}
|
||||
|
||||
export interface IRedirectInfo {
|
||||
// 跳转资源的类型
|
||||
type: string;
|
||||
// 跳转资源的 uuid
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface QueryAssetsOption {
|
||||
type?: string;
|
||||
pattern?: string;
|
||||
ccType?: string;
|
||||
extname?: string;
|
||||
importer?: string;
|
||||
isBundle?: boolean;
|
||||
}
|
||||
|
||||
export interface AssetOperationOption {
|
||||
// 是否强制覆盖已经存在的文件,默认 false
|
||||
overwrite?: boolean;
|
||||
// 是否自动重命名冲突文件,默认 false
|
||||
rename?: boolean;
|
||||
}
|
||||
|
||||
export interface AssetDBOptions {
|
||||
name: string;
|
||||
target: string;
|
||||
library: string;
|
||||
temp: string;
|
||||
/**
|
||||
* 0: 忽略错误
|
||||
* 1: 仅仅打印错误
|
||||
* 2: 打印错误、警告
|
||||
* 3: 打印错误、警告、日志
|
||||
* 4: 打印错误、警告、日志、调试信息
|
||||
*/
|
||||
level: number;
|
||||
ignoreFiles: string[];
|
||||
readonly: boolean;
|
||||
}
|
||||
|
||||
export interface ContributionInfo {
|
||||
mount?: {
|
||||
path: string;
|
||||
readonly?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ExecuteAssetDBScriptMethodOptions {
|
||||
name: string;
|
||||
method: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export interface IAssetMeta {
|
||||
ver: string;
|
||||
importer: string;
|
||||
imported: boolean;
|
||||
uuid: string;
|
||||
files: string[];
|
||||
subMetas: {
|
||||
[index: string]: IAssetMeta;
|
||||
};
|
||||
userData: {
|
||||
[index: string]: any;
|
||||
};
|
||||
displayName: string;
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
25
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/assets/@types/public.d.ts
vendored
Normal file
25
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/assets/@types/public.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* 外部插件注册搜索方式指定返回的接口
|
||||
*
|
||||
* @export
|
||||
* @interface SearchMenuItem
|
||||
*/
|
||||
export interface SearchMenuItem {
|
||||
label: string;
|
||||
key: string;
|
||||
// handler 方法是外部扩展的搜索方法,返回 true 表示匹配搜索成功
|
||||
// searchValue 表示 assets 面板输入的搜索内容,asset 表示匹配搜索时的节点信息
|
||||
handler: (searchVale: string, asset: any) => Boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 外部插件注册扩展的入口
|
||||
* 可以是搜索方式或限定搜索类型
|
||||
*
|
||||
* @export
|
||||
* @interface SearchExtension
|
||||
*/
|
||||
export interface SearchExtension {
|
||||
typeMenu?: Function; // 限定的搜索类型
|
||||
searchMenu: Function; // 搜索方式
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'auto' | 'landscape' | 'portrait';
|
||||
|
||||
export interface IOptions {
|
||||
appid: string;
|
||||
remoteServerAddress: string;
|
||||
buildOpenDataContextTemplate: boolean;
|
||||
orientation: IOrientation;
|
||||
}
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'baidu-mini-game': IOptions;
|
||||
};
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
|
||||
export * from './public';
|
@@ -0,0 +1,88 @@
|
||||
import { ITextureCompressType, IPVRQuality, IASTCQuality, IETCQuality, ITextureFormatInfo } from './texture-compress';
|
||||
import { IBuildTaskOption } from './options';
|
||||
import { IBuildResult } from './build-result';
|
||||
|
||||
export interface IBuildPluginConfig {
|
||||
hooks?: string; // relate url about IHook
|
||||
options?: IDisplayOptions; // config of options
|
||||
verifyRuleMap?: IVerificationRuleMap;
|
||||
}
|
||||
|
||||
export type IVerificationFunc = (val: any, ...arg: any[]) => boolean | Promise<boolean>;
|
||||
|
||||
export type IVerificationRuleMap = Record<
|
||||
string,
|
||||
{
|
||||
func?: IVerificationFunc;
|
||||
message?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
export interface ITextureFormatConfig {
|
||||
displayName: string;
|
||||
options: IDisplayOptions;
|
||||
formats: ITextureFormatInfo[]; // 未指定 formats 则当前格式 key 作为存储的格式 value
|
||||
suffix: string;
|
||||
}
|
||||
|
||||
export type IDisplayOptions = Record<string, IConfigItem>;
|
||||
|
||||
export type ArrayItem = {
|
||||
label: string;
|
||||
value: string;
|
||||
};
|
||||
export interface IConfigItem {
|
||||
// 配置显示的名字,如果需要翻译,则传入 i18n:${key}
|
||||
label?: string;
|
||||
// 设置的简单说明
|
||||
description?: string;
|
||||
// 默认值
|
||||
default?: any;
|
||||
// 配置的类型
|
||||
type?: 'array' | 'object';
|
||||
itemConfigs?: IConfigItem[] | Record<string, IConfigItem>;
|
||||
verifyRules?: string[];
|
||||
attributes?: any;
|
||||
render?: {
|
||||
ui: string;
|
||||
attributes?: any;
|
||||
items?: ArrayItem[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IBuildPlugin {
|
||||
configs?: BuildPlugin.Configs;
|
||||
assetHandlers?: BuildPlugin.AssetHandlers;
|
||||
load?: BuildPlugin.load;
|
||||
unload?: BuildPlugin.Unload;
|
||||
}
|
||||
export type IBaseHooks = (options: IBuildTaskOption, result: IBuildResult) => Promise<void> | void;
|
||||
export type IBuildStageHooks = (root: string, options: IBuildTaskOption) => Promise<void> | void;
|
||||
|
||||
export namespace BuildPlugin {
|
||||
export type Configs = Record<string, IBuildPluginConfig>;
|
||||
export type AssetHandlers = string;
|
||||
export type load = () => Promise<void> | void;
|
||||
export type Unload = () => Promise<void> | void;
|
||||
}
|
||||
|
||||
export namespace BuildHook {
|
||||
export type throwError = boolean; // 插件注入的钩子函数,在执行失败时是否直接退出构建流程
|
||||
export type title = string; // 插件任务整体 title,支持 i18n 写法
|
||||
export type onBeforeBuild = IBaseHooks;
|
||||
export type onBeforeCompressSettings = IBaseHooks;
|
||||
export type onAfterCompressSettings = IBaseHooks;
|
||||
export type onAfterBuild = IBaseHooks;
|
||||
|
||||
export type onAfterMake = IBuildStageHooks;
|
||||
export type onBeforeMake = IBuildStageHooks;
|
||||
|
||||
export type load = () => Promise<void> | void;
|
||||
export type unload = () => Promise<void> | void;
|
||||
}
|
||||
|
||||
export namespace AssetHandlers {
|
||||
export type compressTextures = (
|
||||
tasks: { src: string; dest: string; quality: number | IPVRQuality | IASTCQuality | IETCQuality; format: ITextureCompressType }[],
|
||||
) => Promise<void>;
|
||||
}
|
@@ -0,0 +1,190 @@
|
||||
/**
|
||||
* settings.js 里定义的数据
|
||||
*/
|
||||
|
||||
import { ISplashSetting, ICustomJointTextureLayout, UUID } from "./options";
|
||||
|
||||
// ****************************** settings ************************************************
|
||||
|
||||
// debug: true
|
||||
// designResolution: {width: "960", height: "640", policy: 4}
|
||||
// jsList: ["assets/resources/b.js", "assets/resources/a.js"]
|
||||
// launchScene: "db://assets/New Scene-001.scene"
|
||||
// platform: "web-desktop"
|
||||
// rawAssets: {
|
||||
// assets: {
|
||||
// "0e95a9f8-d4e7-4849-875a-7a11dd692b34": ["mesh/env/gltf/textures/birch_yellow_mat_baseColor.png", "cc.ImageAsset"]
|
||||
// }
|
||||
// internal: {
|
||||
// "1baf0fc9-befa-459c-8bdd-af1a450a0319": ["effects/builtin-standard.effect", "cc.EffectAsset"]
|
||||
// }
|
||||
// }
|
||||
// scenes: [{url: "db://assets/New Scene-001.scene", uuid: "69dc4a42-cc6c-49fb-9a57-7de0c212f83d"},…]
|
||||
// startScene: "current_scene"
|
||||
export interface ISettings {
|
||||
CocosEngine: string;
|
||||
debug: boolean;
|
||||
designResolution: ISettingsDesignResolution;
|
||||
jsList: string[];
|
||||
launchScene: string;
|
||||
preloadAssets: string[],
|
||||
moduleIds: string[];
|
||||
platform: string;
|
||||
renderPipeline: string;
|
||||
physics?: IPhysicsConfig;
|
||||
exactFitScreen: boolean;
|
||||
|
||||
bundleVers: Record<string, string>;
|
||||
subpackages: string[];
|
||||
remoteBundles: string[];
|
||||
server: string;
|
||||
hasResourcesBundle: boolean;
|
||||
hasStartSceneBundle: boolean;
|
||||
|
||||
scriptPackages?: string[];
|
||||
splashScreen?: ISplashSetting;
|
||||
|
||||
customJointTextureLayouts?: ICustomJointTextureLayout[];
|
||||
|
||||
importMaps?: Array<{
|
||||
url: string;
|
||||
map: any;
|
||||
}>;
|
||||
|
||||
macros?: Record<string, any>;
|
||||
collisionMatrix?: any;
|
||||
groupList?: any;
|
||||
// preview
|
||||
engineModules: string[];
|
||||
customLayers: {name: string, bit: number}[];
|
||||
}
|
||||
|
||||
// 物理配置
|
||||
export interface IVec3Like {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
|
||||
export interface ICollisionMatrix {
|
||||
[x: string]: number;
|
||||
}
|
||||
|
||||
export interface IPhysicsMaterial {
|
||||
friction: number; // 0.5
|
||||
rollingFriction: number; // 0.1
|
||||
spinningFriction: number; // 0.1
|
||||
restitution: number; // 0.1
|
||||
}
|
||||
|
||||
export interface IPhysicsConfig {
|
||||
gravity: IVec3Like; // (0,-10, 0)
|
||||
allowSleep: boolean; // true
|
||||
sleepThreshold: number; // 0.1,最小 0
|
||||
autoSimulation: boolean; // true
|
||||
fixedTimeStep: number; // 1 / 60 ,最小 0
|
||||
maxSubSteps: number; // 1,最小 0
|
||||
defaultMaterial: IPhysicsMaterial;
|
||||
useNodeChains: boolean; // true
|
||||
collisionMatrix: ICollisionMatrix;
|
||||
physicsEngine: string;
|
||||
}
|
||||
|
||||
export interface IPackageInfo {
|
||||
name: string;
|
||||
path: string;
|
||||
uuids: UUID[];
|
||||
}
|
||||
|
||||
export interface ISettingsDesignResolution {
|
||||
width: number;
|
||||
height: number;
|
||||
policy: number;
|
||||
}
|
||||
|
||||
interface IAssetPathBase {
|
||||
bundleName?: string;
|
||||
redirect?: string; // 重定向的 bundle 包名
|
||||
}
|
||||
|
||||
export interface IRawAssetPathInfo extends IAssetPathBase {
|
||||
raw: string[];
|
||||
}
|
||||
export declare interface IAssetPathInfo extends IAssetPathBase {
|
||||
raw?: string[];
|
||||
json?: string;
|
||||
groupIndex?: number;
|
||||
}
|
||||
|
||||
export interface IJsonPathInfo extends IAssetPathBase {
|
||||
json?: string;
|
||||
groupIndex?: number;
|
||||
}
|
||||
|
||||
export interface IBuildPaths {
|
||||
dir: string; // 构建资源输出地址( assets 所在的目录,并不一定与构建目录对应)
|
||||
settings: string; // settings.json 输出地址
|
||||
systemJs?: string; // system.js 生成地址
|
||||
engineDir?: string; // 引擎生成地址
|
||||
polyfillsJs?: string; // polyfill.js 生成地址
|
||||
assets: string; // assets 目录
|
||||
subpackages: string; // subpackages 目录
|
||||
remote: string; // remote 目录
|
||||
bundleScripts: string // bundle 的脚本,某些平台无法下载脚本,则将远程包中的脚本移到本地
|
||||
applicationJS: string; // application.js 的生成地址
|
||||
compileConfig?: string; // cocos.compile.config.json
|
||||
importMap: string; // import-map 文件地址
|
||||
}
|
||||
|
||||
export declare class IBuildResult {
|
||||
dest: string; // options 指定的构建目录
|
||||
|
||||
paths: IBuildPaths; // 构建后资源相关地址集合
|
||||
|
||||
settings?: ISettings;
|
||||
|
||||
/**
|
||||
* 指定的 uuid 资源是否包含在构建资源中
|
||||
*/
|
||||
containsAsset: (uuid: string) => boolean;
|
||||
|
||||
/**
|
||||
* 获取指定 uuid 原始资源的存放路径(不包括序列化 json)
|
||||
* 自动图集的小图 uuid 和自动图集的 uuid 都将会查询到合图大图的生成路径
|
||||
* 实际返回多个路径的情况:查询 uuid 为自动图集资源,且对应图集生成多张大图,纹理压缩会有多个图片格式路径
|
||||
*/
|
||||
getRawAssetPaths: (uuid: string) => IRawAssetPathInfo[];
|
||||
|
||||
/**
|
||||
* 获取指定 uuid 资源的序列化 json 路径
|
||||
*/
|
||||
getJsonPathInfo: (uuid: string) => IJsonPathInfo[];
|
||||
|
||||
/**
|
||||
* 获取指定 uuid 资源的路径相关信息
|
||||
* @return {raw?: string[]; json?: string; groupIndex?: number;}
|
||||
* @return.raw: 该资源源文件的实际存储位置
|
||||
* @return.json: 该资源序列化 json 的实际存储位置,不存在为空
|
||||
* @return.groupIndex: 若该资源的序列化 json 在某个 json 分组内,这里标识在分组内的 index,不存在为空
|
||||
*/
|
||||
getAssetPathInfo: (uuid: string) => IAssetPathInfo[];
|
||||
}
|
||||
|
||||
export interface IBundleConfig {
|
||||
importBase: string; // bundle 中 import 目录的名称,通常是 'import'
|
||||
nativeBase: string; // native 中 native 目录的名称,通常是 'native'
|
||||
name: string; // bundle 的名称,可以通过 bundle 名称加载 bundle
|
||||
deps: string[]; // 该 bundle 依赖的其他 bundle 名称
|
||||
uuids: UUID[]; // 该 bundle 中的所有资源的 uuid
|
||||
paths: Record<string, any[]>; // 该 bundle 中可以通过路径加载的资源,参考以前 settings 中 rawAssets 的定义
|
||||
scenes: Record<string, UUID|number>; // 该 bundle 中所有场景,场景名为 key, uuid 为 value
|
||||
packs: Record<UUID, UUID[]>; // 该 bundle 中所有合并的 json, 参考以前 settings 中 packedAssets 的定义
|
||||
versions: { import: Array<string|number>, native: Array<string|number> }; // 该 bundle 中所有资源的版本号,参考以前 settings 中 md5AssetsMap 的定义
|
||||
redirect: Array<string|number>; // 该 bundle 中重定向到其他 bundle 的资源
|
||||
debug: boolean; // 是否是 debug 模式,debug 模式会对 config.json 的数据进行压缩,所以运行时得解压
|
||||
types?: string[]; // paths 中的类型数组,参考以前 settings 中 assetTypes 的定义
|
||||
encrypted?: boolean; // 原生上使用,标记该 bundle 中的脚本是否加密
|
||||
isZip?: boolean; // 是否是 zip 模式
|
||||
zipVersion?: string;
|
||||
extensionMap: Record<string, UUID[]>
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
import { IBuild } from ".";
|
||||
|
||||
// 定义 builder 进程内的全局变量
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
const Build: IBuild;
|
||||
}
|
100
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/builder/@types/public/index.d.ts
vendored
Normal file
100
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/builder/@types/public/index.d.ts
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import { ITransformOptions } from './options';
|
||||
|
||||
export * from './build-result';
|
||||
export * from './build-plugin';
|
||||
export * from './texture-compress';
|
||||
export * from './options';
|
||||
|
||||
interface IAppendRes {
|
||||
hash: string;
|
||||
paths: string[];
|
||||
}
|
||||
|
||||
interface ICreateBundleOptions {
|
||||
excludes?: string[];
|
||||
debug?: boolean;
|
||||
sourceMap?: boolean;
|
||||
}
|
||||
export interface IBuildUtils {
|
||||
/**
|
||||
* 压缩 uuid
|
||||
* 'fc991dd7-0033-4b80-9d41-c8a86a702e59' -> 'fc9913XADNLgJ1ByKhqcC5Z'
|
||||
*/
|
||||
compressUuid: (uuid: string, min: boolean) => string;
|
||||
|
||||
/**
|
||||
* 解压缩 uuid
|
||||
* 'fc9913XADNLgJ1ByKhqcC5Z' -> 'fc991dd7-0033-4b80-9d41-c8a86a702e59'
|
||||
*/
|
||||
decompressUuid: (uuid: string) => string;
|
||||
|
||||
/**
|
||||
* 翻译带有 i18n 开头的名称(i18n:test)(待定)
|
||||
* 'i18n:test' -> '测试'
|
||||
*/
|
||||
transI18nName: (name: string) => string;
|
||||
|
||||
/**
|
||||
* 移除 db 前缀
|
||||
* 'db://assets/test.jpg' -> 'assets/test.jpg'
|
||||
*/
|
||||
removeDbHeader: (url: string) => string;
|
||||
|
||||
/**
|
||||
* 将 db 开头的 url 转为项目里的实际 url
|
||||
* 'db://assets/test.jpg' -> 'c:/project/assets/test.jpg'
|
||||
*/
|
||||
dbUrlToRawPath: (url: string) => string;
|
||||
|
||||
/**
|
||||
* 从路径里获取存在的 uuid
|
||||
* 'E:\test3d\library\oc\0c0c1f5742-89b0-4a1e-b5eb-914d84f48c1c.json' -> '0c0c1f5742-89b0-4a1e-b5eb-914d84f48c1c'
|
||||
*/
|
||||
getUuidFromPath: (path: string) => string;
|
||||
|
||||
/**
|
||||
* 检查是否全局安装了 nodejs
|
||||
*/
|
||||
isInstallNodeJs: () => Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 逐文件拷贝
|
||||
*/
|
||||
copyDirSync: (src: string, dest: string) => void;
|
||||
|
||||
/**
|
||||
* 获取相对路径接口
|
||||
* 返回 / 拼接的相对路径
|
||||
*/
|
||||
relativeUrl: (from: string, to: string) => string;
|
||||
|
||||
transformCode: (code: string, options: ITransformOptions) => Promise<string>;
|
||||
|
||||
/**
|
||||
* 给指定路径添加 md5
|
||||
*/
|
||||
appendMd5ToPaths: (paths: string[]) => Promise<IAppendRes | null>;
|
||||
|
||||
calcMd5: (data: Buffer | string) => string;
|
||||
|
||||
copyPaths: (paths: { src: string; dest: string }[]) => Promise<void[]>;
|
||||
|
||||
createBundle: (src: string, dest: string, options?: ICreateBundleOptions) => Promise<unknown>;
|
||||
}
|
||||
export interface IBuild {
|
||||
Utils: IBuildUtils;
|
||||
|
||||
LIBRARY_NAME: string;
|
||||
IMPORT_HEADER: string;
|
||||
NATIVE_HEADER: string;
|
||||
ASSETS_HEADER: string;
|
||||
SUBPACKAGES_HEADER: string;
|
||||
REMOTE_HEADER: string;
|
||||
BUNDLE_SCRIPTS_HEADER: string;
|
||||
SCRIPT_NAME: string;
|
||||
CONFIG_NAME: string;
|
||||
BUNDLE_ZIP_NAME: string;
|
||||
projectTempDir: string;
|
||||
globalTempDir: string;
|
||||
buildTemplateDir: string; // 构建模板地址 build-templates
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
import { IBundleConfig, ISettings } from "./build-result";
|
||||
import { ITaskItemJSON } from "./options";
|
||||
export interface message extends EditorMessageMap {
|
||||
'open-devtools': {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
open: {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
'generate-preview-setting': {
|
||||
params: any[],
|
||||
result: Promise<{
|
||||
settings: ISettings;
|
||||
script2library: Record<string, string>;
|
||||
bundleConfigs: IBundleConfig[];
|
||||
}>,
|
||||
},
|
||||
'query-tasks-info': {
|
||||
params: [],
|
||||
result: {
|
||||
queue: Record<string, ITaskItemJSON>,
|
||||
free: Promise<boolean>,
|
||||
},
|
||||
},
|
||||
'query-task': {
|
||||
params: string[],
|
||||
result: Promise<ITaskItemJSON>,
|
||||
},
|
||||
/**
|
||||
* 预览合图
|
||||
* @param {object} pacUuid
|
||||
*/
|
||||
'preview-pac': {
|
||||
params: string[],
|
||||
result: Promise<ITaskItemJSON>,
|
||||
},
|
||||
|
||||
}
|
@@ -0,0 +1,134 @@
|
||||
/**
|
||||
* 构建所需的完整参数
|
||||
*/
|
||||
export interface IBuildTaskOption {
|
||||
// 构建后的游戏文件夹生成的路径
|
||||
buildPath: string;
|
||||
debug: boolean;
|
||||
inlineSpriteFrames: boolean;
|
||||
md5Cache: boolean;
|
||||
// bundle 设置
|
||||
mainBundleCompressionType: BundleCompressionType;
|
||||
mainBundleIsRemote: boolean;
|
||||
moveRemoteBundleScript: boolean;
|
||||
mergeJson: boolean;
|
||||
name: string;
|
||||
// packAutoAtlas: boolean;
|
||||
platform: Platform;
|
||||
scenes: IBuildSceneItem[];
|
||||
skipCompressTexture: boolean;
|
||||
sourceMaps: boolean;
|
||||
startScene: string;
|
||||
outputName: string;
|
||||
experimentalEraseModules: boolean;
|
||||
|
||||
/**
|
||||
* 是否是预览进程发送的构建请求。
|
||||
* @default false
|
||||
*/
|
||||
preview?: boolean;
|
||||
|
||||
// 项目设置
|
||||
includeModules?: string[];
|
||||
renderPipeline?: string;
|
||||
designResolution?: IBuildDesignResolution;
|
||||
physicsConfig?: any;
|
||||
flags?: Record<string, boolean>;
|
||||
|
||||
|
||||
// 是否使用自定义插屏选项
|
||||
replaceSplashScreen?: boolean;
|
||||
splashScreen: ISplashSetting;
|
||||
|
||||
packages?: Record<string, any>;
|
||||
id?: string; // 手动配置构建任务 id
|
||||
// recompileConfig?: IRecompileConfig;
|
||||
|
||||
customLayers: {name: string, value: number}[];
|
||||
}
|
||||
|
||||
export type UUID = string;
|
||||
|
||||
export interface ISplashSetting {
|
||||
base64src: string;
|
||||
displayRatio: number;
|
||||
totalTime: number;
|
||||
effect: string;
|
||||
clearColor: { x: number; y: number; z: number; w: number };
|
||||
displayWatermark: boolean;
|
||||
}
|
||||
|
||||
export interface ICustomJointTextureLayout {
|
||||
textureLength: number;
|
||||
contents: IChunkContent[];
|
||||
}
|
||||
|
||||
export interface IChunkContent {
|
||||
skeleton: null | string;
|
||||
clips: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建使用的设计分辨率数据
|
||||
*/
|
||||
export interface IBuildDesignResolution {
|
||||
height: number;
|
||||
width: number;
|
||||
fitWidth?: boolean;
|
||||
fitHeight?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建使用的场景的数据
|
||||
*/
|
||||
export interface IBuildSceneItem {
|
||||
url: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
// **************************** options *******************************************
|
||||
export type Platform =
|
||||
| 'web-desktop'
|
||||
| 'web-mobile'
|
||||
| 'wechatgame'
|
||||
| 'oppo-mini-game'
|
||||
| 'vivo-mini-game'
|
||||
| 'huawei-quick-game'
|
||||
| 'alipay-mini-game'
|
||||
| 'mac'
|
||||
| 'ios'
|
||||
| 'linux'
|
||||
// | 'ios-app-clip'
|
||||
| 'android'
|
||||
| 'ohos'
|
||||
| 'open-harmonyos'
|
||||
| 'windows'
|
||||
| 'xiaomi-quick-game'
|
||||
| 'baidu-mini-game'
|
||||
| 'bytedance-mini-game'
|
||||
| 'cocos-play'
|
||||
| 'huawei-agc'
|
||||
| 'link-sure'
|
||||
| 'qtt'
|
||||
| 'cocos-runtime'
|
||||
;
|
||||
|
||||
export type BundleCompressionType = 'none' | 'merge_dep' | 'merge_all_json' | 'subpackage' | 'zip';
|
||||
export type IModules = 'esm' | 'commonjs' | 'systemjs';
|
||||
|
||||
export interface ITransformOptions {
|
||||
importMapFormat: IModules;
|
||||
}
|
||||
|
||||
export type ITaskState = 'waiting' | 'success' | 'failure' | 'cancel' | 'processing';
|
||||
|
||||
export interface ITaskItemJSON {
|
||||
id: string;
|
||||
progress: number;
|
||||
state: ITaskState;
|
||||
message: string;
|
||||
options: IBuildTaskOption;
|
||||
time: string;
|
||||
dirty: boolean;
|
||||
rawOptions: IBuildTaskOption;
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
export type ITextureCompressType =
|
||||
| 'jpg'
|
||||
| 'png'
|
||||
| 'webp'
|
||||
| 'pvrtc_4bits_rgb'
|
||||
| 'pvrtc_4bits_rgba'
|
||||
| 'pvrtc_4bits_rgb_a'
|
||||
| 'pvrtc_2bits_rgb'
|
||||
| 'pvrtc_2bits_rgba'
|
||||
| 'pvrtc_2bits_rgb_a'
|
||||
| 'etc1_rgb'
|
||||
| 'etc1_rgb_a'
|
||||
| 'etc2_rgb'
|
||||
| 'etc2_rgba'
|
||||
| 'astc_4x4'
|
||||
| 'astc_5x5'
|
||||
| 'astc_6x6'
|
||||
| 'astc_8x8'
|
||||
| 'astc_10x5'
|
||||
| 'astc_10x10'
|
||||
| 'astc_12x12'
|
||||
| string;
|
||||
export type ITextureCompressPlatform = 'miniGame' | 'web' | 'ios' | 'android';
|
||||
|
||||
export interface IHandlerInfo {
|
||||
type: 'program' | 'npm' | 'function';
|
||||
info: ICommandInfo | Function;
|
||||
func?: Function;
|
||||
}
|
||||
|
||||
export interface ICustomConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
path: string;
|
||||
command: string;
|
||||
format: string;
|
||||
overwrite?: boolean;
|
||||
}
|
||||
|
||||
export interface ICommandInfo {
|
||||
command: string;
|
||||
params?: string[];
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface ITextureFormatInfo {
|
||||
displayName: string;
|
||||
value: ITextureCompressType | string;
|
||||
formatSuffix?: string;
|
||||
alpha?: boolean;
|
||||
formatType?: string;
|
||||
handler?: IHandlerInfo;
|
||||
custom?: boolean;
|
||||
params?: string[];
|
||||
}
|
||||
export interface ISupportFormat {
|
||||
rgb: ITextureCompressType[];
|
||||
rgba: ITextureCompressType[];
|
||||
}
|
||||
export interface IConfigGroupsInfo {
|
||||
defaultSupport?: ISupportFormat,
|
||||
support: ISupportFormat,
|
||||
displayName: string;
|
||||
icon: string;
|
||||
}
|
||||
export type IConfigGroups = Record<ITextureCompressPlatform, IConfigGroupsInfo>;
|
||||
|
||||
export type IPVRQuality = 'fastest' | 'fast' | 'normal' | 'high' | 'best';
|
||||
export type IETCQuality = 'slow' | 'fast';
|
||||
export type IASTCQuality = 'veryfast' | 'fast' | 'medium' | 'thorough' | 'exhaustive';
|
@@ -0,0 +1,25 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'auto' | 'landscape' | 'portrait';
|
||||
|
||||
export interface IOptions {
|
||||
appid: string;
|
||||
remoteServerAddress: string;
|
||||
buildOpenDataContextTemplate: boolean;
|
||||
orientation: IOrientation;
|
||||
physX: {
|
||||
use: 'physX' | 'project';
|
||||
notPackPhysXLibs: boolean;
|
||||
mutiThread: boolean;
|
||||
subThreadCount: number;
|
||||
epsilon: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'bytedance-mini-game': IOptions;
|
||||
};
|
||||
}
|
30
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/cocos-play/@types/index.d.ts
vendored
Normal file
30
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/cocos-play/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference path="../../../@types/index.d.ts"/>
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
||||
import { IInternalBuildOptions } from "@editor/library-type/packages/builder/@types/protect";
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface PlatformSettings {
|
||||
runtimeVersion: string,
|
||||
deviceOrientation: IOrientation,
|
||||
statusbarDisplay: boolean,
|
||||
startSceneAssetBundle: false,
|
||||
resourceURL: string,
|
||||
workerPath: string,
|
||||
XHRTimeout: number,
|
||||
WSTimeout: number,
|
||||
uploadFileTimeout: number,
|
||||
downloadFileTimeout: number,
|
||||
cameraPermissionHint: string,
|
||||
userInfoPermissionHint: string,
|
||||
locationPermissionHint: string,
|
||||
albumPermissionHint: string
|
||||
}
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
"cocos-play": PlatformSettings
|
||||
}
|
||||
}
|
25
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/console/@types/pritate.d.ts
vendored
Normal file
25
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/console/@types/pritate.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
export type logType = 'log' | 'warn' | 'error';
|
||||
export interface IMessageItem {
|
||||
rows: number; // 内部有几行 包括 details & stacks
|
||||
translateY: number;
|
||||
show: boolean;
|
||||
title: string;
|
||||
content: string[]; // details
|
||||
count: number; // 重复的个数
|
||||
fold: boolean; // 折叠
|
||||
type: logType;
|
||||
message: any;
|
||||
texture: string; // 纹理 light or dark
|
||||
date?: number; // 格式化的时间
|
||||
time?: number; // 时间戳
|
||||
process?: string;
|
||||
stack: string[];
|
||||
}
|
||||
|
||||
export interface INewItem {
|
||||
type: logType
|
||||
[propName: string]: any
|
||||
}
|
||||
|
||||
export type ILogCounter = Record<logType, number>;
|
684
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/engine-extends/@types/glTF.d.ts
vendored
Normal file
684
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/engine-extends/@types/glTF.d.ts
vendored
Normal file
@@ -0,0 +1,684 @@
|
||||
export type GlTfId = number;
|
||||
/**
|
||||
* Indices of those attributes that deviate from their initialization value.
|
||||
*/
|
||||
export interface AccessorSparseIndices {
|
||||
/**
|
||||
* The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
|
||||
*/
|
||||
"bufferView": GlTfId;
|
||||
/**
|
||||
* The offset relative to the start of the bufferView in bytes. Must be aligned.
|
||||
*/
|
||||
"byteOffset"?: number;
|
||||
/**
|
||||
* The indices data type.
|
||||
*/
|
||||
"componentType": 5121 | 5123 | 5125 | number;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.
|
||||
*/
|
||||
export interface AccessorSparseValues {
|
||||
/**
|
||||
* The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
|
||||
*/
|
||||
"bufferView": GlTfId;
|
||||
/**
|
||||
* The offset relative to the start of the bufferView in bytes. Must be aligned.
|
||||
*/
|
||||
"byteOffset"?: number;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Sparse storage of attributes that deviate from their initialization value.
|
||||
*/
|
||||
export interface AccessorSparse {
|
||||
/**
|
||||
* Number of entries stored in the sparse array.
|
||||
*/
|
||||
"count": number;
|
||||
/**
|
||||
* Index array of size `count` that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase.
|
||||
*/
|
||||
"indices": AccessorSparseIndices;
|
||||
/**
|
||||
* Array of size `count` times number of components, storing the displaced accessor attributes pointed by `indices`. Substituted values must have the same `componentType` and number of components as the base accessor.
|
||||
*/
|
||||
"values": AccessorSparseValues;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.
|
||||
*/
|
||||
export interface Accessor {
|
||||
/**
|
||||
* The index of the bufferView.
|
||||
*/
|
||||
"bufferView"?: GlTfId;
|
||||
/**
|
||||
* The offset relative to the start of the bufferView in bytes.
|
||||
*/
|
||||
"byteOffset"?: number;
|
||||
/**
|
||||
* The datatype of components in the attribute.
|
||||
*/
|
||||
"componentType": 5120 | 5121 | 5122 | 5123 | 5125 | 5126 | number;
|
||||
/**
|
||||
* Specifies whether integer data values should be normalized.
|
||||
*/
|
||||
"normalized"?: boolean;
|
||||
/**
|
||||
* The number of attributes referenced by this accessor.
|
||||
*/
|
||||
"count": number;
|
||||
/**
|
||||
* Specifies if the attribute is a scalar, vector, or matrix.
|
||||
*/
|
||||
"type": "SCALAR" | "VEC2" | "VEC3" | "VEC4" | "MAT2" | "MAT3" | "MAT4" | string;
|
||||
/**
|
||||
* Maximum value of each component in this attribute.
|
||||
*/
|
||||
"max"?: number[];
|
||||
/**
|
||||
* Minimum value of each component in this attribute.
|
||||
*/
|
||||
"min"?: number[];
|
||||
/**
|
||||
* Sparse storage of attributes that deviate from their initialization value.
|
||||
*/
|
||||
"sparse"?: AccessorSparse;
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* The index of the node and TRS property that an animation channel targets.
|
||||
*/
|
||||
export interface AnimationChannelTarget {
|
||||
/**
|
||||
* The index of the node to target.
|
||||
*/
|
||||
"node"?: GlTfId;
|
||||
/**
|
||||
* The name of the node's TRS property to modify, or the "weights" of the Morph Targets it instantiates. For the "translation" property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the "rotation" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the "scale" property, the values are the scaling factors along the x, y, and z axes.
|
||||
*/
|
||||
"path": "translation" | "rotation" | "scale" | "weights" | string;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Targets an animation's sampler at a node's property.
|
||||
*/
|
||||
export interface AnimationChannel {
|
||||
/**
|
||||
* The index of a sampler in this animation used to compute the value for the target.
|
||||
*/
|
||||
"sampler": GlTfId;
|
||||
/**
|
||||
* The index of the node and TRS property to target.
|
||||
*/
|
||||
"target": AnimationChannelTarget;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
|
||||
*/
|
||||
export interface AnimationSampler {
|
||||
/**
|
||||
* The index of an accessor containing keyframe input values, e.g., time.
|
||||
*/
|
||||
"input": GlTfId;
|
||||
/**
|
||||
* Interpolation algorithm.
|
||||
*/
|
||||
"interpolation"?: "LINEAR" | "STEP" | "CUBICSPLINE" | string;
|
||||
/**
|
||||
* The index of an accessor, containing keyframe output values.
|
||||
*/
|
||||
"output": GlTfId;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A keyframe animation.
|
||||
*/
|
||||
export interface Animation {
|
||||
/**
|
||||
* An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets.
|
||||
*/
|
||||
"channels": AnimationChannel[];
|
||||
/**
|
||||
* An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
|
||||
*/
|
||||
"samplers": AnimationSampler[];
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Metadata about the glTF asset.
|
||||
*/
|
||||
export interface Asset {
|
||||
/**
|
||||
* A copyright message suitable for display to credit the content creator.
|
||||
*/
|
||||
"copyright"?: string;
|
||||
/**
|
||||
* Tool that generated this glTF model. Useful for debugging.
|
||||
*/
|
||||
"generator"?: string;
|
||||
/**
|
||||
* The glTF version that this asset targets.
|
||||
*/
|
||||
"version": string;
|
||||
/**
|
||||
* The minimum glTF version that this asset targets.
|
||||
*/
|
||||
"minVersion"?: string;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A buffer points to binary geometry, animation, or skins.
|
||||
*/
|
||||
export interface Buffer {
|
||||
/**
|
||||
* The uri of the buffer.
|
||||
*/
|
||||
"uri"?: string;
|
||||
/**
|
||||
* The length of the buffer in bytes.
|
||||
*/
|
||||
"byteLength": number;
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A view into a buffer generally representing a subset of the buffer.
|
||||
*/
|
||||
export interface BufferView {
|
||||
/**
|
||||
* The index of the buffer.
|
||||
*/
|
||||
"buffer": GlTfId;
|
||||
/**
|
||||
* The offset into the buffer in bytes.
|
||||
*/
|
||||
"byteOffset"?: number;
|
||||
/**
|
||||
* The length of the bufferView in bytes.
|
||||
*/
|
||||
"byteLength": number;
|
||||
/**
|
||||
* The stride, in bytes.
|
||||
*/
|
||||
"byteStride"?: number;
|
||||
/**
|
||||
* The target that the GPU buffer should be bound to.
|
||||
*/
|
||||
"target"?: 34962 | 34963 | number;
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* An orthographic camera containing properties to create an orthographic projection matrix.
|
||||
*/
|
||||
export interface CameraOrthographic {
|
||||
/**
|
||||
* The floating-point horizontal magnification of the view. Must not be zero.
|
||||
*/
|
||||
"xmag": number;
|
||||
/**
|
||||
* The floating-point vertical magnification of the view. Must not be zero.
|
||||
*/
|
||||
"ymag": number;
|
||||
/**
|
||||
* The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`.
|
||||
*/
|
||||
"zfar": number;
|
||||
/**
|
||||
* The floating-point distance to the near clipping plane.
|
||||
*/
|
||||
"znear": number;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A perspective camera containing properties to create a perspective projection matrix.
|
||||
*/
|
||||
export interface CameraPerspective {
|
||||
/**
|
||||
* The floating-point aspect ratio of the field of view.
|
||||
*/
|
||||
"aspectRatio"?: number;
|
||||
/**
|
||||
* The floating-point vertical field of view in radians.
|
||||
*/
|
||||
"yfov": number;
|
||||
/**
|
||||
* The floating-point distance to the far clipping plane.
|
||||
*/
|
||||
"zfar"?: number;
|
||||
/**
|
||||
* The floating-point distance to the near clipping plane.
|
||||
*/
|
||||
"znear": number;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.
|
||||
*/
|
||||
export interface Camera {
|
||||
/**
|
||||
* An orthographic camera containing properties to create an orthographic projection matrix.
|
||||
*/
|
||||
"orthographic"?: CameraOrthographic;
|
||||
/**
|
||||
* A perspective camera containing properties to create a perspective projection matrix.
|
||||
*/
|
||||
"perspective"?: CameraPerspective;
|
||||
/**
|
||||
* Specifies if the camera uses a perspective or orthographic projection.
|
||||
*/
|
||||
"type": "perspective" | "orthographic" | string;
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Image data used to create a texture. Image can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.
|
||||
*/
|
||||
export interface Image {
|
||||
/**
|
||||
* The uri of the image.
|
||||
*/
|
||||
"uri"?: string;
|
||||
/**
|
||||
* The image's MIME type. Required if `bufferView` is defined.
|
||||
*/
|
||||
"mimeType"?: "image/jpeg" | "image/png" | string;
|
||||
/**
|
||||
* The index of the bufferView that contains the image. Use this instead of the image's uri property.
|
||||
*/
|
||||
"bufferView"?: GlTfId;
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Reference to a texture.
|
||||
*/
|
||||
export interface TextureInfo {
|
||||
/**
|
||||
* The index of the texture.
|
||||
*/
|
||||
"index": GlTfId;
|
||||
/**
|
||||
* The set index of texture's TEXCOORD attribute used for texture coordinate mapping.
|
||||
*/
|
||||
"texCoord"?: number;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.
|
||||
*/
|
||||
export interface MaterialPbrMetallicRoughness {
|
||||
/**
|
||||
* The material's base color factor.
|
||||
*/
|
||||
"baseColorFactor"?: number[];
|
||||
/**
|
||||
* The base color texture.
|
||||
*/
|
||||
"baseColorTexture"?: TextureInfo;
|
||||
/**
|
||||
* The metalness of the material.
|
||||
*/
|
||||
"metallicFactor"?: number;
|
||||
/**
|
||||
* The roughness of the material.
|
||||
*/
|
||||
"roughnessFactor"?: number;
|
||||
/**
|
||||
* The metallic-roughness texture.
|
||||
*/
|
||||
"metallicRoughnessTexture"?: TextureInfo;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
export interface MaterialNormalTextureInfo {
|
||||
"index"?: any;
|
||||
"texCoord"?: any;
|
||||
/**
|
||||
* The scalar multiplier applied to each normal vector of the normal texture.
|
||||
*/
|
||||
"scale"?: number;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
export interface MaterialOcclusionTextureInfo {
|
||||
"index"?: any;
|
||||
"texCoord"?: any;
|
||||
/**
|
||||
* A scalar multiplier controlling the amount of occlusion applied.
|
||||
*/
|
||||
"strength"?: number;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* The material appearance of a primitive.
|
||||
*/
|
||||
export interface Material {
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
/**
|
||||
* A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.
|
||||
*/
|
||||
"pbrMetallicRoughness"?: MaterialPbrMetallicRoughness;
|
||||
/**
|
||||
* The normal map texture.
|
||||
*/
|
||||
"normalTexture"?: MaterialNormalTextureInfo;
|
||||
/**
|
||||
* The occlusion map texture.
|
||||
*/
|
||||
"occlusionTexture"?: MaterialOcclusionTextureInfo;
|
||||
/**
|
||||
* The emissive map texture.
|
||||
*/
|
||||
"emissiveTexture"?: TextureInfo;
|
||||
/**
|
||||
* The emissive color of the material.
|
||||
*/
|
||||
"emissiveFactor"?: number[];
|
||||
/**
|
||||
* The alpha rendering mode of the material.
|
||||
*/
|
||||
"alphaMode"?: "OPAQUE" | "MASK" | "BLEND" | string;
|
||||
/**
|
||||
* The alpha cutoff value of the material.
|
||||
*/
|
||||
"alphaCutoff"?: number;
|
||||
/**
|
||||
* Specifies whether the material is double sided.
|
||||
*/
|
||||
"doubleSided"?: boolean;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Geometry to be rendered with the given material.
|
||||
*/
|
||||
export interface MeshPrimitive {
|
||||
/**
|
||||
* A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.
|
||||
*/
|
||||
"attributes": {
|
||||
[k: string]: GlTfId;
|
||||
};
|
||||
/**
|
||||
* The index of the accessor that contains the indices.
|
||||
*/
|
||||
"indices"?: GlTfId;
|
||||
/**
|
||||
* The index of the material to apply to this primitive when rendering.
|
||||
*/
|
||||
"material"?: GlTfId;
|
||||
/**
|
||||
* The type of primitives to render.
|
||||
*/
|
||||
"mode"?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number;
|
||||
/**
|
||||
* An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only `POSITION`, `NORMAL`, and `TANGENT` supported) to their deviations in the Morph Target.
|
||||
*/
|
||||
"targets"?: {
|
||||
[k: string]: GlTfId;
|
||||
}[];
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.
|
||||
*/
|
||||
export interface Mesh {
|
||||
/**
|
||||
* An array of primitives, each defining geometry to be rendered with a material.
|
||||
*/
|
||||
"primitives": MeshPrimitive[];
|
||||
/**
|
||||
* Array of weights to be applied to the Morph Targets.
|
||||
*/
|
||||
"weights"?: number[];
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.
|
||||
*/
|
||||
export interface Node {
|
||||
/**
|
||||
* The index of the camera referenced by this node.
|
||||
*/
|
||||
"camera"?: GlTfId;
|
||||
/**
|
||||
* The indices of this node's children.
|
||||
*/
|
||||
"children"?: GlTfId[];
|
||||
/**
|
||||
* The index of the skin referenced by this node.
|
||||
*/
|
||||
"skin"?: GlTfId;
|
||||
/**
|
||||
* A floating-point 4x4 transformation matrix stored in column-major order.
|
||||
*/
|
||||
"matrix"?: number[];
|
||||
/**
|
||||
* The index of the mesh in this node.
|
||||
*/
|
||||
"mesh"?: GlTfId;
|
||||
/**
|
||||
* The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.
|
||||
*/
|
||||
"rotation"?: number[];
|
||||
/**
|
||||
* The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.
|
||||
*/
|
||||
"scale"?: number[];
|
||||
/**
|
||||
* The node's translation along the x, y, and z axes.
|
||||
*/
|
||||
"translation"?: number[];
|
||||
/**
|
||||
* The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh.
|
||||
*/
|
||||
"weights"?: number[];
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Texture sampler properties for filtering and wrapping modes.
|
||||
*/
|
||||
export interface Sampler {
|
||||
/**
|
||||
* Magnification filter.
|
||||
*/
|
||||
"magFilter"?: 9728 | 9729 | number;
|
||||
/**
|
||||
* Minification filter.
|
||||
*/
|
||||
"minFilter"?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number;
|
||||
/**
|
||||
* s wrapping mode.
|
||||
*/
|
||||
"wrapS"?: 33071 | 33648 | 10497 | number;
|
||||
/**
|
||||
* t wrapping mode.
|
||||
*/
|
||||
"wrapT"?: 33071 | 33648 | 10497 | number;
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* The root nodes of a scene.
|
||||
*/
|
||||
export interface Scene {
|
||||
/**
|
||||
* The indices of each root node.
|
||||
*/
|
||||
"nodes"?: GlTfId[];
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* Joints and matrices defining a skin.
|
||||
*/
|
||||
export interface Skin {
|
||||
/**
|
||||
* The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied.
|
||||
*/
|
||||
"inverseBindMatrices"?: GlTfId;
|
||||
/**
|
||||
* The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root.
|
||||
*/
|
||||
"skeleton"?: GlTfId;
|
||||
/**
|
||||
* Indices of skeleton nodes, used as joints in this skin.
|
||||
*/
|
||||
"joints": GlTfId[];
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* A texture and its sampler.
|
||||
*/
|
||||
export interface Texture {
|
||||
/**
|
||||
* The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used.
|
||||
*/
|
||||
"sampler"?: GlTfId;
|
||||
/**
|
||||
* The index of the image used by this texture.
|
||||
*/
|
||||
"source"?: GlTfId;
|
||||
"name"?: any;
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
||||
/**
|
||||
* The root object for a glTF asset.
|
||||
*/
|
||||
export interface GlTf {
|
||||
/**
|
||||
* Names of glTF extensions used somewhere in this asset.
|
||||
*/
|
||||
"extensionsUsed"?: string[];
|
||||
/**
|
||||
* Names of glTF extensions required to properly load this asset.
|
||||
*/
|
||||
"extensionsRequired"?: string[];
|
||||
/**
|
||||
* An array of accessors.
|
||||
*/
|
||||
"accessors"?: Accessor[];
|
||||
/**
|
||||
* An array of keyframe animations.
|
||||
*/
|
||||
"animations"?: Animation[];
|
||||
/**
|
||||
* Metadata about the glTF asset.
|
||||
*/
|
||||
"asset": Asset;
|
||||
/**
|
||||
* An array of buffers.
|
||||
*/
|
||||
"buffers"?: Buffer[];
|
||||
/**
|
||||
* An array of bufferViews.
|
||||
*/
|
||||
"bufferViews"?: BufferView[];
|
||||
/**
|
||||
* An array of cameras.
|
||||
*/
|
||||
"cameras"?: Camera[];
|
||||
/**
|
||||
* An array of images.
|
||||
*/
|
||||
"images"?: Image[];
|
||||
/**
|
||||
* An array of materials.
|
||||
*/
|
||||
"materials"?: Material[];
|
||||
/**
|
||||
* An array of meshes.
|
||||
*/
|
||||
"meshes"?: Mesh[];
|
||||
/**
|
||||
* An array of nodes.
|
||||
*/
|
||||
"nodes"?: Node[];
|
||||
/**
|
||||
* An array of samplers.
|
||||
*/
|
||||
"samplers"?: Sampler[];
|
||||
/**
|
||||
* The index of the default scene.
|
||||
*/
|
||||
"scene"?: GlTfId;
|
||||
/**
|
||||
* An array of scenes.
|
||||
*/
|
||||
"scenes"?: Scene[];
|
||||
/**
|
||||
* An array of skins.
|
||||
*/
|
||||
"skins"?: Skin[];
|
||||
/**
|
||||
* An array of textures.
|
||||
*/
|
||||
"textures"?: Texture[];
|
||||
"extensions"?: any;
|
||||
"extras"?: any;
|
||||
[k: string]: any;
|
||||
}
|
@@ -0,0 +1,109 @@
|
||||
|
||||
declare module 'gltf-validator' {
|
||||
/**
|
||||
* Returns a version string.
|
||||
*/
|
||||
export const version: string;
|
||||
|
||||
/**
|
||||
* Returns an array of supported extensions names.
|
||||
*/
|
||||
export const supportedExtensions: string[];
|
||||
|
||||
/**
|
||||
* @param uri Relative URI of the external resource.
|
||||
* @returns Promise with Uint8Array data.
|
||||
*/
|
||||
export type ExternalResourceFunction = (uri: string) => Promise<Uint8Array>;
|
||||
|
||||
export interface ValidationOptions {
|
||||
/**
|
||||
* Absolute or relative asset URI that will be copied to validation report.
|
||||
*/
|
||||
uri?: string;
|
||||
|
||||
/**
|
||||
* Max number of reported issues. Use 0 for unlimited output.
|
||||
*/
|
||||
maxIssues?: number;
|
||||
|
||||
/**
|
||||
* Array of ignored issue codes.
|
||||
*/
|
||||
ignoredIssues?: string[];
|
||||
|
||||
/**
|
||||
* Object with overridden severities for issue codes.
|
||||
*/
|
||||
severityOverrides?: {
|
||||
[x: string]: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Function for loading external resources. If omitted, external resources are not validated.
|
||||
*/
|
||||
externalResourceFunction?: ExternalResourceFunction;
|
||||
|
||||
/**
|
||||
* Set to false to skip reading of accessor data.
|
||||
*/
|
||||
validateAccessorData?: boolean;
|
||||
}
|
||||
|
||||
export interface Resource {
|
||||
pointer: string;
|
||||
mimeType: string;
|
||||
storage: string;
|
||||
uri: string;
|
||||
}
|
||||
|
||||
export interface Report {
|
||||
uri: string;
|
||||
mimeType: string;
|
||||
validatorVersion: string;
|
||||
validatedAt: string;
|
||||
issues: {
|
||||
numErrors: number;
|
||||
numWarnings: number;
|
||||
numInfos: number;
|
||||
numHints: number;
|
||||
messages: Array<{
|
||||
code: string;
|
||||
message: string;
|
||||
pointer: string;
|
||||
severity: number;
|
||||
}>;
|
||||
truncated: boolean;
|
||||
};
|
||||
info: {
|
||||
version: string;
|
||||
generator: string;
|
||||
resources: Array<{
|
||||
pointer: string;
|
||||
mimeType: string;
|
||||
storage: string;
|
||||
uri: string;
|
||||
}>;
|
||||
hasAnimations: boolean;
|
||||
hasMaterials: boolean;
|
||||
hasMorphTargets: boolean;
|
||||
hasSkins: boolean;
|
||||
hasTextures: boolean;
|
||||
hasDefaultScene: boolean;
|
||||
primitivesCount: number;
|
||||
maxAttributesUsed: number;
|
||||
};
|
||||
}
|
||||
|
||||
export function validateBytes(data: Uint8Array, options?: ValidationOptions): Promise<Report>;
|
||||
|
||||
export function validateString(json: string, options?: ValidationOptions): Promise<Report>;
|
||||
|
||||
export const enum Severity {
|
||||
Error = 0,
|
||||
|
||||
Warning = 1,
|
||||
|
||||
Information = 2,
|
||||
}
|
||||
}
|
@@ -0,0 +1,811 @@
|
||||
declare module "@base/electron-i18n" {
|
||||
export function translation(key: string, language?: any): string;
|
||||
}
|
||||
|
||||
declare interface I18NWellDefinedDictionary {
|
||||
['about.title']: [];
|
||||
['about.editor']: [];
|
||||
['about.engine']: [];
|
||||
['about.version']: [];
|
||||
['animator.title']: [];
|
||||
['animator.loading.wait_scene_ready']: [];
|
||||
['animator.loading.init_animation_data']: [];
|
||||
['animator.mask.need_select_node']: [];
|
||||
['animator.mask.need_animation_component']: [];
|
||||
['animator.mask.need_animation_clip']: [];
|
||||
['animator.mask.enter_animation_mode']: [];
|
||||
['animator.mask.add_animation_component']: [];
|
||||
['animator.mask.add_animation_clip']: [];
|
||||
['animator.toolbar.exit']: [];
|
||||
['animator.toolbar.setting']: [];
|
||||
['animator.toolbar.order']: [];
|
||||
['animator.toolbar.jump_first_frame']: [];
|
||||
['animator.toolbar.jump_prev_frame']: [];
|
||||
['animator.toolbar.play_animation']: [];
|
||||
['animator.toolbar.stop_animation']: [];
|
||||
['animator.toolbar.pause_animation']: [];
|
||||
['animator.toolbar.jump_next_frame']: [];
|
||||
['animator.toolbar.jump_last_frame']: [];
|
||||
['animator.toolbar.insert_event']: [];
|
||||
['animator.toolbar.save_clip']: [];
|
||||
['animator.property.title']: [];
|
||||
['animator.property.create_prop']: [];
|
||||
['animator.property.remove_prop']: [];
|
||||
['animator.property.clear_keys']: [];
|
||||
['animator.property.create_key']: [];
|
||||
['animator.property.remove_key']: [];
|
||||
['animator.property.copy_key']: [];
|
||||
['animator.property.paste_key']: [];
|
||||
['animator.property.spacing_key']: [];
|
||||
['animator.property.spacing_frame']: [];
|
||||
['animator.event.title']: [];
|
||||
['animator.event.add_func']: [];
|
||||
['animator.event.del_func']: [];
|
||||
['animator.event.add_params']: [];
|
||||
['animator.event.del_params']: [];
|
||||
['animator.event.clear_params']: [];
|
||||
['animator.event.create']: [];
|
||||
['animator.event.paste']: [];
|
||||
['animator.bezier.title']: [];
|
||||
['animator.bezier.click_to_apply']: [];
|
||||
['animator.node.title']: [];
|
||||
['animator.node.move_data']: [];
|
||||
['animator.node.move_data_to']: [];
|
||||
['animator.node.clear_data']: [];
|
||||
['animator.preview_row.line_tips']: [];
|
||||
['animator.preview_row.open_curve_editor']: [];
|
||||
['animator.preview_row.asset_type_should_be']: [];
|
||||
['animator.preview_row.asset_position_tips']: [];
|
||||
['animator.is_save']: [];
|
||||
['animator.is_save_message']: [];
|
||||
['animator.is_paste_overwrite']: [];
|
||||
['animator.is_paste_overwrite_message']: [];
|
||||
['animator.overwrite']: [];
|
||||
['animator.is_clear']: [];
|
||||
['animator.is_clear_message']: [];
|
||||
['animator.is_move_data']: [];
|
||||
['animator.is_move_data_message']: [];
|
||||
['animator.is_remove_prop.title']: [];
|
||||
['animator.is_remove_prop.message']: [];
|
||||
['animator.is_remove_prop.remove']: [];
|
||||
['animator.is_clear_prop.title']: [];
|
||||
['animator.is_clear_prop.message']: [];
|
||||
['animator.is_clear_prop.remove']: [];
|
||||
['animator.move']: [];
|
||||
['animator.clear']: [];
|
||||
['animator.copy']: [];
|
||||
['animator.paste']: [];
|
||||
['animator.save']: [];
|
||||
['animator.abort']: [];
|
||||
['animator.cancel']: [];
|
||||
['animator.edit']: [];
|
||||
['animator.delete']: [];
|
||||
['animator.toolbar.spacing_frame']: [];
|
||||
['asset-db.mask.startup']: [];
|
||||
['asset-db.mask.loading']: [];
|
||||
['asset-db.debug-mode']: [];
|
||||
['asset-db.operate.dialogError']: [];
|
||||
['asset-db.operate.dialogWarning']: [];
|
||||
['asset-db.operate.dialogQuestion']: [];
|
||||
['asset-db.operate.dialogInfo']: [];
|
||||
['asset-db.fail.readonly']: [];
|
||||
['asset-db.createAsset.fail.unknown']: [];
|
||||
['asset-db.createAsset.fail.url']: [];
|
||||
['asset-db.createAsset.fail.exist']: [];
|
||||
['asset-db.createAsset.fail.drop']: [];
|
||||
['asset-db.createAsset.fail.toUrl']: [];
|
||||
['asset-db.createAsset.fail.uuid']: [];
|
||||
['asset-db.createAsset.fail.content']: [];
|
||||
['asset-db.createAsset.fail.readonly']: [];
|
||||
['asset-db.createAsset.warn.overwrite']: [];
|
||||
['asset-db.dropAsset.overwrite']: [];
|
||||
['asset-db.dropAsset.reserve']: [];
|
||||
['asset-db.dropAsset.fail.unknown']: [];
|
||||
['asset-db.dropAsset.fail.url']: [];
|
||||
['asset-db.dropAsset.fail.filepaths']: [];
|
||||
['asset-db.dropAsset.fail.readonly']: [];
|
||||
['asset-db.dropAsset.warn.overwrite']: [];
|
||||
['asset-db.dropAsset.warn.sameway']: [];
|
||||
['asset-db.saveAsset.fail.unknown']: [];
|
||||
['asset-db.saveAsset.fail.uuid']: [];
|
||||
['asset-db.saveAsset.fail.content']: [];
|
||||
['asset-db.saveAsset.fail.readonly']: [];
|
||||
['asset-db.saveAssetMeta.fail.unknown']: [];
|
||||
['asset-db.saveAssetMeta.fail.uuid']: [];
|
||||
['asset-db.saveAssetMeta.fail.content']: [];
|
||||
['asset-db.saveAssetMeta.fail.readonly']: [];
|
||||
['asset-db.copyAsset.fail.unknown']: [];
|
||||
['asset-db.copyAsset.fail.url']: [];
|
||||
['asset-db.copyAsset.fail.source']: [];
|
||||
['asset-db.copyAsset.fail.target']: [];
|
||||
['asset-db.copyAsset.fail.include']: [];
|
||||
['asset-db.copyAsset.fail.parent']: [];
|
||||
['asset-db.copyAsset.fail.readonly']: [];
|
||||
['asset-db.copyAsset.fail.metauuid']: [];
|
||||
['asset-db.moveAsset.fail.unknown']: [];
|
||||
['asset-db.moveAsset.fail.url']: [];
|
||||
['asset-db.moveAsset.fail.source']: [];
|
||||
['asset-db.moveAsset.fail.target']: [];
|
||||
['asset-db.moveAsset.fail.exist']: [];
|
||||
['asset-db.moveAsset.fail.include']: [];
|
||||
['asset-db.moveAsset.fail.parent']: [];
|
||||
['asset-db.moveAsset.fail.readonly_source']: [];
|
||||
['asset-db.moveAsset.fail.readonly']: [];
|
||||
['asset-db.moveAsset.warn.overwrite']: [];
|
||||
['asset-db.deleteAsset.fail.unknown']: [];
|
||||
['asset-db.deleteAsset.fail.url']: [];
|
||||
['asset-db.deleteAsset.fail.unexist']: [];
|
||||
['asset-db.deleteAsset.fail.readonly']: [];
|
||||
['asset-db.preferences.log_level']: [];
|
||||
['asset-db.preferences.log_level_debug']: [];
|
||||
['asset-db.preferences.log_level_log']: [];
|
||||
['asset-db.preferences.log_level_warn']: [];
|
||||
['asset-db.preferences.log_level_error']: [];
|
||||
['asset-db.importers.glTF.glTF_asset_group_mesh']: [];
|
||||
['asset-db.importers.glTF.glTF_asset_group_animation']: [];
|
||||
['asset-db.importers.glTF.glTF_asset_group_node']: [];
|
||||
['asset-db.importers.glTF.glTF_asset_group_skin']: [];
|
||||
['asset-db.importers.glTF.glTF_asset_group_sampler']: [];
|
||||
['asset-db.importers.glTF.glTF_asset']: [{
|
||||
group: any;
|
||||
index: any;
|
||||
name: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.glTF_asset_no_name']: [{
|
||||
group: any;
|
||||
index: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.unsupported_alpha_mode']: [{
|
||||
material: any;
|
||||
mode: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.unsupported_texture_parameter']: [{
|
||||
texture: any;
|
||||
sampler: any;
|
||||
type: any;
|
||||
value: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.texture_parameter_min_filter']: [];
|
||||
['asset-db.importers.glTF.texture_parameter_mag_filter']: [];
|
||||
['asset-db.importers.glTF.unsupported_channel_path']: [{
|
||||
animation: any;
|
||||
channel: any;
|
||||
path: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.reference_skin_in_different_scene']: [{
|
||||
node: any;
|
||||
skin: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.disallow_cubic_spline_channel_split']: [{
|
||||
animation: any;
|
||||
channel: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.failed_to_calculate_tangents_due_to_lack_of_normals']: [{
|
||||
mesh: any;
|
||||
primitive: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.failed_to_calculate_tangents_due_to_lack_of_uvs']: [{
|
||||
mesh: any;
|
||||
primitive: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.failed_to_load_image']: [{
|
||||
url: any;
|
||||
reason: any;
|
||||
}];
|
||||
['asset-db.importers.glTF.image_uri_should_be_file_url']: [];
|
||||
['asset-db.importers.glTF.failed_to_convert_tga']: [];
|
||||
['asset-db.importers.fbx.failed_to_convert_fbx_file']: [{
|
||||
path: any;
|
||||
}];
|
||||
['asset-db.importers.fbx.no_available_fbx_temp_dir']: [];
|
||||
['asset-db.importers.fbx.fbx2glTF_exists_with_non_zero_code']: [{
|
||||
code: any;
|
||||
output: any;
|
||||
}];
|
||||
['asset-db.importers.javascript.transform_failure']: [{
|
||||
path: any;
|
||||
reason: any;
|
||||
}];
|
||||
['assets.title']: [];
|
||||
['assets.previewTitle']: [];
|
||||
['assets.menu.createMenu']: [];
|
||||
['assets.menu.searchPlaceholder_name']: [];
|
||||
['assets.menu.searchPlaceholder_uuid']: [];
|
||||
['assets.menu.searchPlaceholder_type']: [];
|
||||
['assets.menu.searchTip']: [];
|
||||
['assets.menu.search']: [];
|
||||
['assets.menu.searchName']: [];
|
||||
['assets.menu.searchUuid']: [];
|
||||
['assets.menu.searchType']: [];
|
||||
['assets.menu.sort']: [];
|
||||
['assets.menu.sortName']: [];
|
||||
['assets.menu.sortType']: [];
|
||||
['assets.menu.refresh']: [];
|
||||
['assets.menu.allExpand']: [];
|
||||
['assets.menu.allCollapse']: [];
|
||||
['assets.menu.new']: [];
|
||||
['assets.menu.newFolder']: [];
|
||||
['assets.menu.newJavaScript']: [];
|
||||
['assets.menu.newTypeScript']: [];
|
||||
['assets.menu.newCubeMap']: [];
|
||||
['assets.menu.newScene']: [];
|
||||
['assets.menu.newMaterial']: [];
|
||||
['assets.menu.newPhysicsMaterial']: [];
|
||||
['assets.menu.newEffect']: [];
|
||||
['assets.menu.newChunk']: [];
|
||||
['assets.menu.newAnimation']: [];
|
||||
['assets.menu.renderPipeline']: [];
|
||||
['assets.menu.forwardPipeline']: [];
|
||||
['assets.menu.renderPipelineTS']: [];
|
||||
['assets.menu.RenderFlowTS']: [];
|
||||
['assets.menu.RenderStageTS']: [];
|
||||
['assets.menu.newPac']: [];
|
||||
['assets.menu.newTerrain']: [];
|
||||
['assets.menu.copy']: [];
|
||||
['assets.menu.cut']: [];
|
||||
['assets.menu.paste']: [];
|
||||
['assets.menu.delete']: [];
|
||||
['assets.menu.rename']: [];
|
||||
['assets.menu.selectall']: [];
|
||||
['assets.menu.readonly']: [];
|
||||
['assets.menu.revealInlibrary']: [];
|
||||
['assets.menu.reimport']: [];
|
||||
['assets.menu.revealInExplorer']: [];
|
||||
['assets.menu.showUuid']: [];
|
||||
['assets.menu.recommendTS']: [];
|
||||
['assets.operate.cutReady']: [];
|
||||
['assets.operate.cutDone']: [];
|
||||
['assets.operate.copyReady']: [];
|
||||
['assets.operate.copyDone']: [];
|
||||
['assets.operate.dialogError']: [];
|
||||
['assets.operate.dialogWarning']: [];
|
||||
['assets.operate.dialogQuestion']: [];
|
||||
['assets.operate.dialogInfo']: [];
|
||||
['assets.operate.refreshing']: [];
|
||||
['assets.operate.assetDataError']: [];
|
||||
['assets.operate.sureDelete']: [{
|
||||
length: any;
|
||||
filelist: any;
|
||||
}];
|
||||
['assets.operate.renameFail']: [];
|
||||
['assets.operate.pasteFail_parent_into_child']: [];
|
||||
['assets.operate.refreshFail']: [];
|
||||
['assets.operate.readDefaultFileFail']: [];
|
||||
['assets.operate.errorNewnameDuplicate']: [];
|
||||
['assets.operate.errorNewnameUnlegal']: [];
|
||||
['assets.operate.errorNewnameEmpty']: [];
|
||||
['assets.operate.errorScriptName']: [];
|
||||
['assets.operate.errorScriptClassName']: [];
|
||||
['assets.deprecate.fire']: [];
|
||||
['builder.title']: [];
|
||||
['builder.create_user_template']: [];
|
||||
['builder.build_config']: [];
|
||||
['builder.build']: [];
|
||||
['builder.compile']: [];
|
||||
['builder.select_all']: [];
|
||||
['builder.open_compile_file']: [];
|
||||
['builder.source_map']: [];
|
||||
['builder.recompile_engine']: [];
|
||||
['builder.debug_mode']: [];
|
||||
['builder.web_debugger']: [];
|
||||
['builder.require']: [];
|
||||
['builder.new_build_task']: [];
|
||||
['builder.empty_task_holder']: [];
|
||||
['builder.empty_scene']: [];
|
||||
['builder.reveal_in_explorer']: [];
|
||||
['builder.view_build_config']: [];
|
||||
['builder.recompile']: [];
|
||||
['builder.compress_texture']: [];
|
||||
['builder.pack_autoAtlas']: [];
|
||||
['builder.replace_splash_screen']: [];
|
||||
['builder.run']: [];
|
||||
['builder.open']: [];
|
||||
['builder.export']: [];
|
||||
['builder.import']: [];
|
||||
['builder.export_build_config']: [];
|
||||
['builder.import_build_config']: [];
|
||||
['builder.include_project_setting']: [];
|
||||
['builder.only_build_panel']: [];
|
||||
['builder.options.taskName']: [];
|
||||
['builder.options.name']: [];
|
||||
['builder.options.platform']: [];
|
||||
['builder.options.build_path']: [];
|
||||
['builder.options.start_scene']: [];
|
||||
['builder.options.inline_SpriteFrames']: [];
|
||||
['builder.options.merge_json_by_scene']: [];
|
||||
['builder.options.merge_start_scene']: [];
|
||||
['builder.options.orientation']: [];
|
||||
['builder.options.scenes']: [];
|
||||
['builder.options.debug']: [];
|
||||
['builder.options.resolution']: [];
|
||||
['builder.options.preview_url']: [];
|
||||
['builder.options.source_map']: [];
|
||||
['builder.options.force_combile_engine']: [];
|
||||
['builder.options.web_debugger']: [];
|
||||
['builder.options.compress_texture']: [];
|
||||
['builder.options.pack_autoAtlas']: [];
|
||||
['builder.package']: [];
|
||||
['builder.package_hint']: [];
|
||||
['builder.desktop_icon']: [];
|
||||
['builder.desktop_icon_hint']: [];
|
||||
['builder.version_name']: [];
|
||||
['builder.version_name_hint']: [];
|
||||
['builder.version_number']: [];
|
||||
['builder.version_number_hint']: [];
|
||||
['builder.support_min_platform']: [];
|
||||
['builder.support_min_platform_hint']: [];
|
||||
['builder.full_screen']: [];
|
||||
['builder.screen_orientation']: [];
|
||||
['builder.landscape']: [];
|
||||
['builder.portrait']: [];
|
||||
['builder.tiny_packet_mode']: [];
|
||||
['builder.tiny_packet_path']: [];
|
||||
['builder.tiny_packet_path_hint']: [];
|
||||
['builder.keystore']: [];
|
||||
['builder.use_debug_keystore']: [];
|
||||
['builder.private_pem_path']: [];
|
||||
['builder.private_pem_path_hint']: [];
|
||||
['builder.certificate_pem_path']: [];
|
||||
['builder.certificate_pem_path_hint']: [];
|
||||
['builder.print_finger']: [];
|
||||
['builder.pack_res_to_first_pack']: [];
|
||||
['builder.custom_npm_path']: [];
|
||||
['builder.custom_npm_path_hint']: [];
|
||||
['builder.custom_manifest_data']: [];
|
||||
['builder.custom_manifest_data_error']: [];
|
||||
['builder.remote_url']: [];
|
||||
['builder.not_install_nodejs_windows_error']: [];
|
||||
['builder.not_install_nodejs_mac_error']: [];
|
||||
['builder.rpk_installing']: [];
|
||||
['builder.rpk_install_fail']: [];
|
||||
['builder.rpk_install_success']: [];
|
||||
['builder.not_mainfest_data']: [];
|
||||
['builder.npm_installed_success']: [];
|
||||
['builder.npm_install_fail']: [];
|
||||
['builder.oppo.new']: [];
|
||||
['builder.oppo.not_empty']: [];
|
||||
['builder.oppo.icon_not_exist']: [];
|
||||
['builder.oppo.signature_not_exist']: [];
|
||||
['builder.oppo.private_pem_path_error']: [];
|
||||
['builder.oppo.certificate_pem_path_error']: [];
|
||||
['builder.certificate.country']: [];
|
||||
['builder.certificate.state']: [];
|
||||
['builder.certificate.locality']: [];
|
||||
['builder.certificate.organization']: [];
|
||||
['builder.certificate.organizationalUnit']: [];
|
||||
['builder.certificate.commonName']: [];
|
||||
['builder.certificate.email']: [];
|
||||
['builder.certificate.certificatePath']: [];
|
||||
['builder.certificate.generate']: [];
|
||||
['builder.certificate.build_certificate_complete']: [];
|
||||
['builder.certificate.build_certificate_fail']: [];
|
||||
['builder.huawei.select_certificate_path']: [];
|
||||
['builder.huawei.install_nodejs_before_view_certificate']: [];
|
||||
['builder.huawei.select_certificate_path_after_view_certificate']: [];
|
||||
['builder.huawei.certificate_fingerprint']: [];
|
||||
['builder.huawei.certificate_fingerprint_error']: [];
|
||||
['builder.huawei.use_native_renderer']: [];
|
||||
['builder.wechat_game.separate_engine']: [];
|
||||
['builder.wechat_game.separate_engine_tips']: [];
|
||||
['builder.wechat_game.client_path_error']: [{
|
||||
path: any;
|
||||
}];
|
||||
['builder.wechat_game.client_info_path_err']: [{
|
||||
path: any;
|
||||
}];
|
||||
['builder.wechat_game.client_version_low']: [];
|
||||
['builder.wechat_game.remote_server_address']: [];
|
||||
['builder.wechat_game.remote_server_address_tips']: [];
|
||||
['builder.wechat_game.sub_context']: [];
|
||||
['builder.wechat_game.sub_context_tips']: [];
|
||||
['builder.wechat_game.build_sub']: [];
|
||||
['builder.wechat_game.build_sub_tips']: [];
|
||||
['builder.wechat_game.wechatgame_app_path_empty']: [];
|
||||
['builder.error.build_error']: [];
|
||||
['builder.error.dirty_info']: [];
|
||||
['builder.error.build_dir_not_exists']: [{
|
||||
buildDir: any;
|
||||
}];
|
||||
['builder.error.build_path_contains_space']: [];
|
||||
['builder.error.build_path_contains_chinese']: [];
|
||||
['builder.error.can_not_empty']: [];
|
||||
['builder.error.project_name_not_legal']: [];
|
||||
['builder.error.package_name_not_legal']: [];
|
||||
['builder.error.package_name_start_with_number']: [];
|
||||
['builder.error.select_scenes_to_build']: [];
|
||||
['builder.error.binary_api_level']: [];
|
||||
['builder.error.path_too_long_title']: [];
|
||||
['builder.error.path_too_long_desc']: [{
|
||||
max_length: any;
|
||||
}];
|
||||
['builder.error.keep_raw_texture_of_atlas']: [{
|
||||
texturePath: any;
|
||||
pacPath: any;
|
||||
assetPath: any;
|
||||
}];
|
||||
['builder.error.arm64_not_support']: [{
|
||||
current_api: any;
|
||||
min_version: any;
|
||||
}];
|
||||
['builder.warn.same_url']: [];
|
||||
['builder.tasks.build_asset']: [];
|
||||
['builder.tasks.build_engine']: [];
|
||||
['builder.tasks.build_img']: [];
|
||||
['builder.tasks.build_json']: [];
|
||||
['builder.tasks.build_atlas']: [];
|
||||
['builder.tasks.build_script']: [];
|
||||
['builder.tasks.build_suffix']: [];
|
||||
['builder.tasks.build_template']: [];
|
||||
['builder.tasks.load_script']: [];
|
||||
['builder.tasks.sort_asset']: [];
|
||||
['builder.tasks.sort_image']: [];
|
||||
['builder.tasks.sort_script']: [];
|
||||
['builder.tasks.sort_sprite_frame']: [];
|
||||
['builder.tasks.sort_texture']: [];
|
||||
['builder.tasks.sort_json']: [];
|
||||
['builder.tasks.settings.compress']: [];
|
||||
['builder.tasks.settings.design_resolution']: [];
|
||||
['builder.tasks.settings.group']: [];
|
||||
['builder.tasks.settings.md5']: [];
|
||||
['builder.tasks.settings.scene']: [];
|
||||
['builder.tasks.settings.script']: [];
|
||||
['builder.tips.enter_name']: [];
|
||||
['builder.tips.taskName']: [];
|
||||
['builder.tips.build_path']: [];
|
||||
['builder.tips.build_scenes']: [];
|
||||
['builder.tips.inline_SpriteFrames']: [];
|
||||
['builder.tips.md5Cache']: [];
|
||||
['builder.tips.merge_start_scene']: [];
|
||||
['builder.tips.debug']: [];
|
||||
['builder.tips.resolution']: [];
|
||||
['builder.tips.web_debugger']: [];
|
||||
['builder.tips.creat_template_success']: [];
|
||||
['builder.tips.set_start_scene']: [];
|
||||
['builder.splash_setting.title']: [];
|
||||
['builder.splash_setting.drag_img_here']: [];
|
||||
['builder.splash_setting.img_loading']: [];
|
||||
['builder.splash_setting.confirm']: [];
|
||||
['builder.splash_setting.settings.total_time']: [];
|
||||
['builder.splash_setting.settings.display_ratio']: [];
|
||||
['builder.splash_setting.settings.clear_color']: [];
|
||||
['builder.splash_setting.settings.effect']: [];
|
||||
['builder.splash_setting.settings.display_watermark']: [];
|
||||
['builder.splash_setting.is_save_dialog.title']: [];
|
||||
['builder.splash_setting.is_save_dialog.save']: [];
|
||||
['builder.splash_setting.is_save_dialog.cancel']: [];
|
||||
['builder.splash_setting.is_save_dialog.abort']: [];
|
||||
['builder.is_remove_task.title']: [];
|
||||
['builder.is_remove_task.has_building_task']: [];
|
||||
['builder.is_remove_task.message']: [];
|
||||
['builder.is_remove_task.remove']: [];
|
||||
['builder.is_remove_task.deep_remove']: [];
|
||||
['builder.is_remove_task.cancel']: [];
|
||||
['builder.is_stop_build.title']: [];
|
||||
['builder.is_stop_build.message']: [];
|
||||
['builder.is_stop_build.stop']: [];
|
||||
['builder.is_stop_build.cancel']: [];
|
||||
['builder.is_close_win.title']: [];
|
||||
['builder.is_close_win.message']: [];
|
||||
['builder.is_close_win.force_close']: [];
|
||||
['builder.is_close_win.cancel']: [];
|
||||
['builder.is_save_scene.title']: [];
|
||||
['builder.is_save_scene.message']: [];
|
||||
['builder.is_save_scene.save']: [];
|
||||
['builder.is_save_scene.ignore']: [];
|
||||
['builder.is_save_scene.cancel']: [];
|
||||
['builder.merge_json_by_scene']: [];
|
||||
['builder.not_require']: [];
|
||||
['builder.options.open_compile_file']: [];
|
||||
['builder.custom_manifest_file_path']: [];
|
||||
['builder.custom_manifest_file_path_hint']: [];
|
||||
['builder.install_nodejs_before_view_certificate']: [];
|
||||
['builder.window_default_npm_path_error']: [];
|
||||
['builder.mac_default_npm_path_error']: [];
|
||||
['builder.oppo.package_name_error']: [];
|
||||
['builder.huawei.certificate_fingerprint_window_error']: [];
|
||||
['builder.huawei.certificate_fingerprint_mac_error']: [];
|
||||
['console.title']: [];
|
||||
['console.editorLog']: [];
|
||||
['console.cocosLog']: [];
|
||||
['console.tabbar.regex']: [];
|
||||
['console.preferences.display_date']: [];
|
||||
['console.preferences.font_size']: [];
|
||||
['console.preferences.line_height']: [];
|
||||
['engine.title']: [];
|
||||
['engine.compile_engine']: [];
|
||||
['engine.wait_quick_compile']: [];
|
||||
['engine.confirm']: [];
|
||||
['engine.browse']: [];
|
||||
['engine.open']: [];
|
||||
['engine.engine_directory_illegal']: [];
|
||||
['engine.engine_compile_failed']: [];
|
||||
['engine.engine_compile_crash']: [];
|
||||
['engine.javascript_engine']: [];
|
||||
['engine.use_builtin_engine']: [];
|
||||
['engine.custom_engine_path']: [];
|
||||
['engine.QUICK_COMPILER.engine_modified_info']: [];
|
||||
['engine.resources_docs_1']: [];
|
||||
['engine.resources_docs_2']: [];
|
||||
['engine.resources_docs_3']: [];
|
||||
['engine.resources_docs_4']: [];
|
||||
['hierarchy.title']: [];
|
||||
['hierarchy.menu.createMenu']: [];
|
||||
['hierarchy.menu.searchPlaceholder']: [];
|
||||
['hierarchy.menu.searchPlaceholder_name']: [];
|
||||
['hierarchy.menu.searchPlaceholder_uuid']: [];
|
||||
['hierarchy.menu.searchPlaceholder_component']: [];
|
||||
['hierarchy.menu.searchTip']: [];
|
||||
['hierarchy.menu.search']: [];
|
||||
['hierarchy.menu.searchName']: [];
|
||||
['hierarchy.menu.searchUuid']: [];
|
||||
['hierarchy.menu.searchComponent']: [];
|
||||
['hierarchy.menu.refresh']: [];
|
||||
['hierarchy.menu.allExpand']: [];
|
||||
['hierarchy.menu.allCollapse']: [];
|
||||
['hierarchy.menu.newNode']: [];
|
||||
['hierarchy.menu.newNodeEmpty']: [];
|
||||
['hierarchy.menu.new3dObject']: [];
|
||||
['hierarchy.menu.new3dCube']: [];
|
||||
['hierarchy.menu.new3dCylinder']: [];
|
||||
['hierarchy.menu.new3dSphere']: [];
|
||||
['hierarchy.menu.new3dCapsule']: [];
|
||||
['hierarchy.menu.new3dCone']: [];
|
||||
['hierarchy.menu.new3dTorus']: [];
|
||||
['hierarchy.menu.new3dPlane']: [];
|
||||
['hierarchy.menu.new3dQuad']: [];
|
||||
['hierarchy.menu.newLightObject']: [];
|
||||
['hierarchy.menu.newLightDirectional']: [];
|
||||
['hierarchy.menu.newLightSphere']: [];
|
||||
['hierarchy.menu.newLightSpot']: [];
|
||||
['hierarchy.menu.newCameraObject']: [];
|
||||
['hierarchy.menu.newTerrain']: [];
|
||||
['hierarchy.menu.newEffects']: [];
|
||||
['hierarchy.menu.newEffectsParticle']: [];
|
||||
['hierarchy.menu.newUI']: [];
|
||||
['hierarchy.menu.newUICanvas']: [];
|
||||
['hierarchy.menu.newUISprite']: [];
|
||||
['hierarchy.menu.newUILabel']: [];
|
||||
['hierarchy.menu.newUIButton']: [];
|
||||
['hierarchy.menu.newUIToggle']: [];
|
||||
['hierarchy.menu.newUIToggleGroup']: [];
|
||||
['hierarchy.menu.newUISlider']: [];
|
||||
['hierarchy.menu.newUIProgressBar']: [];
|
||||
['hierarchy.menu.newUIWidget']: [];
|
||||
['hierarchy.menu.newUIEditBox']: [];
|
||||
['hierarchy.menu.newUILayout']: [];
|
||||
['hierarchy.menu.newUIScrollView']: [];
|
||||
['hierarchy.menu.newUIMask']: [];
|
||||
['hierarchy.menu.copy']: [];
|
||||
['hierarchy.menu.cut']: [];
|
||||
['hierarchy.menu.paste']: [];
|
||||
['hierarchy.menu.delete']: [];
|
||||
['hierarchy.menu.rename']: [];
|
||||
['hierarchy.menu.duplicate']: [];
|
||||
['hierarchy.menu.showUuid']: [];
|
||||
['hierarchy.menu.link_prefab']: [];
|
||||
['hierarchy.menu.link_prefab_error_node_empty']: [];
|
||||
['hierarchy.menu.link_prefab_error_node_isScene']: [];
|
||||
['hierarchy.menu.link_prefab_error_asset_empty']: [];
|
||||
['hierarchy.menu.link_prefab_error_asset_invalid']: [];
|
||||
['hierarchy.menu.link_prefab_make_sure']: [];
|
||||
['hierarchy.menu.unlink_prefab']: [];
|
||||
['hierarchy.menu.unlink_prefab_error_prefab_empty']: [];
|
||||
['hierarchy.menu.errorNewnameEmpty']: [];
|
||||
['hierarchy.operate.cutReady']: [];
|
||||
['hierarchy.operate.cutDone']: [];
|
||||
['hierarchy.operate.copyReady']: [];
|
||||
['hierarchy.operate.copyDone']: [];
|
||||
['hierarchy.operate.duplicateDone']: [];
|
||||
['hierarchy.operate.dialogError']: [];
|
||||
['hierarchy.operate.dialogWarning']: [];
|
||||
['hierarchy.operate.dialogQuestion']: [];
|
||||
['hierarchy.operate.dialogInfo']: [];
|
||||
['hierarchy.operate.renameFail']: [];
|
||||
['inspector.title']: [];
|
||||
['inspector.add_component']: [];
|
||||
['inspector.lock_unlock']: [];
|
||||
['inspector.backward_selection']: [];
|
||||
['inspector.forward_selection']: [];
|
||||
['inspector.menu.remove_component']: [];
|
||||
['inspector.menu.move_up_component']: [];
|
||||
['inspector.menu.move_down_component']: [];
|
||||
['inspector.menu.copy_node_value']: [];
|
||||
['inspector.menu.paste_node_value']: [];
|
||||
['inspector.menu.copy_component']: [];
|
||||
['inspector.menu.paste_component']: [];
|
||||
['inspector.menu.paste_component_values']: [];
|
||||
['inspector.asset.directory.is_subpackage']: [];
|
||||
['inspector.asset.directory.subpackage_name']: [];
|
||||
['inspector.asset.javascript.plugin']: [];
|
||||
['inspector.asset.javascript.loadPluginInWeb']: [];
|
||||
['inspector.asset.javascript.loadPluginInEditor']: [];
|
||||
['inspector.asset.javascript.loadPluginInNative']: [];
|
||||
['inspector.asset.fbx.browse']: [];
|
||||
['inspector.asset.spriteFrame.edit']: [];
|
||||
['inspector.asset.texture.modeWarn']: [];
|
||||
['inspector.node.layer.confirm_message']: [];
|
||||
['inspector.node.layer.change_children']: [];
|
||||
['inspector.node.layer.change_self']: [];
|
||||
['inspector.gradient.title']: [];
|
||||
['inspector.curve_editor.title']: [];
|
||||
['inspector.sprite_editor.title']: [];
|
||||
['inspector.sprite_editor.scale']: [];
|
||||
['inspector.sprite_editor.reset']: [];
|
||||
['inspector.sprite_editor.save']: [];
|
||||
['inspector.sprite_editor.saveError']: [];
|
||||
['inspector.sprite_editor.border']: [];
|
||||
['inspector.sprite_editor.left']: [];
|
||||
['inspector.sprite_editor.right']: [];
|
||||
['inspector.sprite_editor.top']: [];
|
||||
['inspector.sprite_editor.bottom']: [];
|
||||
['inspector.check_is_saved.message']: [];
|
||||
['inspector.check_is_saved.save']: [];
|
||||
['inspector.check_is_saved.abort']: [];
|
||||
['inspector.prefab.local']: [];
|
||||
['inspector.prefab.reset']: [];
|
||||
['inspector.prefab.save']: [];
|
||||
['inspector.prefab.link']: [];
|
||||
['inspector.prefab.unlink']: [];
|
||||
['inspector.prefab.lost']: [];
|
||||
['inspector.prefab.exist']: [];
|
||||
['packager.title']: [];
|
||||
['packager.menu.internal']: [];
|
||||
['packager.menu.project']: [];
|
||||
['packager.menu.global']: [];
|
||||
['packager.menu.add']: [];
|
||||
['packager.menu.addProject']: [];
|
||||
['packager.menu.addGlobal']: [];
|
||||
['packager.menu.addLabel']: [];
|
||||
['packager.menu.addSuccess']: [];
|
||||
['packager.menu.import']: [];
|
||||
['packager.menu.importProject']: [];
|
||||
['packager.menu.importGlobal']: [];
|
||||
['packager.menu.importSuccess']: [];
|
||||
['packager.menu.install']: [];
|
||||
['packager.menu.installProject']: [];
|
||||
['packager.menu.installGlobal']: [];
|
||||
['packager.menu.installSuccess']: [];
|
||||
['packager.menu.selectDirectory']: [];
|
||||
['packager.menu.search']: [];
|
||||
['packager.menu.openFolder']: [];
|
||||
['packager.menu.author']: [];
|
||||
['packager.menu.state']: [];
|
||||
['packager.menu.remove']: [];
|
||||
['packager.menu.removeSuccess']: [];
|
||||
['packager.menu.removeConfirm']: [];
|
||||
['packager.menu.enable']: [];
|
||||
['packager.menu.disable']: [];
|
||||
['packager.menu.enabled']: [];
|
||||
['packager.menu.disabled']: [];
|
||||
['packager.menu.invalid']: [];
|
||||
['packager.menu.confirm']: [];
|
||||
['packager.menu.addError']: [];
|
||||
['packager.menu.importError']: [];
|
||||
['preferences.title']: [];
|
||||
['preferences.nav.general']: [];
|
||||
['preferences.nav.edit']: [];
|
||||
['preferences.nav.extension']: [];
|
||||
['preferences.nav.native']: [];
|
||||
['preferences.nav.laboratory']: [];
|
||||
['preferences.general.language']: [];
|
||||
['preferences.general.step']: [];
|
||||
['preferences.general.preci']: [];
|
||||
['preferences.general.theme']: [];
|
||||
['preferences.general.themeColor']: [];
|
||||
['preferences.general.preview_ip']: [];
|
||||
['preferences.edit.script_editor']: [];
|
||||
['preferences.edit.picture_editor']: [];
|
||||
['preferences.edit.browse']: [];
|
||||
['preferences.edit.remove']: [];
|
||||
['preferences.edit.internal']: [];
|
||||
['preferences.native.wechatgame_app_path']: [];
|
||||
['preferences.extension.package']: [];
|
||||
['preferences.laboratory.about']: [];
|
||||
['preferences.laboratory.new_add_component']: [];
|
||||
['preferences.browse']: [];
|
||||
['preferences.open']: [];
|
||||
['preview.title']: [];
|
||||
['preview.automatic']: [];
|
||||
['preview.automatic_tooltip']: [];
|
||||
['preview.scene_is_empty']: [];
|
||||
['preview.play']: [];
|
||||
['preview.refresh_device']: [];
|
||||
['preview.scan']: [];
|
||||
['preview.create_template']: [];
|
||||
['preview.load_current_scene_error']: [];
|
||||
['preview.creat_template_success']: [];
|
||||
['project-setting.title']: [];
|
||||
['project-setting.nav.preview']: [];
|
||||
['project-setting.nav.groupList']: [];
|
||||
['project-setting.nav.modules']: [];
|
||||
['project-setting.nav.engine']: [];
|
||||
['project-setting.nav.layer']: [];
|
||||
['project-setting.nav.graphics']: [];
|
||||
['project-setting.nav.general']: [];
|
||||
['project-setting.nav.projectPath']: [];
|
||||
['project-setting.nav.wizardPath']: [];
|
||||
['project-setting.preview.start_scene']: [];
|
||||
['project-setting.preview.auto_refresh']: [];
|
||||
['project-setting.preview.current_scene']: [];
|
||||
['project-setting.preview.simulator_setting_type']: [];
|
||||
['project-setting.preview.global']: [];
|
||||
['project-setting.preview.project']: [];
|
||||
['project-setting.preview.simulator_device_orientation']: [];
|
||||
['project-setting.preview.simulator_resolution']: [];
|
||||
['project-setting.preview.customize_resolution']: [];
|
||||
['project-setting.preview.vertical']: [];
|
||||
['project-setting.preview.horizontal']: [];
|
||||
['project-setting.modules.title']: [];
|
||||
['project-setting.modules.info']: [];
|
||||
['project-setting.modules.warn']: [];
|
||||
['project-setting.modules.module']: [];
|
||||
['project-setting.modules.inquiry']: [];
|
||||
['project-setting.modules.submodule']: [];
|
||||
['project-setting.modules.inquiry_all']: [];
|
||||
['project-setting.engine.cocos_default']: [];
|
||||
['project-setting.engine.user_customize']: [];
|
||||
['project-setting.engine.renderPipeline']: [];
|
||||
['project-setting.engine.physics']: [];
|
||||
['project-setting.engine.builtin']: [];
|
||||
['project-setting.engine.cannon']: [];
|
||||
['project-setting.engine.ammo']: [];
|
||||
['project-setting.general.browse']: [];
|
||||
['project-setting.general.ts_compiler']: [];
|
||||
['project-setting.general.tslint.title']: [];
|
||||
['project-setting.general.tslint.default']: [];
|
||||
['project-setting.general.tslint.path']: [];
|
||||
['project-setting.general.section_canvas']: [];
|
||||
['project-setting.general.design_resolution']: [];
|
||||
['project-setting.general.width']: [];
|
||||
['project-setting.general.height']: [];
|
||||
['project-setting.general.fit_width']: [];
|
||||
['project-setting.general.fit_height']: [];
|
||||
['project-setting.general.type_check_level']: [];
|
||||
['project-setting.general.type_check_tips.disable']: [];
|
||||
['project-setting.general.type_check_tips.checkOnly']: [];
|
||||
['project-setting.general.type_check_tips.fatalOnError']: [];
|
||||
['scene.title']: [];
|
||||
['scene.new']: [];
|
||||
['scene.save']: [];
|
||||
['scene.save_as']: [];
|
||||
['scene.develop']: [];
|
||||
['scene.terrain.is_create_message']: [];
|
||||
['scene.terrain.is_create']: [];
|
||||
['scene.terrain.cancel']: [];
|
||||
['scene.terrain.edit']: [];
|
||||
['scene.terrain.save']: [];
|
||||
['scene.terrain.delete']: [];
|
||||
['scene.terrain.abort']: [];
|
||||
['scene.messages.warning']: [];
|
||||
['scene.messages.scenario_modified']: [];
|
||||
['scene.messages.want_to_save']: [];
|
||||
['scene.messages.save']: [];
|
||||
['scene.messages.dont_save']: [];
|
||||
['scene.messages.cancel']: [];
|
||||
['scene.messages.save_as_fail']: [];
|
||||
['scene.save_prefab']: [];
|
||||
['scene.close_prefab']: [];
|
||||
['scene.save_clip']: [];
|
||||
['scene.close_clip']: [];
|
||||
['scene.gizmos.icon3d']: [];
|
||||
['scene.gizmos.showGrid']: [];
|
||||
['scene.ui_tools.zoom_up']: [];
|
||||
['scene.ui_tools.zoom_down']: [];
|
||||
['scene.ui_tools.zoom_reset']: [];
|
||||
['scene.ui_tools.align_top']: [];
|
||||
['scene.ui_tools.align_v_center']: [];
|
||||
['scene.ui_tools.align_bottom']: [];
|
||||
['scene.ui_tools.align_left']: [];
|
||||
['scene.ui_tools.align_h_center']: [];
|
||||
['scene.ui_tools.align_right']: [];
|
||||
['scene.ui_tools.distribute_top']: [];
|
||||
['scene.ui_tools.distribute_v_center']: [];
|
||||
['scene.ui_tools.distribute_bottom']: [];
|
||||
['scene.ui_tools.distribute_left']: [];
|
||||
['scene.ui_tools.distribute_h_center']: [];
|
||||
['scene.ui_tools.distribute_right']: [];
|
||||
['tester.auto_tooltip']: [];
|
||||
['tester.play_tooltip']: [];
|
||||
['tester.pause_tooltip']: [];
|
||||
['ui-kit.title']: [];
|
||||
}
|
@@ -0,0 +1,156 @@
|
||||
declare module 'tga-js' {
|
||||
export default class TGA {
|
||||
width: number;
|
||||
height: number;
|
||||
getImageData(imageData?: ImageData): ImageData | {width: number, height: number, data: Uint8ClampedArray};
|
||||
constructor();
|
||||
load(data: Buffer): null;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'psd.js' {
|
||||
import PNG from 'pngjs';
|
||||
export default class PSD {
|
||||
constructor (data: Buffer);
|
||||
|
||||
parse();
|
||||
|
||||
image: {
|
||||
toPng(): PNG;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'draco3dgltf' {
|
||||
export function createDecoderModule(options: DecoderModuleOptions): typeof DecoderModule;
|
||||
|
||||
export interface DecoderModuleOptions {
|
||||
|
||||
}
|
||||
|
||||
interface DecoderModule {
|
||||
|
||||
}
|
||||
|
||||
namespace DecoderModule {
|
||||
function destroy(decoder: Decoder): void;
|
||||
|
||||
function destroy(buffer: DecoderBuffer): void;
|
||||
|
||||
function destroy(int32Array: DracoInt32Array): void;
|
||||
|
||||
function destroy(mesh: Geometry): void;
|
||||
|
||||
export class DecoderBuffer {
|
||||
public Init(buffer: Int8Array, size: number): void;
|
||||
}
|
||||
|
||||
export class Decoder {
|
||||
public GetEncodedGeometryType(buffer: DecoderBuffer): GeometryType;
|
||||
|
||||
public DecodeBufferToMesh(buffer: DecoderBuffer, mesh: Mesh): Status;
|
||||
|
||||
public DecodeBufferToPointCloud(buffer: DecoderBuffer, pointCloud: PointCloud): Status;
|
||||
|
||||
public GetFaceFromMesh(geometry: Geometry, index: number, out: DracoInt32Array): void;
|
||||
|
||||
public GetAttributeId(geometry: Geometry, attributeType: AttributeType): number;
|
||||
|
||||
public GetAttributeByUniqueId(geometry: Geometry, uniqueId: number): Attribute;
|
||||
|
||||
public GetAttribute(geometry: Geometry, attributeId: number): Attribute;
|
||||
|
||||
public GetAttributeInt8ForAllPoints(geometry: Geometry, attribute: Attribute, attributeData: DracoInt8Array): void;
|
||||
|
||||
public GetAttributeInt16ForAllPoints(geometry: Geometry, attribute: Attribute, attributeData: DracoInt16Array): void;
|
||||
|
||||
public GetAttributeInt32ForAllPoints(geometry: Geometry, attribute: Attribute, attributeData: DracoInt32Array): void;
|
||||
|
||||
public GetAttributeUInt8ForAllPoints(geometry: Geometry, attribute: Attribute, attributeData: DracoUInt8Array): void;
|
||||
|
||||
public GetAttributeUInt16ForAllPoints(geometry: Geometry, attribute: Attribute, attributeData: DracoUInt16Array): void;
|
||||
|
||||
public GetAttributeUInt32ForAllPoints(geometry: Geometry, attribute: Attribute, attributeData: DracoUInt32Array): void;
|
||||
|
||||
public GetAttributeFloatForAllPoints(geometry: Geometry, attribute: Attribute, attributeData: DracoFloat32Array): void;
|
||||
}
|
||||
|
||||
class Status {
|
||||
public ok(): boolean;
|
||||
public error_msg(): string;
|
||||
}
|
||||
|
||||
enum GeometryType {
|
||||
// See below
|
||||
}
|
||||
|
||||
export const TRIANGULAR_MESH: GeometryType;
|
||||
|
||||
export const POINT_CLOUD: GeometryType;
|
||||
|
||||
export class Mesh {
|
||||
public ptr: number;
|
||||
|
||||
public num_faces(): number;
|
||||
|
||||
public num_points(): number;
|
||||
}
|
||||
|
||||
export class PointCloud {
|
||||
public ptr: number;
|
||||
|
||||
public num_points(): number;
|
||||
}
|
||||
|
||||
export type Geometry = Mesh | PointCloud;
|
||||
|
||||
enum AttributeType {
|
||||
// See below
|
||||
}
|
||||
|
||||
export const POSITION: AttributeType;
|
||||
export const NORMAL: AttributeType;
|
||||
export const COLOR: AttributeType;
|
||||
export const TEX_COORD: AttributeType;
|
||||
|
||||
class Attribute {
|
||||
private constructor();
|
||||
public num_components(): number;
|
||||
}
|
||||
|
||||
export class DracoInt8Array {
|
||||
public size(): number;
|
||||
public GetValue(index: number): number;
|
||||
}
|
||||
|
||||
export class DracoInt16Array {
|
||||
public size(): number;
|
||||
public GetValue(index: number): number;
|
||||
}
|
||||
|
||||
export class DracoInt32Array {
|
||||
public size(): number;
|
||||
public GetValue(index: number): number;
|
||||
}
|
||||
|
||||
export class DracoUInt8Array {
|
||||
public size(): number;
|
||||
public GetValue(index: number): number;
|
||||
}
|
||||
|
||||
export class DracoUInt16Array {
|
||||
public size(): number;
|
||||
public GetValue(index: number): number;
|
||||
}
|
||||
|
||||
export class DracoUInt32Array {
|
||||
public size(): number;
|
||||
public GetValue(index: number): number;
|
||||
}
|
||||
|
||||
export class DracoFloat32Array {
|
||||
public size(): number;
|
||||
public GetValue(index: number): number;
|
||||
}
|
||||
}
|
||||
}
|
16
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/engine/@types/message.d.ts
vendored
Normal file
16
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/engine/@types/message.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface message extends EditorMessageMap {
|
||||
'query-info': {
|
||||
params: [] | [
|
||||
string,
|
||||
],
|
||||
result: {
|
||||
type: string;
|
||||
version: string;
|
||||
path: string;
|
||||
nativeVersion: string; // 原生引擎类型 'custom' 'builtin'
|
||||
nativePath: string;
|
||||
editor: string;
|
||||
renderPipeline: string;
|
||||
},
|
||||
},
|
||||
}
|
49
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/huawei-agc/@types/index.d.ts
vendored
Normal file
49
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/huawei-agc/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions, InternalBuildResult } from '@editor/library-type/packages/builder/@types/protect';
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'android': IOptions;
|
||||
}
|
||||
}
|
||||
|
||||
export type IAppABI = 'armeabi-v7a' | 'arm64-v8a' | 'x86' | 'x86_64';
|
||||
|
||||
export interface IOptions {
|
||||
packageName: string;
|
||||
orientation: {
|
||||
landscapeRight: boolean;
|
||||
landscapeLeft: boolean;
|
||||
portrait: boolean;
|
||||
upsideDown: boolean;
|
||||
},
|
||||
|
||||
apiLevel: string;
|
||||
appABIs: IAppABI[];
|
||||
|
||||
useDebugKeystore: boolean;
|
||||
keystorePath: string;
|
||||
keystorePassword: string;
|
||||
keystoreAlias: string;
|
||||
keystoreAliasPassword: string;
|
||||
|
||||
appBundle: boolean;
|
||||
androidInstant: boolean;
|
||||
remoteUrl: string;
|
||||
sdkPath: string;
|
||||
ndkPath: string;
|
||||
|
||||
renderBackEnd: {
|
||||
vulkan: boolean;
|
||||
gles3: boolean;
|
||||
gles2: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IBuildResult extends InternalBuildResult {
|
||||
userFrameWorks: boolean; // 是否使用用户的配置数据
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
/// <reference path="../../../@types/index.d.ts"/>
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
||||
import { IInternalBuildOptions } from "@editor/library-type/packages/builder/@types/protect/index";
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages:{
|
||||
'huawei-quick-game': IOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
package: string;
|
||||
icon: string;
|
||||
versionName: string;
|
||||
versionCode: string;
|
||||
minPlatformVersion: string;
|
||||
deviceOrientation: IOrientation;
|
||||
tinyPackageServer: string;
|
||||
useDebugKey: boolean;
|
||||
privatePemPath: string;
|
||||
certificatePemPath: string;
|
||||
|
||||
fullScreen: boolean;
|
||||
logLevel: string;
|
||||
manifestPath?: string;
|
||||
}
|
||||
|
||||
export interface ICompileOptions {
|
||||
name: string;
|
||||
tinyPackageServer: string;
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions, IPolyFills } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'ios-app-clip': IOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
orientation: {
|
||||
landscapeRight: boolean;
|
||||
landscapeLeft: boolean;
|
||||
portrait: boolean;
|
||||
upsideDown: boolean;
|
||||
};
|
||||
polyfills?: IPolyFills;
|
||||
mainPackagePath: string;
|
||||
embedXcodeprojTarget?: string;
|
||||
remoteServerAddress: string;
|
||||
}
|
39
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/ios/@types/index.d.ts
vendored
Normal file
39
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/ios/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions, InternalBuildResult } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'ios': IOptions;
|
||||
native: {
|
||||
JobSystem: 'none' | 'tbb' | 'taskFlow';
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export interface IBuildResult extends InternalBuildResult {
|
||||
userFrameWorks: boolean; // 是否使用用户的配置数据
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
packageName: string;
|
||||
orientation: {
|
||||
landscapeRight: boolean;
|
||||
landscapeLeft: boolean;
|
||||
portrait: boolean;
|
||||
upsideDown: boolean;
|
||||
},
|
||||
skipUpdateXcodeProject: boolean;
|
||||
renderBackEnd: {
|
||||
metal: boolean;
|
||||
gles3: boolean;
|
||||
gles2: boolean;
|
||||
},
|
||||
osTarget: {
|
||||
iphoneos: boolean,
|
||||
simulator: boolean,
|
||||
},
|
||||
developerTeam?: string,
|
||||
}
|
30
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/link-sure/@types/index.d.ts
vendored
Normal file
30
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/link-sure/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference path="../../../@types/index.d.ts"/>
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
||||
import { IInternalBuildOptions } from "@editor/library-type/packages/builder/@types/protect";
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface PlatformSettings {
|
||||
runtimeVersion: string,
|
||||
deviceOrientation: IOrientation,
|
||||
statusbarDisplay: boolean,
|
||||
startSceneAssetBundle: false,
|
||||
resourceURL: string,
|
||||
workerPath: string,
|
||||
XHRTimeout: number,
|
||||
WSTimeout: number,
|
||||
uploadFileTimeout: number,
|
||||
downloadFileTimeout: number,
|
||||
cameraPermissionHint: string,
|
||||
userInfoPermissionHint: string,
|
||||
locationPermissionHint: string,
|
||||
albumPermissionHint: string
|
||||
}
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
"link-sure": PlatformSettings
|
||||
}
|
||||
}
|
3
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/linux/@types/index.d.ts
vendored
Normal file
3
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/linux/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/// <reference path="../../../@types/index.d.ts"/>
|
||||
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
26
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/mac/@types/index.d.ts
vendored
Normal file
26
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/mac/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions, InternalBuildResult } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'mac': IOptions;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
packageName: string;
|
||||
renderBackEnd: {
|
||||
metal: boolean;
|
||||
gles3: boolean;
|
||||
gles2: boolean;
|
||||
},
|
||||
supportM1: boolean;
|
||||
skipUpdateXcodeProject: boolean;
|
||||
}
|
||||
|
||||
export interface IBuildCache extends InternalBuildResult {
|
||||
userFrameWorks: boolean; // 是否使用用户的配置数据
|
||||
}
|
36
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/ohos/@types/index.d.ts
vendored
Normal file
36
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/ohos/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
import { IInternalBuildOptions, InternalBuildResult } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'ohos': IOptions;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
packageName: string;
|
||||
orientation: {
|
||||
landscapeRight: boolean;
|
||||
landscapeLeft: boolean;
|
||||
portrait: boolean;
|
||||
upsideDown: boolean;
|
||||
},
|
||||
|
||||
apiLevel: string;
|
||||
sdkPath: string;
|
||||
ndkPath: string;
|
||||
|
||||
renderBackEnd: {
|
||||
// vulkan: boolean;
|
||||
gles3: boolean;
|
||||
// gles2: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IBuildResult extends InternalBuildResult {
|
||||
userFrameWorks: boolean; // 是否使用用户的配置数据
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
/// <reference path="../../../@types/index.d.ts"/>
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
||||
import { IInternalBuildOptions, InternalBuildResult } from "@editor/library-type/packages/builder/@types/protect";
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'open-harmonyos': IOptions;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
packageName: string;
|
||||
orientation: {
|
||||
landscapeRight: boolean;
|
||||
landscapeLeft: boolean;
|
||||
portrait: boolean;
|
||||
upsideDown: boolean;
|
||||
},
|
||||
|
||||
apiLevel: string;
|
||||
sdkPath: string;
|
||||
ndkPath: string;
|
||||
|
||||
renderBackEnd: {
|
||||
// vulkan: boolean;
|
||||
gles3: boolean;
|
||||
// gles2: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IBuildResult extends InternalBuildResult {
|
||||
userFrameWorks: boolean; // 是否使用用户的配置数据
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
/// <reference path="../../../@types/editor/index.d.ts"/>
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
||||
import { IInternalBuildOptions } from "@editor/library-type/packages/builder/@types/protect";
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'oppo-mini-game': IOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
package: string;
|
||||
icon: string;
|
||||
versionName: string;
|
||||
versionCode: string;
|
||||
minPlatformVersion: string;
|
||||
deviceOrientation: IOrientation;
|
||||
tinyPackageServer: string;
|
||||
useDebugKey: boolean;
|
||||
privatePemPath: string;
|
||||
certificatePemPath: string;
|
||||
hasSubPackage?: boolean;
|
||||
separateEngine: boolean;
|
||||
}
|
||||
|
||||
export interface ICompileOptions {
|
||||
name: string;
|
||||
tinyPackageServer: string;
|
||||
useDebugKey: boolean;
|
||||
hasSubPackage: boolean;
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
export interface MenuAssetInfo {
|
||||
// 资源名字
|
||||
name: string;
|
||||
// 资源用于显示的名字
|
||||
displayName: string;
|
||||
// loader 加载的层级地址
|
||||
url: string;
|
||||
// 绝对路径
|
||||
file: string;
|
||||
// 资源的唯一 ID
|
||||
uuid: string;
|
||||
// 使用的导入器名字
|
||||
importer: string;
|
||||
// 类型
|
||||
type: string;
|
||||
// 是否是文件夹
|
||||
isDirectory: boolean;
|
||||
// 是否只读
|
||||
readonly: boolean;
|
||||
// 虚拟资源可以实例化成实体的话,会带上这个扩展名
|
||||
instantiation?: string;
|
||||
// 跳转指向资源
|
||||
redirect?: IRedirectInfo;
|
||||
// 继承类型
|
||||
extends?: string[];
|
||||
// 是否导入完成
|
||||
imported: boolean;
|
||||
// 是否导入失败
|
||||
invalid: boolean;
|
||||
}
|
||||
|
||||
export interface IRedirectInfo {
|
||||
// 跳转资源的类型
|
||||
type: string;
|
||||
// 跳转资源的 uuid
|
||||
uuid: string;
|
||||
}
|
||||
export interface IAssetInfo {
|
||||
name: string; // 资源名字
|
||||
displayName: string; // 资源用于显示的名字
|
||||
source: string; // url 地址
|
||||
path: string; // loader 加载的层级地址
|
||||
url: string; // loader 加载地址会去掉扩展名,这个参数不去掉
|
||||
file: string; // 绝对路径
|
||||
uuid: string; // 资源的唯一 ID
|
||||
importer: string; // 使用的导入器名字
|
||||
imported: boolean; // 是否结束导入过程
|
||||
invalid: boolean; // 是否导入成功
|
||||
type: string; // 类型
|
||||
isDirectory: boolean; // 是否是文件夹
|
||||
library: { [key: string]: string }; // 导入资源的 map
|
||||
subAssets: { [key: string]: IAssetInfo }; // 子资源 map
|
||||
visible: boolean; // 是否显示
|
||||
readonly: boolean; // 是否只读
|
||||
|
||||
instantiation?: string; // 虚拟资源可以实例化成实体的话,会带上这个扩展名
|
||||
redirect?: IRedirectInfo; // 跳转指向资源
|
||||
meta?: any,
|
||||
fatherInfo?: any;
|
||||
}
|
@@ -0,0 +1 @@
|
||||
export * from './protect/';
|
@@ -0,0 +1,19 @@
|
||||
export interface message extends EditorMessageMap {
|
||||
'query-shared-settings': {
|
||||
params: [],
|
||||
result: {
|
||||
useDefineForClassFields: boolean;
|
||||
allowDeclareFields: boolean;
|
||||
loose: boolean;
|
||||
guessCommonJsExports: boolean;
|
||||
exportsConditions: string[];
|
||||
importMap?: {
|
||||
json: {
|
||||
imports?: Record<string, string>;
|
||||
scopes?: Record<string, Record<string, string>>;
|
||||
};
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
41
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/qtt/@types/index.d.ts
vendored
Normal file
41
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/qtt/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/// <reference path="../../../@types/editor/index.d.ts"/>
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
||||
import { IInternalBuildOptions } from "@editor/library-type/packages/builder/@types/protect";
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface PlatformSettings {
|
||||
runtimeVersion: string,
|
||||
deviceOrientation: IOrientation,
|
||||
statusbarDisplay: boolean,
|
||||
startSceneAssetBundle: false,
|
||||
resourceURL: string,
|
||||
workerPath: string,
|
||||
XHRTimeout: number,
|
||||
WSTimeout: number,
|
||||
uploadFileTimeout: number,
|
||||
downloadFileTimeout: number,
|
||||
cameraPermissionHint: string,
|
||||
userInfoPermissionHint: string,
|
||||
locationPermissionHint: string,
|
||||
albumPermissionHint: string,
|
||||
|
||||
package: string;
|
||||
icon: string;
|
||||
versionName: string;
|
||||
versionCode: string;
|
||||
|
||||
//校验数据
|
||||
packageValidity: string,
|
||||
iconValidity: string;
|
||||
versionNameValidity: string;
|
||||
versionCodeValidity: string;
|
||||
}
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
"qtt": PlatformSettings
|
||||
}
|
||||
}
|
@@ -0,0 +1,73 @@
|
||||
import type { WebviewTag } from "electron";
|
||||
import ISceneFacade from './scene-facade-interface';
|
||||
/**
|
||||
* 这个是 engine-view 标签的接口
|
||||
*/
|
||||
export interface EngineView {
|
||||
dirty: boolean;
|
||||
managerReady: boolean;
|
||||
|
||||
$scene: WebviewTag;
|
||||
depend: any;
|
||||
$floatWindow: any;
|
||||
|
||||
// 封装的 webview 通讯模块
|
||||
ipc: any;
|
||||
|
||||
info: any;
|
||||
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
init(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 调用场景进程里的方法
|
||||
* @param methodName
|
||||
* @param params
|
||||
* @param forced
|
||||
* @param timeout
|
||||
*/
|
||||
|
||||
callSceneMethod<T extends keyof ISceneFacade>(methodName: T, params: Parameters<ISceneFacade[T]>, forced?: boolean, timeout?: boolean): Promise<ReturnType<typeof ISceneFacade[T]>>
|
||||
|
||||
/**
|
||||
* 执行组件方法
|
||||
* @param options
|
||||
*/
|
||||
executeComponentMethod(options: { uuid: string, index: number, methodNames: string[] });
|
||||
|
||||
//////////////
|
||||
|
||||
attachFloatWindow(name: string, options: FloatWindowOptions)
|
||||
|
||||
detachFloatWindow(name: string)
|
||||
|
||||
attachToolbar(name: string, options: any)
|
||||
|
||||
detachToolbar(name: string)
|
||||
|
||||
attachInfobar(name: string, options: any)
|
||||
|
||||
detachInfobar(name: string)
|
||||
}
|
||||
export interface FloatWindowOptions {
|
||||
type: string;
|
||||
width: number;
|
||||
height: number;
|
||||
top?: number;
|
||||
bottom?: number;
|
||||
left?: number;
|
||||
right?: number;
|
||||
|
||||
dock?: boolean;
|
||||
|
||||
mode?: 'dock' | 'simple';
|
||||
|
||||
template: string;
|
||||
ready?: ($window: HTMLDivElement, info: ScenePluginInfo, componentMap: { [type: string]: ScenePluginComponentInfo[] }) => void;
|
||||
close?: Function;
|
||||
update?: Function;
|
||||
send?: Function;
|
||||
}
|
68
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/scene/@types/message.d.ts
vendored
Normal file
68
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/scene/@types/message.d.ts
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import {
|
||||
SetPropertyOptions,
|
||||
} from './public';
|
||||
|
||||
export interface message extends EditorMessageMap {
|
||||
'update-create-node-template': {
|
||||
params: [],
|
||||
result: any,
|
||||
},
|
||||
'open': {
|
||||
params: [],
|
||||
result: any,
|
||||
},
|
||||
'open-devtools': {
|
||||
params: [],
|
||||
result: any,
|
||||
},
|
||||
'graphical-tools': {
|
||||
params: [
|
||||
boolean,
|
||||
],
|
||||
result: void,
|
||||
},
|
||||
'open-scene': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'save-scene': {
|
||||
params: [] | [
|
||||
boolean,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'save-as-scene': {
|
||||
params: [
|
||||
boolean,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'close-scene': {
|
||||
params: [],
|
||||
result: boolean,
|
||||
},
|
||||
'set-property': {
|
||||
params: [
|
||||
SetPropertyOptions,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'query-node-tree': {
|
||||
params: [] | [
|
||||
string,
|
||||
],
|
||||
result: any,
|
||||
},
|
||||
'execute-scene-script': {
|
||||
params: [] | [
|
||||
{
|
||||
name: string;
|
||||
method: string;
|
||||
args: any[];
|
||||
}
|
||||
],
|
||||
result: any,
|
||||
},
|
||||
}
|
408
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/scene/@types/public.d.ts
vendored
Normal file
408
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/scene/@types/public.d.ts
vendored
Normal file
@@ -0,0 +1,408 @@
|
||||
// ---- 一些 engine 基础数据 ---- start
|
||||
interface Vec2 {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface Vec3 {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
|
||||
interface Vec4 {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
}
|
||||
|
||||
interface Quat {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
}
|
||||
|
||||
interface Color3 {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
}
|
||||
|
||||
interface Color4 {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
a: number;
|
||||
}
|
||||
|
||||
interface Mat3 {
|
||||
m00: number;
|
||||
m01: number;
|
||||
m02: number;
|
||||
|
||||
m03: number;
|
||||
m04: number;
|
||||
m05: number;
|
||||
|
||||
m06: number;
|
||||
m07: number;
|
||||
m08: number;
|
||||
}
|
||||
|
||||
interface Mat4 {
|
||||
m00: number;
|
||||
m01: number;
|
||||
m02: number;
|
||||
m03: number;
|
||||
|
||||
m04: number;
|
||||
m05: number;
|
||||
m06: number;
|
||||
m07: number;
|
||||
|
||||
m08: number;
|
||||
m09: number;
|
||||
m10: number;
|
||||
m11: number;
|
||||
|
||||
m12: number;
|
||||
m13: number;
|
||||
m14: number;
|
||||
m15: number;
|
||||
}
|
||||
// ---- 一些 engine 基础数据 ---- end
|
||||
|
||||
// ---- 操作消息的参数定义 --- strart
|
||||
|
||||
// set-property 消息的 options 定义
|
||||
export interface SetPropertyOptions {
|
||||
uuid: string; // 修改属性的对象的 uuid
|
||||
path: string; // 属性挂载对象的搜索路径
|
||||
// key: string; // 属性的 key
|
||||
dump: IProperty; // 属性 dump 出来的数据
|
||||
}
|
||||
|
||||
// move-array-element 消息的 options 定义
|
||||
export interface MoveArrayOptions {
|
||||
uuid: string;
|
||||
path: string;
|
||||
target: number;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
// remove-array-element 消息的 options 定义
|
||||
export interface RemoveArrayOptions {
|
||||
uuid: string;
|
||||
path: string;
|
||||
index: number;
|
||||
}
|
||||
|
||||
export interface PasteNodeOptions {
|
||||
target: string; // 目标节点
|
||||
uuids: string | string[]; // 被复制的节点 uuids
|
||||
keepWorldTransform?: boolean; // 是否保持新节点的世界坐标不变
|
||||
}
|
||||
|
||||
export interface CutNodeOptions {
|
||||
parent: string; // 父节点
|
||||
uuids: string | string[]; // 被移入的节点 uuids
|
||||
keepWorldTransform?: boolean; // 是否保持新节点的世界坐标不变
|
||||
}
|
||||
|
||||
// create-node 消息的 options 定义
|
||||
export interface CreateNodeOptions {
|
||||
parent?: string;
|
||||
components?: string[];
|
||||
|
||||
name?: string;
|
||||
dump?: INode | IScene; // node 初始化应用的数据
|
||||
keepWorldTransform?: boolean; // 是否保持新节点的世界坐标不变
|
||||
type?: string; // 资源类型
|
||||
assetUuid?: string; // asset uuid , type value 格式保持兼容拖动的数据格式,有资源 id,则从资源内创建对应的节点
|
||||
canvasRequired?: boolean; // 是否需要有 Canvas
|
||||
unlinkPrefab?: boolean; // 创建后取消 prefab 状态
|
||||
position?: Vec3; // 指定生成的位置
|
||||
}
|
||||
|
||||
export interface ResetNodeOptions {
|
||||
uuid: string | string[];
|
||||
}
|
||||
|
||||
export interface RemoveNodeOptions {
|
||||
uuid: string | string[];
|
||||
keepWorldTransform?: boolean;
|
||||
}
|
||||
|
||||
export interface CreateComponentOptions {
|
||||
uuid: string;
|
||||
component: string;
|
||||
}
|
||||
|
||||
export interface ResetComponentOptions {
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface RemoveComponentOptions {
|
||||
uuid: string;
|
||||
component: string;
|
||||
}
|
||||
|
||||
export interface ExecuteComponentMethodOptions {
|
||||
uuid: string;
|
||||
name: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export interface IAnimOperation {
|
||||
funcName: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export interface ExecuteSceneScriptMethodOptions {
|
||||
name: string;
|
||||
method: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export type IPropertyValueType = IProperty | IProperty[] | null | undefined | number | boolean | string | Vec3 | Vec2;
|
||||
|
||||
export interface IPropertyGroupOptions {
|
||||
id: string // 默认 'default'
|
||||
name: string,
|
||||
displayOrder: number, // 默认 Infinity, 排在最后面
|
||||
style: string // 默认为 'tab'
|
||||
}
|
||||
|
||||
export interface IProperty {
|
||||
value: { [key: string]: IPropertyValueType } | IPropertyValueType;
|
||||
default?: any; // 默认值
|
||||
|
||||
// 多选节点之后,这里存储多个数据,用于自行判断多选后的显示效果,无需更新该数据
|
||||
values?: ({ [key: string]: IPropertyValueType } | IPropertyValueType)[];
|
||||
|
||||
cid?: string;
|
||||
type?: string;
|
||||
readonly?: boolean;
|
||||
visible?: boolean;
|
||||
name?: string;
|
||||
|
||||
elementTypeData?: IProperty; // 数组里的数据的默认值 dump
|
||||
|
||||
path?: string; // 数据的搜索路径,这个是由使用方填充的
|
||||
|
||||
isArray?: boolean;
|
||||
invalid?: boolean;
|
||||
extends?: string[]; // 继承链
|
||||
displayName?: string; // 显示到界面上的名字
|
||||
displayOrder?: number; // 显示排序
|
||||
group?: IPropertyGroupOptions; // tab
|
||||
tooltip?: string; // 提示文本
|
||||
editor?: any; // 组件上定义的编辑器数据
|
||||
animatable?: boolean; // 是否可以在动画中编辑
|
||||
|
||||
// Enum
|
||||
enumList?: any[]; // enum 类型的 list 选项数组
|
||||
|
||||
bitmaskList?: any[];
|
||||
|
||||
// Number
|
||||
min?: number; // 数值类型的最小值
|
||||
max?: number; // 数值类型的最大值
|
||||
step?: number; // 数值类型的步进值
|
||||
slide?: boolean; // 数组是否显示为滑块
|
||||
unit?: string; // 显示的单位
|
||||
radian?: boolean; // 标识是否为角度
|
||||
|
||||
// Label
|
||||
multiline?: boolean; // 字符串是否允许换行
|
||||
// nullable?: boolean; 属性是否允许为空
|
||||
}
|
||||
|
||||
export interface IRemovedComponentInfo {
|
||||
name: string;
|
||||
fileID: string;
|
||||
}
|
||||
|
||||
export interface INode {
|
||||
active: IProperty;
|
||||
locked: IProperty;
|
||||
name: IProperty;
|
||||
position: IProperty;
|
||||
|
||||
/**
|
||||
* 此为 dump 数据,非 node.rotation
|
||||
* 实际指向 node.eulerAngles
|
||||
* rotation 为了给用户更友好的文案
|
||||
*/
|
||||
rotation: IProperty;
|
||||
|
||||
scale: IProperty;
|
||||
layer: IProperty;
|
||||
uuid: IProperty;
|
||||
|
||||
children: any[];
|
||||
parent: any;
|
||||
|
||||
__comps__: IProperty[];
|
||||
__type__: string;
|
||||
__prefab__?: any;
|
||||
_prefabInstance?: any;
|
||||
removedComponents?: IRemovedComponentInfo[];
|
||||
mountedRoot?: string;
|
||||
}
|
||||
|
||||
export interface IComponent extends IProperty {
|
||||
value: {
|
||||
enabled: IPropertyValueType;
|
||||
uuid: IPropertyValueType;
|
||||
name: IPropertyValueType;
|
||||
} & Record<string, IPropertyValueType>;
|
||||
mountedRoot?: string;
|
||||
}
|
||||
|
||||
export interface IScene {
|
||||
name: IProperty;
|
||||
active: IProperty;
|
||||
locked: IProperty;
|
||||
_globals: any;
|
||||
isScene: boolean;
|
||||
autoReleaseAssets: IProperty;
|
||||
|
||||
uuid: IProperty;
|
||||
children: any[];
|
||||
parent: any;
|
||||
__type__: string;
|
||||
targetOverrides?: any;
|
||||
}
|
||||
|
||||
export interface ITargetOverrideInfo {
|
||||
source: string;
|
||||
sourceInfo?: string[];
|
||||
propertyPath: string[];
|
||||
target: string;
|
||||
targetInfo?: string[];
|
||||
}
|
||||
// ---- 操作消息的参数定义 --- end
|
||||
|
||||
// ---- 场景插件返回的 info 信息 ---- start
|
||||
interface ScenePluginNodeInfo {
|
||||
uuid: string;
|
||||
components: ScenePluginComponentInfo[];
|
||||
}
|
||||
|
||||
// 场景插件传回的场景信息
|
||||
export interface ScenePluginInfo {
|
||||
// 选中节点列表
|
||||
nodes: ScenePluginNodeInfo[];
|
||||
|
||||
// gizmo 的一些信息
|
||||
gizmo: {
|
||||
is2D: boolean;
|
||||
};
|
||||
// 当前编辑模式数组
|
||||
modes: string[];
|
||||
}
|
||||
|
||||
// 场景插件传回的组件信息
|
||||
export interface ScenePluginComponentInfo {
|
||||
uuid: string;
|
||||
enabled: boolean;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface QueryClassesOptions {
|
||||
extends?: string | string[];
|
||||
excludeSelf?: boolean;
|
||||
}
|
||||
|
||||
// ---- 场景插件返回的 info 信息 ---- end
|
||||
|
||||
// ---- 动画数据 ---- start
|
||||
|
||||
export interface IKeyDumpData {
|
||||
frame: number;
|
||||
dump: any; // value的dump数据
|
||||
inTangent?: number;
|
||||
inTangentWeight?: number;
|
||||
outTangent?: number;
|
||||
outTangentWeight?: number;
|
||||
interpMode?: number;
|
||||
broken?: boolean;
|
||||
tangentWeightMode?: number;
|
||||
imgUrl?: string;
|
||||
easingMethod?: number;
|
||||
}
|
||||
|
||||
export interface IDumpType {
|
||||
value: string;
|
||||
extends?: string[];
|
||||
}
|
||||
|
||||
export interface IPropCurveDumpData {
|
||||
nodePath: string;
|
||||
// 原始的 keyframe 数据
|
||||
keyframes: IKeyDumpData[];
|
||||
displayName: string;
|
||||
key: string;
|
||||
type?: IDumpType;
|
||||
preExtrap: number;
|
||||
postExtrap: number;
|
||||
isCurveSupport: boolean; // 是否支持贝塞尔曲线编辑
|
||||
}
|
||||
|
||||
export interface IAnimCopyKeySrcInfo {
|
||||
curvesDump: IPropCurveDumpData[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyNodeSrcInfo {
|
||||
curvesDump: IPropCurveDumpData[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyNodeDstInfo {
|
||||
nodePath: string;
|
||||
}
|
||||
|
||||
interface IEventDump {
|
||||
frame: number;
|
||||
func: string;
|
||||
params: string[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyEventSrcInfo {
|
||||
eventsDump: IEventDump[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyPropSrcInfo {
|
||||
curvesDump: IPropCurveDumpData[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyPropDstInfo {
|
||||
nodePath: string;
|
||||
propKeys?: string[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyKeyDstInfo {
|
||||
nodePath: string;
|
||||
propKeys?: string[];
|
||||
startFrame: number;
|
||||
}
|
||||
|
||||
export interface IAnimCopyEventDstInfo {
|
||||
startFrame: number;
|
||||
}
|
||||
// ---- 动画数据 ---- end
|
||||
|
||||
// ---- Contributions ---- start
|
||||
|
||||
export interface ContributionDropItem {
|
||||
type: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
// ---- Contributions ---- end
|
||||
|
||||
export interface UnitTestInfo {
|
||||
name: string;
|
||||
}
|
@@ -0,0 +1,827 @@
|
||||
import {
|
||||
SetPropertyOptions,
|
||||
MoveArrayOptions,
|
||||
RemoveArrayOptions,
|
||||
CutNodeOptions,
|
||||
PasteNodeOptions,
|
||||
CreateNodeOptions,
|
||||
RemoveNodeOptions,
|
||||
CreateComponentOptions,
|
||||
RemoveComponentOptions,
|
||||
ExecuteComponentMethodOptions,
|
||||
IAnimOperation,
|
||||
ExecuteSceneScriptMethodOptions,
|
||||
QueryClassesOptions,
|
||||
} from './public';
|
||||
|
||||
import { Node, Vec3, Quat } from 'cc';
|
||||
import type ParticleManager from '../source/script/3d/manager/particle';
|
||||
import { ISceneEvents } from '../source/script/3d/manager/scene-events-interface';
|
||||
|
||||
interface ISceneFacade extends ISceneEvents {
|
||||
init(): void;
|
||||
|
||||
//////////
|
||||
// node //
|
||||
//////////
|
||||
|
||||
/**
|
||||
* 打开某个场景
|
||||
* @param uuid 场景uuid
|
||||
*/
|
||||
openScene(uuid: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 保存当前场景
|
||||
*/
|
||||
saveScene(asNew: boolean): Promise<boolean>;
|
||||
|
||||
closeScene(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 软刷新场景
|
||||
*/
|
||||
softReloadScene(json: any): Promise<boolean>;
|
||||
|
||||
reloadScene(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 查询当前场景的节点树信息
|
||||
* @param uuid 节点的唯一标识符
|
||||
*/
|
||||
queryNodeTree(uuid: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询使用了资源 UUID 的节点
|
||||
* @param uuid 资源 asset uuid
|
||||
*/
|
||||
queryNodesByAssetUuid(uuid: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询当前场景的序列化数据
|
||||
*/
|
||||
querySceneSerializedData(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询当前场景是否被修改
|
||||
*/
|
||||
querySceneDirty(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询引擎内所有的类
|
||||
*/
|
||||
queryClasses(options?: QueryClassesOptions): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询引擎内所有的组件列表
|
||||
*/
|
||||
queryComponents(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询引擎组件列表是否含有指定类名的脚本
|
||||
* @param name 查询脚本的名字
|
||||
*/
|
||||
queryComponentHasScript(name: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 查询引擎内 Layer 的内置项
|
||||
*/
|
||||
queryLayerBuiltin(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询当前场景的编辑模式
|
||||
*/
|
||||
queryMode(): string;
|
||||
|
||||
/**
|
||||
* 查询当前场景资源的 uuid
|
||||
*/
|
||||
queryCurrentSceneUuid(): string;
|
||||
|
||||
//////////
|
||||
// node //
|
||||
//////////
|
||||
|
||||
/**
|
||||
* 查询一个节点的 dump 数据
|
||||
* @param uuid 节点的唯一标识符
|
||||
*/
|
||||
queryNodeDump(uuid: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询一个节点内挂载的所有组件以及对应的函数
|
||||
* @param uuid 节点的唯一标识符
|
||||
*/
|
||||
queryComponentFunctionOfNode(uuid: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 设置某个元素内的属性
|
||||
* @param options
|
||||
*/
|
||||
setNodeProperty(options: SetPropertyOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 设置某个元素内的某个属性的默认值
|
||||
* @param options
|
||||
*/
|
||||
resetNodeProperty(options: SetPropertyOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 将一个属性从 null 值变为可编辑的值
|
||||
* @param options
|
||||
*/
|
||||
updateNodePropertyFromNull(options: SetPropertyOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 设置某个节点连同它的子集的 layer 属性值
|
||||
* @param options
|
||||
*/
|
||||
setNodeAndChildrenLayer(options: SetPropertyOptions): void;
|
||||
|
||||
/**
|
||||
* 移动数组类型 property 内的某个 item 的位置
|
||||
* @param options
|
||||
*/
|
||||
moveNodeArrayElement(options: MoveArrayOptions): void;
|
||||
|
||||
/**
|
||||
* 删除数组类型 property 内的某个 item 的位置
|
||||
* @param options
|
||||
*/
|
||||
removeNodeArrayElement(options: RemoveArrayOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 实时获取新节点在一个父节点下的有效名称
|
||||
* 规则是 Node 同名时为 Node-001
|
||||
* @param name 名称
|
||||
* @param parentUuid 父节点 uuid
|
||||
*/
|
||||
generateNodeAvailableName(name: string, parentUuid: string): Promise<string>;
|
||||
|
||||
/**
|
||||
* 暂存一个节点的实例化对象
|
||||
* 一般用在复制节点的动作,给下一步粘贴(创建)节点准备数据
|
||||
* @param uuids 节点uuid
|
||||
*/
|
||||
copyNode(uuids: string | string[]): string[];
|
||||
|
||||
/**
|
||||
* 复制节点自身
|
||||
* ctrl + d
|
||||
* @param uuids 节点uuid
|
||||
*/
|
||||
duplicateNode(uuids: string | string[]): string[];
|
||||
|
||||
/**
|
||||
* 粘贴节点
|
||||
* @param options 参数
|
||||
*/
|
||||
pasteNode(options: PasteNodeOptions): Promise<string[]>;
|
||||
|
||||
/**
|
||||
* 挂载节点
|
||||
* @param options 参数
|
||||
*/
|
||||
setNodeParent(options: CutNodeOptions): Promise<string[]>;
|
||||
|
||||
/**
|
||||
* 创建一个新的节点
|
||||
* @param options 参数
|
||||
*/
|
||||
createNode(options: CreateNodeOptions): Promise<any>;
|
||||
|
||||
/**
|
||||
* 重置节点属性 position rotation scale
|
||||
* @param options 参数
|
||||
*/
|
||||
resetNode(uuid: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 删除一个节点
|
||||
* @param options 参数
|
||||
*/
|
||||
removeNode(options: RemoveNodeOptions): void;
|
||||
|
||||
/**
|
||||
* 锁定一个节点不让其在场景中被选中
|
||||
* @param uuids 节点uuid
|
||||
* @param locked true | false
|
||||
* @param loop true | false 是否循环子孙级节点设置
|
||||
*/
|
||||
changeNodeLock(uuids: string | string[], locked: Boolean, loop: Boolean): void;
|
||||
|
||||
/**
|
||||
* 从资源数据还原一个 prefab 节点
|
||||
* @param uuid 节点uuid
|
||||
* @param assetUuid 资源uuid
|
||||
*/
|
||||
restorePrefab(uuid: string, assetUuid: string): Promise<boolean>;
|
||||
|
||||
///////////////
|
||||
// component //
|
||||
///////////////
|
||||
|
||||
/**
|
||||
* 查询一个组件的 dump 数据
|
||||
* @param uuid 节点的唯一标识符
|
||||
*/
|
||||
queryComponent(uuid: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 在某个节点上创建一个组件
|
||||
* @param options 参数
|
||||
*/
|
||||
createComponent(options: CreateComponentOptions): void;
|
||||
|
||||
/**
|
||||
* 重置组件
|
||||
* @param uuid 组件
|
||||
*/
|
||||
resetComponent(uuid: string): void;
|
||||
|
||||
/**
|
||||
* 删除某个节点上的某个组件
|
||||
* @param options 参数
|
||||
*/
|
||||
removeComponent(options: RemoveComponentOptions): void;
|
||||
|
||||
/**
|
||||
* 执行 entity 上指定组件的方法
|
||||
* @param options 参数
|
||||
*/
|
||||
executeComponentMethod(options: ExecuteComponentMethodOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 执行插件注册的场景脚本方法
|
||||
* @param name 插件名字
|
||||
* @param method 方法名字
|
||||
* @param args 传入的参数
|
||||
*/
|
||||
executeSceneScriptMethod(options: ExecuteSceneScriptMethodOptions): Promise<any>;
|
||||
|
||||
///////////////
|
||||
// undo/redo //
|
||||
///////////////
|
||||
|
||||
/**
|
||||
* 保存一次操作记录
|
||||
*/
|
||||
snapshot(command?: any): void;
|
||||
|
||||
/**
|
||||
* 放弃当前步骤的所有变动记录
|
||||
*/
|
||||
abortSnapshot(): void;
|
||||
|
||||
/**
|
||||
* 撤销一次操作记录
|
||||
*/
|
||||
undo(): void;
|
||||
|
||||
/**
|
||||
* 重做一次操作记录
|
||||
*/
|
||||
redo(): void;
|
||||
|
||||
/**
|
||||
* 记录变动的节点
|
||||
* @param node
|
||||
* @param enable enable = false 是内部 undo redo 产生的变化, 不参与重新记录
|
||||
*/
|
||||
recordNode(node: Node, enable: boolean): void;
|
||||
|
||||
///////////
|
||||
// asset //
|
||||
///////////
|
||||
|
||||
/**
|
||||
* 查询所有内置 Effects
|
||||
*/
|
||||
queryAllEffects(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询一个 material 的 dump 数据
|
||||
* @param uuid material 的唯一标识符
|
||||
*/
|
||||
queryMaterial(uuid: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 根据 effecName 构建指定 Effect 的 props 和 defines 属性
|
||||
* @param effectName effect 的名字
|
||||
*/
|
||||
queryEffect(effectName: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询所有 RenderPipelines
|
||||
*/
|
||||
queryAllRenderPipelines(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 同步预览 RenderPipelines
|
||||
*/
|
||||
previewRenderPipeline(uuid: string, data: any): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询当个 RenderPipeline
|
||||
* @param uuid 查询的资源的唯一标识符
|
||||
*/
|
||||
queryRenderPipeline(uuid: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询所有 RenderFlows
|
||||
*/
|
||||
queryAllRenderFlows(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询所有 RenderStages
|
||||
*/
|
||||
queryAllRenderStages(): Promise<any>;
|
||||
|
||||
/**
|
||||
* 材质,实时预览 material 数据
|
||||
* @param uuid 材质uuid
|
||||
* @param material 材质数据
|
||||
*/
|
||||
previewMaterial(uuid: string, material: any): void;
|
||||
|
||||
/**
|
||||
* 应用材质
|
||||
* @param uuid 材质uuid
|
||||
* @param materialDump 材质dump数据
|
||||
*/
|
||||
applyMaterial(uuid: string, materialDump: any): void;
|
||||
|
||||
/**
|
||||
* 修改 physics-material
|
||||
* @param dump dump数据
|
||||
*/
|
||||
changePhysicsMaterial(dump: any): Promise<any>;
|
||||
|
||||
/**
|
||||
* 保存 physics-material
|
||||
* @param uuid uuid
|
||||
*/
|
||||
applyPhysicsMaterial(uuid: string): void;
|
||||
|
||||
/**
|
||||
* 修改 animation-mask
|
||||
* @param dump dump数据
|
||||
*/
|
||||
changeAnimationMask(dump: any): Promise<any>;
|
||||
|
||||
/**
|
||||
* 保存 animation-mask
|
||||
* @param uuid uuid
|
||||
*/
|
||||
applyAnimationMask(uuid: string): void;
|
||||
|
||||
/**
|
||||
* 修改 render-stage
|
||||
* @param dump dump数据
|
||||
*/
|
||||
changeRenderStage(dump: any): Promise<any>;
|
||||
|
||||
/**
|
||||
* 保存 render-stage
|
||||
* @param uuid uuid
|
||||
*/
|
||||
applyRenderStage(uuid: string): void;
|
||||
|
||||
/**
|
||||
* 修改 render-flow
|
||||
* @param dump dump数据
|
||||
*/
|
||||
changeRenderFlow(dump: any): Promise<any>;
|
||||
|
||||
/**
|
||||
* 保存 render-flow
|
||||
* @param uuid uuid
|
||||
*/
|
||||
applyRenderFlow(uuid: string): void;
|
||||
|
||||
/**
|
||||
* 保存 render-texture
|
||||
* @param uuid uuid
|
||||
* @param dump dump数据
|
||||
*/
|
||||
applyRenderTexture(uuid: string, dump: any): void;
|
||||
|
||||
/**
|
||||
* 选择一个 RenderPipeline
|
||||
* @param name 名字
|
||||
*/
|
||||
selectRenderPipeline(name: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* 修改了 RenderPipeline 数据
|
||||
* @param dump 数据
|
||||
*/
|
||||
changeRenderPipeline(dump: any): Promise<any>;
|
||||
|
||||
/**
|
||||
* 应用 RenderPipeline 数据
|
||||
* @param uuid pipeline uuid
|
||||
* @param renderPipelineDump RenderPipeline的dump数据
|
||||
*/
|
||||
applyRenderPipeline(uuid: string, renderPipelineDump: any): void;
|
||||
|
||||
/**
|
||||
* 选择一个 RenderFlow 类型
|
||||
* @param name 名字
|
||||
* @param index 索引
|
||||
*/
|
||||
selectRenderFlow(name: string, index: number): Promise<any>;
|
||||
|
||||
/**
|
||||
* 选择一个 RenderStage 类型
|
||||
* @param name 名字
|
||||
* @param flowIndex 索引
|
||||
* @param stageIndex 索引
|
||||
*/
|
||||
selectRenderStage(name: string, flowIndex: number, stageIndex: number): Promise<any>;
|
||||
|
||||
/**
|
||||
* 查询一个 physics-material 的 dump 数据
|
||||
* @param uuid 资源的唯一标识符
|
||||
*/
|
||||
queryPhysicsMaterial(uuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询一个 animation-mask 的 dump 数据
|
||||
* @param uuid 资源的唯一标识符
|
||||
*/
|
||||
queryAnimationMask(uuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询一个 render-stage 的 dump 数据
|
||||
* @param uuid 资源的唯一标识符
|
||||
*/
|
||||
queryRenderStage(uuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询一个 render-flow 的 dump 数据
|
||||
* @param uuid 资源的唯一标识符
|
||||
*/
|
||||
queryRenderFlow(uuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询可以被创建为节点的所有资源类型
|
||||
*/
|
||||
queryCreatableAssetTypes(): any;
|
||||
|
||||
assetChange(uuid: string, info?: any, meta?: any): Promise<void>;
|
||||
|
||||
assetDelete(uuid: string, info?: any): void;
|
||||
|
||||
/**
|
||||
* 一个资源更新到场景的引用中后发出此消息
|
||||
* @param uuid 资源uuid
|
||||
*/
|
||||
assetRefresh(uuid: string): void;
|
||||
|
||||
///////////
|
||||
// gizmo //
|
||||
///////////
|
||||
|
||||
/**
|
||||
* 查询当前 gizmo 工具的名字
|
||||
*/
|
||||
queryGizmoToolName(): Promise<string>;
|
||||
|
||||
/**
|
||||
* 查询 gizmo 中心点类型
|
||||
*/
|
||||
queryGizmoPivot(): Promise<string>;
|
||||
|
||||
/**
|
||||
* 查询 gizmo 坐标类型
|
||||
*/
|
||||
queryGizmoCoordinate(): Promise<string>;
|
||||
|
||||
/**
|
||||
* 查询 是否处于2D编辑模式
|
||||
*/
|
||||
queryIs2D(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 查询icon gizmo是否为3D
|
||||
*/
|
||||
queryIsIconGizmo3D(): boolean;
|
||||
|
||||
/**
|
||||
* 获取icon gizmo的大小
|
||||
*/
|
||||
queryIconGizmoSize(): number;
|
||||
|
||||
/**
|
||||
* 改变Gizmo的操作工具
|
||||
* @param name 变换工具名字
|
||||
*/
|
||||
setTransformToolName(name: string): void;
|
||||
|
||||
/**
|
||||
* 改变基准中心
|
||||
* @param name 中心位置名
|
||||
*/
|
||||
setPivot(name: string): void;
|
||||
|
||||
/**
|
||||
* 设置使用全局或局部坐标系
|
||||
* @param type 坐标系类型
|
||||
*/
|
||||
setCoordinate(type: string): void;
|
||||
|
||||
/**
|
||||
* 是否进入2D编辑模式
|
||||
* @param value 是否使用2D
|
||||
*/
|
||||
setIs2D(value: boolean): void;
|
||||
|
||||
/**
|
||||
* 设置icon gizmo是否为3D
|
||||
* @param is3D 是否为3D icon
|
||||
*/
|
||||
setIconGizmo3D(is3D: boolean): void;
|
||||
|
||||
/**
|
||||
* 设置icon gizmo的大小
|
||||
*
|
||||
* @param size icon大小
|
||||
*/
|
||||
setIconGizmoSize(size: number): void;
|
||||
|
||||
////////////
|
||||
// camera //
|
||||
////////////
|
||||
/**
|
||||
* 聚焦于某个节点
|
||||
* @param uuid 节点uuid
|
||||
*/
|
||||
focus(uuid: string[] | null, position?: Vec3, rotation?: Quat, viewCenter?: Vec3, immediate?: boolean): void;
|
||||
|
||||
/**
|
||||
* 将编辑相机数据拷贝到节点上
|
||||
* @param uuids 节点数组
|
||||
*/
|
||||
alignNodeToSceneView(uuids: string[]): void;
|
||||
|
||||
/**
|
||||
* 查询grid是否可见
|
||||
*/
|
||||
queryIsGridVisible(): boolean;
|
||||
/**
|
||||
* 设置grid是否可见
|
||||
* @param visible 是否可见
|
||||
*/
|
||||
setGridVisible(visible: boolean): void;
|
||||
|
||||
/**
|
||||
* 将选中的节点与场景相机对齐
|
||||
*/
|
||||
alignWithView(): void;
|
||||
|
||||
/**
|
||||
* 将场景相机与选中的节点对齐
|
||||
*/
|
||||
alignViewWithNode(): void;
|
||||
/**
|
||||
* 设置网格线的颜色
|
||||
* @param color 网格线的颜色[255,255,255,255]
|
||||
*/
|
||||
setGridLineColor(color: number[]): void;
|
||||
|
||||
getCameraProperty(): any;
|
||||
setCameraProperty(opts: any): void;
|
||||
getCameraWheelSpeed(): number;
|
||||
setCameraWheelSpeed(speed: number): void;
|
||||
getCameraWanderSpeed(): number;
|
||||
setCameraWanderSpeed(speed: number): void;
|
||||
zoomSceneViewUp(): void;
|
||||
zoomSceneViewDown(): void;
|
||||
resetSceneViewZoom(): void;
|
||||
|
||||
///////////////
|
||||
// animation //
|
||||
///////////////
|
||||
|
||||
/**
|
||||
* 查询当前动画的播放状态
|
||||
*/
|
||||
queryCurrentAnimationState(): any;
|
||||
|
||||
/**
|
||||
* 查询当前动画的播放状态
|
||||
*/
|
||||
queryCurrentAnimationInfo(): any;
|
||||
|
||||
/**
|
||||
* 传入一个节点,查询这个节点所在的动画节点的 uuid
|
||||
* @param uuid 查询的节点的 uuid
|
||||
*/
|
||||
queryAnimationRootNode(uuid: string): string;
|
||||
|
||||
/**
|
||||
* 查询动画根节点的动画数据信息
|
||||
* @param uuid 查询的节点的 uuid
|
||||
*/
|
||||
queryAnimationRootInfo(uuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询一个 clip 的 dump 数据
|
||||
* @param nodeUuid 节点的唯一标识符
|
||||
* @param clipUuid 动画的唯一标识符
|
||||
*/
|
||||
queryAnimationClip(nodeUuid: string, clipUuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询一个节点上,可以编辑的动画属性数组
|
||||
* @param uuid 动画的 uuid
|
||||
*/
|
||||
queryAnimationProperties(uuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询一个节点上的所有动画 clips 信息
|
||||
* @param nodeUuid 节点的唯一标识符
|
||||
*/
|
||||
queryAnimationClipsInfo(nodeUuid: string): any;
|
||||
|
||||
/**
|
||||
* 查询动画当前的播放时间信息
|
||||
* @param clipUuid 动画资源的唯一标识符
|
||||
*/
|
||||
queryAnimationClipCurrentTime(clipUuid: string): number;
|
||||
|
||||
/**
|
||||
* 查询动画当前轨道的某一帧的数值
|
||||
* @param clipUuid 动画 uuid
|
||||
* @param nodePath 查询数据所在的节点搜索路径
|
||||
* @param propKey 属性名字
|
||||
* @param frame 关键帧数
|
||||
*/
|
||||
queryAnimationPropValueAtFrame(clipUuid: string, nodePath: string, propKey: string, frame: number): any;
|
||||
|
||||
/**
|
||||
* 更改当前动画编辑模式
|
||||
* @param uuid uuid
|
||||
* @param active 激活或关闭
|
||||
*/
|
||||
recordAnimation(uuid: string, active: boolean): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 切换动画根节点
|
||||
* @param uuid uuid
|
||||
* @param clipUuid uuid of clip
|
||||
*/
|
||||
changeAnimationRootNode(uuid: string, clipUuid: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 更改当前当前关键帧
|
||||
* @param time 时间
|
||||
*/
|
||||
setCurEditTime(time: number): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 更改当前正在编辑的动画的播放状态
|
||||
* @param operate 操作
|
||||
* @param clipUuid uuid of clip
|
||||
*/
|
||||
changeClipState(operate: string, clipUuid: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 更改当前正在编辑的动画 uuid
|
||||
* @param clipUuid uuid of clip
|
||||
*/
|
||||
setEditClip(clipUuid: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 保存动画数据
|
||||
*/
|
||||
saveClip(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 动画操作
|
||||
*
|
||||
* @param operationList 操作方法数组
|
||||
*/
|
||||
applyAnimationOperation(operationList: IAnimOperation[]): Promise<boolean>;
|
||||
|
||||
/////////////
|
||||
// preview //
|
||||
/////////////
|
||||
queryPreviewWindowList(): any;
|
||||
|
||||
////////////
|
||||
// script //
|
||||
////////////
|
||||
queryScriptName(uuid: string): Promise<any>;
|
||||
loadScript(uuid: string): Promise<void>;
|
||||
removeScript(info: any): Promise<void>;
|
||||
scriptChange(info: any): Promise<void>;
|
||||
|
||||
///////////////
|
||||
// selection //
|
||||
///////////////
|
||||
_selectNode(uuid: string): void;
|
||||
_unselectNode(uuid: string): void;
|
||||
querySelection(): string[];
|
||||
isSelectNode(uuid: string): boolean;
|
||||
selectNode(uuid: string): void;
|
||||
unselectNode(uuid: string): void;
|
||||
clearSelection(): void;
|
||||
|
||||
////////////
|
||||
// effect //
|
||||
////////////
|
||||
registerEffects(uuids: string[]): void;
|
||||
removeEffects(uuids: string[]): void;
|
||||
updateEffect(uuid: string): void;
|
||||
|
||||
/////////////
|
||||
// terrain //
|
||||
/////////////
|
||||
onRemoveTerrain(uuid: string, info: any): void;
|
||||
|
||||
/////////////
|
||||
// prefab //
|
||||
/////////////
|
||||
createPrefab(uuid: string, url: string): any;
|
||||
getPrefabData(uuid: string): any;
|
||||
linkPrefab(nodeUuid: string, assetUuid: string): any;
|
||||
unlinkPrefab(nodeUuid: string, removeNested: boolean): any;
|
||||
applyPrefab(nodeUuid: string): any;
|
||||
|
||||
//////////
|
||||
// UI //
|
||||
//////////
|
||||
distributeSelectionUI(type: string): void;
|
||||
alignSelectionUI(type: string): void;
|
||||
|
||||
////////////////
|
||||
// particle //
|
||||
////////////////
|
||||
/**
|
||||
* 查询粒子播放的信息
|
||||
* @param uuid 粒子组件的 uuid
|
||||
*/
|
||||
queryParticlePlayInfo(uuid: string): any;
|
||||
/**
|
||||
* 设置粒子播放速度
|
||||
* @param uuid 粒子组件的 uuid
|
||||
* @param speed
|
||||
*/
|
||||
setParticlePlaySpeed(uuid: string, speed: number): void;
|
||||
/**
|
||||
* 播放选中的粒子
|
||||
* @param uuid 粒子组件的 uuid
|
||||
*/
|
||||
playParticle();
|
||||
/**
|
||||
* 重新开始播放选中的粒子
|
||||
* @param uuid 粒子组件的 uuid
|
||||
*/
|
||||
restartParticle();
|
||||
/**
|
||||
* 暂停选中的粒子
|
||||
* @param uuid 粒子组件的 uuid
|
||||
*/
|
||||
pauseParticle();
|
||||
/**
|
||||
* 停止播放选中的粒子
|
||||
* @param uuid 粒子组件的 uuid
|
||||
*/
|
||||
stopParticle();
|
||||
/////////////////
|
||||
// wireframe //
|
||||
/////////////////
|
||||
// applyWireframeStorage(mode: any, color: any): void;
|
||||
// setWireframeMode(mode: any): void;
|
||||
// setWireframeColor(color: any): void;
|
||||
|
||||
////////////////
|
||||
// game view //
|
||||
////////////////
|
||||
changeGameMode(val: boolean): void;
|
||||
pauseGameView(isPause: boolean): void;
|
||||
stepGameView(): void;
|
||||
platformGameView(val: string): void;
|
||||
|
||||
///////////////////
|
||||
// physics //
|
||||
///////////////////
|
||||
updatePhysicsGroup(): void;
|
||||
|
||||
// others
|
||||
onEngineUpdate(): void;
|
||||
|
||||
///////////////////
|
||||
// physics 2D //
|
||||
///////////////////
|
||||
regeneratePolygon2DPoints(uuid: string): void;
|
||||
|
||||
///////////////////
|
||||
// particle 2D //
|
||||
///////////////////
|
||||
exportParticlePlist(uuid: string): Promise<any>;
|
||||
}
|
||||
|
||||
export default ISceneFacade;
|
27
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/server/@types/package.d.ts
vendored
Normal file
27
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/server/@types/package.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// 消息定义
|
||||
interface MessageInterface {
|
||||
params: any[],
|
||||
result: any;
|
||||
}
|
||||
|
||||
// host
|
||||
export interface HostInfo {
|
||||
host: string;
|
||||
ip: string;
|
||||
port: number;
|
||||
}
|
||||
|
||||
// 消息定义
|
||||
export interface main {
|
||||
scene: {
|
||||
[x: string]: MessageInterface;
|
||||
'query-port': {
|
||||
params: [],
|
||||
result: number,
|
||||
};
|
||||
'scan-lan': {
|
||||
params: [],
|
||||
result: HostInfo[],
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
export interface ShortcutItem {
|
||||
when: string;
|
||||
message: string;
|
||||
shortcut: string;
|
||||
pkgName: string;
|
||||
rawShortcut?: string;
|
||||
key: string;
|
||||
missing?: boolean;
|
||||
}
|
||||
|
||||
export type IShortcutItemMap = Record<string, ShortcutItem>;
|
||||
|
||||
export interface IShortcutEditInfo {
|
||||
key: string;
|
||||
shortcut: string;
|
||||
searches: ShortcutItem[];
|
||||
conflict: boolean;
|
||||
when: string;
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
/// <reference path="../../../@types/editor/index.d.ts"/>
|
||||
/// <reference path="@editor/library-type/packages/builder/@types/protect/global.d.ts"/>
|
||||
export * from "@editor/library-type/packages/builder/@types/protect";
|
||||
import { IInternalBuildOptions } from "@editor/library-type/packages/builder/@types/protect";
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'vivo-mini-game': IOptions;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
package: string;
|
||||
icon: string;
|
||||
versionName: string;
|
||||
versionCode: string;
|
||||
minPlatformVersion: string;
|
||||
deviceOrientation: IOrientation;
|
||||
tinyPackageServer: string;
|
||||
useDebugKey: boolean;
|
||||
privatePemPath: string;
|
||||
certificatePemPath: string;
|
||||
logLevel: string;
|
||||
separateEngine: boolean;
|
||||
}
|
||||
|
||||
export interface ICompileOptions {
|
||||
name: string;
|
||||
tinyPackageServer: string;
|
||||
useDebugKey: boolean;
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { appTemplateData, IInternalBuildOptions, IPolyFills } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export interface IOptions {
|
||||
resolution: {
|
||||
designHeight: number;
|
||||
designWidth: number;
|
||||
},
|
||||
polyfills?: IPolyFills;
|
||||
remoteServerAddress?: string;
|
||||
}
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'web-desktop': IOptions;
|
||||
};
|
||||
appTemplateData: appTemplateData;
|
||||
}
|
||||
|
||||
export interface IBaseItem {
|
||||
/**
|
||||
* Display text.
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* Description.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
required?: boolean;
|
||||
|
||||
native?: string;
|
||||
|
||||
wechatPlugin?: boolean;
|
||||
}
|
||||
|
||||
export interface IModuleItem extends IBaseItem {
|
||||
/**
|
||||
* Display text.
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* Description.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* Whether if the feature of options allow multiple selection.
|
||||
*/
|
||||
multi?: boolean;
|
||||
|
||||
/**
|
||||
* If have default it will checked
|
||||
*/
|
||||
default?: string[];
|
||||
|
||||
options?: Record<string, IBaseItem>;
|
||||
|
||||
category?: string;
|
||||
|
||||
flags?: Record<string, IFlagBaseItem>;
|
||||
}
|
||||
|
||||
export interface IDisplayModuleItem extends IModuleItem {
|
||||
_value: boolean;
|
||||
_option?: string;
|
||||
options?: Record<string, IDisplayModuleItem>;
|
||||
}
|
||||
|
||||
export interface IDisplayModuleCache {
|
||||
_value: boolean;
|
||||
_option?: string;
|
||||
flags?: Record<string, boolean>;
|
||||
}
|
20
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/web-mobile/@types/index.d.ts
vendored
Normal file
20
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/web-mobile/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/// <reference path='../../../@types/index'/>
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
import { IInternalBuildOptions, IPolyFills, ISettings } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'auto' | 'landscape' | 'portrait';
|
||||
export interface IOptions {
|
||||
orientation: IOrientation;
|
||||
embedWebDebugger: boolean;
|
||||
remoteServerAddress: string;
|
||||
polyfills: any;
|
||||
}
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'web-mobile': IOptions;
|
||||
}
|
||||
}
|
||||
export interface IUserSettings extends ISettings {
|
||||
orientation: IOrientation;
|
||||
}
|
81
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/wechatgame/@types/index.d.ts
vendored
Normal file
81
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/wechatgame/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
|
||||
/// <reference path='../../../@types/index'/>
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
import { IInternalBuildOptions } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'auto' | 'landscape' | 'portrait';
|
||||
|
||||
export interface IOptions {
|
||||
appid: string;
|
||||
remoteServerAddress: string;
|
||||
buildOpenDataContextTemplate: boolean;
|
||||
orientation: IOrientation;
|
||||
separateEngine: boolean;
|
||||
wasm: 'js' | 'wasm' | boolean;
|
||||
enabelWebGL2: 'off' | 'sameAsProjectSetting';
|
||||
}
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
wechatgame: IOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IBaseItem {
|
||||
/**
|
||||
* Display text.
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* Description.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
required?: boolean;
|
||||
|
||||
native?: string;
|
||||
|
||||
wechatPlugin?: boolean;
|
||||
}
|
||||
|
||||
export interface IModuleItem extends IBaseItem {
|
||||
/**
|
||||
* Display text.
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* Description.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* Whether if the feature of options allow multiple selection.
|
||||
*/
|
||||
multi?: boolean;
|
||||
|
||||
/**
|
||||
* If have default it will checked
|
||||
*/
|
||||
default?: string[];
|
||||
|
||||
options?: Record<string, IBaseItem>;
|
||||
|
||||
category?: string;
|
||||
|
||||
flags?: Record<string, IFlagBaseItem>;
|
||||
}
|
||||
|
||||
export interface IDisplayModuleItem extends IModuleItem {
|
||||
_value: boolean;
|
||||
_option?: string;
|
||||
options?: Record<string, IDisplayModuleItem>;
|
||||
}
|
||||
|
||||
export interface IDisplayModuleCache {
|
||||
_value: boolean;
|
||||
_option?: string;
|
||||
flags?: Record<string, boolean>;
|
||||
}
|
24
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/windows/@types/index.d.ts
vendored
Normal file
24
JisolGameCocos/extensions/oops-plugin-excel-to-json/@types/packages/windows/@types/index.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions, InternalBuildResult } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages: {
|
||||
'windows': IOptions;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
renderBackEnd: {
|
||||
vulkan: boolean;
|
||||
gles3: boolean;
|
||||
gles2: boolean;
|
||||
};
|
||||
serverMode: boolean;
|
||||
}
|
||||
|
||||
export interface IBuildResult extends InternalBuildResult {
|
||||
userFrameWorks: boolean; // 是否使用用户的配置数据
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
|
||||
export * from '@editor/library-type/packages/builder/@types/protect';
|
||||
import { IInternalBuildOptions, ISettings } from '@editor/library-type/packages/builder/@types/protect';
|
||||
|
||||
export type IOrientation = 'landscape' | 'portrait';
|
||||
|
||||
export interface ITaskOption extends IInternalBuildOptions {
|
||||
packages:{
|
||||
'xiaomi-quick-game': IOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
package: string;
|
||||
icon: string;
|
||||
versionName: string;
|
||||
versionCode: string;
|
||||
minPlatformVersion: string;
|
||||
deviceOrientation: IOrientation;
|
||||
tinyPackageServer: string;
|
||||
useDebugKey: boolean;
|
||||
privatePemPath: string;
|
||||
certificatePemPath: string;
|
||||
logLevel: string;
|
||||
|
||||
encapsulation: boolean;
|
||||
makeAfterBuild: boolean;
|
||||
}
|
||||
|
||||
export interface ICompileOption {
|
||||
name: string;
|
||||
useDebugKey: boolean;
|
||||
tinyPackageServer: string;
|
||||
}
|
||||
|
||||
export interface IUserSettings extends ISettings {
|
||||
orientation: IOrientation;
|
||||
}
|
21
JisolGameCocos/extensions/oops-plugin-excel-to-json/LICENSE
Normal file
21
JisolGameCocos/extensions/oops-plugin-excel-to-json/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 dgflash
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@@ -0,0 +1,22 @@
|
||||
### 游戏配置数据生成 + 数据对象代码生成器插件
|
||||

|
||||
|
||||
### Cocos Creator 3.x 配置Excel文件目录、配置Json数据输出目录、配置脚本输出目录
|
||||

|
||||
|
||||
|
||||
### Cocos Creator 3.x 扩展 -> Oops-Framework Excel To Json
|
||||

|
||||
|
||||
### Cocos Creator 3.x 生成数据资源与脚本资源
|
||||

|
||||
|
||||
工具指向策划配置表目录后,每次更新配置时,一键生成数据与静态配置表代码,在项目中后期平凡维护修改时,提高开发效率。
|
||||
|
||||
### Excel中数据规则
|
||||
- Excel中前五行为工具规则数据
|
||||
- 第一行为字段中文名
|
||||
- 第二行为字段英文名,会生成为json数据的字段名
|
||||
- 第三行为字段数据类型,只支持number、string类型,数组和对象类型可自行扩展
|
||||
- 第四行标记输出服务器数据时,是否存在这个字段"server"为显示字段,"server_no"为删除字段
|
||||
- 第五行标记输出客户端数据时,是否存在这个字段"client"为显示字段,"client_no"为删除字段
|
308
JisolGameCocos/extensions/oops-plugin-excel-to-json/dist/ExcelToJson.js
vendored
Normal file
308
JisolGameCocos/extensions/oops-plugin-excel-to-json/dist/ExcelToJson.js
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.run = void 0;
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const JsonToTs_1 = require("./JsonToTs");
|
||||
const main_1 = require("./main");
|
||||
const fs = require('fs');
|
||||
const excel = require('exceljs');
|
||||
/**
|
||||
* Excel转Json数据
|
||||
* @param {*} src 读取的excel文件目录
|
||||
* @param {*} dst 导出的json文件目录
|
||||
* @param {*} name excel文件名
|
||||
* @param {*} isClient 是否为客户端数据
|
||||
*/
|
||||
async function convert(src, dst, name, isClient) {
|
||||
let r = {};
|
||||
let names = []; // 文名字段名
|
||||
let keys = []; // 字段名
|
||||
let types = []; // 通用字段数据类型
|
||||
let types_client = {}; // 客户端数据类型
|
||||
let primary = []; // 多主键配置
|
||||
// let primary_index: number[] = [];
|
||||
const workbook = new excel.Workbook();
|
||||
// 读取excel
|
||||
await workbook.xlsx.readFile(src);
|
||||
const worksheet = workbook.getWorksheet(1); // 获取第一个worksheet
|
||||
let rowNum = 0;
|
||||
let rowStartIndex = 0;
|
||||
worksheet.eachRow((row, rowNumber) => {
|
||||
let data = {};
|
||||
// console.log(row.values);
|
||||
if (rowNumber <= 3) {
|
||||
for (let index = 0; index < row.values.length; index++) {
|
||||
const value = row.values[index];
|
||||
if (value) {
|
||||
// console.log(value);
|
||||
if (rowNumber === 1) {
|
||||
keys.push(value); // 字段英文名
|
||||
if (primary.length == 0) {
|
||||
rowStartIndex = index;
|
||||
primary.push(value);
|
||||
}
|
||||
}
|
||||
else if (rowNumber === 2) {
|
||||
types.push(value); // 通用字段数据类型
|
||||
}
|
||||
else if (rowNumber === 3) {
|
||||
names.push(value); // 字段中文名
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (rowNum == 0) {
|
||||
rowNum = Math.min(keys.length, types.length, names.length);
|
||||
}
|
||||
for (let index = 0; index < rowNum; index++) {
|
||||
const value = row.values[index + rowStartIndex];
|
||||
let type = types[index];
|
||||
let key = keys[index];
|
||||
switch (type) {
|
||||
case "int":
|
||||
case "long":
|
||||
data[key] = value ? parseInt(value) : 0;
|
||||
types_client[key] = {
|
||||
en: "number",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
case "float":
|
||||
case "double":
|
||||
data[key] = value ? parseFloat(value) : 0;
|
||||
types_client[key] = {
|
||||
en: "number",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
case "string":
|
||||
data[key] = value ? value : "";
|
||||
types_client[key] = {
|
||||
en: "string",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
case "boolean":
|
||||
data[key] = value == "true";
|
||||
types_client[key] = {
|
||||
en: "boolean",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
// case "any":
|
||||
// data[key] = JSON.parse(value);
|
||||
// types_client[key] = {
|
||||
// en: "any",
|
||||
// zh: names[index]
|
||||
// };
|
||||
// break;
|
||||
case "cobj":
|
||||
try {
|
||||
data[key] = value ? JSON.parse(`{"${value.toString().replace(/[:]+/g, "\":").replace(/[,]+/g, ",\"")}}`) : "{}";
|
||||
types_client[key] = {
|
||||
en: "object",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-cobj-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr":
|
||||
try {
|
||||
let newValue = value ? `["${value.toString().replace(/[,]+/g, "\",\"")}"]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "string[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr_int":
|
||||
case "carr_long":
|
||||
case "carr_float":
|
||||
case "carr_double":
|
||||
try {
|
||||
let newValue = value ? `[${value}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "number[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr_int`);
|
||||
}
|
||||
break;
|
||||
case "carr_string":
|
||||
try {
|
||||
let newValue;
|
||||
if (value) {
|
||||
if (value[0] == "\"") {
|
||||
newValue = `[${value}]`;
|
||||
}
|
||||
else {
|
||||
newValue = `["${value.toString().replace(/[,]+/g, "\",\"")}"]`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
newValue = "[]";
|
||||
}
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "string[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr_string-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr_object":
|
||||
case "carr_obj":
|
||||
try {
|
||||
let newValue = value ? `[{"${value.toString().replace(/[;]+/g, ",").replace(/[:]+/g, "\":").replace(/[,]+/g, "},{\"")}}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "object[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr_object-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2":
|
||||
try {
|
||||
let newValue;
|
||||
if (value) {
|
||||
newValue = `"${value.toString().replace(/[:]+/g, "\":\"").replace(/[,]+/g, "\",\"")}"`;
|
||||
newValue = `[[${newValue.replace(/[,]+/g, "],[").replace(/[:]+/g, ",")}]]`;
|
||||
}
|
||||
else {
|
||||
newValue = "[]";
|
||||
}
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "string[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2_int":
|
||||
case "carr2_long":
|
||||
case "carr2_float":
|
||||
case "carr2_double":
|
||||
try {
|
||||
let newValue = value ? `[[${value.toString().replace(/[,]+/g, "],[").replace(/[:]+/g, ",")}]]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "number[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2_int-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2_obj":
|
||||
try {
|
||||
let newValue = value ? `[{"${value.toString().replace(/[,]+/g, "\",\"").replace(/[:]+/g, "\":\"").replace(/[,]+/g, "},{").replace(/[;]+/g, "\",\"")}"}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "object[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2_objnum":
|
||||
try {
|
||||
let newValue = value ? `[{"${value.toString().replace(/[:]+/g, "\":").replace(/[,]+/g, "},{\"").replace(/[;]+/g, ",\"")}}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "object[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2_objnum-- ${value}`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 生成数据(多主键)
|
||||
if (rowNumber > 3) {
|
||||
let temp = null;
|
||||
for (var i = 0; i < primary.length; i++) {
|
||||
let k = primary[i];
|
||||
let id = data[k];
|
||||
if (primary.length == 1) {
|
||||
r[id] = data;
|
||||
}
|
||||
else {
|
||||
if (i == primary.length - 1) {
|
||||
temp[id] = data;
|
||||
}
|
||||
else if (i == 0) {
|
||||
if (r[id] == undefined) {
|
||||
r[id] = {};
|
||||
}
|
||||
temp = r[id];
|
||||
}
|
||||
else {
|
||||
temp[id] = {};
|
||||
temp = temp[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 写入流
|
||||
if (r["undefined"] == null) {
|
||||
await fs.writeFileSync(dst, JSON.stringify(r));
|
||||
// 生成客户端脚本
|
||||
if (isClient)
|
||||
(0, JsonToTs_1.createTs)(name, types_client, r, primary);
|
||||
console.log(isClient ? "客户端数据" : "服务器数据", "生成成功", dst);
|
||||
}
|
||||
else {
|
||||
console.warn(isClient ? "客户端数据" : "服务器数据", "无数据", dst);
|
||||
console.warn(r);
|
||||
}
|
||||
}
|
||||
function run() {
|
||||
var inputExcelPath = path_1.default.join(__dirname, main_1.config.PathExcel);
|
||||
var outJsonPath = path_1.default.join(__dirname, main_1.config.PathJson);
|
||||
const files = fs.readdirSync(inputExcelPath);
|
||||
files.forEach((f) => {
|
||||
let name = f.substring(0, f.indexOf("."));
|
||||
let ext = f.toString().substring(f.lastIndexOf(".") + 1);
|
||||
if (ext == "xlsx") {
|
||||
convert(inputExcelPath + f, outJsonPath + name + ".json", name, true); // 客户端数据
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.run = run;
|
62
JisolGameCocos/extensions/oops-plugin-excel-to-json/dist/JsonToTs.js
vendored
Normal file
62
JisolGameCocos/extensions/oops-plugin-excel-to-json/dist/JsonToTs.js
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTs = void 0;
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const main_1 = require("./main");
|
||||
const fs = require('fs');
|
||||
async function createTs(name, fieldType, data, primary) {
|
||||
// 主键参数
|
||||
var script_init_params = "";
|
||||
var script_init_data = "";
|
||||
var script_init_var = "";
|
||||
var script_init_value = "";
|
||||
primary.forEach(key => {
|
||||
script_init_params += `${key}: number, `;
|
||||
script_init_data += `[${key}]`;
|
||||
script_init_var += `/** ${fieldType[key].zh} */\r private _${key}: number = 0;\r `;
|
||||
script_init_value += `this._${key} = ${key};\r `;
|
||||
});
|
||||
script_init_params = script_init_params.substring(0, script_init_params.length - 2);
|
||||
script_init_var = script_init_var.substring(0, script_init_var.length - 5);
|
||||
script_init_value = script_init_value.substring(0, script_init_value.length - 9);
|
||||
// 字段
|
||||
var field = "";
|
||||
for (var id in fieldType) {
|
||||
// if (primary.indexOf(id) == -1) {
|
||||
field += `
|
||||
/** ${fieldType[id].zh} */
|
||||
get ${id}(): ${fieldType[id].en} {
|
||||
return this.data.${id};
|
||||
}`;
|
||||
// }
|
||||
}
|
||||
var script = `import { JsonUtil } from "../../../../extensions/ngame/assets/ngame/util/JsonUtil";
|
||||
|
||||
export class Table${name} {
|
||||
static TableName: string = "${name}";
|
||||
|
||||
static getAllConfig(): { [id: string]: Table${name} } {
|
||||
return JsonUtil.get(Table${name}.TableName);
|
||||
}
|
||||
|
||||
static getConfig(id: number | string) {
|
||||
return Table${name}.getAllConfig()[id] as Table${name};
|
||||
}
|
||||
|
||||
private data: any;
|
||||
|
||||
init(${script_init_params}) {
|
||||
var table = JsonUtil.get(Table${name}.TableName);
|
||||
this.data = table${script_init_data};
|
||||
${script_init_value}
|
||||
}
|
||||
${script_init_var}
|
||||
${field}
|
||||
}`;
|
||||
var p = path_1.default.join(__dirname, main_1.config.PathTs);
|
||||
await fs.writeFileSync(`${p}Table${name}.ts`, script);
|
||||
}
|
||||
exports.createTs = createTs;
|
38
JisolGameCocos/extensions/oops-plugin-excel-to-json/dist/main.js
vendored
Normal file
38
JisolGameCocos/extensions/oops-plugin-excel-to-json/dist/main.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.methods = exports.config = exports.unload = exports.load = void 0;
|
||||
const ExcelToJson_1 = require("./ExcelToJson");
|
||||
/**
|
||||
* @en Hooks triggered after extension loading is complete
|
||||
* @zh 扩展加载完成后触发的钩子
|
||||
*/
|
||||
function load() { }
|
||||
exports.load = load;
|
||||
/**
|
||||
* @en Hooks triggered after extension uninstallation is complete
|
||||
* @zh 扩展卸载完成后触发的钩子
|
||||
*/
|
||||
function unload() { }
|
||||
exports.unload = unload;
|
||||
/**
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
exports.methods = {
|
||||
async excelToJson() {
|
||||
exports.config = await Editor.Profile.getProject("oops-plugin-excel-to-json");
|
||||
if (exports.config.PathExcel == null) {
|
||||
console.warn("项目->项目设置->Excel To Json->PathExcel 配置路径");
|
||||
return;
|
||||
}
|
||||
if (exports.config.PathJson == null) {
|
||||
console.warn("项目->项目设置->Excel To Json->PathJson 配置路径");
|
||||
return;
|
||||
}
|
||||
if (exports.config.PathTs == null) {
|
||||
console.warn("项目->项目设置->Excel To Json->PathTs 配置路径");
|
||||
return;
|
||||
}
|
||||
(0, ExcelToJson_1.run)();
|
||||
}
|
||||
};
|
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
module.exports =
|
||||
{
|
||||
title: "Oops Framework Excel To Json",
|
||||
description:"Oops framework Excel to JSON data plug-in",
|
||||
excel_to_json: "Excel To Json",
|
||||
};
|
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
module.exports =
|
||||
{
|
||||
title: "Oops Framework Excel To Json",
|
||||
description:"Oops Framework Excel 转 Json 数据插件",
|
||||
excel_to_json: "Excel To Json",
|
||||
};
|
1911
JisolGameCocos/extensions/oops-plugin-excel-to-json/package-lock.json
generated
Normal file
1911
JisolGameCocos/extensions/oops-plugin-excel-to-json/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"package_version": 2,
|
||||
"version": "1.0.0",
|
||||
"name": "oops-plugin-excel-to-json",
|
||||
"description": "i18n:oops-plugin-excel-to-json.description",
|
||||
"main": "./dist/main.js",
|
||||
"author": "dgflash",
|
||||
"dependencies": {
|
||||
"fs-extra": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.5",
|
||||
"@types/node": "^16.0.1",
|
||||
"exceljs": "^4.2.1"
|
||||
},
|
||||
"contributions": {
|
||||
"project": {
|
||||
"tab1": {
|
||||
"label": "Excel to Json",
|
||||
"content": {
|
||||
"PathExcel": {
|
||||
"ui": "ui-input",
|
||||
"default": ""
|
||||
},
|
||||
"PathJson": {
|
||||
"ui": "ui-input",
|
||||
"default": ""
|
||||
},
|
||||
"PathTs": {
|
||||
"ui": "ui-input",
|
||||
"default": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"menu": [
|
||||
{
|
||||
"path": "i18n:menu.extension",
|
||||
"label": "i18n:oops-plugin-excel-to-json.title",
|
||||
"message": "excelToJson"
|
||||
}
|
||||
],
|
||||
"messages": {
|
||||
"excelToJson": {
|
||||
"methods": [
|
||||
"excelToJson"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -b",
|
||||
"watch": "tsc -w"
|
||||
}
|
||||
}
|
@@ -0,0 +1,304 @@
|
||||
import path from "path";
|
||||
import { createTs } from "./JsonToTs";
|
||||
import { config } from "./main";
|
||||
|
||||
const fs = require('fs')
|
||||
const excel = require('exceljs');
|
||||
|
||||
/**
|
||||
* Excel转Json数据
|
||||
* @param {*} src 读取的excel文件目录
|
||||
* @param {*} dst 导出的json文件目录
|
||||
* @param {*} name excel文件名
|
||||
* @param {*} isClient 是否为客户端数据
|
||||
*/
|
||||
async function convert(src: string, dst: string, name: string, isClient: boolean) {
|
||||
let r: any = {};
|
||||
let names: any[] = []; // 文名字段名
|
||||
let keys: any[] = []; // 字段名
|
||||
let types: any[] = []; // 通用字段数据类型
|
||||
let types_client: any = {}; // 客户端数据类型
|
||||
let primary: string[] = []; // 多主键配置
|
||||
// let primary_index: number[] = [];
|
||||
|
||||
const workbook = new excel.Workbook();
|
||||
|
||||
// 读取excel
|
||||
await workbook.xlsx.readFile(src);
|
||||
const worksheet = workbook.getWorksheet(1); // 获取第一个worksheet
|
||||
let rowNum = 0;
|
||||
let rowStartIndex = 0;
|
||||
worksheet.eachRow((row: any, rowNumber: number) => {
|
||||
let data: any = {};
|
||||
// console.log(row.values);
|
||||
if (rowNumber <= 3) {
|
||||
for (let index = 0; index < row.values.length; index++) {
|
||||
const value = row.values[index];
|
||||
if (value) {
|
||||
// console.log(value);
|
||||
if (rowNumber === 1) {
|
||||
keys.push(value);// 字段英文名
|
||||
if (primary.length == 0) {
|
||||
rowStartIndex = index;
|
||||
primary.push(value);
|
||||
}
|
||||
}
|
||||
else if (rowNumber === 2) {
|
||||
types.push(value);// 通用字段数据类型
|
||||
}
|
||||
else if (rowNumber === 3) {
|
||||
names.push(value);// 字段中文名
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (rowNum == 0) {
|
||||
rowNum = Math.min(keys.length, types.length, names.length);
|
||||
}
|
||||
|
||||
for (let index = 0; index < rowNum; index++) {
|
||||
const value = row.values[index + rowStartIndex];
|
||||
let type = types[index];
|
||||
let key = keys[index];
|
||||
switch (type) {
|
||||
case "int":
|
||||
case "long":
|
||||
data[key] = value ? parseInt(value) : 0;
|
||||
types_client[key] = {
|
||||
en: "number",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
case "float":
|
||||
case "double":
|
||||
data[key] = value ? parseFloat(value) : 0;
|
||||
types_client[key] = {
|
||||
en: "number",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
case "string":
|
||||
data[key] = value ? value : "";
|
||||
types_client[key] = {
|
||||
en: "string",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
case "boolean":
|
||||
data[key] = value == "true";
|
||||
types_client[key] = {
|
||||
en: "boolean",
|
||||
zh: names[index]
|
||||
};
|
||||
break;
|
||||
// case "any":
|
||||
// data[key] = JSON.parse(value);
|
||||
// types_client[key] = {
|
||||
// en: "any",
|
||||
// zh: names[index]
|
||||
// };
|
||||
// break;
|
||||
case "cobj":
|
||||
try {
|
||||
|
||||
data[key] = value ? JSON.parse(`{"${value.toString().replace(/[:]+/g, "\":").replace(/[,]+/g, ",\"")}}`) : "{}";
|
||||
types_client[key] = {
|
||||
en: "object",
|
||||
zh: names[index]
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-cobj-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr":
|
||||
try {
|
||||
let newValue = value ? `["${value.toString().replace(/[,]+/g, "\",\"")}"]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "string[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr_int":
|
||||
case "carr_long":
|
||||
case "carr_float":
|
||||
case "carr_double":
|
||||
try {
|
||||
let newValue = value ? `[${value}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "number[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr_int`);
|
||||
}
|
||||
break;
|
||||
case "carr_string":
|
||||
try {
|
||||
let newValue;
|
||||
if (value) {
|
||||
if (value[0] == "\"") {
|
||||
newValue = `[${value}]`;
|
||||
} else {
|
||||
newValue = `["${value.toString().replace(/[,]+/g, "\",\"")}"]`;
|
||||
}
|
||||
} else {
|
||||
newValue = "[]";
|
||||
}
|
||||
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "string[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr_string-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr_object":
|
||||
case "carr_obj":
|
||||
try {
|
||||
let newValue = value ? `[{"${value.toString().replace(/[;]+/g, ",").replace(/[:]+/g, "\":").replace(/[,]+/g, "},{\"")}}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "object[]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr_object-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2":
|
||||
try {
|
||||
let newValue;
|
||||
if (value) {
|
||||
newValue = `"${value.toString().replace(/[:]+/g, "\":\"").replace(/[,]+/g, "\",\"")}"`;
|
||||
newValue = `[[${newValue.replace(/[,]+/g, "],[").replace(/[:]+/g, ",")}]]`;
|
||||
} else {
|
||||
newValue = "[]";
|
||||
}
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "string[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2_int":
|
||||
case "carr2_long":
|
||||
case "carr2_float":
|
||||
case "carr2_double":
|
||||
try {
|
||||
let newValue = value ? `[[${value.toString().replace(/[,]+/g, "],[").replace(/[:]+/g, ",")}]]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "number[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2_int-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2_obj":
|
||||
try {
|
||||
let newValue = value ? `[{"${value.toString().replace(/[,]+/g, "\",\"").replace(/[:]+/g, "\":\"").replace(/[,]+/g, "},{").replace(/[;]+/g, "\",\"")}"}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "object[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2-- ${value}`);
|
||||
}
|
||||
break;
|
||||
case "carr2_objnum":
|
||||
try {
|
||||
let newValue = value ? `[{"${value.toString().replace(/[:]+/g, "\":").replace(/[,]+/g, "},{\"").replace(/[;]+/g, ",\"")}}]` : "[]";
|
||||
data[key] = JSON.parse(newValue);
|
||||
types_client[key] = {
|
||||
en: "object[][]",
|
||||
zh: names[index]
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
console.log(`格式错误-carr2_objnum-- ${value}`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 生成数据(多主键)
|
||||
if (rowNumber > 3) {
|
||||
let temp: any = null;
|
||||
for (var i = 0; i < primary.length; i++) {
|
||||
let k = primary[i];
|
||||
let id = data[k];
|
||||
if (primary.length == 1) {
|
||||
r[id] = data;
|
||||
}
|
||||
else {
|
||||
if (i == primary.length - 1) {
|
||||
temp[id] = data;
|
||||
}
|
||||
else if (i == 0) {
|
||||
if (r[id] == undefined) {
|
||||
r[id] = {};
|
||||
}
|
||||
temp = r[id];
|
||||
}
|
||||
else {
|
||||
temp[id] = {};
|
||||
temp = temp[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 写入流
|
||||
if (r["undefined"] == null) {
|
||||
await fs.writeFileSync(dst, JSON.stringify(r));
|
||||
|
||||
// 生成客户端脚本
|
||||
if (isClient) createTs(name, types_client, r, primary);
|
||||
console.log(isClient ? "客户端数据" : "服务器数据", "生成成功", dst);
|
||||
}
|
||||
else {
|
||||
console.warn(isClient ? "客户端数据" : "服务器数据", "无数据", dst);
|
||||
console.warn(r);
|
||||
}
|
||||
}
|
||||
|
||||
export function run() {
|
||||
var inputExcelPath = path.join(__dirname, config.PathExcel);
|
||||
var outJsonPath = path.join(__dirname, config.PathJson);
|
||||
const files = fs.readdirSync(inputExcelPath);
|
||||
files.forEach((f: any) => {
|
||||
let name = f.substring(0, f.indexOf("."));
|
||||
let ext = f.toString().substring(f.lastIndexOf(".") + 1);
|
||||
if (ext == "xlsx") {
|
||||
convert(inputExcelPath + f, outJsonPath + name + ".json", name, true); // 客户端数据
|
||||
}
|
||||
});
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import path from "path";
|
||||
import { config } from "./main";
|
||||
|
||||
const fs = require('fs')
|
||||
|
||||
export async function createTs(name: string, fieldType: any, data: any, primary: string[]) {
|
||||
// 主键参数
|
||||
var script_init_params = "";
|
||||
var script_init_data = "";
|
||||
var script_init_var = "";
|
||||
var script_init_value = "";
|
||||
primary.forEach(key => {
|
||||
script_init_params += `${key}: number, `;
|
||||
script_init_data += `[${key}]`;
|
||||
script_init_var += `/** ${fieldType[key].zh} */\r private _${key}: number = 0;\r `;
|
||||
script_init_value += `this._${key} = ${key};\r `
|
||||
});
|
||||
script_init_params = script_init_params.substring(0, script_init_params.length - 2);
|
||||
script_init_var = script_init_var.substring(0, script_init_var.length - 5);
|
||||
script_init_value = script_init_value.substring(0, script_init_value.length - 9);
|
||||
|
||||
// 字段
|
||||
var field = "";
|
||||
for (var id in fieldType) {
|
||||
// if (primary.indexOf(id) == -1) {
|
||||
field += `
|
||||
/** ${fieldType[id].zh} */
|
||||
get ${id}(): ${fieldType[id].en} {
|
||||
return this.data.${id};
|
||||
}`;
|
||||
// }
|
||||
}
|
||||
|
||||
var script =
|
||||
`import { JsonUtil } from "../../../ngame/util/JsonUtil";
|
||||
|
||||
export class Table${name} {
|
||||
static TableName: string = "${name}";
|
||||
|
||||
static getAllConfig(): { [id: string]: Table${name} } {
|
||||
return JsonUtil.get(Table${name}.TableName);
|
||||
}
|
||||
|
||||
static getConfig(id: number | string) {
|
||||
return Table${name}.getAllConfig()[id] as Table${name};
|
||||
}
|
||||
|
||||
private data: any;
|
||||
|
||||
init(${script_init_params}) {
|
||||
var table = JsonUtil.get(Table${name}.TableName);
|
||||
this.data = table${script_init_data};
|
||||
${script_init_value}
|
||||
}
|
||||
${script_init_var}
|
||||
${field}
|
||||
}`;
|
||||
|
||||
var p = path.join(__dirname, config.PathTs);
|
||||
await fs.writeFileSync(`${p}Table${name}.ts`, script);
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
import { run } from "./ExcelToJson";
|
||||
|
||||
/**
|
||||
* @en Hooks triggered after extension loading is complete
|
||||
* @zh 扩展加载完成后触发的钩子
|
||||
*/
|
||||
export function load() { }
|
||||
|
||||
/**
|
||||
* @en Hooks triggered after extension uninstallation is complete
|
||||
* @zh 扩展卸载完成后触发的钩子
|
||||
*/
|
||||
export function unload() { }
|
||||
|
||||
export var config: any;
|
||||
|
||||
/**
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
export const methods: { [key: string]: (...any: any) => any } = {
|
||||
async excelToJson() {
|
||||
config = await Editor.Profile.getProject("oops-plugin-excel-to-json");
|
||||
if (config.PathExcel == null) {
|
||||
console.warn("项目->项目设置->Excel To Json->PathExcel 配置路径");
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.PathJson == null) {
|
||||
console.warn("项目->项目设置->Excel To Json->PathJson 配置路径");
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.PathTs == null) {
|
||||
console.warn("项目->项目设置->Excel To Json->PathTs 配置路径");
|
||||
return;
|
||||
}
|
||||
|
||||
run();
|
||||
}
|
||||
};
|
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"module": "CommonJS",
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user