using Bit.Core.Enums; using Bit.Core.Models.Data; using Bit.Core.Models.Domain; using Bit.Core.Models.Response; using Bit.Core.Models.View; using BwRegion = Bit.Core.Enums.Region; namespace Bit.Core.Abstractions { public interface IStateService { List AccountViews { get; } Task GetUserKeyAsync(string userId = null); Task SetUserKeyAsync(UserKey value, string userId = null); Task GetMasterKeyAsync(string userId = null); Task SetMasterKeyAsync(MasterKey value, string userId = null); Task GetMasterKeyEncryptedUserKeyAsync(string userId = null); Task SetMasterKeyEncryptedUserKeyAsync(string value, string userId = null); Task GetUserKeyAutoUnlockAsync(string userId = null); Task SetUserKeyAutoUnlockAsync(UserKey value, string userId = null); Task GetActiveUserIdAsync(); Task GetActiveUserEmailAsync(); Task GetActiveUserCustomDataAsync(Func dataMapper); Task IsActiveAccountAsync(string userId = null); Task SetActiveUserAsync(string userId); Task CheckExtensionActiveUserAndSwitchIfNeededAsync(); Task IsAuthenticatedAsync(string userId = null); Task GetUserIdAsync(string email); Task RefreshAccountViewsAsync(bool allowAddAccountRow); Task AddAccountAsync(Account account); Task LogoutAccountAsync(string userId, bool userInitiated); Task GetPreAuthEnvironmentUrlsAsync(); Task SetPreAuthEnvironmentUrlsAsync(EnvironmentUrlData value); Task GetEnvironmentUrlsAsync(string userId = null); Task GetUserKeyBiometricUnlockAsync(string userId = null); Task SetUserKeyBiometricUnlockAsync(UserKey value, string userId = null); Task GetBiometricUnlockAsync(string userId = null); Task SetBiometricUnlockAsync(bool? value, string userId = null); Task GetBiometricLockedAsync(string userId = null); Task SetBiometricLockedAsync(bool value, string userId = null); Task GetSystemBiometricIntegrityState(string bioIntegritySrcKey); Task SetSystemBiometricIntegrityState(string bioIntegritySrcKey, string systemBioIntegrityState); Task IsAccountBiometricIntegrityValidAsync(string bioIntegritySrcKey, string userId = null); Task SetAccountBiometricIntegrityValidAsync(string bioIntegritySrcKey, string userId = null); Task CanAccessPremiumAsync(string userId = null); Task GetProtectedPinAsync(string userId = null); Task SetPersonalPremiumAsync(bool value, string userId = null); Task GetPinKeyEncryptedUserKeyAsync(string userId = null); Task SetPinKeyEncryptedUserKeyAsync(EncString value, string userId = null); Task GetPinKeyEncryptedUserKeyEphemeralAsync(string userId = null); Task SetPinKeyEncryptedUserKeyEphemeralAsync(EncString value, string userId = null); Task SetProtectedPinAsync(string value, string userId = null); Task SetKdfConfigurationAsync(KdfConfig config, string userId = null); Task GetKeyHashAsync(string userId = null); Task SetKeyHashAsync(string value, string userId = null); Task> GetOrgKeysEncryptedAsync(string userId = null); Task SetOrgKeysEncryptedAsync(Dictionary value, string userId = null); Task GetPrivateKeyEncryptedAsync(string userId = null); Task SetPrivateKeyEncryptedAsync(string value, string userId = null); Task GetDeviceKeyAsync(string userId = null); Task SetDeviceKeyAsync(SymmetricCryptoKey value, string userId = null); Task> GetAutofillBlacklistedUrisAsync(string userId = null); Task SetAutofillBlacklistedUrisAsync(List value, string userId = null); Task GetAutofillTileAddedAsync(); Task SetAutofillTileAddedAsync(bool? value); Task GetEmailAsync(string userId = null); Task GetNameAsync(string userId = null); Task SetNameAsync(string value, string userId = null); Task GetOrgIdentifierAsync(string userId = null); Task GetLastActiveTimeAsync(string userId = null); Task SetLastActiveTimeAsync(long? value, string userId = null); Task GetVaultTimeoutAsync(string userId = null); Task SetVaultTimeoutAsync(int? value, string userId = null); Task GetVaultTimeoutActionAsync(string userId = null); Task SetVaultTimeoutActionAsync(VaultTimeoutAction? value, string userId = null); Task GetLastFileCacheClearAsync(); Task SetLastFileCacheClearAsync(DateTime? value); Task GetPreviousPageInfoAsync(string userId = null); Task SetPreviousPageInfoAsync(PreviousPageInfo value, string userId = null); Task GetInvalidUnlockAttemptsAsync(string userId = null); Task SetInvalidUnlockAttemptsAsync(int? value, string userId = null); Task GetLastBuildAsync(); Task SetLastBuildAsync(string value); Task GetDisableFaviconAsync(); Task SetDisableFaviconAsync(bool? value); Task GetDisableAutoTotpCopyAsync(string userId = null); Task SetDisableAutoTotpCopyAsync(bool? value, string userId = null); Task GetInlineAutofillEnabledAsync(string userId = null); Task SetInlineAutofillEnabledAsync(bool? value, string userId = null); Task GetAutofillDisableSavePromptAsync(string userId = null); Task SetAutofillDisableSavePromptAsync(bool? value, string userId = null); Task>> GetCiphersLocalDataAsync(string userId = null); Task SetCiphersLocalDataAsync(Dictionary> value, string userId = null); Task> GetEncryptedCiphersAsync(string userId = null); Task SetEncryptedCiphersAsync(Dictionary value, string userId = null); Task GetDefaultUriMatchAsync(string userId = null); Task SetDefaultUriMatchAsync(int? value, string userId = null); Task GetClearClipboardAsync(string userId = null); Task SetClearClipboardAsync(int? value, string userId = null); Task> GetEncryptedCollectionsAsync(string userId = null); Task SetEncryptedCollectionsAsync(Dictionary value, string userId = null); Task GetPasswordRepromptAutofillAsync(string userId = null); Task SetPasswordRepromptAutofillAsync(bool? value, string userId = null); Task GetPasswordVerifiedAutofillAsync(string userId = null); Task SetPasswordVerifiedAutofillAsync(bool? value, string userId = null); Task GetLastSyncAsync(string userId = null); Task SetLastSyncAsync(DateTime? value, string userId = null); Task GetSecurityStampAsync(string userId = null); Task SetSecurityStampAsync(string value, string userId = null); Task GetEmailVerifiedAsync(string userId = null); Task SetEmailVerifiedAsync(bool? value, string userId = null); Task GetSyncOnRefreshAsync(string userId = null); Task SetSyncOnRefreshAsync(bool? value, string userId = null); Task GetRememberedEmailAsync(); Task SetRememberedEmailAsync(string value); Task GetRememberedOrgIdentifierAsync(); Task SetRememberedOrgIdentifierAsync(string value); Task GetThemeAsync(); Task SetThemeAsync(string value); Task GetAutoDarkThemeAsync(); Task SetAutoDarkThemeAsync(string value); Task GetAddSitePromptShownAsync(string userId = null); Task SetAddSitePromptShownAsync(bool? value, string userId = null); Task GetPushInitialPromptShownAsync(); Task SetPushInitialPromptShownAsync(bool? value); Task GetPushLastRegistrationDateAsync(string userId = null); Task SetPushLastRegistrationDateAsync(DateTime? value, string userId = null); Task GetPushInstallationRegistrationErrorAsync(); Task SetPushInstallationRegistrationErrorAsync(string value); Task GetPushCurrentTokenAsync(string userId = null); Task SetPushCurrentTokenAsync(string value, string userId = null); Task> GetEventCollectionAsync(); Task SetEventCollectionAsync(List value); Task> GetEncryptedFoldersAsync(string userId = null); Task SetEncryptedFoldersAsync(Dictionary value, string userId = null); Task> GetEncryptedPoliciesAsync(string userId = null); Task SetEncryptedPoliciesAsync(Dictionary value, string userId = null); Task GetPushRegisteredTokenAsync(); Task SetPushRegisteredTokenAsync(string value); Task GetUsesKeyConnectorAsync(string userId = null); Task SetUsesKeyConnectorAsync(bool? value, string userId = null); Task GetForcePasswordResetReasonAsync(string userId = null); Task SetForcePasswordResetReasonAsync(ForcePasswordResetReason? value, string userId = null); Task> GetOrganizationsAsync(string userId = null); Task SetOrganizationsAsync(Dictionary organizations, string userId = null); Task GetPasswordGenerationOptionsAsync(string userId = null); Task SetPasswordGenerationOptionsAsync(PasswordGenerationOptions value, string userId = null); Task> GetEncryptedPasswordGenerationHistory(string userId = null); Task SetEncryptedPasswordGenerationHistoryAsync(List value, string userId = null); Task> GetEncryptedSendsAsync(string userId = null); Task SetEncryptedSendsAsync(Dictionary value, string userId = null); Task> GetSettingsAsync(string userId = null); Task SetSettingsAsync(Dictionary value, string userId = null); Task GetAccessTokenAsync(string userId = null); Task SetAccessTokenAsync(string value, bool skipTokenStorage, string userId = null); Task GetRefreshTokenAsync(string userId = null); Task SetRefreshTokenAsync(string value, bool skipTokenStorage, string userId = null); Task GetTwoFactorTokenAsync(string email = null); Task SetTwoFactorTokenAsync(string value, string email = null); Task GetScreenCaptureAllowedAsync(string userId = null); Task SetScreenCaptureAllowedAsync(bool value, string userId = null); Task SaveExtensionActiveUserIdToStorageAsync(string userId); Task GetApprovePasswordlessLoginsAsync(string userId = null); Task SetApprovePasswordlessLoginsAsync(bool? value, string userId = null); Task GetPasswordlessLoginNotificationAsync(); Task SetPasswordlessLoginNotificationAsync(PasswordlessRequestNotification value); Task GetUsernameGenerationOptionsAsync(string userId = null); Task SetUsernameGenerationOptionsAsync(UsernameGenerationOptions value, string userId = null); Task GetShouldConnectToWatchAsync(string userId = null); Task SetShouldConnectToWatchAsync(bool shouldConnect, string userId = null); Task GetLastUserShouldConnectToWatchAsync(); Task SetAvatarColorAsync(string value, string userId = null); Task GetAvatarColorAsync(string userId = null); Task GetPreLoginEmailAsync(); Task SetPreLoginEmailAsync(string value); Task GetAccountDecryptionOptions(string userId = null); Task GetPendingAdminAuthRequestAsync(string userId = null); Task SetPendingAdminAuthRequestAsync(PendingAdminAuthRequest value, string userId = null); string GetLocale(); void SetLocale(string locale); ConfigResponse GetConfigs(); void SetConfigs(ConfigResponse value); Task GetShouldTrustDeviceAsync(); Task SetShouldTrustDeviceAsync(bool value); Task SetUserHasMasterPasswordAsync(bool value, string userId = null); Task GetActiveUserRegionAsync(); Task GetPreAuthRegionAsync(); Task SetPreAuthRegionAsync(BwRegion value); Task ReloadStateAsync(); Task GetShouldCheckOrganizationUnassignedItemsAsync(string userId = null); Task SetShouldCheckOrganizationUnassignedItemsAsync(bool shouldCheck, string userId = null); [Obsolete("Use GetPinKeyEncryptedUserKeyAsync instead, left for migration purposes")] Task GetPinProtectedAsync(string userId = null); [Obsolete("Use SetPinKeyEncryptedUserKeyAsync instead, left for migration purposes")] Task SetPinProtectedAsync(string value, string userId = null); [Obsolete("Use GetPinKeyEncryptedUserKeyEphemeralAsync instead, left for migration purposes")] Task GetPinProtectedKeyAsync(string userId = null); [Obsolete("Use SetPinKeyEncryptedUserKeyEphemeralAsync instead, left for migration purposes")] Task SetPinProtectedKeyAsync(EncString value, string userId = null); [Obsolete("Use GetMasterKeyEncryptedUserKeyAsync instead, left for migration purposes")] Task GetEncKeyEncryptedAsync(string userId = null); [Obsolete("Use SetMasterKeyEncryptedUserKeyAsync instead, left for migration purposes")] Task SetEncKeyEncryptedAsync(string value, string userId = null); [Obsolete("Left for migration purposes")] Task SetKeyEncryptedAsync(string value, string userId = null); [Obsolete("Use GetUserKeyAutoUnlock instead, left for migration purposes")] Task GetKeyEncryptedAsync(string userId = null); [Obsolete("Use GetMasterKeyAsync instead, left for migration purposes")] Task GetKeyDecryptedAsync(string userId = null); } }