mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-11 16:10:05 +00:00
Manage widget definitions with Pinia store (#1510)
* Fix compile * nit * Remove extensions.test * nit
This commit is contained in:
19
src/types/comfy.d.ts
vendored
19
src/types/comfy.d.ts
vendored
@@ -1,20 +1,13 @@
|
||||
import { LGraphNode, IWidget } from './litegraph'
|
||||
import { ComfyApp } from '../scripts/app'
|
||||
import type { LGraphNode } from './litegraph'
|
||||
import type { ComfyApp } from '../scripts/app'
|
||||
import type { ComfyNodeDef } from '@/types/apiTypes'
|
||||
import type { Keybinding } from '@/types/keyBindingTypes'
|
||||
import type { ComfyCommand } from '@/stores/commandStore'
|
||||
import { SettingParams } from './settingTypes'
|
||||
import type { SettingParams } from './settingTypes'
|
||||
import type { BottomPanelExtension } from './extensionTypes'
|
||||
import type { ComfyWidgetConstructor } from '@/scripts/widgets'
|
||||
|
||||
export type Widgets = Record<
|
||||
string,
|
||||
(
|
||||
node,
|
||||
inputName,
|
||||
inputData,
|
||||
app?: ComfyApp
|
||||
) => { widget?: IWidget; minWidth?: number; minHeight?: number }
|
||||
>
|
||||
export type Widgets = Record<string, ComfyWidgetConstructor>
|
||||
|
||||
export interface AboutPageBadge {
|
||||
label: string
|
||||
@@ -94,6 +87,8 @@ export interface ComfyExtension {
|
||||
defs: Record<string, ComfyNodeDef>,
|
||||
app: ComfyApp
|
||||
): Promise<void> | void
|
||||
// TODO(huchenlei): We should deprecate the async return value of
|
||||
// getCustomWidgets.
|
||||
/**
|
||||
* Allows the extension to add custom widgets
|
||||
* @param app The ComfyUI app instance
|
||||
|
||||
4
src/types/litegraph-augmentation.d.ts
vendored
4
src/types/litegraph-augmentation.d.ts
vendored
@@ -22,6 +22,8 @@ declare module '@comfyorg/litegraph' {
|
||||
* Callback fired on each node after the graph is configured
|
||||
*/
|
||||
onAfterGraphConfigured?(): void
|
||||
onGraphConfigured?(): void
|
||||
onExecuted?(output: any): void
|
||||
onNodeCreated?(this: LGraphNode): void
|
||||
setInnerNodes?(nodes: LGraphNode[]): void
|
||||
applyToGraph?(extraLinks?: LLink[]): void
|
||||
@@ -38,7 +40,7 @@ declare module '@comfyorg/litegraph' {
|
||||
name: string,
|
||||
type: string,
|
||||
element: HTMLElement,
|
||||
options: Record<string, any>
|
||||
options?: Record<string, any>
|
||||
): DOMWidget
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user