1 import type { DataTypesThatDocumentCanBeExportedAs } from '@proton/docs-shared'
2 import { DocumentExportMimeTypes } from '@proton/docs-shared'
3 import type { UseCaseInterface } from '../Domain/UseCase/UseCaseInterface'
4 import { Result } from '@proton/docs-shared'
6 export class ExportAndDownload implements UseCaseInterface<void> {
10 format: DataTypesThatDocumentCanBeExportedAs,
11 ): Promise<Result<void>> {
12 const name = `${docName}.${format}`
13 const mimeType = DocumentExportMimeTypes[format]
14 const blob = new Blob([data], {
18 const url = URL.createObjectURL(blob)
20 const a = document.createElement('a')
24 document.body.appendChild(a)