mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-05 13:10:24 +00:00
Convert more js to ts (#101)
* Add testing for ComfyUI examples * Remove examples, add test to github action * Create dir * Update readme * Convert additional files to ts
This commit is contained in:
46
src/types/litegraph-augmentation.d.ts
vendored
Normal file
46
src/types/litegraph-augmentation.d.ts
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import "@comfyorg/litegraph";
|
||||
|
||||
/**
|
||||
* ComfyUI extensions of litegraph
|
||||
*/
|
||||
declare module "@comfyorg/litegraph" {
|
||||
interface LGraphNode {
|
||||
/**
|
||||
* Callback fired on each node after the graph is configured
|
||||
*/
|
||||
onAfterGraphConfigured?(): void;
|
||||
|
||||
/**
|
||||
* If the node is a frontend only node and should not be serialized into the prompt.
|
||||
*/
|
||||
isVirtualNode?: boolean;
|
||||
}
|
||||
|
||||
interface IWidget<TValue = any, TOptions = any> {
|
||||
/**
|
||||
* Allows for additional cleanup when removing a widget when converting to input.
|
||||
*/
|
||||
onRemove?(): void;
|
||||
}
|
||||
|
||||
interface INodeOutputSlot {
|
||||
widget?: unknown;
|
||||
}
|
||||
|
||||
interface INodeInputSlot {
|
||||
widget?: unknown;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extended types for litegraph, to be merged upstream once it has stabilized.
|
||||
*/
|
||||
declare module "@comfyorg/litegraph" {
|
||||
interface INodeInputSlot {
|
||||
pos?: [number, number];
|
||||
}
|
||||
|
||||
interface LGraphNode {
|
||||
widgets_values?: unknown[];
|
||||
}
|
||||
}
|
||||
19
src/types/litegraph-core-augmentation.d.ts
vendored
Normal file
19
src/types/litegraph-core-augmentation.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
Extended types for litegraph, to be merged upstream once it has stabilized.
|
||||
Augmenting the LiteGraph type really didn't want to work, however doing it like this seems to allow it.
|
||||
*/
|
||||
declare module "@comfyorg/litegraph" {
|
||||
interface LiteGraphExtended {
|
||||
search_filter_enabled: boolean;
|
||||
middle_click_slot_add_default_node: boolean;
|
||||
registered_slot_out_types: Record<string, { nodes: string[] }>;
|
||||
registered_slot_in_types: Record<string, { nodes: string[] }>;
|
||||
slot_types_out: string[];
|
||||
slot_types_default_out: Record<string, string[]>;
|
||||
slot_types_default_in: Record<string, string[]>;
|
||||
}
|
||||
|
||||
import type { LiteGraph as LG } from "@comfyorg/litegraph/src/litegraph";
|
||||
export const LiteGraph: LiteGraphExtended & typeof LG;
|
||||
export * from "@comfyorg/litegraph/src/litegraph";
|
||||
}
|
||||
Reference in New Issue
Block a user