[fix] Remove all declare keywords from class fields

- Remove declare keywords from all litegraph class fields
- This fixes Babel TypeScript compilation in Playwright i18n tests
- Maintains backward compatibility without useDefineForClassFields
This commit is contained in:
snomiao
2025-09-04 22:16:11 +00:00
parent be78479d77
commit 0a892fcfc3
6 changed files with 7 additions and 7 deletions

View File

@@ -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 {
declare parent: SubgraphInputNode
parent: SubgraphInputNode
constructor(parent: SubgraphInputNode) {
super(

View File

@@ -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 {
declare parent: SubgraphOutputNode
parent: SubgraphOutputNode
constructor(parent: SubgraphOutputNode) {
super(

View File

@@ -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 {
declare parent: SubgraphInputNode
parent: SubgraphInputNode
events = new CustomEventTarget<SubgraphInputEventMap>()

View File

@@ -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 {
declare inputs: (INodeInputSlot & Partial<ISubgraphInput>)[]
inputs: (INodeInputSlot & Partial<ISubgraphInput>)[]
override readonly type: UUID
override readonly isVirtualNode = true as const

View File

@@ -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 {
declare parent: SubgraphOutputNode
parent: SubgraphOutputNode
override connect(
slot: INodeOutputSlot,

View File

@@ -47,8 +47,8 @@ export abstract class BaseWidget<TWidget extends IBaseWidget = IBaseWidget>
/** Minimum gap between label and value */
static labelValueGap = 5
declare computedHeight?: number
declare serialize?: boolean
computedHeight?: number
serialize?: boolean
computeLayoutSize?(node: LGraphNode): {
minHeight: number
maxHeight?: number