From 650e38e17f63b58111ff1714998cdb7b84774573 Mon Sep 17 00:00:00 2001 From: GuanMu Date: Thu, 16 Oct 2025 22:16:01 +0800 Subject: [PATCH] refactor: improve TypeScript types for NodeCardProps and debug configuration context (#27001) --- .../workflow/workflow-preview/components/nodes/base.tsx | 4 +++- web/context/debug-configuration.ts | 2 +- web/service/base.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/workflow-preview/components/nodes/base.tsx b/web/app/components/workflow/workflow-preview/components/nodes/base.tsx index 55dfac467e..c7483c11bb 100644 --- a/web/app/components/workflow/workflow-preview/components/nodes/base.tsx +++ b/web/app/components/workflow/workflow-preview/components/nodes/base.tsx @@ -23,8 +23,10 @@ import { } from '../node-handle' import ErrorHandleOnNode from '../error-handle-on-node' +type NodeChildElement = ReactElement> + type NodeCardProps = NodeProps & { - children?: ReactElement + children?: NodeChildElement } const BaseCard = ({ diff --git a/web/context/debug-configuration.ts b/web/context/debug-configuration.ts index bbf7be8099..dba2e7a231 100644 --- a/web/context/debug-configuration.ts +++ b/web/context/debug-configuration.ts @@ -242,7 +242,7 @@ const DebugConfigurationContext = createContext({ }, datasetConfigsRef: { current: null, - }, + } as unknown as RefObject, setDatasetConfigs: noop, hasSetContextVar: false, isShowVisionConfig: false, diff --git a/web/service/base.ts b/web/service/base.ts index 358f54183b..1cb99e38d3 100644 --- a/web/service/base.ts +++ b/web/service/base.ts @@ -324,7 +324,7 @@ const baseFetch = base type UploadOptions = { xhr: XMLHttpRequest - method: string + method?: string url?: string headers?: Record data: FormData