From 251bc8c4a36019d719fad9d4bb6548ab04b340fb Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 18 Mar 2025 22:18:35 -0400 Subject: updated iink to latest version --- src/client/views/InkTranscription.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/client/views/InkTranscription.tsx b/src/client/views/InkTranscription.tsx index e800e0ae3..29cbe8e2d 100644 --- a/src/client/views/InkTranscription.tsx +++ b/src/client/views/InkTranscription.tsx @@ -48,7 +48,7 @@ export class InkTranscription extends React.Component { const options = { configuration: { server: { - scheme: 'https', + scheme: 'https' as iink.TScheme, host: 'cloud.myscript.com', applicationKey: 'c0901093-5ac5-4454-8e64-0def0f13f2ca', hmacKey: 'f6465cca-1856-4492-a6a4-e2395841be2f', @@ -56,13 +56,14 @@ export class InkTranscription extends React.Component { }, recognition: { type: 'TEXT', + lang: 'en_US', + text: { + mimeTypes: ['text/plain'] as 'text/plain'[], + }, }, }, }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const editor = new iink.Editor(r, options as any); - - await editor.initialize(); + await iink.Editor.load(r, 'INKV2', options); this._textRegister = r; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -78,7 +79,7 @@ export class InkTranscription extends React.Component { const options = { configuration: { server: { - scheme: 'https', + scheme: 'https' as iink.TScheme, host: 'cloud.myscript.com', applicationKey: 'c0901093-5ac5-4454-8e64-0def0f13f2ca', hmacKey: 'f6465cca-1856-4492-a6a4-e2395841be2f', @@ -86,14 +87,14 @@ export class InkTranscription extends React.Component { }, recognition: { type: 'TEXT', + lang: 'en_US', + text: { + mimeTypes: ['text/plain'] as 'text/plain'[], + }, }, }, }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const editor = new iink.Editor(r, options as any); - - await editor.initialize(); - this.iinkEditor = editor; + this.iinkEditor = await iink.Editor.load(r, 'INKV2', options); this._textRegister = r; // eslint-disable-next-line @typescript-eslint/no-explicit-any r?.addEventListener('exported', (e: any) => this.exportInk(e, this._textRef)); -- cgit v1.2.3-70-g09d2