@@ -95,14 +95,6 @@ interface DotnetHostBuilder {
95
95
run ( ) : Promise < number > ;
96
96
}
97
97
type MonoConfig = {
98
- /**
99
- * The subfolder containing managed assemblies and pdbs. This is relative to dotnet.js script.
100
- */
101
- assemblyRootFolder ?: string ;
102
- /**
103
- * A list of assets to load along with the runtime.
104
- */
105
- assets ?: AssetEntry [ ] ;
106
98
/**
107
99
* Additional search locations for assets.
108
100
*/
@@ -133,6 +125,10 @@ type MonoConfig = {
133
125
* debugLevel < 0 enables debugging and disables debug logging.
134
126
*/
135
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 ;
136
132
/**
137
133
* Enables diagnostic log messages during startup
138
134
*/
@@ -151,10 +147,6 @@ type MonoConfig = {
151
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.
152
148
*/
153
149
startupMemoryCache ?: boolean ;
154
- /**
155
- * hash of assets
156
- */
157
- assetsHash ?: string ;
158
150
/**
159
151
* application environment
160
152
*/
@@ -167,6 +159,10 @@ type MonoConfig = {
167
159
* definition of assets to load along with the runtime.
168
160
*/
169
161
resources ?: ResourceGroups ;
162
+ /**
163
+ * appsettings files to load to VFS
164
+ */
165
+ appsettings ?: string [ ] ;
170
166
/**
171
167
* config extensions declared in MSBuild items @(WasmBootConfigExtension)
172
168
*/
@@ -178,26 +174,31 @@ type ResourceExtensions = {
178
174
[ extensionName : string ] : ResourceList ;
179
175
} ;
180
176
interface ResourceGroups {
181
- readonly hash ?: string ;
182
- readonly assembly ?: ResourceList ;
183
- readonly lazyAssembly ?: ResourceList ;
184
- readonly pdb ?: ResourceList ;
185
- readonly runtime ?: ResourceList ;
186
- readonly satelliteResources ?: {
177
+ hash ?: string ;
178
+ assembly ?: ResourceList ;
179
+ lazyAssembly ?: ResourceList ;
180
+ pdb ?: ResourceList ;
181
+ jsModuleWorker ?: ResourceList ;
182
+ jsModuleNative : ResourceList ;
183
+ jsModuleRuntime : ResourceList ;
184
+ jsSymbols ?: ResourceList ;
185
+ wasmNative : ResourceList ;
186
+ icu ?: ResourceList ;
187
+ satelliteResources ?: {
187
188
[ cultureName : string ] : ResourceList ;
188
189
} ;
189
- readonly libraryInitializers ?: ResourceList ;
190
- readonly libraryStartupModules ?: {
191
- readonly onRuntimeConfigLoaded ?: ResourceList ;
192
- readonly onRuntimeReady ?: ResourceList ;
193
- } ;
194
- readonly extensions ?: ResourceExtensions ;
195
- readonly vfs ?: {
190
+ modulesAfterConfigLoaded ?: ResourceList ;
191
+ modulesAfterRuntimeReady ?: ResourceList ;
192
+ extensions ?: ResourceExtensions ;
193
+ vfs ?: {
196
194
[ virtualPath : string ] : ResourceList ;
197
195
} ;
198
196
}
197
+ /**
198
+ * A "key" is name of the file, a "value" is optional hash for integrity check.
199
+ */
199
200
type ResourceList = {
200
- [ name : string ] : string ;
201
+ [ name : string ] : string | null | "" ;
201
202
} ;
202
203
/**
203
204
* Overrides the built-in boot resource loading mechanism so that boot resources can be fetched
@@ -208,12 +209,12 @@ type ResourceList = {
208
209
* @param integrity The integrity string representing the expected content in the response.
209
210
* @returns A URI string or a Response promise to override the loading process, or null/undefined to allow the default loading behavior.
210
211
*/
211
- type LoadBootResourceCallback = ( type : WebAssemblyBootResourceType , name : string , defaultUri : string , integrity : string ) => string | Promise < Response > | null | undefined ;
212
+ type LoadBootResourceCallback = ( type : AssetBehaviors | "manifest" , name : string , defaultUri : string , integrity : string ) => string | Promise < Response > | null | undefined ;
212
213
interface ResourceRequest {
213
214
name : string ;
214
- behavior : AssetBehaviours ;
215
+ behavior : AssetBehaviors ;
215
216
resolvedUrl ?: string ;
216
- hash ?: string ;
217
+ hash ?: string | null | "" ;
217
218
}
218
219
interface LoadingResource {
219
220
name : string ;
@@ -248,7 +249,24 @@ interface AssetEntry extends ResourceRequest {
248
249
*/
249
250
pendingDownload ?: LoadingResource ;
250
251
}
251
- type AssetBehaviours =
252
+ type SingleAssetBehaviors =
253
+ /**
254
+ * The binary of the dotnet runtime.
255
+ */
256
+ "dotnetwasm"
257
+ /**
258
+ * The javascript module for threads.
259
+ */
260
+ | "js-module-threads"
261
+ /**
262
+ * The javascript module for threads.
263
+ */
264
+ | "js-module-runtime"
265
+ /**
266
+ * The javascript module for threads.
267
+ */
268
+ | "js-module-native" ;
269
+ type AssetBehaviors = SingleAssetBehaviors |
252
270
/**
253
271
* Load asset as a managed resource assembly.
254
272
*/
@@ -273,26 +291,6 @@ type AssetBehaviours =
273
291
* Load asset into the virtual filesystem (for fopen, File.Open, etc).
274
292
*/
275
293
| "vfs"
276
- /**
277
- * The binary of the dotnet runtime.
278
- */
279
- | "dotnetwasm"
280
- /**
281
- * The javascript module for threads.
282
- */
283
- | "js-module-threads"
284
- /**
285
- * The javascript module for threads.
286
- */
287
- | "js-module-runtime"
288
- /**
289
- * The javascript module for threads.
290
- */
291
- | "js-module-dotnet"
292
- /**
293
- * The javascript module for threads.
294
- */
295
- | "js-module-native"
296
294
/**
297
295
* The javascript module that came from nuget package .
298
296
*/
@@ -330,10 +328,8 @@ type DotnetModuleConfig = {
330
328
onConfigLoaded ?: ( config : MonoConfig ) => void | Promise < void > ;
331
329
onDotnetReady ?: ( ) => void | Promise < void > ;
332
330
onDownloadResourceProgress ?: ( resourcesLoaded : number , totalResources : number ) => void ;
333
- getApplicationEnvironment ?: ( bootConfigResponse : Response ) => string | null ;
334
331
imports ?: any ;
335
332
exports ?: string [ ] ;
336
- downloadResource ?: ( request : ResourceRequest ) => LoadingResource | undefined ;
337
333
} & Partial < EmscriptenModule > ;
338
334
type APIType = {
339
335
runMain : ( mainAssemblyName : string , args : string [ ] ) => Promise < number > ;
@@ -400,7 +396,6 @@ type ModuleAPI = {
400
396
exit : ( code : number , reason ?: any ) => void ;
401
397
} ;
402
398
type CreateDotnetRuntimeType = ( moduleFactory : DotnetModuleConfig | ( ( api : RuntimeAPI ) => DotnetModuleConfig ) ) => Promise < RuntimeAPI > ;
403
- type WebAssemblyBootResourceType = "assembly" | "pdb" | "dotnetjs" | "dotnetwasm" | "globalization" | "manifest" | "configuration" ;
404
399
405
400
interface IDisposable {
406
401
dispose ( ) : void ;
0 commit comments