import { NoteType } from '@standardnotes/features' import { DecryptedItemInterface, FileItem, ItemContent, NoteContent, SNNote, SNTag } from '@standardnotes/models' import { ConversionResult } from './ConversionResult' import { SuperConverterHTMLOptions } from '@standardnotes/snjs' export type HTMLToSuperConverterFunction = (html: string, options?: SuperConverterHTMLOptions) => string export interface Converter { getImportType(): string getSupportedFileTypes?: () => string[] getFileExtension?: () => string isContentValid: (content: string) => boolean convert( file: File, dependencies: { insertNote: InsertNoteFn insertTag: InsertTagFn canUploadFiles: boolean uploadFile: UploadFileFn canUseSuper: boolean convertHTMLToSuper: HTMLToSuperConverterFunction convertMarkdownToSuper: (markdown: string) => string readFileAsText: (file: File) => Promise linkItems( item: DecryptedItemInterface, itemToLink: DecryptedItemInterface, ): Promise cleanupItems(items: DecryptedItemInterface[]): Promise }, ): Promise } export type InsertNoteFn = (options: { createdAt: Date updatedAt: Date title: string text: string noteType?: NoteType archived?: boolean pinned?: boolean trashed?: boolean editorIdentifier?: NoteContent['editorIdentifier'] useSuperIfPossible: boolean }) => Promise export type InsertTagFn = (options: { createdAt: Date updatedAt: Date title: string references: SNTag['references'] }) => Promise export type UploadFileFn = (file: File) => Promise export type LinkItemsFn = ( item: DecryptedItemInterface, itemToLink: DecryptedItemInterface, ) => Promise export type CleanupItemsFn = (items: DecryptedItemInterface[]) => Promise