Files
ComfyUI-Model-Manager/src/types/typings.d.ts
hayden 6934fbb331 feat: Optimize dialog
- Change the method of open dialog
- Fix the problem of open dialog disappearing due to virtual scrolling
- Float the active dialog to the top
2024-10-29 15:32:30 +08:00

73 lines
1.4 KiB
TypeScript

type ContainerSize = { width: number; height: number }
type ContainerPosition = { left: number; top: number }
interface BaseModel {
id: number | string
fullname: string
basename: string
extension: string
sizeBytes: number
type: string
pathIndex: number
preview: string | string[]
description: string
metadata: Record<string, string>
}
interface Model extends BaseModel {
createdAt: number
updatedAt: number
}
interface VersionModel extends BaseModel {
shortname: string
downloadPlatform: string
downloadUrl: string
hashes?: Record<string, string>
}
type PassThrough<T = void> = T | object | undefined
interface SelectOptions {
label: string
value: any
icon?: string
command: () => void
}
interface SelectFile extends File {
objectURL: string
}
interface SelectEvent {
files: SelectFile[]
originalEvent: Event
}
interface DownloadTaskOptions {
taskId: string
type: string
fullname: string
preview: string
status: 'pause' | 'waiting' | 'doing'
progress: number
downloadedSize: number
totalSize: number
bps: number
error?: string
}
interface DownloadTask
extends Omit<
DownloadTaskOptions,
'downloadedSize' | 'totalSize' | 'bps' | 'error'
> {
downloadProgress: string
downloadSpeed: string
pauseTask: () => void
resumeTask: () => void
deleteTask: () => void
}
type CustomEventListener = (event: CustomEvent) => void