@galacean/engine-loader 1.1.0-beta.4 → 1.1.0-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-loader",
3
- "version": "1.1.0-beta.4",
3
+ "version": "1.1.0-beta.5",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-draco": "1.1.0-beta.4",
19
- "@galacean/engine-core": "1.1.0-beta.4",
20
- "@galacean/engine-rhi-webgl": "1.1.0-beta.4",
21
- "@galacean/engine-math": "1.1.0-beta.4"
18
+ "@galacean/engine-core": "1.1.0-beta.5",
19
+ "@galacean/engine-rhi-webgl": "1.1.0-beta.5",
20
+ "@galacean/engine-draco": "1.1.0-beta.5",
21
+ "@galacean/engine-math": "1.1.0-beta.5"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
package/types/index.d.ts CHANGED
@@ -15,6 +15,7 @@ import "./SpriteAtlasLoader";
15
15
  import "./SpriteLoader";
16
16
  import "./Texture2DLoader";
17
17
  import "./TextureCubeLoader";
18
+ import "./ProjectLoader";
18
19
  import "./ktx2/KTX2Loader";
19
20
  export type { GLTFParams } from "./GLTFLoader";
20
21
  export * from "./SceneLoader";
@@ -1,14 +1,18 @@
1
- import { Engine, Entity } from "@galacean/engine-core";
1
+ import { Entity } from "@galacean/engine-core";
2
2
  import type { IBasicType, IClassObject, IEntity } from "../schema";
3
+ import { SceneParserContext } from "../scene/SceneParserContext";
3
4
  export declare class ReflectionParser {
5
+ private readonly _context;
4
6
  static customParseComponentHandles: Map<string, Function>;
5
7
  static registerCustomParseComponent(componentType: string, handle: Function): void;
6
- static parseEntity(entityConfig: IEntity, engine: Engine): Promise<Entity>;
7
- private static getEntityByConfig;
8
- static parseClassObject(item: IClassObject, engine: Engine, resourceManager?: any): Promise<any>;
9
- static parseBasicType(value: IBasicType, engine: Engine, resourceManager?: any): Promise<any>;
10
- static parsePropsAndMethods(instance: any, item: Omit<IClassObject, "class">, engine: Engine, resourceManager?: any): Promise<any>;
11
- static parseMethod(instance: any, methodName: string, methodParams: Array<IBasicType>, engine: Engine, resourceManager?: any): Promise<any>;
8
+ constructor(_context: SceneParserContext);
9
+ parseEntity(entityConfig: IEntity): Promise<Entity>;
10
+ parseClassObject(item: IClassObject): Promise<any>;
11
+ parsePropsAndMethods(instance: any, item: Omit<IClassObject, "class">): Promise<any>;
12
+ parseMethod(instance: any, methodName: string, methodParams: Array<IBasicType>): Promise<any>;
13
+ parseBasicType(value: IBasicType): Promise<any>;
14
+ private _getEntityByConfig;
12
15
  private static _isClass;
13
- private static _isRef;
16
+ private static _isAssetRef;
17
+ private static _isEntityRef;
14
18
  }
@@ -18,6 +18,7 @@ export declare class SceneParser {
18
18
  private _resolve;
19
19
  private _reject;
20
20
  private _engine;
21
+ private _reflectionParser;
21
22
  constructor(context: SceneParserContext);
22
23
  /** start parse the scene */
23
24
  start(): void;
@@ -1,4 +1,4 @@
1
- import { Component, Entity, Scene } from "@galacean/engine-core";
1
+ import { Component, Engine, Entity, ResourceManager, Scene } from "@galacean/engine-core";
2
2
  import type { IEntity, IScene } from "../schema";
3
3
  export declare class SceneParserContext {
4
4
  readonly originalData: IScene;
@@ -8,6 +8,8 @@ export declare class SceneParserContext {
8
8
  assets: Map<string, any>;
9
9
  entityConfigMap: Map<string, IEntity>;
10
10
  rootIds: string[];
11
+ readonly engine: Engine;
12
+ readonly resourceManager: ResourceManager;
11
13
  constructor(originalData: IScene, scene: Scene);
12
14
  destroy(): void;
13
15
  }
@@ -23,21 +23,6 @@ export interface IPrefabFile {
23
23
  entities: Array<IEntity>;
24
24
  }
25
25
  export type IMethodParams = Array<IBasicType>;
26
- export type IClassObject = {
27
- class: string;
28
- constructParams?: IMethodParams;
29
- methods?: {
30
- [methodName: string]: Array<IMethodParams>;
31
- };
32
- props?: {
33
- [key: string]: IBasicType | IMethodParams;
34
- };
35
- };
36
- export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClassObject | IMethodParams;
37
- export type IAssetRef = {
38
- key?: string;
39
- refId: string;
40
- };
41
26
  export interface IBasicEntity {
42
27
  name?: string;
43
28
  id?: string;
@@ -59,3 +44,21 @@ export type IComponent = {
59
44
  id: string;
60
45
  refId?: string;
61
46
  } & IClassObject;
47
+ export type IClassObject = {
48
+ class: string;
49
+ constructParams?: IMethodParams;
50
+ methods?: {
51
+ [methodName: string]: Array<IMethodParams>;
52
+ };
53
+ props?: {
54
+ [key: string]: IBasicType | IMethodParams;
55
+ };
56
+ };
57
+ export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClassObject | IMethodParams | IEntityRef;
58
+ export type IAssetRef = {
59
+ key?: string;
60
+ refId: string;
61
+ };
62
+ export type IEntityRef = {
63
+ entityId: string;
64
+ };