From c0bb43776ad0fd1ca5342346390a30dada76a4d4 Mon Sep 17 00:00:00 2001 From: owenpearson Date: Wed, 8 Oct 2025 13:58:54 +0100 Subject: [PATCH] fix(typings): allow generic `Error` in authCallback callback --- ably.d.ts | 2 +- src/common/lib/client/auth.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ably.d.ts b/ably.d.ts index 012de0fe3f..e8bcbb3a3a 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -650,7 +650,7 @@ export interface AuthOptions { * @param tokenRequestOrDetails - A valid `TokenRequest`, `TokenDetails` or Ably JWT to be used for authentication. */ callback: ( - error: ErrorInfo | string | null, + error: Error | string | null, tokenRequestOrDetails: TokenDetails | TokenRequest | string | null, ) => void, ): void; diff --git a/src/common/lib/client/auth.ts b/src/common/lib/client/auth.ts index d457ce10c3..218ba4189a 100644 --- a/src/common/lib/client/auth.ts +++ b/src/common/lib/client/auth.ts @@ -400,7 +400,7 @@ class Auth { let tokenRequestCallback: ( data: API.TokenParams, callback: ( - error: API.ErrorInfo | RequestResultError | string | null, + error: API.ErrorInfo | Error | RequestResultError | string | null, tokenRequestOrDetails: API.TokenDetails | API.TokenRequest | string | null, contentType?: string, ) => void,