@galacean/engine-loader 0.0.0-experimental-2.0-migrate.4 → 0.0.0-experimental-2.0-migrate.6
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 +170 -120
- package/dist/main.js.map +1 -1
- package/dist/module.js +170 -120
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +9 -8
- package/types/schema/CommonSchema.d.ts +12 -0
- package/types/schema/ProjectSchema.d.ts +3 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "0.0.0-experimental-2.0-migrate.
|
|
3
|
+
"version": "0.0.0-experimental-2.0-migrate.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"libs/**/*"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@galacean/engine-core": "0.0.0-experimental-2.0-migrate.
|
|
23
|
-
"@galacean/engine-math": "0.0.0-experimental-2.0-migrate.
|
|
24
|
-
"@galacean/engine-rhi-webgl": "0.0.0-experimental-2.0-migrate.
|
|
22
|
+
"@galacean/engine-core": "0.0.0-experimental-2.0-migrate.6",
|
|
23
|
+
"@galacean/engine-math": "0.0.0-experimental-2.0-migrate.6",
|
|
24
|
+
"@galacean/engine-rhi-webgl": "0.0.0-experimental-2.0-migrate.6"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
|
@@ -9,7 +9,7 @@ export declare class ReflectionParser {
|
|
|
9
9
|
constructor(_context: ParserContext, _refs: RefItem[]);
|
|
10
10
|
/**
|
|
11
11
|
* Apply v2 props to a component/object instance.
|
|
12
|
-
* Each prop value is resolved recursively (handling $ref, $type, $class, $entity, $component, $signal).
|
|
12
|
+
* Each prop value is resolved recursively (handling $ref, $number, $type, $class, $entity, $component, $signal).
|
|
13
13
|
*/
|
|
14
14
|
parseProps(instance: any, props?: Record<string, unknown>): Promise<any>;
|
|
15
15
|
/**
|
|
@@ -18,7 +18,7 @@ export declare class ReflectionParser {
|
|
|
18
18
|
*/
|
|
19
19
|
parseCalls(instance: any, calls?: CallSpec[]): Promise<any>;
|
|
20
20
|
/**
|
|
21
|
-
* Apply props
|
|
21
|
+
* Apply props before executing calls from the same mutation block.
|
|
22
22
|
*/
|
|
23
23
|
parseMutationBlock(target: any, block?: MutationBlock): Promise<any>;
|
|
24
24
|
/**
|
|
@@ -28,12 +28,13 @@ export declare class ReflectionParser {
|
|
|
28
28
|
* 1. null/undefined/primitive → passthrough
|
|
29
29
|
* 2. Array → recurse each element
|
|
30
30
|
* 3. { $ref } → asset reference
|
|
31
|
-
* 4. { $
|
|
32
|
-
* 5. { $
|
|
33
|
-
* 6. { $
|
|
34
|
-
* 7. { $
|
|
35
|
-
* 8. { $
|
|
36
|
-
* 9.
|
|
31
|
+
* 4. { $number } → JSON-safe special number
|
|
32
|
+
* 5. { $type, $args? } → polymorphic type construct
|
|
33
|
+
* 6. { $class } → registered class constructor
|
|
34
|
+
* 7. { $entity } → entity reference by path (flat index + optional children descent)
|
|
35
|
+
* 8. { $component } → component reference
|
|
36
|
+
* 9. { $signal } → signal binding
|
|
37
|
+
* 10. plain object → recurse values (modify originValue in place if exists)
|
|
37
38
|
*/
|
|
38
39
|
private _resolveValue;
|
|
39
40
|
private _getRegisteredClass;
|
|
@@ -15,6 +15,16 @@ export interface ComponentRef {
|
|
|
15
15
|
export interface ClassRef {
|
|
16
16
|
$class: string;
|
|
17
17
|
}
|
|
18
|
+
/** Registered runtime value with optional recursively-resolved constructor arguments. */
|
|
19
|
+
export interface TypeValue {
|
|
20
|
+
$type: string;
|
|
21
|
+
$args?: unknown[];
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/** JSON-safe encoding for positive infinity. */
|
|
25
|
+
export interface SpecialNumberValue {
|
|
26
|
+
$number: "Infinity";
|
|
27
|
+
}
|
|
18
28
|
export interface SignalListener {
|
|
19
29
|
target: {
|
|
20
30
|
$component: ComponentRef;
|
|
@@ -23,6 +33,8 @@ export interface SignalListener {
|
|
|
23
33
|
args?: unknown[];
|
|
24
34
|
}
|
|
25
35
|
export interface CallSpec {
|
|
36
|
+
/** Optional property path from the mutation root to the method owner. */
|
|
37
|
+
target?: string[];
|
|
26
38
|
method: string;
|
|
27
39
|
args?: unknown[];
|
|
28
40
|
result?: MutationBlock;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import type { VirtualResource } from "@galacean/engine-core";
|
|
1
2
|
export interface IProject {
|
|
2
3
|
scene: string;
|
|
3
|
-
files: {
|
|
4
|
-
virtualPath: string;
|
|
5
|
-
path: string;
|
|
6
|
-
type: string;
|
|
4
|
+
files: (VirtualResource & {
|
|
7
5
|
id: string;
|
|
8
|
-
|
|
9
|
-
}[];
|
|
6
|
+
})[];
|
|
10
7
|
}
|