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; using Bit.Core.Utilities; namespace Bit.Core.Abstractions { public interface IStateService { bool BiometricLocked { get; set; } ExtendedObservableCollection AccountViews { get; set; } Task> GetUserIdsAsync(); Task GetActiveUserIdAsync(); Task SetActiveUserAsync(string userId); Task IsAuthenticatedAsync(string userId = null); Task HasMultipleAccountsAsync(); Task RefreshAccountViewsAsync(bool allowAddAccountRow); Task AddAccountAsync(Account account); Task ClearAsync(string userId); Task GetPreAuthEnvironmentUrlsAsync(); Task SetPreAuthEnvironmentUrlsAsync(EnvironmentUrlData value); Task GetEnvironmentUrlsAsync(string userId = null); Task GetBiometricUnlockAsync(string userId = null); Task SetBiometricUnlockAsync(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 GetPinProtectedCachedAsync(string userId = null); Task SetPinProtectedCachedAsync(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(string userId = null); Task SetAutofillTileAddedAsync(bool? value, string userId = null); Task GetEmailAsync(string userId = null); // Task SetEmailAsync(string value, 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(string value, string userId = null); Task GetLastFileCacheClearAsync(string userId = null); Task SetLastFileCacheClearAsync(DateTime? value, string userId = null); 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(string userId = null); Task SetLastBuildAsync(string value, string userId = null); 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 GetForcePasswordReset(string userId = null); Task SetForcePasswordResetAsync(bool? value, string userId = null); Task GetSyncOnRefreshAsync(string userId = null); Task SetSyncOnRefreshAsync(bool? value, string userId = null); Task GetRememberedEmailAsync(string userId = null); Task SetRememberedEmailAsync(string value, string userId = null); Task GetRememberEmailAsync(string userId = null); Task SetRememberEmailAsync(bool? value, string userId = null); Task GetRememberedOrgIdentifierAsync(string userId = null); Task SetRememberedOrgIdentifierAsync(string value, string userId = null); Task GetRememberOrgIdentifierAsync(string userId = null); Task SetRememberOrgIdentifierAsync(bool? value, string userId = null); Task GetThemeAsync(string userId = null); Task SetThemeAsync(string value, string userId = null); Task GetAddSitePromptShownAsync(string userId = null); Task SetAddSitePromptShownAsync(bool? value, string userId = null); Task GetMigratedFromV1Async(string userId = null); Task SetMigratedFromV1Async(bool? value, string userId = null); Task GetMigratedFromV1AutofillPromptShownAsync(string userId = null); Task SetMigratedFromV1AutofillPromptShownAsync(bool? value, string userId = null); Task GetTriedV1ResyncAsync(string userId = null); Task SetTriedV1ResyncAsync(bool? value, string userId = null); Task GetPushInitialPromptShownAsync(string userId = null); Task SetPushInitialPromptShownAsync(bool? value, string userId = null); Task GetPushLastRegistrationDateAsync(string userId = null); Task SetPushLastRegistrationDateAsync(DateTime? value, string userId = null); Task GetPushCurrentTokenAsync(string userId = null); Task SetPushCurrentTokenAsync(string value, string userId = null); Task> GetEventCollectionAsync(string userId = null); Task SetEventCollectionAsync(List value, string userId = null); 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 GetAppExtensionStartedAsync(string userId = null); Task SetAppExtensionStartedAsync(bool? value, string userId = null); Task GetAppExtensionActivatedAsync(string userId = null); Task SetAppExtensionActivatedAsync(bool? value, string userId = null); Task GetAppIdAsync(string userId = null); Task SetAppIdAsync(string value, string userId = null); 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); } }