mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-02 20:22:08 +00:00
fix: remove @ts-expect-error suppressions with proper type guards
This commit is contained in:
@@ -9,6 +9,12 @@ import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||
import { isAudioNode, isImageNode, isVideoNode } from '@/utils/litegraphUtil'
|
||||
import { shouldIgnoreCopyPaste } from '@/workbench/eventHelpers'
|
||||
|
||||
/** A node that supports pasting files */
|
||||
interface PasteableNode {
|
||||
pasteFile?(file: File): void
|
||||
pasteFiles?(files: File[]): void
|
||||
}
|
||||
|
||||
function pasteClipboardItems(data: DataTransfer): boolean {
|
||||
const rawData = data.getData('text/html')
|
||||
const match = rawData.match(/data-metadata="([A-Za-z0-9+/=]+)"/)?.[1]
|
||||
@@ -28,7 +34,7 @@ function pasteClipboardItems(data: DataTransfer): boolean {
|
||||
|
||||
function pasteItemsOnNode(
|
||||
items: DataTransferItemList,
|
||||
node: LGraphNode | null,
|
||||
node: PasteableNode | null,
|
||||
contentType: string
|
||||
): void {
|
||||
if (!node) return
|
||||
@@ -51,7 +57,7 @@ function pasteItemsOnNode(
|
||||
export function pasteImageNode(
|
||||
canvas: LGraphCanvas,
|
||||
items: DataTransferItemList,
|
||||
imageNode: LGraphNode | null = null
|
||||
imageNode: PasteableNode | null = null
|
||||
): void {
|
||||
const {
|
||||
graph,
|
||||
|
||||
Reference in New Issue
Block a user