using System; using System.Collections.Generic; using System.Threading.Tasks; using Bit.Core.Enums; using Bit.Core.Models.Data; using Bit.Core.Models.Domain; using Bit.Core.Models.View; namespace Bit.Core.Abstractions { public interface IStateService { List AccountViews { get; } Task GetActiveUserIdAsync(); 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 GetBiometricUnlockAsync(string userId = null); Task SetBiometricUnlockAsync(bool? value, string userId = null); Task GetBiometricLockedAsync(string userId = null); Task SetBiometricLockedAsync(bool value, string userId = null); Task CanAccessPremiumAsync(string userId = null); Task GetProtectedPinAsync(string userId = null); Task SetProtectedPinAsync(string value, string userId = null); Task GetPinProtectedAsync(string userId = null); Task SetPinProtectedAsync(string value, string userId = null); Task GetPinProtectedKeyAsync(string userId = null); Task SetPinProtectedKeyAsync(EncString value, string userId = null); Task GetKdfTypeAsync(string userId = null); Task SetKdfTypeAsync(KdfType? value, string userId = null); Task GetKdfIterationsAsync(string userId = null); Task SetKdfIterationsAsync(int? value, string userId = null); Task GetKeyEncryptedAsync(string userId = null); Task SetKeyEncryptedAsync(string value, string userId = null); Task GetKeyDecryptedAsync(string userId = null); Task SetKeyDecryptedAsync(SymmetricCryptoKey value, string userId = null); Task GetKeyHashAsync(string userId = null); Task SetKeyHashAsync(string value, string userId = null); Task GetEncKeyEncryptedAsync(string userId = null); Task SetEncKeyEncryptedAsync(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> 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(string userId = null); Task SetDisableFaviconAsync(bool? value, string userId = null); 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>> GetLocalDataAsync(string userId = null); Task SetLocalDataAsync(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> GetNeverDomainsAsync(string userId = null); Task SetNeverDomainsAsync(HashSet 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(string userId = null); Task SetThemeAsync(string value, string userId = null); Task GetAutoDarkThemeAsync(string userId = null); Task SetAutoDarkThemeAsync(string value, string userId = null); Task GetAddSitePromptShownAsync(string userId = null); Task SetAddSitePromptShownAsync(bool? value, string userId = null); Task GetPushInitialPromptShownAsync(); Task SetPushInitialPromptShownAsync(bool? value); Task GetPushLastRegistrationDateAsync(); Task SetPushLastRegistrationDateAsync(DateTime? value); Task GetPushInstallationRegistrationErrorAsync(); Task SetPushInstallationRegistrationErrorAsync(string value); Task GetPushCurrentTokenAsync(); Task SetPushCurrentTokenAsync(string value); 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> 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 SaveExtensionActiveUserIdToStorageAsync(string userId); } }