Line data Source code
1 : import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
2 : import type { InputSpec } from '@comfyorg/object-info-parser/schemas/nodeDefSchemaV2'
3 :
4 : interface LitegraphServiceAccess {
5 : addNodeInput(node: LGraphNode, inputSpec: InputSpec): void
6 : updatePreviews(node: LGraphNode, callback?: () => void): void
7 : fitView(): void
8 : }
9 :
10 : /** `useLitegraphService` for the modules it imports, which cannot import it back. */
11 2356 : export let useLitegraphServiceAccess: () => LitegraphServiceAccess
12 :
13 : /** Called by `litegraphService` when it loads. */
14 2356 : export function provideLitegraphService(
15 : useService: () => LitegraphServiceAccess
16 : ): void {
17 2356 : useLitegraphServiceAccess = useService
18 : }
|