Files
standardnotes-app-web/packages/services/src/Domain/SharedVaults/SharedVaultServiceInterface.ts

26 lines
1.1 KiB
TypeScript

import { ClientDisplayableError } from '@standardnotes/responses'
import {
DecryptedItemInterface,
TrustedContactInterface,
SharedVaultListingInterface,
VaultListingInterface,
KeySystemRootKeyStorageMode,
} from '@standardnotes/models'
import { AbstractService } from '../Service/AbstractService'
import { SharedVaultServiceEvent, SharedVaultServiceEventPayload } from './SharedVaultServiceEvent'
export interface SharedVaultServiceInterface
extends AbstractService<SharedVaultServiceEvent, SharedVaultServiceEventPayload> {
createSharedVault(dto: {
name: string
description?: string
userInputtedPassword: string | undefined
storagePreference?: KeySystemRootKeyStorageMode
}): Promise<VaultListingInterface | ClientDisplayableError>
deleteSharedVault(sharedVault: SharedVaultListingInterface): Promise<ClientDisplayableError | void>
convertVaultToSharedVault(vault: VaultListingInterface): Promise<SharedVaultListingInterface | ClientDisplayableError>
getItemLastEditedBy(item: DecryptedItemInterface): TrustedContactInterface | undefined
getItemSharedBy(item: DecryptedItemInterface): TrustedContactInterface | undefined
}