import { HistoryServiceInterface } from './../History/HistoryServiceInterface' import { InternalEventBusInterface } from './../Internal/InternalEventBusInterface' import { PreferenceServiceInterface } from './../Preferences/PreferenceServiceInterface' import { AsymmetricMessageServiceInterface } from './../AsymmetricMessage/AsymmetricMessageServiceInterface' import { SyncOptions } from './../Sync/SyncOptions' import { ImportDataReturnType } from './../Mutator/ImportDataUseCase' import { ChallengeServiceInterface } from './../Challenge/ChallengeServiceInterface' import { VaultServiceInterface } from './../Vaults/VaultServiceInterface' import { ApplicationIdentifier } from '@standardnotes/common' import { BackupFile, DecryptedItemInterface, DecryptedItemMutator, ItemStream, PayloadEmitSource, Platform, PrefKey, PrefValue, } from '@standardnotes/models' import { BackupServiceInterface, FilesClientInterface } from '@standardnotes/files' import { AlertService } from '../Alert/AlertService' import { ComponentManagerInterface } from '../Component/ComponentManagerInterface' import { ApplicationEvent } from '../Event/ApplicationEvent' import { ApplicationEventCallback } from '../Event/ApplicationEventCallback' import { FeaturesClientInterface } from '../Feature/FeaturesClientInterface' import { SubscriptionManagerInterface } from '../Subscription/SubscriptionManagerInterface' import { DeviceInterface } from '../Device/DeviceInterface' import { ItemManagerInterface } from '../Item/ItemManagerInterface' import { MutatorClientInterface } from '../Mutator/MutatorClientInterface' import { StorageValueModes } from '../Storage/StorageTypes' import { DeinitMode } from './DeinitMode' import { DeinitSource } from './DeinitSource' import { UserClientInterface } from '../User/UserClientInterface' import { SessionsClientInterface } from '../Session/SessionsClientInterface' import { HomeServerServiceInterface } from '../HomeServer/HomeServerServiceInterface' import { User } from '@standardnotes/responses' import { EncryptionProviderInterface } from '../Encryption/EncryptionProviderInterface' export interface ApplicationInterface { deinit(mode: DeinitMode, source: DeinitSource): void getDeinitMode(): DeinitMode isStarted(): boolean isLaunched(): boolean addEventObserver(callback: ApplicationEventCallback, singleEvent?: ApplicationEvent): () => void addSingleEventObserver(event: ApplicationEvent, callback: ApplicationEventCallback): () => void hasProtectionSources(): boolean createEncryptedBackupFileForAutomatedDesktopBackups(): Promise createEncryptedBackupFile(): Promise createDecryptedBackupFile(): Promise hasPasscode(): boolean lock(): Promise softLockBiometrics(): void setValue(key: string, value: unknown, mode?: StorageValueModes): void getValue(key: string, mode?: StorageValueModes): T removeValue(key: string, mode?: StorageValueModes): Promise isLocked(): Promise getPreference(key: K): PrefValue[K] | undefined getPreference(key: K, defaultValue: PrefValue[K]): PrefValue[K] getPreference(key: K, defaultValue?: PrefValue[K]): PrefValue[K] | undefined setPreference(key: K, value: PrefValue[K]): Promise streamItems( contentType: string | string[], stream: ItemStream, ): () => void getUser(): User | undefined hasAccount(): boolean setCustomHost(host: string): Promise isThirdPartyHostUsed(): boolean isUsingHomeServer(): Promise getNewSubscriptionToken(): Promise importData(data: BackupFile, awaitSync?: boolean): Promise /** * Mutates a pre-existing item, marks it as dirty, and syncs it */ changeAndSaveItem( itemToLookupUuidFor: DecryptedItemInterface, mutate: (mutator: M) => void, updateTimestamps?: boolean, emitSource?: PayloadEmitSource, syncOptions?: SyncOptions, ): Promise /** * Mutates pre-existing items, marks them as dirty, and syncs */ changeAndSaveItems( itemsToLookupUuidsFor: DecryptedItemInterface[], mutate: (mutator: M) => void, updateTimestamps?: boolean, emitSource?: PayloadEmitSource, syncOptions?: SyncOptions, ): Promise get features(): FeaturesClientInterface get componentManager(): ComponentManagerInterface get items(): ItemManagerInterface get mutator(): MutatorClientInterface get user(): UserClientInterface get files(): FilesClientInterface get subscriptions(): SubscriptionManagerInterface get fileBackups(): BackupServiceInterface | undefined get sessions(): SessionsClientInterface get homeServer(): HomeServerServiceInterface | undefined get vaults(): VaultServiceInterface get challenges(): ChallengeServiceInterface get alerts(): AlertService get asymmetric(): AsymmetricMessageServiceInterface get preferences(): PreferenceServiceInterface get events(): InternalEventBusInterface get history(): HistoryServiceInterface get encryption(): EncryptionProviderInterface readonly identifier: ApplicationIdentifier readonly platform: Platform device: DeviceInterface }