import { ClientDisplayableError, SharedVaultInviteServerHash, SharedVaultUserServerHash, SharedVaultPermission, } from '@standardnotes/responses' import { DecryptedItemInterface, TrustedContactInterface, SharedVaultListingInterface, VaultListingInterface, KeySystemRootKeyStorageMode, } from '@standardnotes/models' import { AbstractService } from '../Service/AbstractService' import { SharedVaultServiceEvent, SharedVaultServiceEventPayload } from './SharedVaultServiceEvent' import { PendingSharedVaultInviteRecord } from './PendingSharedVaultInviteRecord' export interface SharedVaultServiceInterface extends AbstractService { createSharedVault(dto: { name: string description?: string userInputtedPassword: string | undefined storagePreference?: KeySystemRootKeyStorageMode }): Promise deleteSharedVault(sharedVault: SharedVaultListingInterface): Promise convertVaultToSharedVault(vault: VaultListingInterface): Promise inviteContactToSharedVault( sharedVault: SharedVaultListingInterface, contact: TrustedContactInterface, permissions: SharedVaultPermission, ): Promise removeUserFromSharedVault( sharedVault: SharedVaultListingInterface, userUuid: string, ): Promise leaveSharedVault(sharedVault: SharedVaultListingInterface): Promise getSharedVaultUsers(sharedVault: SharedVaultListingInterface): Promise isSharedVaultUserSharedVaultOwner(user: SharedVaultUserServerHash): boolean isCurrentUserSharedVaultAdmin(sharedVault: SharedVaultListingInterface): boolean getItemLastEditedBy(item: DecryptedItemInterface): TrustedContactInterface | undefined getItemSharedBy(item: DecryptedItemInterface): TrustedContactInterface | undefined downloadInboundInvites(): Promise getOutboundInvites( sharedVault?: SharedVaultListingInterface, ): Promise acceptPendingSharedVaultInvite(pendingInvite: PendingSharedVaultInviteRecord): Promise getCachedPendingInviteRecords(): PendingSharedVaultInviteRecord[] getInvitableContactsForSharedVault(sharedVault: SharedVaultListingInterface): Promise deleteInvite(invite: SharedVaultInviteServerHash): Promise }