diff --git a/packages/encryption/src/Domain/Split/AbstractKeySplit.ts b/packages/encryption/src/Domain/Split/AbstractKeySplit.ts new file mode 100644 index 000000000..59a46b008 --- /dev/null +++ b/packages/encryption/src/Domain/Split/AbstractKeySplit.ts @@ -0,0 +1,23 @@ +import { + DecryptedPayloadInterface, + EncryptedPayloadInterface, + ItemsKeyInterface, + RootKeyInterface, +} from '@standardnotes/models' + +export interface AbstractKeySplit { + usesRootKey?: { + items: T[] + key: RootKeyInterface + } + usesItemsKey?: { + items: T[] + key: ItemsKeyInterface + } + usesRootKeyWithKeyLookup?: { + items: T[] + } + usesItemsKeyWithKeyLookup?: { + items: T[] + } +} diff --git a/packages/encryption/src/Domain/Split/EncryptionSplit.ts b/packages/encryption/src/Domain/Split/EncryptionSplit.ts index 197c2bfb1..6db0e39ad 100644 --- a/packages/encryption/src/Domain/Split/EncryptionSplit.ts +++ b/packages/encryption/src/Domain/Split/EncryptionSplit.ts @@ -2,29 +2,11 @@ import { Uuid } from '@standardnotes/common' import { DecryptedPayloadInterface, EncryptedPayloadInterface, - ItemsKeyInterface, PayloadInterface, - RootKeyInterface, } from '@standardnotes/models' +import { AbstractKeySplit } from './AbstractKeySplit' import { EncryptionTypeSplit } from './EncryptionTypeSplit' -export interface AbstractKeySplit { - usesRootKey?: { - items: T[] - key: RootKeyInterface - } - usesItemsKey?: { - items: T[] - key: ItemsKeyInterface - } - usesRootKeyWithKeyLookup?: { - items: T[] - } - usesItemsKeyWithKeyLookup?: { - items: T[] - } -} - export type KeyedEncryptionSplit = AbstractKeySplit export type KeyedDecryptionSplit = AbstractKeySplit diff --git a/packages/encryption/src/Domain/index.ts b/packages/encryption/src/Domain/index.ts index fe100a4a5..990c5e8e1 100644 --- a/packages/encryption/src/Domain/index.ts +++ b/packages/encryption/src/Domain/index.ts @@ -26,6 +26,7 @@ export * from './Service/Functions' export * from './Service/Items/ItemsEncryption' export * from './Service/RootKey/KeyMode' export * from './Service/RootKey/RootKeyEncryption' +export * from './Split/AbstractKeySplit' export * from './Split/EncryptionSplit' export * from './Split/EncryptionTypeSplit' export * from './Split/Functions'