import { ChallengeService } from './../Challenge/ChallengeService'; import { DecryptedItem, DecryptedItemInterface, FileItem, SNNote } from '@standardnotes/models'; import { DiskStorageService } from '../Storage/DiskStorageService'; import { AbstractService, InternalEventBusInterface, Challenge, ChallengeReason, EncryptionService, MobileUnlockTiming, TimingDisplayOption, ProtectionsClientInterface, MutatorClientInterface, InternalEventHandlerInterface, InternalEventInterface, ProtectionEvent } from '@standardnotes/services'; import { ChallengeResponse } from '../Challenge'; /** * Enforces certain actions to require extra authentication, * like viewing a protected note, as well as managing how long that * authentication should be valid for. */ export declare class ProtectionService extends AbstractService implements ProtectionsClientInterface, InternalEventHandlerInterface { private encryption; private mutator; private challenges; private storage; protected internalEventBus: InternalEventBusInterface; private sessionExpiryTimeout; private mobilePasscodeTiming; private mobileBiometricsTiming; private isBiometricsSoftLockEngaged; private applicationStarted; constructor(encryption: EncryptionService, mutator: MutatorClientInterface, challenges: ChallengeService, storage: DiskStorageService, internalEventBus: InternalEventBusInterface); deinit(): void; handleEvent(event: InternalEventInterface): Promise; isLocked(): Promise; softLockBiometrics(): void; hasProtectionSources(): boolean; hasUnprotectedAccessSession(): boolean; hasBiometricsEnabled(): boolean; enableBiometrics(): boolean; disableBiometrics(): Promise; createLaunchChallenge(): Challenge | undefined; authorizeProtectedActionForItems(items: T[], challengeReason: ChallengeReason): Promise; authorizeItemAccess(item: DecryptedItem): Promise; authorizeAddingPasscode(): Promise; authorizeChangingPasscode(): Promise; authorizeRemovingPasscode(): Promise; authorizeSearchingProtectedNotesText(): Promise; authorizeFileImport(): Promise; authorizeBackupCreation(): Promise; authorizeMfaDisable(): Promise<{ success: boolean; challengeResponse?: ChallengeResponse; }>; authorizeAutolockIntervalChange(): Promise; authorizeSessionRevoking(): Promise; authorizeListedPublishing(): Promise; authorizeAccountDeletion(): Promise<{ success: boolean; challengeResponse?: ChallengeResponse; }>; authorizeAction(reason: ChallengeReason, dto: { fallBackToAccountPassword: boolean; requireAccountPassword: boolean; forcePrompt: boolean; }): Promise; authorizeActionWithChallengeResponse(reason: ChallengeReason, dto: { fallBackToAccountPassword: boolean; requireAccountPassword: boolean; forcePrompt: boolean; }): Promise<{ success: boolean; challengeResponse?: ChallengeResponse; }>; getMobilePasscodeTimingOptions(): TimingDisplayOption[]; getMobileBiometricsTimingOptions(): TimingDisplayOption[]; getMobileBiometricsTiming(): MobileUnlockTiming | undefined; getMobilePasscodeTiming(): MobileUnlockTiming | undefined; setMobileBiometricsTiming(timing: MobileUnlockTiming): void; setMobilePasscodeTiming(timing: MobileUnlockTiming): void; setMobileScreenshotPrivacyEnabled(isEnabled: boolean): void; getMobileScreenshotPrivacyEnabled(): boolean; private validateOrRenewSession; private validateOrRenewSessionWithChallengeResponse; getSessionExpiryDate(): Date; clearSession(): Promise; private setSessionExpiryDate; private getLastSessionLength; private setSessionLength; private updateSessionExpiryTimer; protectItems(items: I[]): Promise; unprotectItems(items: I[], reason: ChallengeReason): Promise; protectNote(note: SNNote): Promise; unprotectNote(note: SNNote): Promise; protectNotes(notes: SNNote[]): Promise; unprotectNotes(notes: SNNote[]): Promise; protectFile(file: FileItem): Promise; unprotectFile(file: FileItem): Promise; }