Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor: improve TypeScript types for NodeCardProps and debug configuration context (#27001)

GuanMu650e38e17f63
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 55dfac467e2..c7483c11bbe 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<Partial<NodeProps>>
+
type NodeCardProps = NodeProps & {
- children?: ReactElement
+ children?: NodeChildElement
}
const BaseCard = ({
diff --git a/web/context/debug-configuration.ts b/web/context/debug-configuration.ts
index bbf7be80994..dba2e7a231b 100644
--- a/web/context/debug-configuration.ts
+++ b/web/context/debug-configuration.ts
@@ -242,7 +242,7 @@ const DebugConfigurationContext = createContext<IDebugConfiguration>({
},
datasetConfigsRef: {
current: null,
- },
+ } as unknown as RefObject<DatasetConfigs>,
setDatasetConfigs: noop,
hasSetContextVar: false,
isShowVisionConfig: false,
diff --git a/web/service/base.ts b/web/service/base.ts
index 358f54183b3..1cb99e38d36 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<string, string>
data: FormData