1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Desktop: Add support for OCR (#8975)

This commit is contained in:
Laurent Cozic
2023-12-13 19:24:58 +00:00
committed by GitHub
parent 0e847685ff
commit bce94f1775
79 changed files with 2381 additions and 445 deletions

View File

@@ -26,6 +26,10 @@ let nodeSqlite_: any = null;
const shim = {
Geolocation: null as any,
electronBridge_: null as any,
fsDriver_: null as any,
httpAgent_: null as any,
proxyAgent: null as any,
electronBridge: (): any => {
throw new Error('Not implemented');
@@ -210,21 +214,21 @@ const shim = {
FileApiDriverLocal: null as any,
readLocalFileBase64: (_path: string) => {
readLocalFileBase64: (_path: string): any => {
throw new Error('Not implemented');
},
uploadBlob: (_url: string, _options: any) => {
uploadBlob: (_url: string, _options: any): any => {
throw new Error('Not implemented');
},
sjclModule: null as any,
randomBytes: async (_count: number) => {
randomBytes: async (_count: number): Promise<any> => {
throw new Error('Not implemented');
},
stringByteLength: (_s: string) => {
stringByteLength: (_s: string): any => {
throw new Error('Not implemented');
},
@@ -243,7 +247,7 @@ const shim = {
throw new Error('Not implemented');
},
imageFromDataUrl: async (_imageDataUrl: string, _filePath: string, _options: any = null) => {
imageFromDataUrl: async (_imageDataUrl: string, _filePath: string, _options: any = null): Promise<any> => {
throw new Error('Not implemented');
},
@@ -251,25 +255,29 @@ const shim = {
throw new Error('Not implemented');
},
pdfToImages: async (_pdfPath: string, _outputDirectoryPath: string): Promise<string[]> => {
throw new Error('Not implemented');
},
Buffer: null as any,
openUrl: () => {
openUrl: (_url: string): any => {
throw new Error('Not implemented');
},
httpAgent: () => {
httpAgent: (_url: string): any => {
throw new Error('Not implemented');
},
openOrCreateFile: (_path: string, _defaultContents: any) => {
openOrCreateFile: (_path: string, _defaultContents: any): any => {
throw new Error('Not implemented');
},
waitForFrame: () => {
waitForFrame: (): any => {
throw new Error('Not implemented');
},
appVersion: () => {
appVersion: (): any => {
throw new Error('Not implemented');
},
@@ -283,15 +291,15 @@ const shim = {
isTestingEnv_ = v;
},
pathRelativeToCwd: (_path: string) => {
pathRelativeToCwd: (_path: string): any => {
throw new Error('Not implemented');
},
showMessageBox: (_message: string, _options: any = null) => {
showMessageBox: (_message: string, _options: any = null): any => {
throw new Error('Not implemented');
},
writeImageToFile: (_image: any, _format: any, _filePath: string) => {
writeImageToFile: (_image: any, _format: any, _filePath: string): void => {
throw new Error('Not implemented');
},
@@ -315,20 +323,20 @@ const shim = {
// Having the timers wrapped in that way would also make it easier to debug timing issue and
// find out what timers have been fired or not.
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
setTimeout: (_fn: Function, _interval: number) => {
setTimeout: (_fn: Function, _interval: number): any=> {
throw new Error('Not implemented');
},
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
setInterval: (_fn: Function, _interval: number) => {
setInterval: (_fn: Function, _interval: number): any=> {
throw new Error('Not implemented');
},
clearTimeout: (_id: any) => {
clearTimeout: (_id: any): any => {
throw new Error('Not implemented');
},
clearInterval: (_id: any) => {
clearInterval: (_id: any): any => {
throw new Error('Not implemented');
},
@@ -350,7 +358,7 @@ const shim = {
return react_;
},
dgram: () => {
dgram: (): any => {
throw new Error('Not implemented');
},