mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
create transactions from AI receipt image recognition results
This commit is contained in:
@@ -6,6 +6,7 @@ export class KnownFileType {
|
||||
public static readonly TSV = new KnownFileType('tsv', 'text/tab-separated-values');
|
||||
public static readonly MARKDOWN = new KnownFileType('md', 'text/markdown');
|
||||
public static readonly JS = new KnownFileType('js', 'application/javascript');
|
||||
public static readonly JPG = new KnownFileType('jpg', 'image/jpeg');
|
||||
|
||||
public readonly extension: string;
|
||||
public readonly contentType: string;
|
||||
@@ -37,6 +38,12 @@ export class KnownFileType {
|
||||
});
|
||||
}
|
||||
|
||||
public createFileFromBlob(blob: Blob, fileName: string): File {
|
||||
return new File([blob], this.formatFileName(fileName), {
|
||||
type: this.contentType,
|
||||
});
|
||||
}
|
||||
|
||||
public static parse(extension: string): KnownFileType | undefined {
|
||||
return KnownFileType.allInstancesByExtension[extension];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user