import type { Graph } from '@antv/x6'; import type { NsGraph } from '../interface'; import type { Disposable } from '../common/disposable'; import type { IGraphCommandService } from '../command/interface'; import type { IModelService } from '../model-service/interface'; import { HookHub } from '@antv/xflow-hook'; import { Syringe } from 'mana-syringe'; import type { EventArgs } from '@antv/x6/es/graph/events'; import type { IGraphConfig } from '../xflow-main/graph/config'; export interface IRegisterHookFn { (hooks: T): Disposable; } export interface IRegisterHookHubFn { (registry: IHookService): Disposable; } /** * extension 应该实现这个扩展点来注册更多的hook */ export declare const IHookService: Syringe.DefinedToken; export interface IHookService { registerHookHub: (hookName: string, hook: HookHub) => Disposable; registerHook: (registerHookFunc: IRegisterHookFn) => Disposable; hookProvider: () => T; } /** * extension 应该实现这个扩展点来注册更多的hook */ export declare const IHookContribution: Syringe.DefinedToken; /** * 扩展hook */ export interface IHookContribution { /** * 注册hook * @param registry the HookRegistry. */ registerHook: (hooks: T) => Promise; /** * 注册hookhub * @param registry the HookRegistry. */ registerHookHub: (registry: IHookService) => Promise; } /** 内置的Hooks */ export declare type IEvent = NsGraph.IEvent; export declare type IEventCollection = NsGraph.IEvent[]; export declare type IEventSubscription = Disposable[]; export interface IGeneralAppService { graph: Graph; commandService: IGraphCommandService; modelService: IModelService; options: IGraphConfig; } export declare const initHooks: () => { graphOptions: HookHub; reactNodeRender: HookHub>>, Map>>>; reactEdgeLabelRender: HookHub>>, Map>>>; afterGraphInit: HookHub; beforeGraphDestroy: HookHub; x6Events: HookHub; }; export declare type IHooks = ReturnType;