diff --git a/package.json b/package.json index 928479c9d6..271208c879 100644 --- a/package.json +++ b/package.json @@ -223,7 +223,7 @@ "stylelint-config-standard": "^36.0.0", "stylelint-scss": "^6.0.0", "ts-node": "^10.9.1", - "typescript": "5.3.3" + "typescript": "5.4.2" }, "peerDependencies": { "postcss": "^8.4.19", diff --git a/playwright/global.d.ts b/playwright/global.d.ts index 166bfbe993..9663b9310f 100644 --- a/playwright/global.d.ts +++ b/playwright/global.d.ts @@ -31,3 +31,10 @@ declare global { matrixcs: typeof Matrix; } } + +// Workaround for lack of strict mode not resolving complex types correctly +declare module "matrix-js-sdk/src/http-api/index.ts" { + interface UploadResponse { + json(): Promise; + } +} diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index b1c8a4ec14..c62733c0f0 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -151,16 +151,10 @@ declare global { interface HTMLAudioElement { type?: string; - // sinkId & setSinkId are experimental and typescript doesn't know about them - sinkId: string; - setSinkId(outputId: string): void; } interface HTMLVideoElement { type?: string; - // sinkId & setSinkId are experimental and typescript doesn't know about them - sinkId: string; - setSinkId(outputId: string): void; } // Add Chrome-specific `instant` ScrollBehaviour diff --git a/src/components/views/dialogs/devtools/BaseTool.tsx b/src/components/views/dialogs/devtools/BaseTool.tsx index 49bcd76009..e5f93ead3f 100644 --- a/src/components/views/dialogs/devtools/BaseTool.tsx +++ b/src/components/views/dialogs/devtools/BaseTool.tsx @@ -60,7 +60,7 @@ const BaseTool: React.FC> = ({ let actionButton: ReactNode = null; if (message) { children = message; - } else if (onAction) { + } else if (onAction && actionLabel) { const onActionClick = (): void => { onAction().then((msg) => { if (typeof msg === "string") { diff --git a/src/components/views/settings/account/PhoneNumbers.tsx b/src/components/views/settings/account/PhoneNumbers.tsx index 27c2bdf104..b037643bc0 100644 --- a/src/components/views/settings/account/PhoneNumbers.tsx +++ b/src/components/views/settings/account/PhoneNumbers.tsx @@ -16,7 +16,7 @@ limitations under the License. */ import React from "react"; -import { ThreepidMedium } from "matrix-js-sdk/src/matrix"; +import { IAuthData, ThreepidMedium } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t, UserFriendlyError } from "../../../../languageHandler"; @@ -216,7 +216,7 @@ export default class PhoneNumbers extends React.Component { const address = this.state.verifyMsisdn; this.state.addTask ?.haveMsisdnToken(token) - .then(([finished] = []) => { + .then(([finished]: [success?: boolean, result?: IAuthData | Error | null] = []) => { let newPhoneNumber = this.state.newPhoneNumber; if (finished !== false) { const msisdns = [...this.props.msisdns, { address, medium: ThreepidMedium.Phone }]; diff --git a/yarn.lock b/yarn.lock index 68fc700e52..ea4f6367de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9154,10 +9154,10 @@ typed-array-length@^1.0.4, typed-array-length@^1.0.5: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" -typescript@5.3.3: - version "5.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" - integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== +typescript@5.4.2: + version "5.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372" + integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ== ua-parser-js@^1.0.2: version "1.0.37"