fix: automatically convert Super notes to Markdown for the Plaintext Backups feature

This commit is contained in:
Mo
2023-05-02 15:37:23 -05:00
parent 2eddc3a1c6
commit 75ecf4c393
11 changed files with 88 additions and 48 deletions

View File

@@ -1,11 +1,13 @@
import { OnChunkCallback } from '../Chunker/OnChunkCallback'
import { DesktopWatchedDirectoriesChanges } from '../Device/DesktopWatchedChanges'
import { FileBackupRecord } from '../Device/FileBackupsMapping'
import { SuperConverterServiceInterface } from './SuperConverterServiceInterface'
export interface BackupServiceInterface {
openAllDirectoriesContainingBackupFiles(): void
prependWorkspacePathForPath(path: string): string
importWatchedDirectoryChanges(changes: DesktopWatchedDirectoriesChanges): Promise<void>
setSuperConverter(converter: SuperConverterServiceInterface): void
getFileBackupInfo(file: { uuid: string }): Promise<FileBackupRecord | undefined>
readEncryptedFileFromBackup(uuid: string, onChunk: OnChunkCallback): Promise<'success' | 'failed' | 'aborted'>

View File

@@ -0,0 +1,3 @@
export interface SuperConverterServiceInterface {
convertString: (superString: string, toFormat: 'txt' | 'md' | 'html' | 'json') => string
}

View File

@@ -17,6 +17,7 @@ export * from './Device/FileBackupsMapping'
export * from './Operations/DownloadAndDecrypt'
export * from './Operations/EncryptAndUpload'
export * from './Service/BackupServiceInterface'
export * from './Service/SuperConverterServiceInterface'
export * from './Service/FilesClientInterface'
export * from './Service/ReadAndDecryptBackupFileFileSystemAPI'
export * from './Service/ReadAndDecryptBackupFileUsingBackupService'