mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Fixed typings and documentation
This commit is contained in:
@@ -64,7 +64,7 @@ There are several settings that could be defined or modified per node:
|
|||||||
* **collapsed**: if it is shown collapsed (small)
|
* **collapsed**: if it is shown collapsed (small)
|
||||||
* **redraw_on_mouse**: forces a redraw if the mouse passes over the widget
|
* **redraw_on_mouse**: forces a redraw if the mouse passes over the widget
|
||||||
* **widgets_up**: widgets do not start after the slots
|
* **widgets_up**: widgets do not start after the slots
|
||||||
* **widgets_y**: widgets should start being drawn from this Y
|
* **widgets_start_y**: widgets should start being drawn from this Y
|
||||||
* **clip_area**: clips the content when rendering the node
|
* **clip_area**: clips the content when rendering the node
|
||||||
* **resizable**: if it can be resized dragging the corner
|
* **resizable**: if it can be resized dragging the corner
|
||||||
* **horizontal**: if the slots should be placed horizontally on the top and bottom of the node
|
* **horizontal**: if the slots should be placed horizontally on the top and bottom of the node
|
||||||
|
|||||||
29
src/litegraph.d.ts
vendored
29
src/litegraph.d.ts
vendored
@@ -15,7 +15,7 @@ export type widgetTypes =
|
|||||||
/** https://github.com/jagenjo/litegraph.js/tree/master/guides#node-slots */
|
/** https://github.com/jagenjo/litegraph.js/tree/master/guides#node-slots */
|
||||||
export interface INodeSlot {
|
export interface INodeSlot {
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type: string | -1;
|
||||||
label?: string;
|
label?: string;
|
||||||
dir?:
|
dir?:
|
||||||
| typeof LiteGraph.UP
|
| typeof LiteGraph.UP
|
||||||
@@ -601,7 +601,9 @@ export declare class LGraphNode {
|
|||||||
properties: Record<string, any>;
|
properties: Record<string, any>;
|
||||||
properties_info: any[];
|
properties_info: any[];
|
||||||
|
|
||||||
flags: object;
|
flags: Partial<{
|
||||||
|
collapsed: boolean
|
||||||
|
}>;
|
||||||
|
|
||||||
color: string;
|
color: string;
|
||||||
bgcolor: string;
|
bgcolor: string;
|
||||||
@@ -623,6 +625,17 @@ export declare class LGraphNode {
|
|||||||
| typeof LiteGraph.NEVER
|
| typeof LiteGraph.NEVER
|
||||||
| typeof LiteGraph.ALWAYS;
|
| typeof LiteGraph.ALWAYS;
|
||||||
|
|
||||||
|
/** If set to true widgets do not start after the slots */
|
||||||
|
widgets_up: boolean;
|
||||||
|
/** widgets start at y distance from the top of the node */
|
||||||
|
widgets_start_y: number;
|
||||||
|
/** if you render outside the node, it will be clipped */
|
||||||
|
clip_area: boolean;
|
||||||
|
/** if set to false it wont be resizable with the mouse */
|
||||||
|
resizable: boolean;
|
||||||
|
/** slots are distributed horizontally */
|
||||||
|
horizontal: boolean;
|
||||||
|
|
||||||
/** configure a node from an object containing the serialized info */
|
/** configure a node from an object containing the serialized info */
|
||||||
configure(info: SerializedLGraphNode): void;
|
configure(info: SerializedLGraphNode): void;
|
||||||
/** serialize the content */
|
/** serialize the content */
|
||||||
@@ -715,7 +728,7 @@ export declare class LGraphNode {
|
|||||||
*/
|
*/
|
||||||
addOutput(
|
addOutput(
|
||||||
name: string,
|
name: string,
|
||||||
type: string,
|
type: string | -1,
|
||||||
extra_info?: Partial<INodeOutputSlot>
|
extra_info?: Partial<INodeOutputSlot>
|
||||||
): void;
|
): void;
|
||||||
/**
|
/**
|
||||||
@@ -723,7 +736,7 @@ export declare class LGraphNode {
|
|||||||
* @param array of triplets like [[name,type,extra_info],[...]]
|
* @param array of triplets like [[name,type,extra_info],[...]]
|
||||||
*/
|
*/
|
||||||
addOutputs(
|
addOutputs(
|
||||||
array: [string, string, Partial<INodeOutputSlot> | undefined][]
|
array: [string, string | -1, Partial<INodeOutputSlot> | undefined][]
|
||||||
): void;
|
): void;
|
||||||
/** remove an existing output slot */
|
/** remove an existing output slot */
|
||||||
removeOutput(slot: number): void;
|
removeOutput(slot: number): void;
|
||||||
@@ -735,7 +748,7 @@ export declare class LGraphNode {
|
|||||||
*/
|
*/
|
||||||
addInput(
|
addInput(
|
||||||
name: string,
|
name: string,
|
||||||
type: string,
|
type: string | -1,
|
||||||
extra_info?: Partial<INodeInputSlot>
|
extra_info?: Partial<INodeInputSlot>
|
||||||
): void;
|
): void;
|
||||||
/**
|
/**
|
||||||
@@ -743,7 +756,7 @@ export declare class LGraphNode {
|
|||||||
* @param array of triplets like [[name,type,extra_info],[...]]
|
* @param array of triplets like [[name,type,extra_info],[...]]
|
||||||
*/
|
*/
|
||||||
addInputs(
|
addInputs(
|
||||||
array: [string, string, Partial<INodeInputSlot> | undefined][]
|
array: [string, string | -1, Partial<INodeInputSlot> | undefined][]
|
||||||
): void;
|
): void;
|
||||||
/** remove an existing input slot */
|
/** remove an existing input slot */
|
||||||
removeInput(slot: number): void;
|
removeInput(slot: number): void;
|
||||||
@@ -777,7 +790,7 @@ export declare class LGraphNode {
|
|||||||
type: T["type"],
|
type: T["type"],
|
||||||
name: string,
|
name: string,
|
||||||
value: T["value"],
|
value: T["value"],
|
||||||
callback?: WidgetCallback<T>,
|
callback?: WidgetCallback<T> | string,
|
||||||
options?: T["options"]
|
options?: T["options"]
|
||||||
): T;
|
): T;
|
||||||
|
|
||||||
@@ -1111,7 +1124,7 @@ export declare class LGraphCanvas {
|
|||||||
last_mouse_position: Vector2;
|
last_mouse_position: Vector2;
|
||||||
/** Timestamp of last mouse click, defaults to 0 */
|
/** Timestamp of last mouse click, defaults to 0 */
|
||||||
last_mouseclick: number;
|
last_mouseclick: number;
|
||||||
link_render_mode:
|
links_render_mode:
|
||||||
| typeof LiteGraph.STRAIGHT_LINK
|
| typeof LiteGraph.STRAIGHT_LINK
|
||||||
| typeof LiteGraph.LINEAR_LINK
|
| typeof LiteGraph.LINEAR_LINK
|
||||||
| typeof LiteGraph.SPLINE_LINK;
|
| typeof LiteGraph.SPLINE_LINK;
|
||||||
|
|||||||
Reference in New Issue
Block a user