mind-elixir
Version:
Mind elixir is a free open source mind map core.
92 lines (91 loc) • 2.42 kB
TypeScript
import type { CustomSvg, Topic } from './types/dom';
import type { MindElixirInstance, Uid } from './index';
export interface Arrow {
id: string;
/**
* label of arrow
*/
label: string;
/**
* id of start node
*/
from: Uid;
/**
* id of end node
*/
to: Uid;
/**
* offset of control point from start point
*/
delta1: {
x: number;
y: number;
};
/**
* offset of control point from end point
*/
delta2: {
x: number;
y: number;
};
/**
* whether the arrow is bidirectional
*/
bidirectional?: boolean;
/**
* style properties for the arrow
*/
style?: {
/**
* stroke color of the arrow
*/
stroke?: string;
/**
* stroke width of the arrow
*/
strokeWidth?: string | number;
/**
* stroke dash array for dashed lines
*/
strokeDasharray?: string;
/**
* stroke line cap style
*/
strokeLinecap?: 'butt' | 'round' | 'square';
/**
* opacity of the arrow
*/
opacity?: string | number;
/**
* color of the arrow label
*/
labelColor?: string;
};
}
export type DivData = {
cx: number;
cy: number;
w: number;
h: number;
ctrlX: number;
ctrlY: number;
};
export type ArrowOptions = {
bidirectional?: boolean;
style?: {
stroke?: string;
strokeWidth?: string | number;
strokeDasharray?: string;
strokeLinecap?: 'butt' | 'round' | 'square';
opacity?: string | number;
labelColor?: string;
};
};
export declare const createArrow: (this: MindElixirInstance, from: Topic, to: Topic, options?: ArrowOptions) => void;
export declare const createArrowFrom: (this: MindElixirInstance, arrow: Omit<Arrow, "id">) => void;
export declare const removeArrow: (this: MindElixirInstance, linkSvg?: CustomSvg) => void;
export declare const selectArrow: (this: MindElixirInstance, link: CustomSvg) => void;
export declare const unselectArrow: (this: MindElixirInstance) => void;
export declare function renderArrow(this: MindElixirInstance): void;
export declare function editArrowLabel(this: MindElixirInstance, el: CustomSvg): void;
export declare function tidyArrow(this: MindElixirInstance): void;