IOfflineProvider.ts 1.6 KB

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