You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** If present, the hash will be extracted from the image's `data-blurhash` or `data-thumbhash` attribute and ratio will be calculated from the image's actual dimensions. */
162
+
image?: HTMLImageElement
163
+
hash?: string
164
+
hashType?: 'blurhash'|'thumbhash'
165
+
/** @default 32 */
166
+
size?: number
167
+
/** Will be calculated from the image's actual dimensions if image is provided and ratio is not. */
168
+
ratio?: number
169
+
}): string|undefined
170
+
// #endregion createPlaceholderFromHash
142
171
exportfunctioncreatePlaceholderFromHash(
143
172
{
144
173
image,
@@ -156,7 +185,7 @@ export function createPlaceholderFromHash(
156
185
/** Will be calculated from the image's actual dimensions if image is provided and ratio is not. */
157
186
ratio?: number
158
187
}={},
159
-
){
188
+
): string|undefined{
160
189
if(image&&!hash){
161
190
const{ blurhash, thumbhash }=image.dataset
162
191
hash=thumbhash||blurhash
@@ -195,7 +224,7 @@ function updateSizesAttribute(
195
224
updateOnResize?: boolean
196
225
processSourceElements?: boolean
197
226
},
198
-
){
227
+
): (()=>void)|undefined{
199
228
if(element.dataset.sizes!=='auto')
200
229
return
201
230
@@ -252,7 +281,7 @@ function updatePictureSources(image: HTMLImageElement) {
0 commit comments