微信云开发插件

This commit is contained in:
2025-08-17 22:15:07 +08:00
parent 939e6d553d
commit db79fbf9e0
1760 changed files with 914220 additions and 0 deletions

View File

@@ -0,0 +1 @@
../nanoid/bin/nanoid.cjs

View File

@@ -0,0 +1 @@
../@babel/parser/bin/babel-parser.js

View File

@@ -0,0 +1 @@
../typescript/bin/tsc

View File

@@ -0,0 +1 @@
../typescript/bin/tsserver

View File

@@ -0,0 +1,266 @@
{
"name": "wx-cloud-plugin",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"node_modules/@babel/parser": {
"version": "7.21.3",
"license": "MIT",
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@cocos/creator-types": {
"version": "3.8.3",
"resolved": "https://registry.npmmirror.com/@cocos/creator-types/-/creator-types-3.8.3.tgz",
"integrity": "sha512-dVAgORX+dWzINdM6gGOcgFNbFXUItEv9Dg2DCWWPHN1qMHaqUe1h+hslcIsJK9OxgOcmS6Lh9FZcklfXn5jkOQ==",
"dev": true
},
"node_modules/@types/fs-extra": {
"version": "9.0.13",
"resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-9.0.13.tgz",
"integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node": {
"version": "18.19.43",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-18.19.43.tgz",
"integrity": "sha512-Mw/YlgXnyJdEwLoFv2dpuJaDFriX+Pc+0qOBJ57jC1H6cDxIj2xc5yUrdtArDVG0m+KV6622a4p2tenEqB3C/g==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/@vue/compiler-core": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
}
},
"node_modules/@vue/compiler-dom": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@vue/compiler-core": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/compiler-sfc": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.47",
"@vue/compiler-dom": "3.2.47",
"@vue/compiler-ssr": "3.2.47",
"@vue/reactivity-transform": "3.2.47",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7",
"postcss": "^8.1.10",
"source-map": "^0.6.1"
}
},
"node_modules/@vue/compiler-ssr": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@vue/compiler-dom": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/reactivity": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/reactivity-transform": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.47",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7"
}
},
"node_modules/@vue/runtime-core": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@vue/reactivity": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/runtime-dom": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@vue/runtime-core": "3.2.47",
"@vue/shared": "3.2.47",
"csstype": "^2.6.8"
}
},
"node_modules/@vue/server-renderer": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@vue/compiler-ssr": "3.2.47",
"@vue/shared": "3.2.47"
},
"peerDependencies": {
"vue": "3.2.47"
}
},
"node_modules/@vue/shared": {
"version": "3.2.47",
"license": "MIT"
},
"node_modules/csstype": {
"version": "2.6.21",
"license": "MIT"
},
"node_modules/estree-walker": {
"version": "2.0.2",
"license": "MIT"
},
"node_modules/fs-extra": {
"version": "10.1.0",
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"license": "ISC"
},
"node_modules/jsonfile": {
"version": "6.1.0",
"license": "MIT",
"dependencies": {
"universalify": "^2.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/magic-string": {
"version": "0.25.9",
"license": "MIT",
"dependencies": {
"sourcemap-codec": "^1.4.8"
}
},
"node_modules/nanoid": {
"version": "3.3.4",
"license": "MIT",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/picocolors": {
"version": "1.0.0",
"license": "ISC"
},
"node_modules/postcss": {
"version": "8.4.21",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/source-map": {
"version": "0.6.1",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/sourcemap-codec": {
"version": "1.4.8",
"license": "MIT"
},
"node_modules/typescript": {
"version": "5.5.4",
"resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.5.4.tgz",
"integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/universalify": {
"version": "2.0.0",
"license": "MIT",
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/vue": {
"version": "3.2.47",
"license": "MIT",
"dependencies": {
"@vue/compiler-dom": "3.2.47",
"@vue/compiler-sfc": "3.2.47",
"@vue/runtime-dom": "3.2.47",
"@vue/server-renderer": "3.2.47",
"@vue/shared": "3.2.47"
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
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.

View File

@@ -0,0 +1,19 @@
# @babel/parser
> A JavaScript parser
See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/parser
```
or using yarn:
```sh
yarn add @babel/parser --dev
```

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env node
/* eslint no-var: 0 */
var parser = require("..");
var fs = require("fs");
var filename = process.argv[2];
if (!filename) {
console.error("no filename specified");
} else {
var file = fs.readFileSync(filename, "utf8");
var ast = parser.parse(file);
console.log(JSON.stringify(ast, null, " "));
}

View File

@@ -0,0 +1,5 @@
try {
module.exports = require("./lib/index.cjs");
} catch {
module.exports = require("./lib/index.js");
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
{
"name": "@babel/parser",
"version": "7.21.3",
"description": "A JavaScript parser",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-parser",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"keywords": [
"babel",
"javascript",
"parser",
"tc39",
"ecmascript",
"@babel/parser"
],
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-parser"
},
"main": "./lib/index.js",
"types": "./typings/babel-parser.d.ts",
"files": [
"bin",
"lib",
"typings/babel-parser.d.ts",
"index.cjs"
],
"engines": {
"node": ">=6.0.0"
},
"devDependencies": {
"@babel/code-frame": "^7.18.6",
"@babel/helper-check-duplicate-nodes": "^7.18.6",
"@babel/helper-fixtures": "^7.21.0",
"@babel/helper-string-parser": "^7.19.4",
"@babel/helper-validator-identifier": "^7.19.1",
"charcodes": "^0.2.0"
},
"bin": "./bin/babel-parser.js",
"type": "commonjs"
}

View File

@@ -0,0 +1,239 @@
// This file is auto-generated! Do not modify it directly.
/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */
import * as _babel_types from '@babel/types';
type Plugin =
| "asyncDoExpressions"
| "asyncGenerators"
| "bigInt"
| "classPrivateMethods"
| "classPrivateProperties"
| "classProperties"
| "classStaticBlock" // Enabled by default
| "decimal"
| "decorators-legacy"
| "decoratorAutoAccessors"
| "destructuringPrivate"
| "doExpressions"
| "dynamicImport"
| "explicitResourceManagement"
| "exportDefaultFrom"
| "exportNamespaceFrom" // deprecated
| "flow"
| "flowComments"
| "functionBind"
| "functionSent"
| "importMeta"
| "jsx"
| "logicalAssignment"
| "importAssertions"
| "importReflection"
| "moduleBlocks"
| "moduleStringNames"
| "nullishCoalescingOperator"
| "numericSeparator"
| "objectRestSpread"
| "optionalCatchBinding"
| "optionalChaining"
| "partialApplication"
| "placeholders"
| "privateIn" // Enabled by default
| "regexpUnicodeSets"
| "throwExpressions"
| "topLevelAwait"
| "v8intrinsic"
| ParserPluginWithOptions[0];
type ParserPluginWithOptions =
| ["decorators", DecoratorsPluginOptions]
| ["estree", { classFeatures?: boolean }]
// @deprecated
| ["moduleAttributes", { version: "may-2020" }]
| ["pipelineOperator", PipelineOperatorPluginOptions]
| ["recordAndTuple", RecordAndTuplePluginOptions]
| ["flow", FlowPluginOptions]
| ["typescript", TypeScriptPluginOptions];
type PluginConfig = Plugin | ParserPluginWithOptions;
interface DecoratorsPluginOptions {
decoratorsBeforeExport?: boolean;
allowCallParenthesized?: boolean;
}
interface PipelineOperatorPluginOptions {
proposal: "minimal" | "fsharp" | "hack" | "smart";
topicToken?: "%" | "#" | "@@" | "^^" | "^";
}
interface RecordAndTuplePluginOptions {
syntaxType: "bar" | "hash";
}
interface FlowPluginOptions {
all?: boolean;
enums?: boolean;
}
interface TypeScriptPluginOptions {
dts?: boolean;
disallowAmbiguousJSXLike?: boolean;
}
// Type definitions for @babel/parser
// Project: https://github.com/babel/babel/tree/main/packages/babel-parser
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Avi Vahl <https://github.com/AviVahl>
// TypeScript Version: 2.9
/**
* Parse the provided code as an entire ECMAScript program.
*/
declare function parse(
input: string,
options?: ParserOptions
): ParseResult<_babel_types.File>;
/**
* Parse the provided code as a single expression.
*/
declare function parseExpression(
input: string,
options?: ParserOptions
): ParseResult<_babel_types.Expression>;
interface ParserOptions {
/**
* By default, import and export declarations can only appear at a program's top level.
* Setting this option to true allows them anywhere where a statement is allowed.
*/
allowImportExportEverywhere?: boolean;
/**
* By default, await use is not allowed outside of an async function.
* Set this to true to accept such code.
*/
allowAwaitOutsideFunction?: boolean;
/**
* By default, a return statement at the top level raises an error.
* Set this to true to accept such code.
*/
allowReturnOutsideFunction?: boolean;
/**
* By default, new.target use is not allowed outside of a function or class.
* Set this to true to accept such code.
*/
allowNewTargetOutsideFunction?: boolean;
allowSuperOutsideMethod?: boolean;
/**
* By default, exported identifiers must refer to a declared variable.
* Set this to true to allow export statements to reference undeclared variables.
*/
allowUndeclaredExports?: boolean;
/**
* By default, Babel parser JavaScript code according to Annex B syntax.
* Set this to `false` to disable such behavior.
*/
annexB?: boolean;
/**
* By default, Babel attaches comments to adjacent AST nodes.
* When this option is set to false, comments are not attached.
* It can provide up to 30% performance improvement when the input code has many comments.
* @babel/eslint-parser will set it for you.
* It is not recommended to use attachComment: false with Babel transform,
* as doing so removes all the comments in output code, and renders annotations such as
* /* istanbul ignore next *\/ nonfunctional.
*/
attachComment?: boolean;
/**
* By default, Babel always throws an error when it finds some invalid code.
* When this option is set to true, it will store the parsing error and
* try to continue parsing the invalid input file.
*/
errorRecovery?: boolean;
/**
* Indicate the mode the code should be parsed in.
* Can be one of "script", "module", or "unambiguous". Defaults to "script".
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
* of ES6 import or export statements.
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
*/
sourceType?: "script" | "module" | "unambiguous";
/**
* Correlate output AST nodes with their source filename.
* Useful when generating code and source maps from the ASTs of multiple input files.
*/
sourceFilename?: string;
/**
* By default, the first line of code parsed is treated as line 1.
* You can provide a line number to alternatively start with.
* Useful for integration with other source tools.
*/
startLine?: number;
/**
* By default, the parsed code is treated as if it starts from line 1, column 0.
* You can provide a column number to alternatively start with.
* Useful for integration with other source tools.
*/
startColumn?: number;
/**
* Array containing the plugins that you want to enable.
*/
plugins?: ParserPlugin[];
/**
* Should the parser work in strict mode.
* Defaults to true if sourceType === 'module'. Otherwise, false.
*/
strictMode?: boolean;
/**
* Adds a ranges property to each node: [node.start, node.end]
*/
ranges?: boolean;
/**
* Adds all parsed tokens to a tokens property on the File node.
*/
tokens?: boolean;
/**
* By default, the parser adds information about parentheses by setting
* `extra.parenthesized` to `true` as needed.
* When this option is `true` the parser creates `ParenthesizedExpression`
* AST nodes instead of using the `extra` property.
*/
createParenthesizedExpressions?: boolean;
}
type ParserPlugin = PluginConfig;
declare const tokTypes: {
// todo(flow->ts) real token type
[name: string]: any;
};
interface ParseError {
code: string;
reasonCode: string;
}
type ParseResult<Result> = Result & {
errors: ParseError[];
};
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };

View File

@@ -0,0 +1,55 @@
# creator-types
[![CI Status](https://github.com/cocos/creator-types/actions/workflows/ci.yaml/badge.svg)](https://github.com/cocos/creator-types/actions/workflows/ci.yaml)
![Typescript](https://img.shields.io/badge/Language-Typescript-blue.svg)
Definitions of engine and editor within Creator
**Please note that this repository is for definition purposes only. Run your code in an appropriate environment.**
## Install
To install the latest version of the definitions:
```bash
npm install @cocos/creator-types
```
In typical scenarios, we need to install definitions for a specific version, for example, when we are using Creator 3.8.0, you can install the definition files as follows:
```bash
npm install @cocos/creator-types@3.8.0
```
## Usage
In the tsconfig.json within the project where it's needed, locate compilerOptions.types and add two declarations:
```json
{
"compilerOptions": {
"types": [
"@cocos/creator-types/engine",
"@cocos/creator-types/editor",
]
}
}
```
After declaring `@cocos/creator-types/engine`, the `cc` module can be recognized correctly in the code:
```ts
import { Node } from 'cc';
```
After declaring `@cocos/creator-types/editor`, the `Editor` object can be recognized correctly in the code.
```ts
Editor.Dialog;
```
For more detailed information, please refer to:
[Engine API](https://docs.cocos.com/creator/api/en/)
[Extension Doc](https://docs.cocos.com/creator/manual/en/editor/extension/readme.html)

View File

@@ -0,0 +1 @@
/// <reference path="./editor/index.d.ts"/>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
declare namespace Editor {
namespace Interface {
// ---- Package ---- start
interface PackageInfo {
debug: boolean;
enable: boolean;
// TODO 更名为 packageJSON 更合适
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;
migrations?: {
version: string;
profile?: string;
custom?: string;
}[];
contributions?: {
messages?: Record<string, Message.MessageConfig>;
[key: string]: any;
builder?: string; // 构建插件注册脚本
};
}
// ---- 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
}
}

View File

@@ -0,0 +1,3 @@
/// <reference path="./editor.d.ts"/>
/// <reference path="./message.d.ts"/>
/// <reference path="./utils.d.ts"/>

View File

@@ -0,0 +1,41 @@
import * as AssetDb from './packages/asset-db/@types/protected/message';
import * as Builder from './packages/builder/@types/protected/message';
import * as Engine from './packages/engine/@types/protected/message';
import * as Information from './packages/information/@types/message';
import * as Preferences from './packages/preferences/@types/message';
import * as Program from './packages/program/@types/message';
import * as Programming from './packages/programming/@types/message';
import * as Project from './packages/project/@types/message';
import * as Scene from './packages/scene/@types/message';
import * as Server from './packages/server/@types/message';
import * as Device from './packages/device/@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;
'builder': Builder.message;
'engine': Engine.message;
'information': Information.message;
'preferences': Preferences.message;
'program': Program.message;
'programming': Programming.message;
'project': Project.message;
'scene': Scene.message;
'server': Server.message;
'device': Device.message;
'extension': Extension.message;
}
}

View File

@@ -0,0 +1,18 @@
/// <reference path='../../../@types/index.d.ts'/>
import { IBuildTaskOption } from '@cocos/creator-types/editor/packages/builder/@types/public';
export * from '@cocos/creator-types/editor/packages/builder/@types/protected';
export interface ITaskOptions extends IBuildTaskOption {
packages: { 'adsense-h5g-plugin': IOptions };
}
export interface IOptions {
adsensePropertyCode: string;
enableTestAd: boolean;
AFPHostPropertyCode: string;
AFPHostDomain: string;
otherAFPHostPropertyCode: string;
otherAFPDomain: string;
}

View File

@@ -0,0 +1,17 @@
/// <reference path='../../../@types/index'/>
export * from '@cocos/creator-types/editor/packages/builder/@types/protected';
import { IInternalBuildOptions, IPolyFills, ISettings } from '@cocos/creator-types/editor/packages/builder/@types/protected';
export type IOrientation = 'landscape' | 'portrait';
export interface ITaskOption extends IInternalBuildOptions {
packages: {
'alipay-mini-game': {
deviceOrientation: IOrientation;
separateEngine: boolean;
subpackages?: { name: string, root: string }[];
wasmSubpackage: boolean;
};
};
}

View File

@@ -0,0 +1,77 @@
/// <reference path='../../../@types/index'/>
export * from '@cocos/creator-types/editor/packages/builder/@types/protected';
import { IInternalBuildOptions, InternalBuildResult } from '@cocos/creator-types/editor/packages/builder/@types/protected';
import { IOptions as INativeOption } from '@cocos/creator-types/editor/packages/native';
export type IOrientation = 'landscape' | 'portrait';
export interface ITaskOption extends IInternalBuildOptions {
packages: {
'android': IOptions;
native: INativeOption;
}
}
export type IAppABI = 'armeabi-v7a' | 'arm64-v8a' | 'x86' | 'x86_64';
export interface IOptions {
packageName: string;
resizeableActivity: boolean;
maxAspectRatio: string;
orientation: {
landscapeRight: boolean;
landscapeLeft: boolean;
portrait: boolean;
upsideDown: boolean;
},
apiLevel: number;
appABIs: IAppABI[];
useDebugKeystore: boolean;
keystorePath: string;
keystorePassword: string;
keystoreAlias: string;
keystoreAliasPassword: string;
appBundle: boolean;
androidInstant: boolean;
inputSDK: boolean;
remoteUrl: string;
sdkPath: string;
ndkPath: string;
javaHome?: string;
javaPath?: 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; // 有效期
}

View File

@@ -0,0 +1,6 @@
/**
* 此文件由 ../../../../scripts/init.js 自动生成。
*/
export * from './../../../../../../resources/3d/engine/packages/native-pack-tool';

View File

@@ -0,0 +1,17 @@
import { InitialEditorData } from './private';
declare module 'cc/editor/new-gen-anim' {
import { editorExtrasTag } from 'cc';
interface PoseGraph {
[editorExtrasTag]?: {
rootOutputNodeEditorData?: InitialEditorData;
} & InitialEditorData;
}
namespace poseGraphOp {
interface PoseGraphNodeShell {
[editorExtrasTag]?: InitialEditorData;
}
}
}

View File

@@ -0,0 +1,7 @@
declare module 'vue/dist/vue.js' {
import Vue from 'vue';
export * from 'vue';
export default Vue;
}
declare module '@base/electron-i18n';

View File

@@ -0,0 +1,141 @@
import { AssetInfo, QueryAssetsOption, AssetOperationOption, IAssetMeta, IAssetInfo } from './public';
import { MissingAssetInfo } from '@editor/asset-db/libs/info';
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: [
urlOrUUIDOrPath: string, // uuid | url | path
dataKeys?: string[],
],
result: AssetInfo | null,
},
'query-missing-asset-info': {
params: [
urlOrPath: string, // uuid | path
],
result: MissingAssetInfo | 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: [
options?: QueryAssetsOption,
dataKeys?: (keyof IAssetInfo)[]
],
result: AssetInfo[],
},
'generate-available-url': {
params: [
string,
],
result: string,
},
}

View File

@@ -0,0 +1,14 @@
export { Asset, Importer, VirtualAsset } from '@editor/asset-db';
export interface MessageResult {
error: Error | null;
result: any;
}
export interface IMessage {
name: string;
args: any[];
}
export * from './public';
export * from './protected/global';
export * from './protected/asset';
export * from './protected/asset-handler';

View File

@@ -0,0 +1,269 @@
import { type } from 'os';
import { IAsset, IAssetInfo, VirtualAsset, Asset, IExportData } from './asset';
import { Migrate } from '@editor/asset-db/libs/importer';
export interface CustomOperator {
label?: string; // 处理方法名displayName 将会出现在一些文档定义上
operator: (...args: any[]) => any | Promise<any>;
public?: boolean; // 是否公开此方法在查询列表上
// 将来可能有的其他描述信息,比如图信息配置
};
export type ThumbnailSize = 'large' | 'small' | 'middle' | 'origin';
export interface Importer {
version: string; // 对用户可见的版本号影响数据迁移、meta 文件内的版本号
versionCode?: number; // 对内判断导入是否变化的版本号,用户不可见
/**
* 实际导入流程
* @param asset
*/
import(asset: VirtualAsset | Asset): Promise<boolean>;
// ---- 一些导入过程中需要的行为配置 ----
migrations?: Migrate[];
migrationHook?: MigrateHook;
afterSubAssetsImport?(asset: Asset): Promise<void>; //后续理论上是 createSubAsset 的时候可以监听它的 import 完成行为
/**
* 是否强制重新导入
* @param asset
*/
force?(asset: VirtualAsset | Asset): Promise<boolean>;
}
export interface IExportOptions {
debug: boolean;
compressUUID: boolean;
stripDefault: boolean;
canUseCache: boolean;
}
export interface Exporter {
// 导入接口,生成需要被放置在 importer 和 native 目录下的资源文件路径
// 其中:默认 import 的结果会按照 uuid 的剪裁路径拼接规则存放在 asset/import 目录下, native 同理
generateExportData?: (asset: IAsset, options?: Partial<IExportOptions>) => IExportData | Promise<IExportData>;
// 根据配置路径导出资源到目标目录下,内置了默认的拷贝行为,这个钩子主要用于处理 font 字体拷贝这类的
outputExportData?: (src: IExportData, dest: IExportData) => boolean | Promise<boolean>;
}
export type AssetHandler = AssetHandlerBase | CustomAssetHandler;
export interface CustomAssetHandler extends Partial<AssetHandlerBase> {
name: string;
// 继承的资源处理器名称
extends: string;
// 通过钩子,扩展已有的资源导入流程
importer?: ImporterHook | Importer;
}
export interface AssetHandlerBase extends CustomHandlerBase {
/**
* 资源的显示名称,支持 i18n:xxx
*/
displayName?: string;
/**
* 资源描述信息,支持 i18n:xxx
*/
description?: string;
/**
* 资源描述文档
*/
docURL?: string;
/**
* 检查文件是否适用于这个处理器
* @param asset
*/
validate?(asset: IAsset): Promise<boolean>;
// 资源导入行为处理
importer: Importer;
// 定义资源的导出行为,构建将会调用此处的方法
exporter?: Exporter;
// 对应导入资源在导入后的资源类型信息,未传递默认为 cc.Asset
assetType?: string;
// 指定资源的 userData 配置
userDataConfig?: {
// 用于 userData 默认值的渲染界面
default: Record<string, IUerDataConfigItem>;
/**
* 获取指定资源的 userData 配置,可选,如配置需要根据资源做差异化处理可以在此配置
* @return 自定义配置的定义,包括渲染定义
* @param asset
*/
generate?(asset: IAsset): Promise<Record<string, IUerDataConfigItem>>;
};
// 指定资源的缩略图信息默认值为必填项thumbnail 为可选性
iconInfo?: {
default: ThumbnailInfo;
/**
* 获取某个资源的预览图信息预览图地址icon 图标等)
* @return 缩略图信息
* @param asset
*/
generateThumbnail?(asset: IAsset): ThumbnailInfo | Promise<ThumbnailInfo>;
};
/**
* 资源创建信息
*/
createInfo?: {
generateMenuInfo(): ICreateMenuInfo[] | Promise<ICreateMenuInfo[]>;
/**
* 创建当前资源,可选,无此方法时走 db 默认创建资源的流程(需要提供模板地址)
* @param option
*/
create?(option: CreateAssetOptions): Promise<string | string[] | null>;
};
// 虚拟资源可以实例化成实体的话,会带上这个扩展名
instantiation?: string;
}
export interface ICreateMenuInfo extends Editor.Menu.ContextMenuItem {
// 新建菜单名称,支持 i18n:xxx
label: string;
// 创建的默认文件名称带后缀,具体实际上是为 assets 面板提供的数据assets 面板新建时,需要先让用户填写清楚命名最后才创建
fullFileName?: string;
// 资源模板地址,例如 db://xxx/ani ,支持 url 与绝对路径
template?: string;
// 创建类型的 handler 名称,默认为当前处理器名称
handler?: string;
// 创建子菜单
submenu?: ICreateMenuInfo[];
// 分组名称
group?: string;
}
export interface CustomHandlerBase {
name: string;
/**
* 打开资源文件行为
* @param asset
*/
open?(asset: IAsset);
/**
* 一些自定义的处理行为方法,方法 key 即 ID 是唯一的
* 同名方法将会警告并覆盖内部,如需复用内部处理行为可以通过 API 调用
*/
customOperationMap?: Record<string, CustomOperator>;
}
/**
* 扩展已有的资源处理器(Importer 保持原样)
*/
export interface CustomHandler extends CustomHandlerBase {
handlerList: string[];
// 通过钩子,扩展已有的资源导入流程
importer?: {
before: (asset: IAsset) => Promise<boolean>;
after: (asset: IAsset) => Promise<boolean>;
};
// ----------------- 资源基础操作相关 -------------------
// 通过钩子,扩展已有的资源导入流程,做一些本地化处理
importer?: ImporterHook;
/**
* 一些自定义的处理行为方法,方法 key 即 ID 是唯一的
* 同名方法将会警告并覆盖内部,如需复用内部处理行为可以通过 API 调用
*/
customOperationMap?: Record<string, CustomOperator>;
}
export interface ImporterHook {
before?: (asset: IAsset) => Promise<boolean>;
after?: (asset: IAsset) => Promise<boolean>;
}
export interface CreateAssetOptions {
// 资源创建的输出地址,支持绝对路径和 url
target: string;
// 资源处理器名称,决定了此新建资源将由哪个资源处理器处理
handler: string;
template?: string;
// 指定 uuid ,由于 uuid 也有概率冲突uuid 冲突时会自动重新分配 uuid
uuid?: string;
// 默认 false 不覆盖同名时文件将会重命名指定的 path
overwrite?: boolean;
// 新建资源时指定的一些 userData 默认配置值
userData?: Record<string, any>;
// 传递一些自定义配置信息,可以在自定义资源处理器内使用
customOptions?: Record<string, any>;
}
export interface CreateAssetDialogOptions {
// 与资源处理器一对一的处理行为
handler?: string;
// 使用 type 时,由于同一个 type 会对应多种的实体资源,默认取第一个匹配的创建行为
ccType?: string;
// 默认创建地址
url?: string;
// 默认的资源模板地址
template?: string;
}
export interface ExportAssetOptions {
customOptions?: Record<string, string>;
output: string;
}
export interface ThumbnailInfo {
type: 'icon' | 'image',
value: string; // 具体 icon 名字或者 image 路径image 路径支持绝对路径、 db:// 、 project:// 、和 packages:// 下的路径
}
export interface ICONConfig extends ThumbnailInfo {
// 是否支持缩略图,如存在可以单独像 db 查询缩略图信息
thumbnail?: boolean;
}
export interface IUerDataConfigItem {
key?: string; // 唯一标识符
// 配置显示的名字,如果需要翻译,则传入 i18n:${key}
label?: string;
// 设置的简单说明
description?: string;
// 默认值
default?: any;
// 配置的类型
type?: 'array' | 'object';
itemConfigs?: IUerDataConfigItem[] | Record<string, IUerDataConfigItem>;
render?: {
ui: string;
attributes?: Record<string, string | boolean | number>;
items?: Array<{
label: string;
value: string;
}>;
};
}
export interface IAssetConfig {
displayName?: string;
description?: string;
docURL?: string;
userDataConfig?: Record<string, IUerDataConfigItem>;
iconInfo?: ThumbnailInfo;
// 记录此资源的来源信息
from?: {
pkgName: string;
internal: boolean;
}
}

View File

@@ -0,0 +1,40 @@
import { Asset, VirtualAsset } from '@editor/asset-db';
export interface IRedirectInfo {
type: string; // 跳转资源的类型
uuid: string; // 跳转资源的 uuid
}
export interface IExportData {
import: {
type: 'buffer' | 'json';
path: string;
};
// 例如 { 'test.font': 'test.font' }
native?: Record<string, string>;
}
export * from '../public';
export * from './plugin';
export class VirtualAsset extends VirtualAsset {
/**
* 获取资源的导出数据
*/
getData: (name: 'output') => IExportData;
setData: (name: 'output', data: IExportData) => void;
}
export class Asset extends Asset, IVirtualAsset {};
export type IAsset = VirtualAsset | Asset;
export type QueryAssetType = 'asset' | 'script' | 'all';
export interface ISerializedOptions {
debug: boolean;
_exporting?: boolean;
dontStripDefault?: boolean;
}
export type SerializedAsset = string | object | CCON;

View File

@@ -0,0 +1,47 @@
import { AssetDB } from "@editor/asset-db";
import { Meta } from "@editor/asset-db/libs/meta";
import { deprecate } from "util";
import { AssetInfo, IAssetWorkerInfo } from "../private";
import { IAsset } from './asset';
import { QueryAssetsOption } from '../public';
import EventEmitter from "events";
declare global {
const Manager: IAssetWorkerManager;
}
export declare class AssetManager extends EventEmitter {
queryAssetUsers(uuid: string): string[] | PromiseLike<string[]>;
queryAssetInfos: (options?: QueryAssetsOption, dataKeys?: string[]) => IAssetInfo[];
queryAssets: (options?: QueryAssetsOption) => IAsset[];
queryAsset: (uuid: string) => IAsset;
queryAssetProperty: (asset: IAsset, property: (keyof IAssetInfo | 'depends' | 'dependScripts' | 'dependedScripts')) => any;
queryAssetProperty: (asset: IAsset, property: 'depends') => string[];
queryAssetProperty: (asset: IAsset, property: 'library') => Record<string, string>;
queryAssetInfo: (uuid: string, dataKeys?: string[]) => Promise<IAssetInfo | null>;
queryAssetMeta: (uuid: string) => Meta | null;
queryDBAssetInfo: (name: string) => IAssetInfo | null;
queryAssetMtime: (uuid: string) => number | null;
queryAssetDependencies: (uuid: string, type: 'asset' | 'script' = 'asset') => Promise<string[]>;
encodeAsset: (asset: Asset | VirtualAsset) => IAssetInfo;
}
export interface IAssetWorkerManager {
/**
* @deprecated use `Manager.assetDBManager.assetDBMap` instead
*/
AssetWorker: Record<string, AssetDB>;
AssetInfo: IAssetWorkerInfo;
assetDBManager: {
pause(source: string): Promise<boolean>;
resume(): Promise<boolean>;
assetDBMap: Record<string, AssetDB>;
readonly ready: boolean;
},
Utils: {
url2uuid(url: string): string;
url2path(url: string): string;
path2url(url: string, dbName?: string): string;
},
assetManager: AssetManager;
}

View File

@@ -0,0 +1,191 @@
import { AssetInfo, AssetDBOptions, ExecuteAssetDBScriptMethodOptions, IAssetInfo } from '../public';
import { message as publicMessage } from '../message';
import { IData } from '@editor/asset-db/libs/data';
import { MissingAssetInfo } from '@editor/asset-db/libs/info';
import { QueryAssetType } from './asset';
import { CreateAssetDialogOptions, CreateAssetOptions, IAssetConfig, ICONConfig, ICreateMenuInfo, ThumbnailInfo, ThumbnailSize } from './asset-handler';
import { IMessage } from '../protected';
export interface message extends publicMessage {
/**
* 查询已被删除的资源信息
*/
'query-missing-asset-info': {
params: [
urlOrPath: string, // uuid | path
],
result: MissingAssetInfo | null,
},
/**
* 查询资源依赖的资源或脚本 uuid 数组
* @param url 资源的 uuid
* @param type 可选,指定查询的资源类型,默认 asset 可选值asset, script, all
*/
'query-asset-dependencies': {
params: [
string,
QueryAssetType | undefined
],
result: string[],
},
'query-asset-mtime': {
params: [
string
],
result: string | null,
},
/**
* 查询资源被哪些资源或脚本直接使用到
* @param url 资源的 uuid
* @param type 可选,指定查询的资源类型,默认 asset 可选值asset, script, all
*/
'query-asset-users': {
params: [
string,
QueryAssetType | undefined
],
result: string | null,
},
/**
* 查询资源的 data 信息
*/
'query-asset-data': {
params: [
string
],
result: IData | null,
},
/**
* 检查刷新所有的数据库
*/
'refresh': {
params: [],
result: void,
},
/**
* 检查是否已有资源处理任务
*/
'is-busy': {
params: [],
result: boolean,
},
/**
* 暂停资源处理
*/
'pause': {
params: [
string,
],
result: boolean,
},
/**
* 恢复资源处理
*/
'resume': {
params: [],
result: boolean,
},
'open-devtools': {
params: [],
result: void,
},
/**
* 查询指定名称的数据库信息
* @name 数据库名称
*/
'query-db-info': {
params: [
string,
],
result: AssetDBOptions,
},
/**
* 查询所有的数据库名称列表
*/
'query-db-list': {
params: [],
result: string[],
},
/**
* 指定类型弹出创建资源的对话框
* @param option CreateAssetDialogOptions
*/
'create-asset-dialog': {
params: [
option: CreateAssetDialogOptions
],
result: AssetInfo | null,
},
/**
* 将一个虚拟资源实例化成一个实体资源
* @param source 需要实例化的虚拟资源
* @param target 生成到到某个路径内
*/
'init-asset': {
params: [
string,
string,
],
result: AssetInfo | null,
},
/**
* 查询出所有的 importer
*/
'query-all-importer': {
params: [],
result: string[],
},
/**
* 查询出所有的 assetTypes
*/
'query-all-asset-types': {
params: [],
result: string[],
},
/**
* 执行指定的 db 脚本
*/
'execute-script': {
params: [ExecuteAssetDBScriptMethodOptions];
result: any;
},
'query-create-menu-list': {
params: [],
result: ICreateMenuInfo[];
},
'query-asset-thumbnail': {
params: [uuid: string, size?: number | ThumbnailSize],
result: ThumbnailInfo;
},
'query-icon-config-map': {
params: [],
result: Record<string, ICONConfig>;
},
'query-asset-config-map': {
params: [],
result: Record<string, IAssetConfig>;
},
'new-asset': {
params: [options: CreateAssetOptions],
result: AssetInfo;
},
/**
* 执行资源处理器内定义的自定义消息操作
*/
'execute-custom-operation': {
params: [handlerName: string, operate: string, ...args: any[]],
result: any;
},
/**
* 批量消息
* @param messageList 需要批量操作的消息,可能是一个消息也可能是多个
* @param parallelism 是否支持并行操作
*/
'batch-message-handler': {
params: [
messageList: IMessage[],
parallelism?: boolean,
],
result: any[];
}
}

View File

@@ -0,0 +1,110 @@
import { AssetDBOptions } from '@editor/asset-db/libs/asset-db';
import { IAssetWorkerInfo } from '../private';
export interface IAssetDBInfo extends AssetDBOptions {
// 当前数据库的启动状态
state: 'none' | 'start' | 'startup' | 'refresh'; // 是否已启动
// 数据库是否可见
visible: boolean;
// 提前预导入的资源后缀,将会在 afterPreStart 之前完成预导入的资源
preImportExtList: string[];
}
export type AssetDBHookType =
'beforeInit' | 'afterInit'
| 'beforePreStart' | 'afterPreStart'
| 'beforeReady' | 'afterReady'
| 'beforeStartDB' | 'afterStartDB'
| 'beforeStopDB' | 'afterStopDB'
| 'beforeRefresh' | 'afterRefresh'
;
export namespace GlobalHook {
/**
* 初始化资源进程环境的前后钩子,每次启动后仅调用一次
* @param info
*/
export function beforeInit(info: IAssetWorkerInfo): void | Promise<void>;
export function afterInit(info: IAssetWorkerInfo): void | Promise<void>;
/**
* 预启动所有数据库的前后钩子,每次启动后仅调用一次
* 这对钩子,仅对编辑器内部使用
* @param assetDBInfoMap
*/
export function beforePreStart(assetDBInfoMap: Record<string, IAssetDBInfo>): void | Promise<void>;
export function afterPreStart(assetDBInfoMap: Record<string, IAssetDBInfo>): void | Promise<void>;
/**
* 所有数据库 ready 的前后钩子,每次启动后仅调用一次
*/
export function beforeReady(): void | Promise<void>;
export function afterReady(): void | Promise<void>;
/**
* 刷新所有所有数据库的前后钩子,将会调用多次
*/
export function beforeRefresh(): void | Promise<void>;
export function afterRefresh(): void | Promise<void>;
}
export namespace MountHook {
// --------------- 在数据库全部启动后, 针对单个数据库启动的钩子 -------------------
/**
* 在数据库全部启动后,新增启动某个数据库的前后钩子
* @param dbInfo
*/
export function beforeStartDB(dbInfo: IAssetDBInfo): void | Promise<void>;
export function afterStartDB(dbInfo: IAssetDBInfo): void | Promise<void>;
/**
* 在数据库全部启动后,单独关闭某个数据库的前后钩子
* @param dbInfo
*/
export function beforeStopDB(dbInfo: IAssetDBInfo): void | Promise<void>;
export function afterStopDB(dbInfo: IAssetDBInfo): void | Promise<void>;
}
export interface AssetDBMountInfo {
path: string;
name: string;
readonly?: boolean;
visible?: boolean;
enable?: string;
}
export interface ImporterRegisterInfo {
list: string[];
script: string;
}
export interface AssetHandlerInfo {
extnames: string[];
handler: string;
name: string;
}
/**
* package.json 内定义的扩展信息
*/
export interface AssetDBContribution {
script?: string; // db 脚本机制db 扩展机制主入口
'asset-handler': Array<AssetHandlerInfo>,
'global-hook'?: string[];
'mount-hook'?: string[];
// 注册的资源数据库信息
mount?: AssetDBMountInfo;
// ----------------- 3.9 已废弃 --------------------------
// 注册的导入器
importer?: ImporterRegisterInfo;
// 之前的插件机制,注册资源的打开信息
openMessage?: {
[importerName: string]: string;
};
}

View File

@@ -0,0 +1,152 @@
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;
}
// 如果使用了 datakeys 过滤,请使用此接口定义
export interface IAssetInfo {
name: 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
// dataKeys 作用范围
isBundle?: boolean; // 是否是文件夹
displayName?: string; // 资源用于显示的名字
readonly?: boolean; // 是否只读
visible?: boolean; // 是否显示
subAssets?: { [key: string]: IAssetInfo }; // 子资源 map
// 虚拟资源可以实例化成实体的话,会带上这个扩展名
instantiation?: string;
redirect?: IRedirectInfo; // 跳转指向资源
meta?: IAssetMeta,
fatherInfo?: any;
extends?: string[]; // 资源的继承链信息
mtime?: number; // 资源文件的 mtime
depends?: string[]; // 依赖的资源 uuid 信息
dependeds?: string[]; // 被依赖的资源 uuid 信息
}
export interface AssetOperationOption {
// 是否强制覆盖已经存在的文件,默认 false
overwrite?: boolean;
// 是否自动重命名冲突文件,默认 false
rename?: boolean;
}
// Basic information about the resource
// 资源的基础信息
export interface AssetInfo extends IAssetInfo {
// 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 {
ccType?: string | string[], // 'cc.ImageAsset' 这类,多个用数组
isBundle?: boolean, // 筛选 asset bundle 信息,搜索子包只能与 pattern 选项共存
importer?: string | string[], // 导入名称,多个用数组
pattern?: string, // 路径匹配globs 格式
extname?: string | string[], // 扩展名匹配,多个用数组
// 筛选一些符合 userData 配置的资源
userData?: Record<string, boolean | string | number>;
}
export interface AssetOperationOption {
// 是否强制覆盖已经存在的文件,默认 false
overwrite?: boolean;
// 是否自动重命名冲突文件,默认 false
rename?: boolean;
}
export interface AssetDBOptions {
name: string;
target: string;
library: string;
temp: string;
interval: number;
/**
* 0: 忽略错误
* 1: 仅仅打印错误
* 2: 打印错误、警告
* 3: 打印错误、警告、日志
* 4: 打印错误、警告、日志、调试信息
*/
level: number;
ignoreFiles: string[];
preImportExtList?: string[];
readonly: boolean;
visible: boolean;
ignoreGlob?: string;
}
export interface ExecuteAssetDBScriptMethodOptions {
name: string;
method: string;
args?: any[];
}

View File

@@ -0,0 +1,24 @@
/**
* 外部插件注册搜索方式指定返回的接口
*
* @export
* @interface SearchMenuItem
*/
export interface SearchMenuItem {
label: string;
key: string;
// handler 方法是外部扩展的搜索方法,返回 true 表示匹配搜索成功
// searchValue 表示 assets 面板输入的搜索内容asset 表示匹配搜索时的节点信息
handler: (searchVale: string, asset: any) => boolean | Promise<boolean>;
}
/**
* 外部插件注册扩展的入口
* 可以是搜索方式或限定搜索类型
*
* @export
* @interface SearchExtension
*/
export interface SearchExtension {
searchMenu: Function; // 搜索方式
}

View File

@@ -0,0 +1,7 @@
// 因为外围使用了 'vue/dist/vue.js' 否则不需要此声明文件
declare module 'vue/dist/vue.js' {
import Vue from 'vue';
export * from 'vue';
export default Vue;
}

View File

@@ -0,0 +1,2 @@
export * from './public';

View File

@@ -0,0 +1,12 @@
export interface message extends EditorMessageMap {
'open': {
params: [
panel: 'default' | 'build-bundle',
],
result: void,
},
'query-worker-ready': {
params: [],
result: boolean,
},
}

View File

@@ -0,0 +1,11 @@
import { IBuild, IBuildUtils, ITaskState } from './public';
import { InternalBuildResult } from './protected/build-result';
export * from './protected/asset-manager';
export * from './protected/import-map';
export * from './protected/options';
export * from './protected/build-result';
export * from './protected/build-plugin';
export * from './protected/bundle-config'
export * from './public';
export * from './protected/texture-packer';

View File

@@ -0,0 +1,85 @@
import { UUID } from '../public';
import { IInternalBuildOptions, IAssetInfo, IBuildSceneItem } from './options';
// ********************************* asset-manager *********************************
export class BuilderAssetCache {
// 场景资源的 assets 信息缓存
public readonly scenes: Array<IBuildSceneItem>;
// 脚本资源的 assets 信息缓存
public readonly scriptUuids: Array<string>;
// 除场景、脚本资源外的资源 assets uuid 缓存
public readonly assetUuids: Array<string>;
init: () => Promise<void>;
hasAsset: (uuid: string) => Promise<boolean>;
addAsset: (asset: IAsset) => void;
addInstance: (instance: any) => void;
clearAsset: (uuid: string) => void;
removeAsset: (uuid: string) => void;
getMeta: (uuid: string) => Promise<any>;
addMeta: (uuid: string, meta: any) => void;
getDependUuids: (uuid: string) => Promise<readonly string[]>;
getDependUuidsDeep: (uuid: string) => Promise<readonly string[]>;
/**
* 获取序列化文件
*/
getLibraryJSON: (uuid: string) => Promise<any>;
getSerializedJSON: (uuid: string, options: IInternalBuildOptions) => Promise<any>;
forEach: (type: string, handle: Function) => Promise<void>;
getInstance: (uuid: string) => Promise<any>;
outputAssetJson: (uuid: string, destDir: string, options: IInternalBuildOptions) => Promise<void>;
}
export type IUrl = string; // 需要的是符合 url 标准的字符串,例如 asset/script/text.ts
export type IAssetInfoMap = Record<UUID, IAssetInfo>;
export type IUuidDependMap = Record<UUID, UUID[]>;
export type IJsonGroupMap = Record<UUID, IJSONGroupItem>;
export type IAssetGroupMap = Record<UUID, IAssetGroupItem>;
// TODO meta 的类型定义
export type IMetaMap = Record<UUID, any>;
export type IJsonMap = Record<UUID, any>;
export type IInstanceMap = Record<UUID, any>;
export type ICompressOptions = Record<string, number>;
export interface IAssetGroupItem {
// 分组名字
// name: string;
// 分组的根 url
baseUrls: string[];
// 脚本编译后的实际地址
scriptDest: string;
// 脚本 uuid 列表
scriptUuids: UUID[];
// raw 资源 uuid 列表
assetUuids: UUID[];
}
export interface IJSONGroupItem {
// 分组名字
name?: string;
// 分组名字
type: string;
// json 资源 uuid 列表
uuids: UUID[];
}
export interface IAssetGroupOptions {
// 脚本打包后的输出路径
scriptUrl: string;
baseUrl: string;
}
export type IGroupType = 'json' | 'script' | 'asset';
export type IUpdateType = 'asset-change' | 'asset-add' | 'asset-delete';
export interface IUpdateInfo {
type: IUpdateType;
uuid: string;
}

View File

@@ -0,0 +1,289 @@
// ********************************* plugin ****************************************
import {
IBuildPluginConfig,
IBuildTaskOption,
IDisplayOptions,
IConfigItem,
ISettings,
IVerificationRuleMap,
PlatformCompressConfig,
IBuildUtils,
IBuild,
ITaskState,
} from '../public';
import { BuilderAssetCache } from './asset-manager';
import { InternalBuildResult } from './build-result';
import { IInternalBuildOptions, IConsoleType } from './options';
import { ITextureCompressPlatform, ITextureCompressType } from '../public/texture-compress';
import { BundleCompressionType } from './bundle-config';
import { ImportMap } from './import-map';
import { IImportMapOptions, IPlatformType } from './options';
export interface IQuickSpawnOption {
cwd?: string;
env?: any;
downGradeWaring?: boolean; // 将会转为 log 打印,默认为 false
downGradeLog?: boolean; // 将会转为 debug 打印,默认为 true
downGradeError?: boolean; // 将会转为警告,默认为 false
ignoreLog?: boolean; // 忽略 log 信息
ignoreError?: boolean; // 忽略错误信息
prefix?: string; // log 输出前缀
}
export interface IInternalBuildUtils extends IBuildUtils {
/**
* 获取构建出的所有模块或者模块包文件。
*/
getModuleFiles(result: InternalBuildResult): Promise<string[]>;
/**
* 快速开启子进程
* @param command
* @param cmdParams
* @param options
*/
quickSpawn(command: string, cmdParams: string[], options?: IQuickSpawnOption): Promise<number | boolean>;
/**
* 将某个 hash 值添加到某个路径上
* @param targetPath
* @param hash
* @returns
*/
patchMd5ToPath(targetPath: string, hash: string): string;
/**
* 编译脚本,遇到错误将会抛出异常
* @param contents
* @param path
*/
compileJS(contents: Buffer, path: string): string;
}
export interface IInternalBuild extends IBuild {
Utils: IInternalBuildUtils;
debugMode: boolean; // 是否为调试模式,仅供开发使用,进程池开启的子进程打开 inspector 后会自动在第一行断点,任务管理器也可以随意组织
// ------------------ 开放的一些构建内置资源处理模块,供插件自由组合使用(持续更新中) ---------------------
ScriptBuilder: typeof ScriptBuilder;
}
export type IProcessingFunc = (process: number, message: string, state?: ITaskState) => void;
export interface IBuildManager {
taskManager: any;
currentCompileTask: any;
currentBuildTask: any;
__taskId: string;
}
// TODO 此接口似乎没有用到
export interface IBuildProcessInfo {
state: ITaskState; // 任务状态
progress: number; // 任务进度
message: string; // 最后一次更新的进度消息
id: string; // 任务唯一标识符
options: any; // 构建参数
}
export interface IScriptInfo {
file: string;
uuid: string;
}
type ICheckRule = 'pathExist' | 'valid' | 'required' | 'normalName' | 'noChinese' | 'array' | 'string' | 'number' | 'http';
export interface IBuildPanel {
// 内部使用的 Vue
Vue: any;
validator: {
has: (ruleName: string) => boolean;
// 通过返回空字符串,失败返回错误信息
checkRuleWithMessage: (ruleName: ICheckRule, val: any, ...arg: any[]) => Promise<string>;
check: (ruleName: ICheckRule, val: any, ...arg: any[]) => Promise<boolean>;
checkWithInternalRule: (ruleName: ICheckRule, val: any, ...arg: any[]) => boolean;
queryRuleMessage: (ruleName: ICheckRule) => string;
};
}
/**
* 构建内置的脚本编译模块,后续会开放更多的接口,供平台使用
*/
export declare class ScriptBuilder {
static outputImportMap(importMap: ImportMap, options: IImportMapOptions): Promise<void>;
}
export interface IBuildWorkerPluginInfo {
assetHandlers?: string;
// 注册到各个平台的钩子函数
hooks?: Record<string, string>;
pkgName: string;
internal: boolean; // 是否为内置插件
priority: number; // 优先级
// [platform][stageName]: ICustomBuildStageItem
customBuildStages?: {
[platform: string]: ICustomBuildStageItem[];
};
buildTemplate?: BuildTemplateConfig;
}
export type IPluginHookName =
| 'onBeforeBuild'
| 'onAfterInit'
| 'onBeforeInit'
| 'onAfterInit'
| 'onBeforeBuildAssets'
| 'onAfterBuildAssets'
| 'onBeforeCompressSettings'
| 'onAfterCompressSettings'
| 'onAfterBuild'
| 'onBeforeCopyBuildTemplate'
| 'onAfterCopyBuildTemplate'
| 'onError';
// | 'onBeforeCompile'
// | 'compile'
// | 'onAfterCompile'
// | 'run';
export type IPluginHook = Record<IPluginHookName, IInternalBaseHooks>;
export interface IInternalHook {
throwError?: boolean; // 插件注入的钩子函数,在执行失败时是否直接退出构建流程
title?: string; // 插件任务整体 title支持 i18n 写法
// ------------------ 钩子函数 --------------------------
onBeforeBuild?: IInternalBaseHooks;
onBeforeInit?: IInternalBaseHooks;
onAfterInit?: IInternalBaseHooks;
onBeforeBuildAssets?: IInternalBaseHooks;
onAfterBuildAssets?: IInternalBaseHooks;
onBeforeCompressSettings?: IInternalBaseHooks;
onAfterCompressSettings?: IInternalBaseHooks;
onAfterBuild?: IInternalBaseHooks;
onBeforeCopyBuildTemplate?: IInternalBaseHooks;
onAfterCopyBuildTemplate?: IInternalBaseHooks;
// ------------------ 其他操作函数 ---------------------
// 内置插件才有可能触发这个函数
run?: (dest: string, options: IBuildTaskOption) => Promise<boolean>;
// 内置插件才有可能触发这个函数
compile?: (dest: string, options: IBuildTaskOption) => boolean;
}
export type IInternalBaseHooks = (
options: IInternalBuildOptions,
result: InternalBuildResult,
cache: BuilderAssetCache,
...args: any[]
) => void;
export interface IBuildTask {
handle: (options: IInternalBuildOptions, result: InternalBuildResult, cache: BuilderAssetCache, settings?: ISettings) => {};
title: string;
name: string;
}
export type OverwriteCommonOption =
| 'buildPath'
| 'server'
| 'polyfills'
| 'mainBundleIsRemote'
| 'name'
| 'sourceMaps'
| 'experimentalEraseModules'
| 'buildStageGroup';
export interface ICustomBuildStageItem {
name: string; // 阶段唯一名称,同平台不允许重名
displayName?: string; // 阶段名称,显示在构建面板对应按钮以及一些报错提示上
description?: string; // 构建阶段描述,将会作为构建面板对应按钮上的 tooltip
hidden?: boolean; // 是否显示指定的控制按钮在构建列表,默认显示
parallelism?: 'none' | 'all' | 'other';
}
type IBuildStageItem<T> = T & ICustomBuildStageItem;
export interface MessageStageItem {
message?: Editor.Message.MessageInfo;
}
export interface HookStageItem {
hook?: string;
}
export interface IInternalBuildPluginConfig extends IBuildPluginConfig {
doc?: string; // 注册文档地址
platformName?: string; // 平台名,可以指定为 i18n 写法, 只有官方构建插件的该字段有效
icon?: string; // 平台 icon
displayName?: string; // 在构建面板上的显示名称,默认为插件名
hooks?: string; // 钩子函数的存储路径
panel?: string; // relate url about custom panel
// 仅对内部插件开放
textureCompressConfig?: PlatformCompressConfig;
buildTemplateConfig?: BuildTemplateConfig;
assetBundleConfig?: {
// asset bundle 的配置
supportedCompressionTypes: BundleCompressionType[];
platformType: IPlatformType;
};
priority?: number;
wrapWithFold?: boolean; // 是否将选项显示在折叠框内(默认 true
options?: IDisplayOptions; // 需要注入的平台参数配置
verifyRuleMap?: IVerificationRuleMap; // 注入的需要更改原有参数校验规则的函数
commonOptions?: Record<string, IConfigItem>; // 允许修改部分内置配置的界面显示方式
debugConfig?: IDebugConfig;
// 阶段性任务注册信息,由于涉及到按钮排序问题,需要指定为数组
customBuildStages?: Array<IBuildStageItem<MessageStageItem> | IBuildStageItem<HookStageItem>>;
internal?: boolean; // 注册后,构建插件赋予的标记,插件指定无效
}
export interface BuildTemplateConfig {
// 构建模板的配置
templates: {
path: string;
// 输出地址的相对路径
destUrl: string;
}[];
displayName?: string;
version: string;
}
export interface ICustomBuildStageDisplayItem extends IBuildStageItem<MessageStageItem> {
groupItems: IBuildStageItem<MessageStageItem>[]; // 是否是复合按钮
inGroup: boolean;
lock?: boolean; // 是否锁定,用于界面防止重复点击
}
export interface BuildCheckResult {
error: string;
newValue: any;
level: IConsoleType;
}
export type IBuildVerificationFunc = (value: any, options: IBuildTaskOption) => boolean | Promise<boolean>;
export interface IDebugConfig {
options?: IDisplayOptions; // 显示在构建平台编译运行调试工具上的配置选项
custom?: string; // 显示在构建平台编译运行调试工具上的配置 vue 组件
}
export interface ICompInfo {
displayName?: string;
doc?: string;
custom?: any;
options?: IDisplayOptions;
panelInfo?: PanelInfo;
wrapWithFold: boolean;
// ..... 初始化时未存在的字段 .....
panel?: any; // 实例化后的 panel 对象
pkgName?: string; // 插件名称
}
// 构建平台下架状态
export interface IPlatformDelisted {
status: 'preDelisted' | 'delisted'; // 状态
message: string; // 默认下架提示信息
[key: string]: string; // 对应语言的下架提示信息。例如 message_zh
}

View File

@@ -0,0 +1,260 @@
import { BundleCompressionType, IAssetPathInfo, IBuildPaths, IBuildTaskOption, IBundleConfig, IJsonPathInfo, ISettings, UUID, IBuildSceneItem, ITextureCompressType, ITextureCompressFormatType } from '../public';
import { IAssetInfo, BuilderAssetCache } from './asset-manager';
import { ImportMapWithImports } from './import-map';
import { IInternalBuildOptions } from '../protect';
// 已经约定好的一些统计 key (不完整)
export const enum BuildMetricKey {
platform = 'B100001',
gameName = 'B100004',
packageName = 'B100005',
sceneNum = 'B100006',
scriptNum = 'B100007',
assetNum = 'B100008',
includeModules = 'B100009',
size = 'B100010',
server = 'B100012',
orientation = 'B100011',
is3D = 'B100014',
sceneOrPrefab = 'B100016',
audioClip = 'B100038',
appid = 'B100013',
dimension = 'B100014',
meshNum = 'B100015',
prefabNum = 'B100016',
useSplashScreen = 'B100018',
designResolution = 'B100017',
buildTime = 'B100042',
makeTime = 'B100043',
error = 'B100044',
customCompress = 'B100145',
renderPipeline = 'B100031',
splashSettings = 'B100039',
}
export const enum BuildCrashMetricKey {
platform = 'B100000',
projectId = 'B100002',
gameName = 'B100003',
packageName = 'B100004',
sceneNum = 'B100005',
scriptNum = 'B100006',
assetNum = 'B100007',
includeModules = 'B100008',
appid = 'B100009',
}
export class TextureCompress {
_taskMap: Record<string, IImageTaskInfo>;
platform: string;
async init(): Promise<void>;
async updateUserConfig(): Promise<void>;
addTask(assetInfo: IAssetInfo): IImageTaskInfo;
async run(): Promise<void>;
}
export enum BuiltinBundleName {
RESOURCES = 'resources',
MAIN = 'main',
START_SCENE = 'start-scene',
INTERNAL = 'internal',
}
export interface IBundleManager {
bundleMap: Record<string, IBundle>;
bundles: IBundle[];
destDir: string;
scriptBuilder: ScriptBuilder;
packResults: PacInfo;
cache: BuilderAssetCache;
hookMap: Record<string, string>;
buildAsset(): Promise<void>;
initBundle(): Promise<void>;
initAsset(): Promise<void>;
buildScript(): Promise<any>;
outputBundle(): Promise<void>;
bundleDataTask(): Promise<void>;
runPluginTask(hookName: string): Promise<void>;
}
export class IBuildTemplate {
query(name: string): string | null;
initUrl(relativeUrl: string, name?: string): string | undefined;
copyTo(dest: string): Promise<void>;
findFile(dest: string): string | undefined;
}
export class InternalBuildResult {
settings: ISettings;
// 脚本资源包分组(子包/分包)
scriptPackages: string[];
// MD5 后缀 map
pluginVers: Record<UUID, string>;
importMap: ImportMapWithImports;
// 传入构建的 options
rawOptions: IBuildTaskOption;
// 输出路径集合
paths: IBuildPaths;
// 允许的自定义编译选项
compileOptions?: any;
staticsInfo: Record<string, any>;
// addPlugin: (plugin: UUID) => void;
// removePlugin: (plugin: UUID) => void;
}
export interface ICompressConfig {
src: string;
mipmapFiles?: string[];
dest: string;
compressOptions: Record<string, any>;
format: ITextureCompressType;
customConfig?: ICustomConfig;
uuid: string;
suffix: string;
formatType: ITextureCompressFormatType;
}
export interface ImageCompressTask {
src: string;
// 需要预生成的 mipmaps 源地址
mipmapFiles?: string[];
presetId: string;
compressOptions: Record<string, any>;
// suffixMap: Record<string, string>;
dest?: string[]; // 纹理压缩生成后,会将地址输出在此
suffix?: string[];
mtime?: any;
}
export interface IImageTaskInfo {
src: string;
presetId: string;
hasAlpha: boolean;
mtime: string | number;
hasMipmaps: boolean;
compressOptions: Record<string, any>;
// 不同纹理压缩类型的生成压缩地址
dest: string[];
suffix: string[];
dirty?: boolean;
}
export interface ISuffixMap {
native: Record<string, string[]>;
import: Record<string, string[]>;
}
export interface IVersionMap {
import: Record<UUID, string>;
native: Record<UUID, string>;
}
export interface IMD5Map {
'raw-assets': Record<UUID, string>;
import: Record<UUID, string>;
plugin?: Record<UUID, string>;
}
export interface IAtlasResult {
assetsToImage: Record<string, string>;
imageToAtlas: Record<string, string>;
atlasToImages: Record<string, string[]>;
}
export class IBuilder {
cache: BuilderAssetCache;
result: InternalBuildResult;
options: IInternalBuildOptions;
bundleManager: IBundleManager;
hooksInfo: IBuildHooksInfo;
buildTemplate: IBuildTemplate;
updateProcess(message: string, increment?: number): void;
}
export interface IBuildHooksInfo {
pkgNameOrder: string[];
infos: Record<string, { path: string; internal: boolean }>;
}
export class IBundle {
readonly scenes: IBuildSceneItem[]; // 该 bundle 中的所有场景,包含重定向的
readonly assets: UUID[]; // 该 bundle 中的所有资源,包含重定向的
readonly assetsWithoutRedirect: UUID[]; // 该 bundle 中的未重定向的资源
readonly scripts: UUID[]; // 该 bundle 中的所有参与编译的脚本(不包含插件脚本)
readonly rootAssets: UUID[]; // 该 bundle 中的根资源,即直接放在 bundle 目录下的资源,包含重定向的资源
readonly isSubpackage: boolean; // 该 bundle 是否是子包
root: string; // bundle 的根目录, 开发者勾选的目录,如果是 main 包,这个字段为 ''
dest: string; // bundle 的输出目录
importBase: string;
nativeBase: string;
scriptDest: string; // 脚本的输出地址
name: string; // bundle 的名称
priority: number; // bundle 的优先级
compressionType: BundleCompressionType; // bundle 的压缩类型
assetVer: IVersionMap; // bundle 内的资源版本
version: string; // bundle 本身的版本信息
readonly isRemote: boolean; // bundle 是否是远程包
redirect: Record<UUID, string>; // bundle 中的重定向资源
deps: Set<string>; // bundle 的依赖 bundle
groups: IGroup[]; // 该 bundle 中的资源分组
configOutPutName: string;
config: IBundleConfig; // 该 bundle 的资源清单
readonly isZip: boolean; // 该 bundle 是否是 zip 模式
zipVer: string; // Zip 压缩模式,压缩包的版本
// 存储纹理压缩 image uuid 与对应的纹理资源地址
public compressRes: Record<string, string[]> = {};
atlasRes: IAtlasResult;
compressTask: Record<UUID, IImageTaskInfo> ;
_rootAssets: Set<UUID>; // 该 bundle 直接包含的资源
_scenes: Record<string, IBuildSceneItem>;
_scripts: Set<UUID>; // 所有脚本,包含插件脚本
_assets: Set<UUID>;
output: boolean;
md5Cache: boolean;
debug: boolean;
public paths: Record<string, string[]> = {};
// addScene(scene: UUID): void;
// addScript(script: UUID): void;
build(): void;
initConfig(): void;
initAssetPaths(): Promise<void>;
addRootAsset(asset: IAssetInfo): void;
addAsset(asset: IAssetInfo): void;
removeAsset(asset: UUID): void;
addRedirect(asset: UUID, redirect: string): void;
addAssetWithUuid(asset: UUID): void;
getRedirect(uuid: UUID): string | undefined;
addGroup(type: IJSONGroupType, uuids: UUID[]): void;
addToGroup(type: IJSONGroupType, uuid: UUID): void;
removeFromGroups(uuid: UUID): void;
containsAsset(uuid: string, deep?: boolean): boolean;
}
export type ICompressImageResult = Record<UUID, {
formats: string[],
files: string[],
}>;
export interface IGroup {
// 分组名字
name: string;
// 分组类型
type: IJSONGroupType;
// 该组中的资源 uuid 列表
uuids: UUID[];
}
export type IJSONGroupType = 'NORMAL' | 'TEXTURE' | 'IMAGE';
export interface IDefaultGroup {
assetUuids: UUID[];
scriptUuids: UUID[];
jsonUuids: UUID[];
}

View File

@@ -0,0 +1,62 @@
import { BundleCompressionType } from '../public';
export type BundlePlatformType = 'native' | 'miniGame' | 'web';
export type BundleConfigProperty = 'compressionType' | 'isRemote';
export const enum BundleCompressionTypes {
NONE = 'none',
MERGE_DEP = 'merge_dep',
MERGE_ALL_JSON = 'merge_all_json',
SUBPACKAGE = 'subpackage',
ZIP = 'zip',
}
export const enum BuiltinBundleName {
RESOURCES = 'resources',
MAIN = 'main',
START_SCENE = 'start-scene',
INTERNAL = 'internal',
}
export interface PlatformBundleConfig {
platformName: string;
platformType: BundlePlatformType;
supportOptions: Record<string, any[]>;
}
export interface BundleRenderConfig {
platformTypeInfo: PlatformTypeInfo;
platformConfigs: Record<string, PlatformBundleConfig>;
maxOptionList: Record<string, any[]>;
// 当所有平台的选项都一致时,不添加 minOptionList
minOptionList?: Record<string, any[]>;
// TODO 平台插件注册 config 机制
}
export interface PlatformTypeInfo {
icon: string;
displayName: string;
}
export interface CustomBundleConfigItem {
preferredOptions?: {
isRemote: boolean;
compressionType: BundleCompressionType;
},
fallbackOptions?: {
compressionType: BundleCompressionType;
isRemote?: boolean;
},
// 平台覆盖参数
overwriteSettings?: Record<string, overwriteSettingItem>;
// 配置模式,默认 auto 会自动根据优先级计算结果fallback 会使用 fallbackOptions
configMode?: 'auto' | 'fallback' | 'overwrite';
}
export interface CustomBundleConfig {
displayName: string;
configs: Record<BundlePlatformType, CustomBundleConfigItem>;
};
export interface BundleConfigItem {
isRemote?: boolean;
compressionType: BundleCompressionType;
}

View File

@@ -0,0 +1,19 @@
import { IBuildPanel, IInternalBuild } from './build-plugin';
// 定义 builder 进程内的全局变量
declare global {
// 构建进程可用
const Build: IInternalBuild;
const __manager: {
taskManager: any;
currentCompileTask: any;
currentBuildTask: any;
__taskId: string;
workerMg: any;
};
// 渲染进程可用
const BuildPanel: IBuildPanel;
}

View File

@@ -0,0 +1,7 @@
export interface ImportMap {
imports?: Record<string, string>;
scopes?: Record<string, Record<string, string>>;
}
export type ImportMapWithImports = ImportMap & { imports: NonNullable<ImportMap['imports']> };

View File

@@ -0,0 +1,58 @@
import { IBundleConfig, ISettings } from '../public/build-result';
import { IBuildTaskItemJSON, Platform } from '../public/options';
import { IPackOptions, PreviewPackResult } from './texture-packer';
export interface message extends EditorMessageMap {
'open-devtools': {
params: [],
result: void,
},
'generate-preview-setting': {
params: [options: IBuildTaskOption],
result: {
settings: ISettings;
script2library: Record<string, string>;
bundleConfigs: IBundleConfig[];
},
},
'query-tasks-info': {
params: [options?: { type: 'build' | 'bundle' }],
result: {
list: IBuildTaskItemJSON[],
queue: Record<string, IBuildTaskItemJSON>,
free: boolean,
},
},
/**
* 查询某个构建任务信息
*/
'query-task': {
params: [id: string],
result: IBuildTaskItemJSON,
},
/**
* 预览合图
* @param {object} pacUuid
*/
'preview-pac': {
params: [pacUuid: string, options?: IPackOptions],
result: PreviewPackResult | null,
},
'add-task': {
params: [options: IBuildTaskOption, shouldWait?: boolean],
result: TaskAddResult | BuildExitCode,
},
'preview-bundle-config': {
params: [config: CustomBundleConfigItem],
result: Record<string, { compressionType: BundleCompressionType, isRemote: boolean} >,
},
'query-platform-config': {
params: [],
result: {
order: Platform[];
native: Platform[];
config: Record<string, PlatformConfig>;
},
}
}

View File

@@ -0,0 +1,313 @@
import { StatsQuery, ConfigInterface } from '@cocos/ccbuild';
import { IPolyFills, IBuildDesignResolution, IBuildOptionBase, IBuildTaskOption, ITaskItemJSON, BundleCompressionType, IPhysicsConfig, IBundleOptions } from '../public';
import { IAssetInfo, IAssetMeta } from '../../../asset-db/@types/protected';
import { EngineInfo } from '../../../engine/@types/index';
export interface IBundleInternalOptions extends IBundleOptions {
dest: string, // bundle 的输出目录
scriptDest: string, // 脚本的输出地址
priority: number, // bundle 的优先级
compressionType: BundleCompressionType, // bundle 的压缩类型
isRemote: boolean // bundle 是否是远程包
bundleFilterConfig?: BundleFilterConfig[];
// isEncrypted: boolean // bundle 中的代码是否加密,原生平台使用
}
type PlatformType = StatsQuery.ConstantManager.PlatformType;
type IBuildTimeConstantValue = StatsQuery.ConstantManager.ValueType;
export interface ScriptAssetuserData {
isPlugin?: boolean;
isNative?: boolean;
loadPluginInNative?: boolean;
loadPluginInWeb?: boolean;
}
export interface fileMap {
src: string;
dest: string;
}
export type Physics = 'cannon' | 'ammo' | 'builtin';
export type Url = string; // 需要的是符合 url 标准的字符串
export type AssetInfoArr = Array<string | number>; // 固定两位或三位数组 [url,ccType,isSubAsset]
export const enum TaskAddResult {
BUSY,
SUCCESS,
PARAM_ERROR,
}
export interface BundleFilterConfig {
range: 'include' | 'exclude';
type: 'asset' | 'url';
patchOption?: {
patchType: 'glob' | 'beginWith' | 'endWith' | 'contain';
value: string;
};
assets?: string[];
}
export interface IBundleInitOptions extends IBundleOptions {
root: string, // bundle 的根目录, 开发者勾选的目录,如果是 main 包,这个字段为''
name: BuiltinBundleName | string, // bundle 的名称
priority: number, // bundle 的优先级
compressionType: BundleCompressionType, // bundle 的压缩类型
isRemote: boolean, // bundle 是否是远程包
md5Cache: boolean,
debug: boolean, // 是否压缩
output?: boolean, // 是否输出此 bundle 包(默认为 true
// isEncrypted: boolean // bundle 中的代码是否加密,原生平台使用
dest: string, // bundle 的输出目录
scriptDest: string, // 脚本的输出地址
}
export enum BuiltinBundleName {
RESOURCES = 'resources',
MAIN = 'main',
START_SCENE = 'start-scene',
INTERNAL = 'internal',
}
export interface IBuildScriptParam {
/**
* 若存在,表示将 import map 转换为指定的模块格式。
*/
importMapFormat?: 'commonjs' | 'esm';
polyfills?: IPolyFills;
/**
* 擦除模块结构。当选择后会获得更快的脚本导入速度,但无法再使用模块特性,如 `import.meta`、`import()` 等。
* @experimental
*/
experimentalEraseModules?: boolean;
outputName: string; // 输出文件夹名称(带后缀)
targets?: ITransformTarget;
system?: {
preset?: 'web' | 'commonjs-like',
},
flags: Record<string, IBuildTimeConstantValue>,
platform: PlatformType,
/**
* 是否开启模块热重载
* @default false
*/
hotModuleReload?: boolean;
commonDir: string;
bundleCommonChunk: boolean;
}
/**
* 模块保留选项。
* - 'erase' 擦除模块信息。生成的代码中将不会保留模块信息。
* - 'preserve' 保留原始模块信息。生成的文件将和原始模块文件结构一致。
* - 'facade' 保留原始模块信息,将所有模块转化为一个 SystemJS 模块,但这些模块都打包在一个单独的 IIFE bundle 模块中。
* 当这个 bundle 模块执行时,所有模块都会被注册。
* 当你希望代码中仍旧使用模块化的特性如动态导入、import.meta.url但又不希望模块零散在多个文件时可以使用这个选项。
*/
export type ModulePreservation = 'erase' | 'preserve' | 'facade';
export interface AssetSerializeOptions {
'cc.EffectAsset': {
glsl1: boolean;
glsl3: boolean;
glsl4: boolean;
};
// 是否输出 ccon 格式
exportCCON?: boolean;
}
export interface ISerializedOptions {
debug: boolean;
useCCONB?: boolean;
useCCON?: boolean;
_exporting?: boolean;
dontStripDefault?: boolean;
'cc.EffectAsset'?: {
glsl1: boolean;
glsl3: boolean;
glsl4: boolean;
};
}
export interface IBundleBuildOptions {
buildTaskIds?: string[];
taskName: string;
dest: string;
bundleConfigs: IBundleOptions[];
id?: string;
optionList?: IBuildTaskOption[];
logDest?: string;
}
export interface TransformOptions {
/**
* Babel plugins to excluded. Will be passed to as partial `exclude` options of `@babel/preset-env`.
*/
excludes?: Array<string | RegExp>;
/**
* Babel plugins to included. Will be passed to as partial `include` options of `@babel/preset-env`.
*/
includes?: Array<string | RegExp>;
targets?: ITransformTarget;
}
export interface IMD5Options {
// 填写需要过滤或者包含的路径匹配列表或者符合 glob 匹配规则的字符串
excludes: string[];
includes: string[];
replaceOnly: string[];
}
export interface IScriptOptions {
transform: TransformOptions;
debug: boolean;
sourceMaps: boolean;
hotModuleReload: boolean;
moduleFormat: rollup.ModuleFormat;
modulePreservation: ModulePreservation;
commonDir: string;
bundleCommonChunk: boolean;
}
export interface IImportMapOptions {
debug: boolean;
dest: string;
importMapFormat?: 'commonjs' | 'esm';
}
export type IPlatformType = 'native' | 'miniGame' | 'web';
export interface IInternalBuildOptions extends IBuildTaskOption {
dest: string;
// 编译 application.js 参数配置
appTemplateData: appTemplateData;
// 编译引擎参数配置
buildEngineParam: IBuildEngineParam;
// 编译脚本配置选项
buildScriptParam: IBuildScriptParam;
// 序列化打包资源时的特殊处理
assetSerializeOptions: AssetSerializeOptions;
// 配置添加 md5 后缀时需要过滤的路径匹配列表
md5CacheOptions: IMD5Options,
updateOnly: boolean;
generateCompileConfig?: boolean;
recompileConfig?: IRecompileConfig;
logDest: string; // log 输出地址
// 项目设置,重复定义为必选参数
includeModules: string[];
renderPipeline: string;
designResolution: IBuildDesignResolution;
physicsConfig: IPhysicsConfig;
flags?: Record<string, boolean>;
macroConfig?: Record<string, any>;
// 构建之前默认会清空构建目录,如不希望清空,请在 onBeforeInit 之前修改当前参数为 true
useCache?: boolean;
bundleConfigs?: IBundleInternalOptions[];
engineInfo: EngineInfo;
platformType: IPlatformType;
}
export interface appTemplateData {
debugMode: boolean;
renderMode: boolean; // !!options.renderMode,
// ImportMapSupported: boolean;
// NonconformingCommonJs: boolean;
showFPS: boolean;
importMapFile?: string;
resolution: {
policy: number;
width: number;
height: number;
};
// hasPhysicsAmmo: boolean;
md5Cache: boolean;
cocosTemplate?: string; // 注入的子模板路径
}
export interface IBuildEngineParam {
entry?: string; // 引擎入口文件
debug: boolean;
sourceMaps: boolean;
platform: PlatformType;
includeModules: string[];
engineVersion: string;
md5Map: string[];
engineName: string;
useCache: boolean;
split?: boolean;
targets?: ITransformTarget;
skip?: boolean;
nativeCodeBundleMode: 'wasm' | 'asmjs' | 'both';
assetURLFormat?:
| 'relative-from-out'
| 'relative-from-chunk'
| 'runtime-resolved';
baseUrl?: string;
flags?: Record<string, IBuildTimeConstantValue>;
output?: string;
preserveType?: boolean;
isNative?: boolean;
wasmCompressionMode?: 'brotli';
enableNamedRegisterForSystemJSModuleFormat?: boolean;
}
export type ITransformTarget = string | string[] | Record<string, string>;
export interface IAssetInfo extends IAssetInfo {
temp?: string; // 资源的构建缓存目录
fatherInfo?: any;
// fatherUuid?: string | undefined;
userData?: any;
dirty?: boolean;
meta: IAssetMeta;
subAssets: Record<string, IAssetInfo>;
mtime: number;
}
export interface IRecompileConfig {
enable: boolean;
generateAssets: boolean;
generateScripts: boolean;
generateEngine: boolean; // 是否生成引擎
generateEngineByCache: boolean; // 是否使用缓存引擎
}
export interface IStageTaskItemJSON extends ITaskItemJSON {
stage: string;
options: IBuildStageOptions;
type: 'build-stage',
}
export interface IBundleTaskItemJSON extends ITaskItemJSON {
options: IBundleBuildOptions;
type: 'bundle',
}
export interface IBuildStageOptions {
root: string;
platform: Platform;
taskId?: string;
nextStages?: string[];
buildTaskOptions?: IBuildTaskOption;
taskName?: string;
}
export const enum BuildExitCode {
PARAM_ERROR = 32,
BUILD_FAILED = 34,
BUILD_SUCCESS = 36,
BUILD_BUSY = 37,
UNKNOWN_ERROR = 50,
}

View File

@@ -0,0 +1,132 @@
export interface IPackOptions {
// size of packed image.
maxWidth: number;
maxHeight: number;
// padding of image.
padding: number;
allowRotation: boolean;
forceSquared: boolean;
powerOfTwo: boolean;
algorithm: string;
format: string;
quality: number;
contourBleed: boolean;
paddingBleed: boolean;
filterUnused: boolean;
removeTextureInBundle: boolean;
removeImageInBundle: boolean;
removeSpriteAtlasInBundle: boolean;
// TODO 平台压缩配置补全
compressSettings: Record<string, any>,
bleed: number;
mode: 'preview' | 'build';
}
export interface IPacInfo {
spriteFrames: any[];
relativePath: string;
relativeDir: string;
uuid: string;
path: string;
packOptions: IPackOptions;
}
export interface PreviewPackResult {
atlasImagePaths: string[];
unpackedImages: {imageUuid: string, libraryPath: string} [];
dirty: boolean;
}
export interface IInternalPackOptions {
// size of packed image.
maxWidth: number;
maxHeight: number;
// padding of image.
padding: number;
allowRotation: boolean;
forceSquared: boolean;
powerOfTwo: boolean;
algorithm: string;
format: string;
quality: number;
contourBleed: boolean;
paddingBleed: boolean;
filterUnused: boolean;
removeTextureInBundle: boolean;
removeImageInBundle: boolean;
removeSpriteAtlasInBundle: boolean;
// TODO 平台压缩配置补全
compressSettings: Record<string, any>,
bleed: number;
mode: 'preview' | 'build';
name: string;
destDir: string;
}
export interface IAutoAtlasUserData {
name: string;
bleed: number | boolean;
width: number;
height: number;
removeTextureInBundle: boolean;
removeImageInBundle: boolean;
removeSpriteAtlasInBundle: boolean;
filterUnused: boolean;
}
export interface IAtlasInfo {
spriteFrameInfos: ISpriteFrameInfo[];
width: number;
height: number;
name: string;
imagePath: string;
imageUuid: string;
textureUuid: string;
// TODO 这个字段目前没有使用,后续考虑删除
compressed: CompressedInfo;
}
export interface CompressedInfo {
suffixs: string[];
imagePathNoExt: string;
}
export interface ISpriteFrameInfo {
name: string;
uuid: string;
imageUuid: string;
textureUuid: string;
file: string;
trim: any;
rawWidth: number;
rawHeight: number;
width: number;
height: number;
originalPath: string;
rotated: boolean;
spriteFrame: any;
}
export interface IPackResult {
atlases: IAtlasInfo[];
unpackedImages: {imageUuid: string, libraryPath: string} [];
pacUuid: string;
}
export interface IStorePackInfo {
sharpMd5: string;
md5: string;
versionDev: string;
result?: IPackResult;
}
export interface ITrimInfo {
width: number;
height: number;
}

View File

@@ -0,0 +1,136 @@
import { ITextureCompressType, IPVRQuality, IASTCQuality, IETCQuality, ITextureFormatInfo } from './texture-compress';
import { IBuildTaskOption, IConsoleType } from './options';
import { IBuildResult } from './build-result';
export interface IBuildPluginConfig {
doc?: string; // document address
hooks?: string; // relate url about IHook
panel?: string; // relate url about custom panel
options?: IDisplayOptions; // config of options
verifyRuleMap?: IVerificationRuleMap;
}
export interface IBuildPluginProfile {
builder?: {
common?: Record<string, any>;
// { platform: options }
options?: Record<string, Record<string, any>>;
// id: options
taskOptionsMap?: Record<string, any>;
};
__version__: string;
// 旧版本的数据格式,已废弃
common?: Record<string, any>;
// { platform: options }
options?: Record<string, Record<string, any>>;
}
export type IVerificationFunc = (val: any, ...arg: any[]) => boolean | Promise<boolean>;
export type IInternalVerificationFunc = (val: any, ...arg: any[]) => boolean;
export type IVerificationRuleMap = Record<string, IVerificationRule>;
export interface IVerificationRule {
func: IVerificationFunc;
message: string;
}
export interface IInternalVerificationRule {
func: IInternalVerificationFunc;
message: string;
}
export type IDisplayOptions = Record<string, IConfigItem>;
export type ArrayItem = {
label: string;
value: string;
};
export interface IConfigItem {
key?: string; // 唯一标识符
// 配置显示的名字,如果需要翻译,则传入 i18n:${key}
label?: string;
// 设置的简单说明
description?: string;
experiment?: boolean; // 是否为实验性属性
// 默认值
default?: any;
// 配置的类型
type?: 'array' | 'object';
itemConfigs?: IConfigItem[] | Record<string, IConfigItem>;
verifyRules?: string[];
verifyKey?: string;
verifyLevel?: IConsoleType, // 不赋值是默认为 error等级为 error 时校验不通过将会无法点击构建,其他则仅做界面提示
hidden?: boolean; // 是否隐藏
render?: {
ui: string;
attributes?: Record<string, string | boolean | number>;
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 onError = IBaseHooks; // 构建发生中断错误时的回调,仅作为事件通知,并不能劫持错误
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>;
}
// ui-panel 注册数据
export interface PanelInfo {
$?: { [name: string]: string | HTMLElement | null };
template?: string; // TODO 暂时设置为可选
style?: string;
methods?: { [name: string]: Function };
ready?: Function;
close?: Function;
update?: (options: IBuildTaskOption, path: string, value: any) => void | Promise<void>;
}
export interface IPanelThis {
$: Record<string, HTMLElement>;
dispatch: (name: string, ...args: any[]) => void;
}
export interface IPanelInfo extends PanelInfo {
component?: any; // 注入面板的 vue 组件,可与与 options 共存options 会优先显示
customButton?: string; // 要注入的构建按钮 ui-panel 组件
}

View File

@@ -0,0 +1,188 @@
/**
* settings.js 里定义的数据
*/
import { ISplashSetting, ICustomJointTextureLayout, UUID, IPhysicsConfig, IOrientation } 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;
engine: {
debug: boolean;
macros: Record<string, any>;
customLayers: {name: string, bit: number}[];
sortingLayers: {id: number, name: string, value: number}[];
platform: string;
engineModules?: string[];
builtinAssets: string[];
};
physics?: IPhysicsConfig;
rendering: {
renderPipeline: string;
renderMode?: number;
// effect.bin
effectSettingsPath?: string;
};
assets: {
server: string;
remoteBundles: string[];
bundleVers: Record<string, string>;
preloadBundles: { bundle: string, version?: string }[];
importBase?: string;
nativeBase?: string;
subpackages: string[];
preloadAssets: string[];
jsbDownloaderMaxTasks?: number;
jsbDownloaderTimeout?: number;
projectBundles: string[];
downloadMaxConcurrency?: number;
};
plugins: {
jsList: string[];
};
scripting: {
scriptPackages?: string[];
};
launch: {
launchScene: string;
};
screen: {
frameRate?: number;
exactFitScreen: boolean;
orientation?: IOrientation;
designResolution: ISettingsDesignResolution;
};
splashScreen?: ISplashSetting;
animation: {
customJointTextureLayouts?: ICustomJointTextureLayout[];
};
profiling?: {
showFPS: boolean;
};
}
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 所在的目录,并不一定与构建目录对应)
effectBin?: string; // effect.bin 输出地址
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 文件地址
engineMeta: string; // 引擎构建结果的 meta 文件路径
plugins: Record<string, string>;
hashedMap: Record<string, string>; // 用于记录被编辑器添加过 md5 hash 值的路径 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, Array<UUID | number>>; // 该 bundle 中所有合并的 json, 参考以前 settings 中 packedAssets 的定义
versions: { import: Array<UUID | number>, native: Array<UUID | 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, Array<UUID | number>>;
/**
* 是否有需要预加载的脚本,默认为 `true`。
*/
hasPreloadScript: boolean;
dependencyRelationships: Record<string, Array<UUID | number>>;
}

View File

@@ -0,0 +1,6 @@
import { IBuild } from '.';
// 定义 builder 进程内的全局变量
declare global {
const Build: IBuild;
}

View File

@@ -0,0 +1,102 @@
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;
targets?: string;
}
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
isCommand: boolean; // 是否为命令行构建
}

View File

@@ -0,0 +1,358 @@
import * as babel from '@babel/core';
import { ITextureCompressPlatform, ITextureCompressType, PlatformCompressConfig } from './texture-compress';
import { IPlatformType } from '../protected';
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?: string; // 物理材质 uuid
useNodeChains: boolean; // true
collisionMatrix: ICollisionMatrix;
physicsEngine: string;
physX?: {
notPackPhysXLibs: boolean;
multiThread: boolean;
subThreadCount: number;
epsilon: number;
};
}
// 物理配置
export interface ICollisionMatrix {
[x: string]: number;
}
export interface IVec3Like {
x: number;
y: number;
z: number;
}
export interface IPhysicsMaterial {
friction: number; // 0.5
rollingFriction: number; // 0.1
spinningFriction: number; // 0.1
restitution: number; // 0.1
}
export type IConsoleType = 'log' | 'warn' | 'error' | 'debug';
export type BreakType = 'cancel' | 'crashed' | 'refreshed' | 'interrupted' | '';
export type ICustomConsoleType = IConsoleType | 'group' | 'groupEnd' | 'groupCollapsed';
export interface IConsoleMessage {
type: ICustomConsoleType,
value: string;
num: number;
time: string;
}
export interface IPlatformConfig {
texture: PlatformCompressConfig;
type: IPlatformType;
name: string;
}
export interface IBuildOptionBase {
// packAutoAtlas: boolean;
taskName: string;
platform: Platform;
scenes: IBuildSceneItem[];
skipCompressTexture: boolean;
sourceMaps: boolean;
experimentalEraseModules: boolean;
bundleCommonChunk: boolean;
startScene: string;
// 构建后的游戏文件夹生成的路径
buildPath: string;
debug: boolean;
inlineSpriteFrames: boolean;
md5Cache: boolean;
// bundle 设置
mainBundleCompressionType: BundleCompressionType;
mainBundleIsRemote: boolean;
useBuiltinServer: boolean; // 使用内置的服务器地址,实验性功能
server?: string; // 服务器地址
startSceneAssetBundle: boolean; // 配置初始场景为远程包
bundleCommonJs?: string;
// 移除远程包 Bundle 的脚本, 小游戏平台将会自动勾选
moveRemoteBundleScript: boolean;
// 项目设置
includeModules?: string[];
renderPipeline?: string;
designResolution?: IBuildDesignResolution;
physicsConfig?: IPhysicsConfig;
flags?: Record<string, boolean>;
customLayers: { name: string, value: number }[];
sortingLayers: { id: number, name: string, value: number }[];
macroConfig?: Record<string, any>
// 是否使用自定义插屏选项
useSplashScreen?: boolean;
splashScreen: ISplashSetting;
/**
* 是否是预览进程发送的构建请求。
* @default false
*/
preview?: boolean;
buildMode?: 'normal' | 'bundle' | 'script';
}
export interface BundleFilterConfig {
range: 'include' | 'exclude';
type: 'asset' | 'url';
patchOption?: {
patchType: 'glob' | 'beginWith' | 'endWith' | 'contain';
value: string;
};
assets?: string[];
}
export interface IBundleOptions {
root: string, // bundle 的根目录, 开发者勾选的目录,如果是 main 包等内置 Bundle这个字段任意字符串均可
priority?: number, // bundle 的优先级
compressionType?: BundleCompressionType, // bundle 的压缩类型
isRemote?: boolean, // bundle 是否是远程包
output?: boolean, // 是否输出此 bundle 包(默认为 true
name: string;
// isEncrypted: boolean // bundle 中的代码是否加密,原生平台使用
dest?: string, // bundle 的输出目录
scriptDest?: string, // 脚本的输出地址
bundleFilterConfig?: BundleFilterConfig[];
}
/**
* 构建所需的完整参数
*/
export interface IBuildTaskOption extends IBuildOptionBase {
taskId?: string; // 指定构建任务 id可选
logDest?: string; // 任务的指定构建输出地址,可选
name: string;
outputName: string;
taskName: string;
polyfills?: IPolyFills;
buildScriptTargets?: string;
nextStages?: string[];
resolution: {
width: number;
height: number;
policy: number;
}
// 构建阶段性任务绑定分组
buildStageGroup?: Record<string, string[]>;
packages?: Record<string, any>;
id?: string; // 手动配置构建任务 id
// recompileConfig?: IRecompileConfig;
// 构建 Bundle 的指定包含传参,未传递时按照项目内所有 Bundle 的原始配置打包
// name 有一定的计算规则,作为选填项
bundleConfigs?: IBundleOptions[];
buildBundleOnly?: boolean; // 仅构建 Bundle
// 一些偏好设置选项
useBuildAssetCache?: boolean;
useBuildEngineCache?: boolean;
useBuildTextureCompressCache?: boolean;
useBuildAutoAtlasCache?: boolean;
__version__?: string;
overwriteProjectSettings?: {
macroConfig?: {
cleanupImageCache: string;
},
includeModules?: {
physics?: 'inherit-project-setting' | string;
'physics-2d'?: 'inherit-project-setting' | string;
'gfx-webgl2'?: 'inherit-project-setting' | 'on' | 'off';
[key: string]: 'inherit-project-setting' | string;
};
};
nativeCodeBundleMode: 'wasm' | 'asmjs' | 'both';
wasmCompressionMode?: 'brotli';
}
export interface IBundleTaskOption extends IBuildTaskOption {
dest: string;
}
export type UUID = string;
export interface ISplashSetting {
displayRatio: number;
totalTime: number;
watermarkLocation: 'default' | 'topLeft' | 'topRight' | 'topCenter' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
autoFit: boolean;
logo?: {
type: 'default' | 'none' | 'custom';
image?: string;
base64?: string;
}
background?: {
type: 'default' | 'color' | 'custom';
color?: ISplashBackgroundColor;
image?: string;
base64?: string;
}
}
export interface ISplashBackgroundColor {
x: number;
y: number;
z: number;
w: number ;
}
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;
policy?: number;
}
/**
* 构建使用的场景的数据
*/
export interface IBuildSceneItem {
url: string;
uuid: string;
}
export interface IPolyFills {
/**
* True if async functions polyfills(i.e. regeneratorRuntime) needs to be included.
* You need to turn on this field if you want to use async functions in language.
*/
asyncFunctions?: boolean;
/**
* If true, [core-js](https://github.com/zloirock/core-js) polyfills are included.
* The default options of [core-js-builder](https://github.com/zloirock/core-js/tree/master/packages/core-js-builder)
* will be used to build the core-js.
*/
coreJs?: boolean;
targets?: string;
}
export interface IBuildSystemJsOption {
dest: string;
platform: string;
debug: boolean;
sourceMaps: boolean;
hotModuleReload?: boolean;
}
interface ICompressPresetConfig {
name: string;
options: Record<ITextureCompressPlatform, Record<ITextureCompressType, { quality: number | string }>>;
}
export interface ITextureCompressConfigs {
userPreset: Record<string, ICompressPresetConfig>;
genMipmaps: boolean;
customConfigs: Record<string, ICompressPresetConfig>;
}
// **************************** options *******************************************
export type Platform =
| 'web-desktop'
| 'web-mobile'
| 'wechatgame'
| 'wechatprogram'
| 'oppo-mini-game'
| 'vivo-mini-game'
| 'huawei-quick-game'
| 'alipay-mini-game'
| 'taobao-creative-app'
| 'taobao-mini-game'
| 'mac'
| 'ios'
| 'linux'
// | 'ios-app-clip'
| 'android'
| 'ohos'
| 'openharmony'
| 'windows'
| 'xiaomi-quick-game'
| 'baidu-mini-game'
| 'bytedance-mini-game'
| 'cocos-play'
| 'huawei-agc'
| 'link-sure'
| 'qtt'
| 'fb-instant-games'
| 'cocos-runtime'
| 'xr-meta'
| 'xr-huaweivr'
| 'xr-pico'
| 'xr-rokid'
| 'xr-monado'
| 'ar-android'
| 'ar-ios'
| 'xr-spaces'
| 'xr-seed'
| 'online'
| 'xr-gsxr'
| 'xr-yvr'
| 'xr-htc'
| 'xr-iqiyi'
| 'xr-skyworth'
| 'xr-ffalcon'
| 'xr-nreal'
| 'xr-inmo'
| 'xr-lenovo'
;
export type BundleCompressionType = 'none' | 'merge_dep' | 'merge_all_json' | 'subpackage' | 'zip';
export type IModules = 'esm' | 'commonjs' | 'systemjs';
export interface ITransformOptions {
importMapFormat: IModules;
plugins?: babel.PluginItem[];
}
export type ITaskState = 'waiting' | 'success' | 'failure' | 'cancel' | 'processing' | 'none';
export interface ITaskItemJSON {
id: string;
progress: number;
state: ITaskState;
// 当前任务的主信息
message: string;
// 当前任务的详细日志信息
detailMessage?: string;
time: string;
}
export interface IBuildTaskItemJSON extends ITaskItemJSON {
stage: 'build' | string;
options: IBuildTaskOption;
dirty: boolean;
rawOptions?: IBuildTaskOption;
type: 'build',
}
export type IOrientation = 'auto' | 'landscape' | 'portrait';

View File

@@ -0,0 +1,129 @@
import { IDisplayOptions } from "./build-plugin";
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 type ITextureCompressFormatType = 'pvr' | 'jpg' | 'png' | 'etc' | 'astc' | 'webp';
export interface IHandlerInfo {
type: 'program' | 'npm' | 'function';
info: ICommandInfo | Function;
func?: Function;
}
export interface ITextureFormatConfig {
displayName: string;
options: IDisplayOptions;
formats: ITextureFormatInfo[]; // 未指定 formats 则当前格式 key 作为存储的格式 value
suffix: string;
// --------- 用于任务调度的参数配置 --------
// 是否支持同格式并行压缩
parallelism: boolean;
// 是否使用子进程开启
childProcess?: boolean;
}
export interface ITextureCompressConfig {
name: string;
textureCompressConfig: PlatformCompressConfig;
}
export interface AllTextureCompressConfig {
// 平台的纹理压缩支持配置
platformConfig: Record<string, ITextureCompressConfig>;
// 所有支持的纹理压缩格式信息
formatsInfo: Record<string, ITextureFormatInfo>;
// 用户的自定义纹理压缩配置
customFormats: Record<string, ITextureFormatInfo>;
// 配置的平台分组配置
configGroups: IConfigGroups;
// 默认的支持格式
defaultSupport: ISupportFormat;
textureFormatConfigs: Record<string, ITextureFormatConfig>;
}
export interface UserCompressConfig {
customConfigs: Record<string, ICustomConfig>;
defaultConfig: Record<string, {
name: string;
options: Record<string, Record<string, { quality: string | number}>>;
}>;
userPreset: Record<string, {
name: string;
options: Record<string, Record<string, { quality: string | number}>>;
// 平台覆盖配置
overwrite?: Record<string, Record<string, { quality: string | number}>>;
}>;
genMipmaps: boolean;
}
export interface PlatformCompressConfig {
platformType: ITextureCompressPlatform; // 注册的纹理压缩平台类型
support: ISupportFormat; // 该平台支持的纹理压缩格式,按照推荐优先级排列
}
export interface ICustomConfig {
id: string;
name: string;
path: string;
command: string;
format: string;
overwrite?: boolean;
num?: number;
}
export interface ICommandInfo {
command: string;
params?: string[];
path: string;
}
export interface ITextureFormatInfo {
displayName: string;
value: ITextureCompressType | string;
formatSuffix?: string;
alpha?: boolean;
formatType?: ITextureCompressFormatType;
handler?: IHandlerInfo;
custom?: boolean;
params?: string[];
}
export interface ISupportFormat {
rgb: ITextureCompressType[];
rgba: ITextureCompressType[];
}
export interface IConfigGroupsInfo {
defaultSupport?: ISupportFormat,
support: ISupportFormat,
displayName: string;
icon: string;
supportOverwrite?: boolean;
}
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';
export type ConfigType = 'options' | 'overwrite';

View File

@@ -0,0 +1,34 @@
/// <reference path='../../../@types/index'/>
export * from '@cocos/creator-types/editor/packages/builder/@types/protected';
import { IInternalBuildOptions } from '@cocos/creator-types/editor/packages/builder/@types/protected';
export type IOrientation = 'auto' | 'landscape' | 'portrait';
export type IDevToolsLaunchMethod = 'full' | 'lite';
export interface IOptions {
appid: string;
buildOpenDataContextTemplate: boolean;
orientation: IOrientation;
physX: {
notPackPhysXLibs: boolean;
multiThread: boolean;
subThreadCount: number;
epsilon: number;
use?: boolean;
};
subpackages?: { name: string, root: string }[];
wasmSubpackage: boolean;
devToolsLaunchMethod: IDevToolsLaunchMethod;
generatePreloadJsFileList: boolean;
}
export interface ITaskOption extends IInternalBuildOptions {
packages: {
'bytedance-mini-game': IOptions;
};
}

View File

@@ -0,0 +1 @@
/// <reference path='../../../@types/index'/>

View File

@@ -0,0 +1 @@
/// <reference path='../../../@types/index'/>

View File

@@ -0,0 +1,33 @@
export type logType = 'log' | 'warn' | 'error' | 'info';
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>;
export type IConsoleExtension = {
name: string,
key: string,
label: string,
value?: boolean,
show: boolean
}

View File

@@ -0,0 +1,8 @@
import { IDeviceItem } from './public';
export interface message extends EditorMessageMap {
'query': {
params: [],
result: IDeviceItem[],
},
}

View File

@@ -0,0 +1,12 @@
export interface IDevices {
deviceConfig: IDeviceItem[];
custom: IDeviceItem[];
enableDevice: Record<string, boolean>;
}
export interface IDeviceItem {
name: string;
width: number;
height: number;
ratio: number;
}

View 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;
}

View File

@@ -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,
}
}

View File

@@ -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']: [];
}

View File

@@ -0,0 +1,162 @@
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 const cce: any;
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;
// eslint-disable-next-line
export interface DecoderModuleOptions {
}
// eslint-disable-next-line
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;
}
}
}
declare const EditorExtends: any;

View File

@@ -0,0 +1,87 @@
// 这个文件用于记录导入器的各种类型定义,导出声明文件的时候将导出这个配置文件
export type ImageImportType = 'raw' | 'texture' | 'normal map' | 'sprite-frame' | 'texture cube';
/** 图片资源的 userData */
export interface ImageAssetUserData {
/** 图片类型 */
type: ImageImportType,
/** 垂直翻转 */
flipVertical?: boolean,
/** 消除透明伪影 */
fixAlphaTransparencyArtifacts?: boolean,
/** 是否为 RGBE */
isRGBE?: boolean,
/** 这个图片是不是拥有 alpha 通道 */
hasAlpha?: boolean,
/** 重定向的 uuidImageAsset 在编辑器内已隐藏,相关交互操作需要通过此参数重定向操作目标*/
redirect?: string,
visible?: boolean,
/** 是否翻转绿通道 */
flipGreenChannel?: boolean,
/**
* 部分资源导入后可能产生多张图像资源
*/
sign?: string;
alpha?: string;
}
export interface SpriteFrameAssetUserData extends SpriteFrameBaseAssetUserData {
isUuid?: boolean;
imageUuidOrDatabaseUri: string;
}
export interface SpriteFrameBaseAssetUserData {
trimType: string;
trimThreshold: number;
rotated: boolean;
offsetX: number;
offsetY: number;
trimX: number;
trimY: number;
width: number;
height: number;
rawWidth: number;
rawHeight: number;
borderTop: number;
borderBottom: number;
borderLeft: number;
borderRight: number;
packable?: boolean;
pixelsToUnit: number;
pivotX: number;
pivotY: number;
meshType: number;
vertices: SpriteFrameVertices;
}
export interface Texture2DAssetUserData extends TextureBaseAssetUserData {
isUuid?: boolean;
imageUuidOrDatabaseUri?: string;
}
export type WrapMode = 'repeat' | 'clamp-to-edge' | 'mirrored-repeat';
export type Filter = 'none' | 'nearest' | 'linear';
export interface TextureBaseAssetUserData {
wrapModeS: WrapMode;
wrapModeT: WrapMode;
minfilter: Filter;
magfilter: Filter;
mipfilter: Filter;
anisotropy: number;
}
export interface TextureCubeAssetUserData extends TextureBaseAssetUserData {
imageDatabaseUri?: string;
isRGBE: boolean;
mipBakeMode: number;
/**
* `0` 意味着默认。见 https://github.com/cocos-creator/3d-tasks/issues/2253
*/
faceSize?: number;
// 符号资源 uuid
sign?: string;
}

View File

@@ -0,0 +1,51 @@
import ScriptManager from './manager/script';
import NodeManager from './manager/node';
import ComponentManager from './manager/component';
import AssetManager from './manager/asset';
import DialogManager from './manager/dialog';
export declare const Script: ScriptManager;
export declare const Node: NodeManager;
export declare const Component: ComponentManager;
export declare const Asset: AssetManager;
export declare const Dialog: DialogManager;
import * as Uuid from './utils/uuid';
export declare const UuidUtils: typeof Uuid;
export declare let GeometryUtils: any;
export declare let PrefabUtils: any;
export declare let serialize: any;
export declare let serializeCompiled: any;
import { MissingClassReporter } from './missing-reporter/missing-class-reporter';
import { MissingObjectReporter } from './missing-reporter/missing-object-reporter';
export { walkProperties } from './missing-reporter/object-walker';
export declare const MissingReporter: {
classInstance: {
reporter: MissingClassReporter;
classFinder(id: any, data: any, owner: any, propName: any): any;
hasMissingClass: boolean;
reportMissingClass(asset: any): void;
reset(): void;
};
class: typeof MissingClassReporter;
object: typeof MissingObjectReporter;
};
export declare function init(): Promise<void>;
/**
* 启动各个管理器
*/
export declare function start(): void;
/**
* 关闭各个管理器
*/
export declare function stop(): void;
export declare function emit(name: string | symbol, ...args: string[]): void;
export declare function on(name: string | symbol, handle: (...args: any[]) => void): void;
export declare function removeListener(name: string | symbol, handle: (...args: any[]) => void): void;
declare global {
export const EditorExtends: typeof import('.');
export namespace cce {
namespace Utils {
const serialize: typeof import('./utils/serialize/index')['serialize'];
}
}
}
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/editor-extends/index.ts"],"names":[],"mappings":"AAIA,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,eAAO,MAAM,MAAM,eAAoB,CAAC;AACxC,eAAO,MAAM,IAAI,aAAkB,CAAC;AACpC,eAAO,MAAM,SAAS,kBAAuB,CAAC;AAC9C,eAAO,MAAM,KAAK,cAAmB,CAAC;AACtC,eAAO,MAAM,MAAM,eAAoB,CAAC;AAGxC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,eAAO,MAAM,SAAS,aAAO,CAAC;AAG9B,eAAO,IAAI,aAAa,EAAE,GAAG,CAAC;AAG9B,eAAO,IAAI,WAAW,EAAE,GAAG,CAAC;AAE5B,eAAO,IAAI,SAAS,EAAE,GAAG,CAAC;AAC1B,eAAO,IAAI,iBAAiB,EAAE,GAAG,CAAC;AAGlC,OAAO,EAAE,oBAAoB,EAAgB,MAAM,2CAA2C,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,eAAO,MAAM,eAAe;;;;;;;;;;CAI3B,CAAC;AAEF,wBAAsB,IAAI,kBAQzB;AAED;;GAEG;AACH,wBAAgB,KAAK,SAIpB;AAED;;GAEG;AACH,wBAAgB,IAAI,SAInB;AAID,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,QAE5D;AAED,wBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,QAEzE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,QAErF;AAED,OAAO,CAAC,MAAM,CAAC;IACX,MAAM,CAAC,MAAM,aAAa,EAAE,cAAc,GAAG,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,CAAC;QACjB,UAAiB,KAAK,CAAC;YACZ,MAAM,SAAS,EAAE,cAAc,yBAAyB,CAAC,CAAC,WAAW,CAAC,CAAC;SACjF;KACJ;CACJ"}

View File

@@ -0,0 +1,15 @@
export default class AssetManager {
/**
* 查询一个资源的 info 信息
* @param uuid
* @param callback
*/
queryAssetInfo(uuid: string, callback: Function): void;
/**
* 查询一个路径下的资源
* @param url
* @param callback
*/
getAssetInfoFromUrl(url: string): any;
}
//# sourceMappingURL=asset.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/manager/asset.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,YAAY;IAE7B;;;;OAIG;IACI,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IActD;;;;OAIG;IACI,mBAAmB,CAAC,GAAG,EAAE,MAAM;CAgBzC"}

View File

@@ -0,0 +1,64 @@
/// <reference types="node" />
import { EventEmitter } from 'events';
interface MenuItem {
component: Function;
menuPath: string;
priority: number;
}
export default class ComponentManager extends EventEmitter {
allow: boolean;
_menus: MenuItem[];
/**
* 添加一个组件的菜单项
* @param component
* @param path
* @param priority
*/
addMenu(component: Function, path: string, priority?: number): void;
/**
* 删除一个组件的菜单项
* @param component
*/
removeMenu(component: Function): void;
/**
* 查询已经注册的组件菜单项
*/
getMenus(): MenuItem[];
_map: {
[index: string]: any;
};
/**
* 新增一个组件
* 1. 调用Node的addComponent时会调用此方法
* 2. Node添加到场景树时会遍历身上的组件调用此方法
* @param uuid
* @param component
*/
add(uuid: string, component: any): void;
/**
* 删除一个组件
* 1. 调用Node的_removeComponent时会调用此方法,removeComponent会在下一帧调用_removeComponent,
* removeComponent会调用一些Component的生命周期函数而_removeComponent不会。
* 2. Node添加到场景树时会遍历身上的组件调用此方法
* @param uuid
*/
remove(uuid: string): void;
/**
* 清空全部数据
*/
clear(): void;
/**
* 获取一个指定的组件
* @param uuid
*/
getComponent(uuid: string): any;
/**
* 获取所有的组件数据
*/
getComponents(): {
[index: string]: any;
};
changeUUID(oldUUID: string, newUUID: string): void;
}
export {};
//# sourceMappingURL=component.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/manager/component.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,UAAU,QAAQ;IACd,SAAS,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,YAAY;IAEtD,KAAK,UAAS;IAKd,MAAM,EAAE,QAAQ,EAAE,CAAM;IAExB;;;;;OAKG;IACH,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAY5D;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,QAAQ;IAW9B;;OAEG;IACH,QAAQ;IAOR,IAAI,EAAE;QAAC,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,CAAM;IAKlC;;;;;;OAMG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG;IAYhC;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM;IAiBnB;;OAEG;IACH,KAAK;IASL;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM;IAIzB;;OAEG;IACH,aAAa;;;IAIb,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAe9C"}

View File

@@ -0,0 +1,32 @@
interface MessageDialogOptions {
title?: string;
detail?: string;
default?: number;
cancel?: number;
buttons?: string[];
}
export default class Dialog {
/**
* 信息弹窗
* @param message 显示的消息
* @param options 信息弹窗可选参数
* @param window 依附于哪个窗口(插件主进程才可使用)
*/
info(message: string, options?: MessageDialogOptions): Promise<unknown>;
/**
* 警告弹窗
* @param message 警告信息
* @param options 警告弹窗可选参数
* @param window 依附于哪个窗口(插件主进程才可使用)
*/
warn(message: string, options?: MessageDialogOptions): Promise<unknown>;
/**
* 错误弹窗
* @param message 错误信息
* @param options 错误弹窗可选参数
* @param window 依附于哪个窗口(插件主进程才可使用)
*/
error(message: string, options?: MessageDialogOptions): Promise<unknown>;
}
export {};
//# sourceMappingURL=dialog.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/manager/dialog.ts"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAID,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;IAYxD;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;IAYxD;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;CAW5D"}

View File

@@ -0,0 +1,48 @@
/// <reference types="node" />
import type { Node } from 'cc';
import { EventEmitter } from 'events';
export default class NodeManager extends EventEmitter {
allow: boolean;
_map: {
[index: string]: any;
};
/**
* 新增一个节点,当引擎将一个节点添加到场景树中,同时会遍历子节点,递归的调用这个方法。
* @param uuid
* @param node
*/
add(uuid: string, node: any): void;
/**
* 删除一个节点,当引擎将一个节点从场景树中移除,同时会遍历子节点,递归的调用这个方法。
* @param uuid
*/
remove(uuid: string): void;
/**
* 清空所有数据
*/
clear(): void;
/**
* 获取一个节点数据,查的范围包括被删除的节点
* @param uuid
*/
getNode(uuid: string): Node | null;
/**
* 获取所有的节点数据
*/
getNodes(): {
[index: string]: any;
};
/**
* 获取场景中使用了某个资源的节点
* @param uuid asset uuid
*/
getNodesByAsset(uuid: string): string[];
/**
* 获取所有在场景树中的节点数据
*/
getNodesInScene(): {
[index: string]: any;
};
changeNodeUUID(oldUUID: string, newUUID: string): void;
}
//# sourceMappingURL=node.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/manager/node.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAOtC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,YAAY;IAEjD,KAAK,UAAS;IAEd,IAAI,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAM;IAIpC;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IAY3B;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM;IAiBnB;;OAEG;IACH,KAAK;IAQL;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIlC;;OAEG;IACH,QAAQ;;;IAIR;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM;IAqC5B;;OAEG;IACH,eAAe;;;IAIf,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAelD"}

View File

@@ -0,0 +1,26 @@
/// <reference types="node" />
import { EventEmitter } from 'events';
export default class ScriptManager extends EventEmitter {
allow: boolean;
_map: {
[index: string]: Function[];
};
/**
* 将一个 ctor 放到一个脚本注册 class 的数组里
* @param uuid
* @param ctor
*/
add(uuid: string, ctor: Function): void;
/**
* 在 uuid 指向的脚本 ctor 数组里删除对应的 ctor
* @param uuid
* @param ctor
*/
remove(uuid: string, ctor: Function): void;
/**
* 获取指定模块内注册的 class 列表
* @param uuid
*/
getCtors(uuid: string): Function[];
}
//# sourceMappingURL=script.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/manager/script.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,YAAY;IAEnD,KAAK,UAAS;IAEd,IAAI,EAAE;QAAC,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;KAAC,CAAK;IAExC;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;IAYhC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;IAenC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM;CAGxB"}

View File

@@ -0,0 +1,13 @@
import { MissingReporter } from './missing-reporter';
export declare class MissingClassReporter extends MissingReporter {
report(): void;
reportByOwner(): void;
}
export declare const MissingClass: {
reporter: MissingClassReporter;
classFinder(id: any, data: any, owner: any, propName: any): any;
hasMissingClass: boolean;
reportMissingClass(asset: any): void;
reset(): void;
};
//# sourceMappingURL=missing-class-reporter.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"missing-class-reporter.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/missing-reporter/missing-class-reporter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAqFrD,qBAAa,oBAAqB,SAAQ,eAAe;IAErD,MAAM;IAQN,aAAa;CA6BhB;AAGD,eAAO,MAAM,YAAY;;oBAEL,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG;;8BAY/B,GAAG;;CAahC,CAAC"}

View File

@@ -0,0 +1,8 @@
import { MissingReporter } from './missing-reporter';
export declare class MissingObjectReporter extends MissingReporter {
root: any;
doReport(obj: any, value: any, parsedObjects: any, rootUrl: any, inRootBriefLocation: any): Promise<void>;
report(): void;
reportByOwner(): void;
}
//# sourceMappingURL=missing-object-reporter.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"missing-object-reporter.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/missing-reporter/missing-object-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA8BrD,qBAAa,qBAAsB,SAAQ,eAAe;IAEtD,IAAI,EAAE,GAAG,CAAC;IAEJ,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,GAAG;IA8E/F,MAAM;IA4BN,aAAa;CA+BhB"}

View File

@@ -0,0 +1,20 @@
export declare class MissingReporter {
outputLevel: 'debug' | 'warn' | 'error';
static INFO_DETAILED: string;
static getObjectType(obj: any): "component" | "prefab" | "scene" | "asset";
missingObjects: Set<unknown>;
missingOwners: Map<any, any>;
root: any;
report(): void;
reportByOwner(): void;
constructor(root?: any);
reset(): void;
stash(obj: any): void;
/**
* stashByOwner 和 stash 的区别在于stash 要求对象中有值stashByOwner 允许对象的值为空
* @param {any} [value] - 如果 value 未设置,不会影响提示信息,只不过提示信息可能会不够详细
*/
stashByOwner(owner: any, propName: any, value: any): void;
removeStashedByOwner(owner: any, propName: any): any;
}
//# sourceMappingURL=missing-reporter.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"missing-reporter.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/missing-reporter/missing-reporter.ts"],"names":[],"mappings":"AAEA,qBAAa,eAAe;IAExB,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAW;IAElD,MAAM,CAAC,aAAa,SAA8B;IAElD,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG;IAgB7B,cAAc,eAAa;IAG3B,aAAa,gBAAa;IAE1B,IAAI,EAAE,GAAG,CAAC;IAEV,MAAM;IACN,aAAa;gBAED,IAAI,CAAC,EAAE,GAAG;IAItB,KAAK;IAML,KAAK,CAAC,GAAG,EAAE,GAAG;IAId;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;IASlD,oBAAoB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;CAoBjD"}

View File

@@ -0,0 +1,43 @@
export declare class ObjectWalkerBehavior {
walk(obj: any, key: any, val: any): void;
root: any;
constructor(root: any);
parseObject(val: any): void;
parseCCClass(val: any, klass: any, props: any): void;
forIn(val: any): void;
forEach(val: any): void;
}
export declare class ObjectWalker extends ObjectWalkerBehavior {
iteratee: any;
parsedObjects: any;
parsedKeys: any;
ignoreParent: any;
ignoreSubPrefabHelper: any;
walked: Set<unknown>;
constructor(root: any, iteratee: any, options?: any);
walk(obj: any, key: any, val: any): void;
}
/**
* Traverse all objects recursively
* @param {Object} root
* @param {Function} iteratee
* @param {Object} iteratee.object
* @param {String} iteratee.property
* @param {Object} iteratee.value - per object will be navigated ONLY once in this parameter
* @param {Object[]} iteratee.parsedObjects - parsed object path, NOT contains the "object" parameter
*/
export declare function walk(root: any, iteratee: any): void;
/**
* Traverse all object's properties recursively
* @param {Object} root
* @param {Function} iteratee
* @param {Object} iteratee.object
* @param {String} iteratee.property - per object property will be navigated ONLY once in this parameter
* @param {Object} iteratee.value - per object may be navigated MORE than once in this parameter
* @param {Object[]} iteratee.parsedObjects - parsed object path, NOT contains the "object" parameter
* @param {Object} [options]
* @param {Boolean} [options.dontSkipNull = false]
*/
export declare function walkProperties(root: any, iteratee: any, options: any): void;
export declare function getNextProperty(parsedObjects: any, parsingObject: any, object: any): string;
//# sourceMappingURL=object-walker.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"object-walker.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/missing-reporter/object-walker.ts"],"names":[],"mappings":"AAIA,qBAAa,oBAAoB;IAC7B,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAEjC,IAAI,EAAE,GAAG,CAAC;gBAEE,IAAI,EAAE,GAAG;IAIrB,WAAW,CAAC,GAAG,EAAE,GAAG;IAwBpB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;IAU7C,KAAK,CAAC,GAAG,EAAE,GAAG;IAWd,OAAO,CAAC,GAAG,EAAE,GAAG;CAKnB;AAMD,qBAAa,YAAa,SAAQ,oBAAoB;IAClD,QAAQ,EAAE,GAAG,CAAC;IACd,aAAa,EAAE,GAAG,CAAC;IACnB,UAAU,EAAE,GAAG,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC;IAClB,qBAAqB,EAAE,GAAG,CAAC;IAE3B,MAAM,eAAa;gBAEP,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG;IAuBnD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;CAmCpC;AAGD;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,QAE5C;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,QAwBpE;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,UAiBlF"}

View File

@@ -0,0 +1,7 @@
/**
* 反序列化指定数据,并处理其中涉及的资源引用。
* @param serialized 序列化后的数据。
* @returns 反序列化的结果。
*/
export declare function deserializeFull(serialized: unknown): Promise<unknown>;
//# sourceMappingURL=deserialize.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/utils/deserialize.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,OAAO,oBAiCxD"}

View File

@@ -0,0 +1,18 @@
import { gfx } from 'cc';
interface IWritableArrayLike<T> {
length: number;
[index: number]: T;
}
export declare const calculateNormals: (positions: ArrayLike<number>, indices: ArrayLike<number>, out?: IWritableArrayLike<number>) => IWritableArrayLike<number>;
export declare const calculateTangents: (positions: ArrayLike<number>, indices: ArrayLike<number>, normals: ArrayLike<number>, uvs: ArrayLike<number>, out?: IWritableArrayLike<number>) => IWritableArrayLike<number>;
export declare function forEachFace(indices: ArrayLike<number>, primitiveMode: gfx.PrimitiveMode, callback: (faceIndices: number[]) => any): void;
export declare class MeshSplitInfo {
indices: number[];
jointSet: Set<number>;
primitiveMode: gfx.PrimitiveMode;
constructor(primitiveMode?: any);
}
export declare const splitBasedOnJoints: (joints: ArrayLike<number>, indices: ArrayLike<number>, primitiveMode: gfx.PrimitiveMode, capacity: number) => MeshSplitInfo[];
export declare function getUintArrayCtor(maxElement: number): Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor;
export {};
//# sourceMappingURL=geometry.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/utils/geometry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAGzB,UAAU,kBAAkB,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,cAQN,UAAU,MAAM,CAAC,WAAW,UAAU,MAAM,CAAC,QAAO,mBAAmB,MAAM,CAAC,+BAyBjG,CAAC;AAEL,eAAO,MAAM,iBAAiB,cAcP,UAAU,MAAM,CAAC,WAAW,UAAU,MAAM,CAAC,WAAW,UAAU,MAAM,CAAC,OACnF,UAAU,MAAM,CAAC,QAAO,mBAAmB,MAAM,CAAC,+BAgD3D,CAAC;AAEL,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,GAAG,QAoEjI;AAED,qBAAa,aAAa;IACf,OAAO,EAAE,MAAM,EAAE,CAAM;IACvB,QAAQ,cAAqB;IAE7B,aAAa,EAAE,GAAG,CAAC,aAAa,CAAC;gBAC5B,aAAa,MAAsC;CAGlE;AAED,eAAO,MAAM,kBAAkB,WAsBX,UAAU,MAAM,CAAC,WAAW,UAAU,MAAM,CAAC,iBAAiB,IAAI,aAAa,YAAY,MAAM,oBAyBjH,CAAC;AAEL,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,2EAIlD"}

View File

@@ -0,0 +1,17 @@
import { Component, Node, Prefab } from 'cc';
interface IAddPrefabInfoOption {
nodeFileIdGenerator?: (node: Node) => string;
compFileIdGenerator?: (comp: Component, index: number) => string;
}
/**
* 递归循环所有的子节点,执行 handle 方法
* @param {*} node
* @param {*} handle
*/
export declare function walkNode(node: Node, handle: (node: Node, isChild: boolean) => boolean | void, isChild?: boolean): void;
export declare function visitObjTypeReferences(node: Node, visitor: any): void;
export declare function addPrefabInfo(targetNode: Node, rootNode: Node, asset: Prefab, opts?: IAddPrefabInfoOption): void;
export declare function checkAndStripNode(node: Node, quiet?: boolean | undefined): Record<string, any>;
export declare function addPrefabInstance(node: Node): void;
export {};
//# sourceMappingURL=prefab.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"prefab.d.ts","sourceRoot":"","sources":["../../../source/editor-extends/utils/prefab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAKlE,UAAU,oBAAoB;IAC1B,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;IAC7C,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACpE;AAID;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,GAAC,IAAI,EAAE,OAAO,UAAQ,QAU3G;AAID,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,QAyB9D;AAyBD,wBAAgB,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,oBAAyB,QAoE7G;AAGD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAE,OAAO,GAAG,SAAqB,uBA6EnF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,QAQ3C"}

View File

@@ -0,0 +1,48 @@
import type { ValueType } from 'cc';
import { BufferBuilder, CCON } from 'cc/editor/serialization';
import { IArrayOptions, IClassOptions, ICustomClassOptions, IObjParsingInfo, PropertyOptions } from './parser';
export declare abstract class Builder {
constructor(options: IBuilderOptions);
abstract setProperty_Raw(owner: object, ownerInfo: IObjParsingInfo, key: string | number, value: any, options: PropertyOptions): void;
abstract setProperty_Class(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: IClassOptions): IObjParsingInfo;
abstract setProperty_CustomizedClass(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: ICustomClassOptions): IObjParsingInfo;
abstract setProperty_ValueType(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, value: ValueType, options: PropertyOptions): IObjParsingInfo | null;
abstract setProperty_TypedArray(owner: object, ownerInfo: IObjParsingInfo, key: string | number, value: any, options: PropertyOptions): void;
abstract setProperty_AssetUuid(owner: object, ownerInfo: IObjParsingInfo, key: string | number, uuid: string, options: PropertyOptions): void;
abstract setProperty_Array(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: IArrayOptions): IObjParsingInfo;
abstract setProperty_Dict(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: PropertyOptions): IObjParsingInfo;
abstract setProperty_ParsedObject(ownerInfo: IObjParsingInfo, key: string | number, valueInfo: IObjParsingInfo, formerlySerializedAs: string | null): void;
abstract setRoot(objInfo: IObjParsingInfo): void;
dump(): object | string | CCON;
protected abstract finalizeJsonPart(): any;
protected get hasBinaryBuffer(): boolean;
protected get mainBufferBuilder(): BufferBuilder;
private stringify;
private minify;
private _useCCON;
private _mainBufferBuilder;
private _dumpAsJson;
private _dumpAsCCON;
}
export interface IBuilderOptions {
builder?: 'dynamic' | 'compiled';
stringify?: boolean;
minify?: boolean;
noNativeDep?: boolean;
forceInline?: boolean;
/**
* Outputs as CCON.
*
* CCON denotes `Cocos Creator Object Notation`(let's imagine JSON as JavaScript Object Notation).
* It allows binary representation of some value but loses the readability.
*
* CCON can be represented as two formal:
* - JSON + Binary file(s)
* - Single Binary file
* However `serialize()` produces whole `CCON` and you could select a suitable formal.
* As Cocos Creator 3.3, the `useCCON` only be turned on
* when it's going to serialize `AnimationClip` into library or into production.
*/
useCCON?: boolean;
}
//# sourceMappingURL=base-builder.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"base-builder.d.ts","sourceRoot":"","sources":["../../../../source/editor-extends/utils/serialize/base-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG/G,8BAAsB,OAAO;gBACb,OAAO,EAAE,eAAe;IAoBpC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAGrI,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;IAGlJ,QAAQ,CAAC,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,eAAe;IAGlK,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,IAAI;IAEjL,QAAQ,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAE5I,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAE7I,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;IAGlJ,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe;IAGnJ,QAAQ,CAAC,wBAAwB,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAE1J,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAKhD,IAAI,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI;IAQ9B,SAAS,CAAC,QAAQ,CAAC,gBAAgB,IAAI,GAAG;IAE1C,SAAS,KAAK,eAAe,YAE5B;IAED,SAAS,KAAK,iBAAiB,kBAE9B;IAED,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,MAAM,CAAU;IAExB,QAAgB,QAAQ,CAAU;IAElC,OAAO,CAAC,kBAAkB,CAAuB;IAEjD,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,WAAW;CAQtB;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAEjC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,WAAW,CAAC,EAAE,OAAO,CAAC;IAGtB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}

View File

@@ -0,0 +1,53 @@
import { ValueType, deserialize } from 'cc';
import { Node, IRefsBuilder, TraceableDict } from './types';
import { PropertyOptions, IArrayOptions, IClassOptions, ICustomClassOptions, IObjParsingInfo } from '../parser';
import D = deserialize.Internal;
type Empty = D.Empty_;
import File = D.File_;
type IFileData = D.IFileData_;
type IRefs = D.IRefs_;
import { Builder, IBuilderOptions } from '../base-builder';
export declare const FORMAT_VERSION = 1;
declare namespace RefsBuilder {
class Impl implements IRefsBuilder {
private beforeOffsetRefs;
private afterOffsetRefs;
private ctx;
constructor(ctx: CompiledBuilder);
addRef(owner: Node, key: string | number, target: Node): number;
build(): IRefs | null;
}
}
export declare function reduceEmptyArray<T extends any[]>(array: T): T | Empty;
export default class CompiledBuilder extends Builder {
noNativeDep: boolean;
sharedUuids: TraceableDict<string>;
sharedStrings: TraceableDict<string>;
refsBuilder: RefsBuilder.Impl;
dependAssets: (string | number | Node)[];
private rootNode;
private normalNodes;
private advancedNodes;
private classNodes;
private data;
constructor(options: IBuilderOptions);
setProperty_Array(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: IArrayOptions): IObjParsingInfo;
setProperty_Dict(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: PropertyOptions): IObjParsingInfo;
setProperty_Class(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: IClassOptions): IObjParsingInfo;
setProperty_CustomizedClass(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, options: ICustomClassOptions): IObjParsingInfo;
setProperty_ParsedObject(ownerInfo: IObjParsingInfo, key: string | number, valueInfo: IObjParsingInfo, formerlySerializedAs: string | null): void;
setProperty_Raw(owner: object, ownerInfo: IObjParsingInfo, key: string | number, value: any, options: PropertyOptions): void;
setProperty_ValueType(owner: object | null, ownerInfo: IObjParsingInfo | null, key: string | number, value: ValueType, options: PropertyOptions): IObjParsingInfo | null;
setProperty_TypedArray(owner: object, ownerInfo: IObjParsingInfo, key: string | number, value: any, options: PropertyOptions): void;
setProperty_AssetUuid(owner: object, ownerInfo: IObjParsingInfo, key: string | number, uuid: string, options: PropertyOptions): void;
setRoot(objInfo: IObjParsingInfo): void;
private setDynamicProperty;
private collectInstances;
private dumpInstances;
private dumpInstanceTypes;
private dumpDependUuids;
finalizeJsonPart(): object | string;
}
export declare function getRootData(data: IFileData): IFileData[File.Instances];
export {};
//# sourceMappingURL=builder.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../../source/editor-extends/utils/serialize/compiled/builder.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,SAAS,EACT,WAAW,EACd,MAAM,IAAI,CAAC;AAMZ,OAAO,EAAa,IAAI,EAAwC,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EACH,eAAe,EACf,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,eAAe,EAClB,MAAM,WAAW,CAAC;AAInB,OAAO,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC;AAChC,KAAK,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;AAEtB,OAAO,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC;AAEtB,KAAK,SAAS,GAAG,CAAC,CAAC,UAAU,CAAC;AAE9B,KAAK,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;AAItB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAU3D,eAAO,MAAM,cAAc,IAAI,CAAC;AAKhC,kBAAU,WAAW,CAAC;IAWlB,MAAa,IAAK,YAAW,YAAY;QACrC,OAAO,CAAC,gBAAgB,CAA0B;QAClD,OAAO,CAAC,eAAe,CAA0B;QACjD,OAAO,CAAC,GAAG,CAAkB;oBAEjB,GAAG,EAAE,eAAe;QAIhC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,IAAI,GAAG,MAAM;QAqB/D,KAAK,IAAI,KAAK,GAAG,IAAI;KAuBxB;CACJ;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAErE;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAChD,WAAW,EAAE,OAAO,CAAC;IAErB,WAAW,wBAAqC;IAChD,aAAa,wBAAqC;IAElD,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC;IAI9B,YAAY,6BAAmC;IAE/C,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,aAAa,CAAmD;IACxE,OAAO,CAAC,UAAU,CAA0C;IAE5D,OAAO,CAAC,IAAI,CAAkD;gBAElD,OAAO,EAAE,eAAe;IAcpC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAC,IAAI,EAAE,SAAS,EAAE,eAAe,GAAC,IAAI,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;IAOnI,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAC,IAAI,EAAE,SAAS,EAAE,eAAe,GAAC,IAAI,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe;IAOpI,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAC,IAAI,EAAE,SAAS,EAAE,eAAe,GAAC,IAAI,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;IAQnI,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAC,IAAI,EAAE,SAAS,EAAE,eAAe,GAAC,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,eAAe;IAUrJ,wBAAwB,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,GAAC,IAAI,GAAG,IAAI;IAM7I,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAI1H,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAC,IAAI,EAAE,SAAS,EAAE,eAAe,GAAC,IAAI,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe,GAAC,IAAI;IAiBhK,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAWjI,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IASlI,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAMvC,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,gBAAgB;IAgDxB,OAAO,CAAC,aAAa;IAiCrB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,eAAe;IAkDvB,gBAAgB,IAAI,MAAM,GAAG,MAAM;CAiCtC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CActE"}

View File

@@ -0,0 +1,11 @@
import { deserialize } from 'cc';
import D = deserialize.Internal;
type IClass = D.IClass_;
type IMask = D.IMask_;
import { ClassNode, CustomClassNode } from './types';
export default function (classNodes: (ClassNode | CustomClassNode)[]): {
sharedClasses: (IClass | string)[];
sharedMasks: IMask[];
};
export {};
//# sourceMappingURL=create-class-mask.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"create-class-mask.d.ts","sourceRoot":"","sources":["../../../../../source/editor-extends/utils/serialize/compiled/create-class-mask.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACd,MAAM,IAAI,CAAC;AAGZ,OAAO,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC;AAEhC,KAAK,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC;AAExB,KAAK,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AA4JnF,MAAM,CAAC,OAAO,WAAU,UAAU,EAAE,CAAC,SAAS,GAAC,eAAe,CAAC,EAAE,GAAG;IAChE,aAAa,EAAE,CAAC,MAAM,GAAC,MAAM,CAAC,EAAE,CAAC;IACjC,WAAW,EAAE,KAAK,EAAE,CAAC;CACxB,CAkCA"}

View File

@@ -0,0 +1,7 @@
import { deserialize } from 'cc';
import D = deserialize.Internal;
type IFileData = D.IFileData_;
type IPackedFileData = D.IPackedFileData_;
export default function packJSONs(datas: IFileData[]): IPackedFileData;
export {};
//# sourceMappingURL=pack-jsons.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pack-jsons.d.ts","sourceRoot":"","sources":["../../../../../source/editor-extends/utils/serialize/compiled/pack-jsons.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACd,MAAM,IAAI,CAAC;AAGZ,OAAO,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC;AAShC,KAAK,SAAS,GAAG,CAAC,CAAC,UAAU,CAAC;AAE9B,KAAK,eAAe,GAAG,CAAC,CAAC,gBAAgB,CAAC;AAgL1C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,eAAe,CAwCrE"}

Some files were not shown because too many files have changed in this diff Show More