From 91020b3d0066a310a0ad55a41ece33899b882a18 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Wed, 6 Mar 2024 22:59:41 +0000 Subject: [PATCH] Remove references to internal js-sdk type `CryptoBackend` (#12321) * Remove references to internal js-sdk type `CryptoBackend` * Use `Paramteters` to avoid `ts-ignore` --- .eslintrc.js | 2 -- test/components/views/rooms/EventTile-test.tsx | 4 +--- test/test-utils/test-utils.ts | 4 +--- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 342dbde484..0d877a7bbb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -125,8 +125,6 @@ module.exports = { "!matrix-js-sdk/src/crypto/verification/QRCode", "!matrix-js-sdk/src/crypto/verification/request", "!matrix-js-sdk/src/crypto/verification/request/VerificationRequest", - "!matrix-js-sdk/src/common-crypto", - "!matrix-js-sdk/src/common-crypto/CryptoBackend", "!matrix-js-sdk/src/oidc", "!matrix-js-sdk/src/oidc/discovery", "!matrix-js-sdk/src/oidc/authorize", diff --git a/test/components/views/rooms/EventTile-test.tsx b/test/components/views/rooms/EventTile-test.tsx index b46eef44b8..ce89a9fe8f 100644 --- a/test/components/views/rooms/EventTile-test.tsx +++ b/test/components/views/rooms/EventTile-test.tsx @@ -29,7 +29,6 @@ import { TweakName, } from "matrix-js-sdk/src/matrix"; import { EventEncryptionInfo, EventShieldColour, EventShieldReason } from "matrix-js-sdk/src/crypto-api"; -import { CryptoBackend } from "matrix-js-sdk/src/common-crypto/CryptoBackend"; import { TooltipProvider } from "@vector-im/compound-web"; import EventTile, { EventTileProps } from "../../../../src/components/views/rooms/EventTile"; @@ -320,8 +319,7 @@ describe("EventTile", () => { decryptEvent: async (_ev): Promise => { throw new Error("can't decrypt"); }, - } as CryptoBackend; - + } as Parameters[0]; await mxEvent.attemptDecryption(mockCrypto); const { container } = getComponent(); diff --git a/test/test-utils/test-utils.ts b/test/test-utils/test-utils.ts index a79a7ce5f0..fd4a83e208 100644 --- a/test/test-utils/test-utils.ts +++ b/test/test-utils/test-utils.ts @@ -43,7 +43,6 @@ import { normalize } from "matrix-js-sdk/src/utils"; import { ReEmitter } from "matrix-js-sdk/src/ReEmitter"; import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler"; import { Feature, ServerSupport } from "matrix-js-sdk/src/feature"; -import { CryptoBackend } from "matrix-js-sdk/src/common-crypto/CryptoBackend"; import { MapperOpts } from "matrix-js-sdk/src/event-mapper"; // eslint-disable-next-line no-restricted-imports import { MatrixRTCSessionManager } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSessionManager"; @@ -442,8 +441,7 @@ export async function mkEncryptedEvent(opts: { const mockCrypto = { decryptEvent: async (_ev): Promise => decryptionResult, - } as CryptoBackend; - + } as Parameters[0]; await mxEvent.attemptDecryption(mockCrypto); return mxEvent; }