@@ -121,7 +121,7 @@ export class MockRuntime
121
121
122
122
public getStorage ( ) : IDocumentStorageService {
123
123
return {
124
- createBlob : async ( blob ) => {
124
+ createBlob : async ( blob : ArrayBufferLike ) => {
125
125
if ( this . processing ) {
126
126
return this . storage . createBlob ( blob ) ;
127
127
}
@@ -139,7 +139,7 @@ export class MockRuntime
139
139
this . blobPs . push ( P ) ;
140
140
return P ;
141
141
} ,
142
- readBlob : async ( id ) => this . storage . readBlob ( id ) ,
142
+ readBlob : async ( id : string ) => this . storage . readBlob ( id ) ,
143
143
} as unknown as IDocumentStorageService ;
144
144
}
145
145
@@ -234,7 +234,7 @@ export class MockRuntime
234
234
redirectTable : [ string , string ] [ ] | undefined ;
235
235
} > {
236
236
if ( this . detachedStorage . blobs . size > 0 ) {
237
- const table = new Map ( ) ;
237
+ const table = new Map < string , string > ( ) ;
238
238
for ( const [ detachedId , blob ] of this . detachedStorage . blobs ) {
239
239
const { id } = await this . attachedStorage . createBlob ( blob ) ;
240
240
table . set ( detachedId , id ) ;
@@ -259,7 +259,7 @@ export class MockRuntime
259
259
for ( const op of ops ) {
260
260
// TODO: better typing
261
261
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
262
- this . blobManager . reSubmit ( ( op as any ) . metadata ) ;
262
+ this . blobManager . reSubmit ( ( op as any ) . metadata as Record < string , unknown > | undefined ) ;
263
263
}
264
264
}
265
265
@@ -319,7 +319,11 @@ export const validateSummary = (
319
319
assert . strictEqual ( key , redirectTableBlobName ) ;
320
320
assert ( attachment . type === SummaryType . Blob ) ;
321
321
assert ( typeof attachment . content === "string" ) ;
322
- redirectTable = [ ...new Map < string , string > ( JSON . parse ( attachment . content ) ) . entries ( ) ] ;
322
+ redirectTable = [
323
+ ...new Map < string , string > (
324
+ JSON . parse ( attachment . content ) as [ string , string ] [ ] ,
325
+ ) . entries ( ) ,
326
+ ] ;
323
327
}
324
328
}
325
329
return { ids, redirectTable } ;
@@ -869,7 +873,7 @@ describe("BlobManager", () => {
869
873
await runtime . attach ( ) ;
870
874
await runtime . connect ( ) ;
871
875
const ac = new AbortController ( ) ;
872
- let handleP ;
876
+ let handleP : Promise < IFluidHandleInternal < ArrayBufferLike > > | undefined ;
873
877
try {
874
878
const blob = IsoBuffer . from ( "blob" , "utf8" ) ;
875
879
handleP = runtime . createBlob ( blob , ac . signal ) ;
@@ -922,7 +926,7 @@ describe("BlobManager", () => {
922
926
await runtime . attach ( ) ;
923
927
await runtime . connect ( ) ;
924
928
const ac = new AbortController ( ) ;
925
- let handleP ;
929
+ let handleP : Promise < IFluidHandleInternal < ArrayBufferLike > > | undefined ;
926
930
try {
927
931
handleP = runtime . createBlob ( IsoBuffer . from ( "blob" , "utf8" ) , ac . signal ) ;
928
932
const p1 = runtime . processBlobs ( true ) ;
@@ -945,7 +949,9 @@ describe("BlobManager", () => {
945
949
}
946
950
await runtime . connect ( ) ;
947
951
runtime . processOps ( ) ;
948
- await assert . rejects ( handleP ) ;
952
+
953
+ // TODO: `handleP` can be `undefined`; this should be made safer.
954
+ await assert . rejects ( handleP as Promise < IFluidHandleInternal < ArrayBufferLike > > ) ;
949
955
const summaryData = validateSummary ( runtime ) ;
950
956
assert . strictEqual ( summaryData . ids . length , 0 ) ;
951
957
assert . strictEqual ( summaryData . redirectTable , undefined ) ;
0 commit comments