1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-23 21:31:29 +01:00

Fix sdk client undefined (#13003)

* feat: remove undefined from `client$`

* feat: add undefined to `userClient$`

* feat: implement TS strict for SdkService
This commit is contained in:
Andreas Coroiu 2025-01-22 14:25:10 +01:00 committed by GitHub
parent 09748389e7
commit c97e937333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { Observable } from "rxjs"; import { Observable } from "rxjs";
import { BitwardenClient } from "@bitwarden/sdk-internal"; import { BitwardenClient } from "@bitwarden/sdk-internal";
@ -10,13 +8,13 @@ export abstract class SdkService {
/** /**
* Retrieve the version of the SDK. * Retrieve the version of the SDK.
*/ */
version$: Observable<string>; abstract version$: Observable<string>;
/** /**
* Retrieve a client initialized without a user. * Retrieve a client initialized without a user.
* This client can only be used for operations that don't require a user context. * This client can only be used for operations that don't require a user context.
*/ */
client$: Observable<BitwardenClient | undefined>; abstract client$: Observable<BitwardenClient>;
/** /**
* Retrieve a client initialized for a specific user. * Retrieve a client initialized for a specific user.
@ -29,5 +27,5 @@ export abstract class SdkService {
* *
* @param userId * @param userId
*/ */
abstract userClient$(userId: UserId): Observable<BitwardenClient>; abstract userClient$(userId: UserId): Observable<BitwardenClient | undefined>;
} }