mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-24 00:09:32 +00:00
Build comfyui-frontend-types library (#1725)
* Install vite-plugin-dts * Explicitly type workflowStore * Working rollup * Hide diff type * Inline primevue toast mesage types * Add prepare-types script to generate package.json for type package * Add global declaration * Add publish types Github action * Update litegraph * Add @comfyorg to package name
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import type { ToastMessageOptions } from 'primevue/toast'
|
||||
import { Component } from 'vue'
|
||||
|
||||
export interface BaseSidebarTabExtension {
|
||||
@@ -41,6 +40,53 @@ export type BottomPanelExtension =
|
||||
| VueBottomPanelExtension
|
||||
| CustomBottomPanelExtension
|
||||
|
||||
/**
|
||||
* Defines message options in Toast component.
|
||||
*/
|
||||
export interface ToastMessageOptions {
|
||||
/**
|
||||
* Severity level of the message.
|
||||
* @defaultValue info
|
||||
*/
|
||||
severity?:
|
||||
| 'success'
|
||||
| 'info'
|
||||
| 'warn'
|
||||
| 'error'
|
||||
| 'secondary'
|
||||
| 'contrast'
|
||||
| undefined
|
||||
/**
|
||||
* Summary content of the message.
|
||||
*/
|
||||
summary?: string | undefined
|
||||
/**
|
||||
* Detail content of the message.
|
||||
*/
|
||||
detail?: any | undefined
|
||||
/**
|
||||
* Whether the message can be closed manually using the close icon.
|
||||
* @defaultValue true
|
||||
*/
|
||||
closable?: boolean | undefined
|
||||
/**
|
||||
* Delay in milliseconds to close the message automatically.
|
||||
*/
|
||||
life?: number | undefined
|
||||
/**
|
||||
* Key of the Toast to display the message.
|
||||
*/
|
||||
group?: string | undefined
|
||||
/**
|
||||
* Style class of the message.
|
||||
*/
|
||||
styleClass?: any
|
||||
/**
|
||||
* Style class of the content.
|
||||
*/
|
||||
contentStyleClass?: any
|
||||
}
|
||||
|
||||
export type ToastManager = {
|
||||
add(message: ToastMessageOptions): void
|
||||
remove(message: ToastMessageOptions): void
|
||||
|
||||
9
src/types/index.ts
Normal file
9
src/types/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ComfyApp } from '@/scripts/app'
|
||||
|
||||
export type { ComfyExtension } from './comfy'
|
||||
export type { ComfyApi } from '@/scripts/api'
|
||||
export type { ComfyApp } from '@/scripts/app'
|
||||
|
||||
declare global {
|
||||
const app: ComfyApp
|
||||
}
|
||||
Reference in New Issue
Block a user