API

Interface IOfflineProvider

Class used to enable access to offline support

interface IOfflineProvider {
    enableSceneOffline: boolean;
    enableTexturesOffline: boolean;
    loadFile(
        url: string,
        sceneLoaded: (data: any) => void,
        progressCallBack?: (data: any) => void,
        errorCallback?: () => void,
        useArrayBuffer?: boolean,
    ): void;
    loadImage(url: string, image: HTMLImageElement): void;
    open(successCallback: () => void, errorCallback: () => void): void;
}

Implemented by

Index
enableSceneOffline: boolean

Gets a boolean indicating if scene must be saved in the database

enableTexturesOffline: boolean

Gets a boolean indicating if textures must be saved in the database

  • Loads a file from offline support

    Parameters

    • url: string

      defines the URL to load from

    • sceneLoaded: (data: any) => void

      defines a callback to call on success

    • OptionalprogressCallBack: (data: any) => void

      defines a callback to call when progress changed

    • OptionalerrorCallback: () => void

      defines a callback to call on error

    • OptionaluseArrayBuffer: boolean

      defines a boolean to use array buffer instead of text string

    Returns void

  • Loads an image from the offline support

    Parameters

    • url: string

      defines the url to load from

    • image: HTMLImageElement

      defines the target DOM image

    Returns void

  • Open the offline support and make it available

    Parameters

    • successCallback: () => void

      defines the callback to call on success

    • errorCallback: () => void

      defines the callback to call on error

    Returns void