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:
25
libs/state/src/legacy/state.service.ts
Normal file
25
libs/state/src/legacy/state.service.ts
Normal 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user