33//!
44//! This is generated file, see src/mono/wasm/runtime/rollup.config.js
55
6- //! This is not considered public API with backward compatibility guarantees.
6+ //! This is not considered public API with backward compatibility guarantees.
77
88declare interface NativePointer {
99 __brandNativePointer : "NativePointer" ;
@@ -63,6 +63,9 @@ declare interface EmscriptenModule {
6363 onAbort ?: {
6464 ( error : any ) : void ;
6565 } ;
66+ onExit ?: {
67+ ( code : number ) : void ;
68+ } ;
6669}
6770type InstantiateWasmSuccessCallback = ( instance : WebAssembly . Instance , module : WebAssembly . Module | undefined ) => void ;
6871type InstantiateWasmCallBack = ( imports : WebAssembly . Imports , successCallback : InstantiateWasmSuccessCallback ) => any ;
@@ -92,14 +95,6 @@ interface DotnetHostBuilder {
9295 run ( ) : Promise < number > ;
9396}
9497type MonoConfig = {
95- /**
96- * The subfolder containing managed assemblies and pdbs. This is relative to dotnet.js script.
97- */
98- assemblyRootFolder ?: string ;
99- /**
100- * A list of assets to load along with the runtime.
101- */
102- assets ?: AssetEntry [ ] ;
10398 /**
10499 * Additional search locations for assets.
105100 */
@@ -130,6 +125,10 @@ type MonoConfig = {
130125 * debugLevel < 0 enables debugging and disables debug logging.
131126 */
132127 debugLevel ?: number ;
128+ /**
129+ * Gets a value that determines whether to enable caching of the 'resources' inside a CacheStorage instance within the browser.
130+ */
131+ cacheBootResources ?: boolean ;
133132 /**
134133 * Enables diagnostic log messages during startup
135134 */
@@ -148,10 +147,6 @@ type MonoConfig = {
148147 * If true, the snapshot of runtime's memory will be stored in the browser and used for faster startup next time. Default is false.
149148 */
150149 startupMemoryCache ?: boolean ;
151- /**
152- * hash of assets
153- */
154- assetsHash ?: string ;
155150 /**
156151 * application environment
157152 */
@@ -164,6 +159,10 @@ type MonoConfig = {
164159 * definition of assets to load along with the runtime.
165160 */
166161 resources ?: ResourceGroups ;
162+ /**
163+ * appsettings files to load to VFS
164+ */
165+ appsettings ?: string [ ] ;
167166 /**
168167 * config extensions declared in MSBuild items @(WasmBootConfigExtension)
169168 */
@@ -175,25 +174,31 @@ type ResourceExtensions = {
175174 [ extensionName : string ] : ResourceList ;
176175} ;
177176interface ResourceGroups {
178- readonly hash ?: string ;
179- readonly assembly ?: ResourceList ;
180- readonly lazyAssembly ?: ResourceList ;
181- readonly pdb ?: ResourceList ;
182- readonly runtime ?: ResourceList ;
183- readonly satelliteResources ?: {
177+ hash ?: string ;
178+ assembly ?: ResourceList ;
179+ lazyAssembly ?: ResourceList ;
180+ pdb ?: ResourceList ;
181+ jsModuleWorker ?: ResourceList ;
182+ jsModuleNative : ResourceList ;
183+ jsModuleRuntime : ResourceList ;
184+ wasmSymbols ?: ResourceList ;
185+ wasmNative : ResourceList ;
186+ icu ?: ResourceList ;
187+ satelliteResources ?: {
184188 [ cultureName : string ] : ResourceList ;
185189 } ;
186- readonly libraryInitializers ?: {
187- readonly onRuntimeConfigLoaded : ResourceList ;
188- readonly onRuntimeReady : ResourceList ;
189- } ;
190- readonly extensions ?: ResourceExtensions ;
191- readonly vfs ?: {
190+ modulesAfterConfigLoaded ?: ResourceList ;
191+ modulesAfterRuntimeReady ?: ResourceList ;
192+ extensions ?: ResourceExtensions ;
193+ vfs ?: {
192194 [ virtualPath : string ] : ResourceList ;
193195 } ;
194196}
197+ /**
198+ * A "key" is name of the file, a "value" is optional hash for integrity check.
199+ */
195200type ResourceList = {
196- [ name : string ] : string ;
201+ [ name : string ] : string | null | "" ;
197202} ;
198203/**
199204 * Overrides the built-in boot resource loading mechanism so that boot resources can be fetched
@@ -203,13 +208,14 @@ type ResourceList = {
203208 * @param defaultUri The URI from which the framework would fetch the resource by default. The URI may be relative or absolute.
204209 * @param integrity The integrity string representing the expected content in the response.
205210 * @returns A URI string or a Response promise to override the loading process, or null/undefined to allow the default loading behavior.
211+ * When returned string is not qualified with `./` or absolute URL, it will be resolved against the application base URI.
206212 */
207- type LoadBootResourceCallback = ( type : WebAssemblyBootResourceType , name : string , defaultUri : string , integrity : string ) => string | Promise < Response > | null | undefined ;
213+ type LoadBootResourceCallback = ( type : WebAssemblyBootResourceType , name : string , defaultUri : string , integrity : string , behavior : AssetBehaviors ) => string | Promise < Response > | null | undefined ;
208214interface ResourceRequest {
209215 name : string ;
210- behavior : AssetBehaviours ;
216+ behavior : AssetBehaviors ;
211217 resolvedUrl ?: string ;
212- hash ?: string ;
218+ hash ?: string | null | "" ;
213219}
214220interface LoadingResource {
215221 name : string ;
@@ -244,59 +250,64 @@ interface AssetEntry extends ResourceRequest {
244250 */
245251 pendingDownload ?: LoadingResource ;
246252}
247- type AssetBehaviours =
248- /**
249- * Load asset as a managed resource assembly.
250- */
251- "resource"
252- /**
253- * Load asset as a managed assembly.
254- */
255- | "assembly"
256- /**
257- * Load asset as a managed debugging information.
258- */
259- | "pdb"
260- /**
261- * Store asset into the native heap.
262- */
263- | "heap"
264- /**
265- * Load asset as an ICU data archive.
266- */
267- | "icu"
268- /**
269- * Load asset into the virtual filesystem (for fopen, File.Open, etc).
270- */
271- | "vfs"
272- /**
273- * The binary of the dotnet runtime.
274- */
275- | "dotnetwasm"
276- /**
277- * The javascript module for threads.
278- */
279- | "js-module-threads"
280- /**
281- * The javascript module for threads.
282- */
283- | "js-module-runtime"
284- /**
285- * The javascript module for threads.
286- */
287- | "js-module-dotnet"
288- /**
289- * The javascript module for threads.
290- */
291- | "js-module-native"
292- /**
293- * The javascript module that came from nuget package .
294- */
295- | "js-module-library-initializer"
296- /**
297- * The javascript module for threads.
298- */
299- | "symbols" ;
253+ type SingleAssetBehaviors =
254+ /**
255+ * The binary of the dotnet runtime.
256+ */
257+ "dotnetwasm"
258+ /**
259+ * The javascript module for loader.
260+ */
261+ | "js-module-dotnet"
262+ /**
263+ * The javascript module for threads.
264+ */
265+ | "js-module-threads"
266+ /**
267+ * The javascript module for runtime.
268+ */
269+ | "js-module-runtime"
270+ /**
271+ * The javascript module for emscripten.
272+ */
273+ | "js-module-native"
274+ /**
275+ * Typically blazor.boot.json
276+ */
277+ | "manifest" ;
278+ type AssetBehaviors = SingleAssetBehaviors |
279+ /**
280+ * Load asset as a managed resource assembly.
281+ */
282+ "resource"
283+ /**
284+ * Load asset as a managed assembly.
285+ */
286+ | "assembly"
287+ /**
288+ * Load asset as a managed debugging information.
289+ */
290+ | "pdb"
291+ /**
292+ * Store asset into the native heap.
293+ */
294+ | "heap"
295+ /**
296+ * Load asset as an ICU data archive.
297+ */
298+ | "icu"
299+ /**
300+ * Load asset into the virtual filesystem (for fopen, File.Open, etc).
301+ */
302+ | "vfs"
303+ /**
304+ * The javascript module that came from nuget package .
305+ */
306+ | "js-module-library-initializer"
307+ /**
308+ * The javascript module for threads.
309+ */
310+ | "symbols" ;
300311declare const enum GlobalizationMode {
301312 /**
302313 * Load sharded ICU data.
@@ -326,10 +337,8 @@ type DotnetModuleConfig = {
326337 onConfigLoaded ?: ( config : MonoConfig ) => void | Promise < void > ;
327338 onDotnetReady ?: ( ) => void | Promise < void > ;
328339 onDownloadResourceProgress ?: ( resourcesLoaded : number , totalResources : number ) => void ;
329- getApplicationEnvironment ?: ( bootConfigResponse : Response ) => string | null ;
330340 imports ?: any ;
331341 exports ?: string [ ] ;
332- downloadResource ?: ( request : ResourceRequest ) => LoadingResource | undefined ;
333342} & Partial < EmscriptenModule > ;
334343type APIType = {
335344 runMain : ( mainAssemblyName : string , args : string [ ] ) => Promise < number > ;
@@ -432,4 +441,4 @@ declare global {
432441}
433442declare const createDotnetRuntime : CreateDotnetRuntimeType ;
434443
435- export { AssetEntry , CreateDotnetRuntimeType , DotnetHostBuilder , DotnetModuleConfig , EmscriptenModule , GlobalizationMode , IMemoryView , ModuleAPI , MonoConfig , ResourceRequest , RuntimeAPI , createDotnetRuntime as default , dotnet , exit } ;
444+ export { AssetBehaviors , AssetEntry , CreateDotnetRuntimeType , DotnetHostBuilder , DotnetModuleConfig , EmscriptenModule , GlobalizationMode , IMemoryView , ModuleAPI , MonoConfig , ResourceRequest , RuntimeAPI , createDotnetRuntime as default , dotnet , exit } ;
0 commit comments