@galacean/engine-loader 1.1.0-beta.1 → 1.1.0-beta.11

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.1",
3
+ "version": "1.1.0-beta.11",
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-core": "1.1.0-beta.1",
19
- "@galacean/engine-draco": "1.1.0-beta.1",
20
- "@galacean/engine-math": "1.1.0-beta.1",
21
- "@galacean/engine-rhi-webgl": "1.1.0-beta.1"
18
+ "@galacean/engine-core": "1.1.0-beta.11",
19
+ "@galacean/engine-draco": "1.1.0-beta.11",
20
+ "@galacean/engine-math": "1.1.0-beta.11",
21
+ "@galacean/engine-rhi-webgl": "1.1.0-beta.11"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -1,7 +1,7 @@
1
1
  import { IndexFormat, TypedArray, VertexElementFormat } from "@galacean/engine-core";
2
2
  import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
3
- import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF } from "./GLTFSchema";
4
- import { BufferInfo, GLTFParserContext } from "./parser/GLTFParserContext";
3
+ import { BufferInfo, ParserContext } from "./parser/ParserContext";
4
+ import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF } from "./Schema";
5
5
  /**
6
6
  * @internal
7
7
  */
@@ -23,7 +23,7 @@ export declare class GLTFUtil {
23
23
  */
24
24
  static getComponentType(componentType: AccessorComponentType): Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor;
25
25
  static getNormalizedComponentScale(componentType: AccessorComponentType): number;
26
- static getAccessorBuffer(context: GLTFParserContext, gltf: IGLTF, accessor: IAccessor): BufferInfo;
26
+ static getAccessorBuffer(context: ParserContext, gltf: IGLTF, accessor: IAccessor): BufferInfo;
27
27
  /**
28
28
  * @deprecated
29
29
  * Get accessor data.
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";
@@ -20,7 +20,7 @@ export interface InitMessage extends BaseMessage {
20
20
  export interface BinomialTranscodeMessage extends BaseMessage {
21
21
  type: "transcode";
22
22
  format: number;
23
- buffer: ArrayBuffer;
23
+ buffer: Uint8Array;
24
24
  }
25
25
  export type IBinomialMessage = InitMessage | BinomialTranscodeMessage;
26
26
  export type TranscodeResult = {
@@ -3,6 +3,6 @@ import { AbstractTranscoder, TranscodeResult } from "./AbstractTranscoder";
3
3
  /** @internal */
4
4
  export declare class BinomialLLCTranscoder extends AbstractTranscoder {
5
5
  constructor(workerLimitCount: number);
6
- _initTranscodeWorkerPool(): Promise<Worker[]>;
7
- transcode(buffer: ArrayBuffer, format: KTX2TargetFormat): Promise<TranscodeResult>;
6
+ _initTranscodeWorkerPool(): Promise<any>;
7
+ transcode(buffer: Uint8Array, format: KTX2TargetFormat): Promise<TranscodeResult>;
8
8
  }
@@ -1,2 +1,6 @@
1
+ import { TranscodeResult } from "./AbstractTranscoder";
1
2
  /** @internal */
2
3
  export declare function TranscodeWorkerCode(): void;
4
+ export declare const _init: () => (wasmBinary?: ArrayBuffer) => any;
5
+ export declare const init: (wasmBinary?: ArrayBuffer) => any;
6
+ export declare function transcode(buffer: Uint8Array, targetFormat: any, KTX2File: any): TranscodeResult;
@@ -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
+ };