sceneSerializer.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. import type { Scene } from "../scene";
  2. /**
  3. * Class used to serialize a scene into a string
  4. */
  5. export declare class SceneSerializer {
  6. /**
  7. * Clear cache used by a previous serialization
  8. */
  9. static ClearCache(): void;
  10. /**
  11. * Serialize a scene into a JSON compatible object
  12. * Note that if the current engine does not support synchronous texture reading (like WebGPU), you should use SerializeAsync instead
  13. * as else you may not retrieve the proper base64 encoded texture data (when using the Texture.ForceSerializeBuffers flag)
  14. * @param scene defines the scene to serialize
  15. * @returns a JSON compatible object
  16. */
  17. static Serialize(scene: Scene): any;
  18. private static _Serialize;
  19. /**
  20. * Serialize a scene into a JSON compatible object
  21. * @param scene defines the scene to serialize
  22. * @returns a JSON promise compatible object
  23. */
  24. static SerializeAsync(scene: Scene): Promise<any>;
  25. private static _CollectPromises;
  26. /**
  27. * Serialize a mesh into a JSON compatible object
  28. * @param toSerialize defines the mesh to serialize
  29. * @param withParents defines if parents must be serialized as well
  30. * @param withChildren defines if children must be serialized as well
  31. * @returns a JSON compatible object
  32. */
  33. static SerializeMesh(toSerialize: any, withParents?: boolean, withChildren?: boolean): any;
  34. }