@galacean/engine-loader 1.4.0-alpha.3 → 1.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +24 -9
- package/dist/main.js.map +1 -1
- package/dist/module.js +24 -9
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +6 -4
- package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +16 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "1.4.0-
|
|
3
|
+
"version": "1.4.0-beta.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-core": "1.4.0-
|
|
22
|
-
"@galacean/engine-
|
|
23
|
-
"@galacean/engine-
|
|
21
|
+
"@galacean/engine-core": "1.4.0-beta.1",
|
|
22
|
+
"@galacean/engine-rhi-webgl": "1.4.0-beta.1",
|
|
23
|
+
"@galacean/engine-math": "1.4.0-beta.1"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"b:types": "tsc"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EngineObject, Entity } from "@galacean/engine-core";
|
|
2
|
-
import type { IBasicType,
|
|
2
|
+
import type { IBasicType, IClass, IEntity, IHierarchyFile, IMethodParams } from "../schema";
|
|
3
3
|
import { ParserContext } from "./ParserContext";
|
|
4
4
|
export declare class ReflectionParser {
|
|
5
5
|
private readonly _context;
|
|
@@ -7,13 +7,15 @@ export declare class ReflectionParser {
|
|
|
7
7
|
static registerCustomParseComponent(componentType: string, handle: Function): void;
|
|
8
8
|
constructor(_context: ParserContext<IHierarchyFile, EngineObject>);
|
|
9
9
|
parseEntity(entityConfig: IEntity): Promise<Entity>;
|
|
10
|
-
parseClassObject(item:
|
|
11
|
-
parsePropsAndMethods(instance: any, item: Omit<
|
|
12
|
-
parseMethod(instance: any, methodName: string, methodParams:
|
|
10
|
+
parseClassObject(item: IClass): Promise<any>;
|
|
11
|
+
parsePropsAndMethods(instance: any, item: Omit<IClass, "class">): Promise<any>;
|
|
12
|
+
parseMethod(instance: any, methodName: string, methodParams: IMethodParams): Promise<any>;
|
|
13
13
|
parseBasicType(value: IBasicType, originValue?: any): Promise<any>;
|
|
14
14
|
private _getEntityByConfig;
|
|
15
15
|
private static _isClass;
|
|
16
|
+
private static _isClassType;
|
|
16
17
|
private static _isAssetRef;
|
|
17
18
|
private static _isEntityRef;
|
|
18
19
|
private static _isComponentRef;
|
|
20
|
+
private static _isMethodObject;
|
|
19
21
|
}
|
|
@@ -23,7 +23,11 @@ export interface IColor {
|
|
|
23
23
|
export interface IHierarchyFile {
|
|
24
24
|
entities: Array<IEntity>;
|
|
25
25
|
}
|
|
26
|
-
export type
|
|
26
|
+
export type IMethod = {
|
|
27
|
+
params: Array<IBasicType>;
|
|
28
|
+
result?: IInstance;
|
|
29
|
+
};
|
|
30
|
+
export type IMethodParams = Array<IBasicType> | IMethod;
|
|
27
31
|
export interface IBasicEntity {
|
|
28
32
|
name?: string;
|
|
29
33
|
id?: string;
|
|
@@ -41,15 +45,9 @@ export interface IRefEntity extends IBasicEntity {
|
|
|
41
45
|
assetRefId: string;
|
|
42
46
|
key?: string;
|
|
43
47
|
isClone?: boolean;
|
|
44
|
-
modifications: {
|
|
48
|
+
modifications: (IInstance & {
|
|
45
49
|
target: IPrefabModifyTarget;
|
|
46
|
-
|
|
47
|
-
[methodName: string]: Array<IMethodParams>;
|
|
48
|
-
};
|
|
49
|
-
props?: {
|
|
50
|
-
[key: string]: IBasicType | IMethodParams;
|
|
51
|
-
};
|
|
52
|
-
}[];
|
|
50
|
+
})[];
|
|
53
51
|
removedEntities: IPrefabModifyTarget[];
|
|
54
52
|
removedComponents: IPrefabModifyTarget[];
|
|
55
53
|
}
|
|
@@ -68,18 +66,23 @@ export interface IStrippedEntity extends IBasicEntity {
|
|
|
68
66
|
export type IComponent = {
|
|
69
67
|
id: string;
|
|
70
68
|
refId?: string;
|
|
71
|
-
} &
|
|
72
|
-
export type
|
|
69
|
+
} & IClass;
|
|
70
|
+
export type IClass = {
|
|
73
71
|
class: string;
|
|
74
|
-
constructParams?:
|
|
72
|
+
constructParams?: Array<IBasicType>;
|
|
73
|
+
} & IInstance;
|
|
74
|
+
export interface IInstance {
|
|
75
75
|
methods?: {
|
|
76
76
|
[methodName: string]: Array<IMethodParams>;
|
|
77
77
|
};
|
|
78
78
|
props?: {
|
|
79
79
|
[key: string]: IBasicType | IMethodParams;
|
|
80
80
|
};
|
|
81
|
+
}
|
|
82
|
+
export type IClassType = {
|
|
83
|
+
classType: string;
|
|
81
84
|
};
|
|
82
|
-
export type IBasicType = string | number | boolean | null | undefined | IAssetRef |
|
|
85
|
+
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClass | IClassType | IMethodParams | IEntityRef;
|
|
83
86
|
export type IAssetRef = {
|
|
84
87
|
key?: string;
|
|
85
88
|
refId: string;
|