mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-05 21:20:12 +00:00
Chore: TypeScript cleanup - remove 254 @ts-expect-error suppressions (#7884)
## Summary Removes **254** `@ts-expect-error` suppressions through proper type fixes rather than type assertions. ## Key Changes ### Type System Improvements - Add `globalDefs` and `groupNodes` types to `ComfyAppWindowExtension` - Extract interfaces for group node handling (`GroupNodeHandler`, `InnerNodeOutput`, etc.) - Add `getHandler()` helper to consolidate GROUP symbol access pattern ### Files Fixed - **pnginfo.ts**: 39 suppressions removed via proper typing of workflow/prompt data - **app.ts**: 39 suppressions removed via interface extraction and type narrowing - **Tier 1 files**: 17 suppressions removed (maskeditor, imageDrawer, groupNode, etc.) - **groupNode.ts**: Major refactoring with proper interface organization ## Approach Following established constraints: - No `any` types - No `as unknown as T` casts (except legacy API boundaries) - Priority: Fix actual types > Type narrowing > Targeted suppressions as last resort - Prefix unused callback parameters with underscore - Extract repeated inline types into named interfaces ## Validation - ✅ `pnpm typecheck` passes - ✅ `pnpm lint` passes - ✅ `pnpm knip` passes ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7884-Chore-TypeScript-cleanup-remove-254-ts-expect-error-suppressions-2e26d73d3650812e9b48da203ce1d296) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -15,7 +15,7 @@ import { LGraphGroup } from './LGraphGroup'
|
||||
import { LGraphNode } from './LGraphNode'
|
||||
import type { NodeId } from './LGraphNode'
|
||||
import { LLink } from './LLink'
|
||||
import type { LinkId } from './LLink'
|
||||
import type { LinkId, SerialisedLLinkArray } from './LLink'
|
||||
import { MapProxyHandler } from './MapProxyHandler'
|
||||
import { Reroute } from './Reroute'
|
||||
import type { RerouteId } from './Reroute'
|
||||
@@ -102,11 +102,24 @@ export interface LGraphConfig {
|
||||
links_ontop?: any
|
||||
}
|
||||
|
||||
export interface GroupNodeWorkflowData {
|
||||
external: (number | string)[][]
|
||||
links: SerialisedLLinkArray[]
|
||||
nodes: {
|
||||
index?: number
|
||||
type?: string
|
||||
inputs?: unknown[]
|
||||
outputs?: unknown[]
|
||||
}[]
|
||||
config?: Record<number, unknown>
|
||||
}
|
||||
|
||||
export interface LGraphExtra extends Dictionary<unknown> {
|
||||
reroutes?: SerialisableReroute[]
|
||||
linkExtensions?: { id: number; parentId: number | undefined }[]
|
||||
ds?: DragAndScaleState
|
||||
workflowRendererVersion?: RendererType
|
||||
groupNodes?: Record<string, GroupNodeWorkflowData>
|
||||
}
|
||||
|
||||
export interface BaseLGraph {
|
||||
|
||||
Reference in New Issue
Block a user