index.d.ts 1.0 KB

1234567891011121314151617181920212223242526
  1. import { Point } from '@antv/x6-geometry';
  2. import { KeyValue } from '@antv/x6-common';
  3. import { Registry } from '../registry';
  4. import { Edge } from '../../model';
  5. import { CellView } from '../../view';
  6. import * as strategies from './main';
  7. import { Graph } from '../../graph';
  8. export declare namespace ConnectionStrategy {
  9. type Definition = (this: Graph, terminal: Edge.TerminalCellData, cellView: CellView, magnet: Element, coords: Point.PointLike, edge: Edge, type: Edge.TerminalType, options: KeyValue) => Edge.TerminalCellData;
  10. }
  11. export declare namespace ConnectionStrategy {
  12. type Presets = (typeof ConnectionStrategy)['presets'];
  13. type NativeNames = keyof Presets;
  14. interface NativeItem<T extends NativeNames = NativeNames> {
  15. name: T;
  16. args?: KeyValue;
  17. }
  18. interface ManaualItem {
  19. name: Exclude<string, NativeNames>;
  20. args?: KeyValue;
  21. }
  22. }
  23. export declare namespace ConnectionStrategy {
  24. const presets: typeof strategies;
  25. const registry: Registry<Definition, typeof strategies, never>;
  26. }