From 21efd0f460485483ce1eb930ddf5d35d5d9c5f77 Mon Sep 17 00:00:00 2001 From: Salmen Hichri Date: Sat, 18 May 2024 08:31:54 +0100 Subject: [PATCH] Updated eslint --- packages/js/core/src/exports/aiChat/comp/base.ts | 3 ++- packages/js/core/src/exports/aiContext/tasksService.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/js/core/src/exports/aiChat/comp/base.ts b/packages/js/core/src/exports/aiChat/comp/base.ts index fb02fa6c..48aad336 100644 --- a/packages/js/core/src/exports/aiChat/comp/base.ts +++ b/packages/js/core/src/exports/aiChat/comp/base.ts @@ -1,3 +1,4 @@ +import {CallbackArgType, CallbackFunction} from '../../../../../../shared/src/types/callbackFunction'; import {NluxError, NluxUsageError} from '../../../../../../shared/src/types/error'; import {domOp} from '../../../../../../shared/src/utils/dom/domOp'; import {uid} from '../../../../../../shared/src/utils/uid'; @@ -361,7 +362,7 @@ export abstract class BaseComp action(...args)); + return domOp(() => (action as CallbackFunction)(...args as CallbackArgType[])); }; protected executeRenderer(root: HTMLElement | DocumentFragment) { diff --git a/packages/js/core/src/exports/aiContext/tasksService.ts b/packages/js/core/src/exports/aiContext/tasksService.ts index fc22c3f4..4c3016db 100644 --- a/packages/js/core/src/exports/aiContext/tasksService.ts +++ b/packages/js/core/src/exports/aiContext/tasksService.ts @@ -5,7 +5,7 @@ import { RunTaskResult, } from '../../../../../shared/src/types/aiContext/contextResults'; import {ContextTask, ContextTasks} from '../../../../../shared/src/types/aiContext/data'; -import {CallbackFunction} from '../../../../../shared/src/types/callbackFunction'; +import {CallbackArgType, CallbackFunction} from '../../../../../shared/src/types/callbackFunction'; import {warn} from '../../../../../shared/src/utils/warn'; type UpdateQueueItem = { @@ -241,7 +241,9 @@ export class TasksService { } try { - const result = callback(...(parameters ?? [])); + const result = callback( + ...(parameters ?? []) as CallbackArgType[], + ); return { success: true, result, @@ -409,7 +411,7 @@ export class TasksService { updateData.paramDescriptions = item.paramDescriptions; } - acc[itemId] = updateData; + acc[itemId] = updateData as ContextTask; } return acc;