1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

[PM-24677] Slim StateService down so it can be moved to state lib (#16021)

* Slim StateService down so it can be moved to state lib

* Fix accidental import changes

* Add `switchAccount` assertion

* Needs to use mock
This commit is contained in:
Justin Baur
2025-08-18 12:37:25 -04:00
committed by GitHub
parent ea305a0f71
commit 939fd402c3
49 changed files with 286 additions and 1274 deletions

View File

@@ -0,0 +1,25 @@
import { UserId } from "@bitwarden/user-core";
export type RequiredUserId = { userId: UserId };
/**
* This class exists for various legacy reasons, there are likely better things to use than this service.
*/
export abstract class StateService {
abstract clean(options: RequiredUserId): Promise<void>;
/**
* Gets the user's auto key
*/
abstract getUserKeyAutoUnlock(options: RequiredUserId): Promise<string | null>;
/**
* Sets the user's auto key
*/
abstract setUserKeyAutoUnlock(value: string | null, options: RequiredUserId): Promise<void>;
/**
* @deprecated For backwards compatible purposes only, use DesktopAutofillSettingsService
*/
abstract setEnableDuckDuckGoBrowserIntegration(value: boolean): Promise<void>;
abstract getDuckDuckGoSharedKey(): Promise<string | null>;
abstract setDuckDuckGoSharedKey(value: string): Promise<void>;
}