mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-22 07:44:11 +00:00
[fix] Add definite assignment assertions to fix TypeScript errors
- Add ! definite assignment assertions to properties that were using declare - This fixes TypeScript compilation errors while maintaining Babel compatibility - Properties are guaranteed to be assigned at runtime
This commit is contained in:
@@ -12,7 +12,7 @@ import type { SubgraphInputNode } from './SubgraphInputNode'
|
||||
* A virtual slot that simply creates a new input slot when connected to.
|
||||
*/
|
||||
export class EmptySubgraphInput extends SubgraphInput {
|
||||
parent: SubgraphInputNode
|
||||
parent!: SubgraphInputNode
|
||||
|
||||
constructor(parent: SubgraphInputNode) {
|
||||
super(
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { SubgraphOutputNode } from './SubgraphOutputNode'
|
||||
* A virtual slot that simply creates a new output slot when connected to.
|
||||
*/
|
||||
export class EmptySubgraphOutput extends SubgraphOutput {
|
||||
parent: SubgraphOutputNode
|
||||
parent!: SubgraphOutputNode
|
||||
|
||||
constructor(parent: SubgraphOutputNode) {
|
||||
super(
|
||||
|
||||
@@ -30,7 +30,7 @@ import { isNodeSlot, isSubgraphOutput } from './subgraphUtils'
|
||||
* Functionally, however, when editing a subgraph, that "subgraph input" is the "origin" or "output side" of a link.
|
||||
*/
|
||||
export class SubgraphInput extends SubgraphSlot {
|
||||
parent: SubgraphInputNode
|
||||
parent!: SubgraphInputNode
|
||||
|
||||
events = new CustomEventTarget<SubgraphInputEventMap>()
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import type { SubgraphInput } from './SubgraphInput'
|
||||
* An instance of a {@link Subgraph}, displayed as a node on the containing (parent) graph.
|
||||
*/
|
||||
export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
||||
inputs: (INodeInputSlot & Partial<ISubgraphInput>)[]
|
||||
inputs!: (INodeInputSlot & Partial<ISubgraphInput>)[]
|
||||
|
||||
override readonly type: UUID
|
||||
override readonly isVirtualNode = true as const
|
||||
|
||||
@@ -29,7 +29,7 @@ import { isNodeSlot, isSubgraphInput } from './subgraphUtils'
|
||||
* Functionally, however, when editing a subgraph, that "subgraph output" is the "target" or "input side" of a link.
|
||||
*/
|
||||
export class SubgraphOutput extends SubgraphSlot {
|
||||
parent: SubgraphOutputNode
|
||||
parent!: SubgraphOutputNode
|
||||
|
||||
override connect(
|
||||
slot: INodeOutputSlot,
|
||||
|
||||
@@ -63,10 +63,10 @@ export abstract class BaseWidget<TWidget extends IBaseWidget = IBaseWidget>
|
||||
}
|
||||
|
||||
linkedWidgets?: IBaseWidget[]
|
||||
name: string
|
||||
options: TWidget['options']
|
||||
name!: string
|
||||
options!: TWidget['options']
|
||||
label?: string
|
||||
type: TWidget['type']
|
||||
type!: TWidget['type']
|
||||
y: number = 0
|
||||
last_y?: number
|
||||
width?: number
|
||||
|
||||
Reference in New Issue
Block a user