mirror of
https://github.com/bitwarden/browser
synced 2026-02-26 09:33:22 +00:00
[PM-31406] fix: TypeScript 5.9 type compatibility fixes for vault-owned code (#19191)
* fix: TypeScript 5.9 type compatibility fixes for vault-owned code Add explicit `as BufferSource` casts and `Uint8Array` wrapping to satisfy stricter type checking in TypeScript 5.9. Non-functional changes. * Fix cli build
This commit is contained in:
@@ -170,7 +170,7 @@ export class CreateCommand {
|
||||
const updatedCipher = await this.cipherService.saveAttachmentRawWithServer(
|
||||
cipher,
|
||||
fileName,
|
||||
new Uint8Array(fileBuf).buffer,
|
||||
new Uint8Array(fileBuf),
|
||||
activeUserId,
|
||||
);
|
||||
const decCipher = await this.cipherService.decrypt(updatedCipher, activeUserId);
|
||||
|
||||
@@ -169,7 +169,7 @@ export abstract class CipherService implements UserKeyRotationDataProvider<Ciphe
|
||||
abstract saveAttachmentRawWithServer(
|
||||
cipher: Cipher,
|
||||
filename: string,
|
||||
data: ArrayBuffer,
|
||||
data: Uint8Array,
|
||||
userId: UserId,
|
||||
admin?: boolean,
|
||||
): Promise<Cipher>;
|
||||
|
||||
@@ -1959,7 +1959,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
|
||||
const fd = new FormData();
|
||||
try {
|
||||
const blob = new Blob([encData.buffer], { type: "application/octet-stream" });
|
||||
const blob = new Blob([encData.buffer as BlobPart], { type: "application/octet-stream" });
|
||||
fd.append("key", dataEncKey[1].encryptedString);
|
||||
fd.append("data", blob, encFileName.encryptedString);
|
||||
fd.append("lastKnownRevisionDate", lastKnownRevisionDate.toISOString());
|
||||
|
||||
@@ -120,7 +120,7 @@ export class DownloadAttachmentComponent {
|
||||
|
||||
this.fileDownloadService.download({
|
||||
fileName: attachment.fileName,
|
||||
blobData: decBuf,
|
||||
blobData: decBuf as BlobPart,
|
||||
});
|
||||
} catch {
|
||||
this.toastService.showToast({
|
||||
|
||||
Reference in New Issue
Block a user