Skip to content

Commit 8ac206c

Browse files
committed
Fix some type inconsistencies
The `exifreader` dependency unfortunately pulls in `@types/node` which conflicts with the DOM implementations.
1 parent f7c1632 commit 8ac206c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts/WoltLabSuite/Core/Image/ExifUtil.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function getExifBytesFromJpeg(blob: Blob | File): Promise<Exif> {
8282

8383
const bytes = await blobToUint8(blob);
8484

85-
let exif = new Uint8Array(0);
85+
let exif: Uint8Array<ArrayBufferLike> = new Uint8Array(0);
8686

8787
if (bytes[0] !== 0xff && bytes[1] !== Tag.SOI) {
8888
throw new Error("Not a JPEG");
@@ -169,7 +169,7 @@ export async function removeExifData(blob: Blob | File): Promise<Blob> {
169169
}
170170
}
171171

172-
return new Blob([result], { type: blob.type });
172+
return new Blob([result as BlobPart], { type: blob.type });
173173
}
174174

175175
/**
@@ -192,7 +192,7 @@ export async function setExifData(blob: Blob, exif: Exif): Promise<Blob> {
192192

193193
const result = concatUint8Arrays(start, exif, end);
194194

195-
return new Blob([result], { type: blob.type });
195+
return new Blob([result as BlobPart], { type: blob.type });
196196
}
197197

198198
export type Exif = Uint8Array;

ts/WoltLabSuite/Core/Notification/ServiceWorker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ServiceWorker {
4646
await this.#serviceWorkerRegistration
4747
).pushManager.subscribe({
4848
userVisibleOnly: true,
49-
applicationServerKey: this.#urlBase64ToUint8Array(this.#publicKey),
49+
applicationServerKey: this.#urlBase64ToUint8Array(this.#publicKey) as BufferSource,
5050
});
5151
if (!subscription) {
5252
// subscription failed

0 commit comments

Comments
 (0)