@@ -67,31 +67,41 @@ const retryDecay = [
6767 millisecondsPerDay * 7 ,
6868] ;
6969
70+ export function getAvatarUri (
71+ email : string | undefined ,
72+ repoPathOrCommit : undefined ,
73+ options ?: { defaultStyle ?: GravatarDefaultStyle ; size ?: number } ,
74+ ) : Uri ;
75+ export function getAvatarUri (
76+ email : string | undefined ,
77+ repoPathOrCommit : string | GitRevisionReference ,
78+ options ?: { defaultStyle ?: GravatarDefaultStyle ; size ?: number } ,
79+ ) : Uri | Promise < Uri > ;
7080export function getAvatarUri (
7181 email : string | undefined ,
7282 repoPathOrCommit : string | GitRevisionReference | undefined ,
73- { defaultStyle , size = 16 } : { defaultStyle ?: GravatarDefaultStyle ; size ?: number } = { } ,
83+ options ? : { defaultStyle ?: GravatarDefaultStyle ; size ?: number } ,
7484) : Uri | Promise < Uri > {
7585 ensureAvatarCache ( avatarCache ) ;
7686
7787 // Double the size to avoid blurring on the retina screen
78- size *= 2 ;
88+ const size = ( options ?. size ?? 16 ) * 2 ;
7989
8090 if ( ! email ) {
8191 const avatar = createOrUpdateAvatar (
8292 `${ missingGravatarHash } :${ size } ` ,
8393 undefined ,
8494 size ,
8595 missingGravatarHash ,
86- defaultStyle ,
96+ options ?. defaultStyle ,
8797 ) ;
8898 return avatar . uri ?? avatar . fallback ! ;
8999 }
90100
91101 const hash = md5 ( email . trim ( ) . toLowerCase ( ) , 'hex' ) ;
92102 const key = `${ hash } :${ size } ` ;
93103
94- const avatar = createOrUpdateAvatar ( key , email , size , hash , defaultStyle ) ;
104+ const avatar = createOrUpdateAvatar ( key , email , size , hash , options ?. defaultStyle ) ;
95105 if ( avatar . uri != null ) return avatar . uri ;
96106
97107 let query = avatarQueue . get ( key ) ;
0 commit comments