import { AbstractEngine } from "@babylonjs/core/Engines/abstractEngine"; export interface IPreloadAssetsFilterOptions { /** * Defines the name of the scene (ie. "menu.scene") to filter the assets to preload. This is used to match the scene name in the scenes-used-files.json file. */ sceneName: string; /** * Defines wether to disable loading and saving sounds to the database for the preload. */ disableSounds?: boolean; /** * Defines wether to disable loading and saving textures to the database for the preload. */ disableTextures?: boolean; /** * Defines wether to disable loading and saving geometries to the database for the preload (aka. babylonbinarymeshdata files). */ disableGeometries?: boolean; } export interface IPreloadAssetsToDatabaseOptions { engine?: AbstractEngine; /** * Defines wether to disable loading and saving images to the database. * This is particularly useful when the application supports compressed KTX textures. So only KTX textures are stored. */ disableImages?: boolean; /** * Defines a list of scene names to filter the scenes to preload. If not defined, all scenes will be preloaded. * Using this filter can be useful to reduce the amount of assets to preload when only a subset of scenes is needed. * @example ["menu.babylon", "map1.babylon"] */ scenesFilter?: (string | IPreloadAssetsFilterOptions)[]; /** * A callback function that is called with the progress of the asset loading process, as a value between 0 and 1. * @param progress defines the progress of the asset loading process, as a value between 0 and 1. */ onProgress?: (progress: number) => void; } /** * Preloads the assets used by the scenes into the database. * This can be used to preload the assets before starting the application or to update the database with new assets after a new deployment. * This is particularly useful to improve loading times when the application with a slow network connection, as the assets will be loaded from the local database instead of being downloaded from the server each time. * @param databaseName defines the name of the database to create (if doesn't exists) and open and save files to it * @param rootUrl defines the root url to load the scenes used files list and the scene manifest files from. Typically "/scenes/". * @param options defines the options for preloading assets, including a callback function to be called with the progress of the asset loading process */ export declare function preloadAssetsToDatabase(databaseName: string, rootUrl: string, options?: IPreloadAssetsToDatabaseOptions): Promise<{ loadedCount: number; processedFilesCount: number; }>;