mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 07:30:11 +00:00
New settings API (#1292)
* Add settings API * Add playwright test * Update README
This commit is contained in:
5
src/types/comfy.d.ts
vendored
5
src/types/comfy.d.ts
vendored
@@ -3,6 +3,7 @@ import { 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'
|
||||
|
||||
export type Widgets = Record<
|
||||
string,
|
||||
@@ -43,6 +44,10 @@ export interface ComfyExtension {
|
||||
* Menu commands to add to the menu bar
|
||||
*/
|
||||
menuCommands?: MenuCommandGroup[]
|
||||
/**
|
||||
* Settings to add to the settings menu
|
||||
*/
|
||||
settings?: SettingParams[]
|
||||
/**
|
||||
* Allows any initialisation, e.g. loading resources. Called after the canvas is created but before nodes are added
|
||||
* @param app The ComfyUI app instance
|
||||
|
||||
@@ -37,9 +37,12 @@ export interface ExtensionManager {
|
||||
unregisterSidebarTab(id: string): void
|
||||
getSidebarTabs(): SidebarTabExtension[]
|
||||
|
||||
// Toast
|
||||
toast: ToastManager
|
||||
command: CommandManager
|
||||
setting: {
|
||||
get: (id: string) => any
|
||||
set: (id: string, value: any) => void
|
||||
}
|
||||
}
|
||||
|
||||
export interface CommandManager {
|
||||
|
||||
Reference in New Issue
Block a user