IOfflineProvider.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Class used to enable access to offline support
  3. * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeCached
  4. */
  5. export interface IOfflineProvider {
  6. /**
  7. * Gets a boolean indicating if scene must be saved in the database
  8. */
  9. enableSceneOffline: boolean;
  10. /**
  11. * Gets a boolean indicating if textures must be saved in the database
  12. */
  13. enableTexturesOffline: boolean;
  14. /**
  15. * Open the offline support and make it available
  16. * @param successCallback defines the callback to call on success
  17. * @param errorCallback defines the callback to call on error
  18. */
  19. open(successCallback: () => void, errorCallback: () => void): void;
  20. /**
  21. * Loads an image from the offline support
  22. * @param url defines the url to load from
  23. * @param image defines the target DOM image
  24. */
  25. loadImage(url: string, image: HTMLImageElement): void;
  26. /**
  27. * Loads a file from offline support
  28. * @param url defines the URL to load from
  29. * @param sceneLoaded defines a callback to call on success
  30. * @param progressCallBack defines a callback to call when progress changed
  31. * @param errorCallback defines a callback to call on error
  32. * @param useArrayBuffer defines a boolean to use array buffer instead of text string
  33. */
  34. loadFile(url: string, sceneLoaded: (data: any) => void, progressCallBack?: (data: any) => void, errorCallback?: () => void, useArrayBuffer?: boolean): void;
  35. }