Remove references to internal js-sdk type CryptoBackend (#12321)

* Remove references to internal js-sdk type `CryptoBackend`

* Use `Paramteters` to avoid `ts-ignore`
This commit is contained in:
Richard van der Hoff 2024-03-06 22:59:41 +00:00 committed by GitHub
parent 8bd74f517c
commit 91020b3d00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 8 deletions

View file

@ -125,8 +125,6 @@ module.exports = {
"!matrix-js-sdk/src/crypto/verification/QRCode", "!matrix-js-sdk/src/crypto/verification/QRCode",
"!matrix-js-sdk/src/crypto/verification/request", "!matrix-js-sdk/src/crypto/verification/request",
"!matrix-js-sdk/src/crypto/verification/request/VerificationRequest", "!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",
"!matrix-js-sdk/src/oidc/discovery", "!matrix-js-sdk/src/oidc/discovery",
"!matrix-js-sdk/src/oidc/authorize", "!matrix-js-sdk/src/oidc/authorize",

View file

@ -29,7 +29,6 @@ import {
TweakName, TweakName,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { EventEncryptionInfo, EventShieldColour, EventShieldReason } from "matrix-js-sdk/src/crypto-api"; 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 { TooltipProvider } from "@vector-im/compound-web";
import EventTile, { EventTileProps } from "../../../../src/components/views/rooms/EventTile"; import EventTile, { EventTileProps } from "../../../../src/components/views/rooms/EventTile";
@ -320,8 +319,7 @@ describe("EventTile", () => {
decryptEvent: async (_ev): Promise<IEventDecryptionResult> => { decryptEvent: async (_ev): Promise<IEventDecryptionResult> => {
throw new Error("can't decrypt"); throw new Error("can't decrypt");
}, },
} as CryptoBackend; } as Parameters<MatrixEvent["attemptDecryption"]>[0];
await mxEvent.attemptDecryption(mockCrypto); await mxEvent.attemptDecryption(mockCrypto);
const { container } = getComponent(); const { container } = getComponent();

View file

@ -43,7 +43,6 @@ import { normalize } from "matrix-js-sdk/src/utils";
import { ReEmitter } from "matrix-js-sdk/src/ReEmitter"; import { ReEmitter } from "matrix-js-sdk/src/ReEmitter";
import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler"; import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler";
import { Feature, ServerSupport } from "matrix-js-sdk/src/feature"; 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"; import { MapperOpts } from "matrix-js-sdk/src/event-mapper";
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import { MatrixRTCSessionManager } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSessionManager"; import { MatrixRTCSessionManager } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSessionManager";
@ -442,8 +441,7 @@ export async function mkEncryptedEvent(opts: {
const mockCrypto = { const mockCrypto = {
decryptEvent: async (_ev): Promise<IEventDecryptionResult> => decryptionResult, decryptEvent: async (_ev): Promise<IEventDecryptionResult> => decryptionResult,
} as CryptoBackend; } as Parameters<MatrixEvent["attemptDecryption"]>[0];
await mxEvent.attemptDecryption(mockCrypto); await mxEvent.attemptDecryption(mockCrypto);
return mxEvent; return mxEvent;
} }