3
3
//!
4
4
//! This is generated file, see src/mono/wasm/runtime/rollup.config.js
5
5
6
- //! This is not considered public API with backward compatibility guarantees.
6
+ //! This is not considered public API with backward compatibility guarantees.
7
7
8
8
declare interface NativePointer {
9
9
__brandNativePointer : "NativePointer" ;
@@ -63,6 +63,9 @@ declare interface EmscriptenModule {
63
63
onAbort ?: {
64
64
( error : any ) : void ;
65
65
} ;
66
+ onExit ?: {
67
+ ( code : number ) : void ;
68
+ } ;
66
69
}
67
70
type InstantiateWasmSuccessCallback = ( instance : WebAssembly . Instance , module : WebAssembly . Module | undefined ) => void ;
68
71
type InstantiateWasmCallBack = ( imports : WebAssembly . Imports , successCallback : InstantiateWasmSuccessCallback ) => any ;
@@ -92,14 +95,6 @@ interface DotnetHostBuilder {
92
95
run ( ) : Promise < number > ;
93
96
}
94
97
type 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 [ ] ;
103
98
/**
104
99
* Additional search locations for assets.
105
100
*/
@@ -130,6 +125,10 @@ type MonoConfig = {
130
125
* debugLevel < 0 enables debugging and disables debug logging.
131
126
*/
132
127
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 ;
133
132
/**
134
133
* Enables diagnostic log messages during startup
135
134
*/
@@ -148,10 +147,6 @@ type MonoConfig = {
148
147
* If true, the snapshot of runtime's memory will be stored in the browser and used for faster startup next time. Default is false.
149
148
*/
150
149
startupMemoryCache ?: boolean ;
151
- /**
152
- * hash of assets
153
- */
154
- assetsHash ?: string ;
155
150
/**
156
151
* application environment
157
152
*/
@@ -164,6 +159,10 @@ type MonoConfig = {
164
159
* definition of assets to load along with the runtime.
165
160
*/
166
161
resources ?: ResourceGroups ;
162
+ /**
163
+ * appsettings files to load to VFS
164
+ */
165
+ appsettings ?: string [ ] ;
167
166
/**
168
167
* config extensions declared in MSBuild items @(WasmBootConfigExtension)
169
168
*/
@@ -175,25 +174,31 @@ type ResourceExtensions = {
175
174
[ extensionName : string ] : ResourceList ;
176
175
} ;
177
176
interface 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 ?: {
184
188
[ cultureName : string ] : ResourceList ;
185
189
} ;
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 ?: {
192
194
[ virtualPath : string ] : ResourceList ;
193
195
} ;
194
196
}
197
+ /**
198
+ * A "key" is name of the file, a "value" is optional hash for integrity check.
199
+ */
195
200
type ResourceList = {
196
- [ name : string ] : string ;
201
+ [ name : string ] : string | null | "" ;
197
202
} ;
198
203
/**
199
204
* Overrides the built-in boot resource loading mechanism so that boot resources can be fetched
@@ -203,13 +208,14 @@ type ResourceList = {
203
208
* @param defaultUri The URI from which the framework would fetch the resource by default. The URI may be relative or absolute.
204
209
* @param integrity The integrity string representing the expected content in the response.
205
210
* @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.
206
212
*/
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 ;
208
214
interface ResourceRequest {
209
215
name : string ;
210
- behavior : AssetBehaviours ;
216
+ behavior : AssetBehaviors ;
211
217
resolvedUrl ?: string ;
212
- hash ?: string ;
218
+ hash ?: string | null | "" ;
213
219
}
214
220
interface LoadingResource {
215
221
name : string ;
@@ -244,59 +250,64 @@ interface AssetEntry extends ResourceRequest {
244
250
*/
245
251
pendingDownload ?: LoadingResource ;
246
252
}
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" ;
300
311
declare const enum GlobalizationMode {
301
312
/**
302
313
* Load sharded ICU data.
@@ -326,10 +337,8 @@ type DotnetModuleConfig = {
326
337
onConfigLoaded ?: ( config : MonoConfig ) => void | Promise < void > ;
327
338
onDotnetReady ?: ( ) => void | Promise < void > ;
328
339
onDownloadResourceProgress ?: ( resourcesLoaded : number , totalResources : number ) => void ;
329
- getApplicationEnvironment ?: ( bootConfigResponse : Response ) => string | null ;
330
340
imports ?: any ;
331
341
exports ?: string [ ] ;
332
- downloadResource ?: ( request : ResourceRequest ) => LoadingResource | undefined ;
333
342
} & Partial < EmscriptenModule > ;
334
343
type APIType = {
335
344
runMain : ( mainAssemblyName : string , args : string [ ] ) => Promise < number > ;
@@ -432,4 +441,4 @@ declare global {
432
441
}
433
442
declare const createDotnetRuntime : CreateDotnetRuntimeType ;
434
443
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