mind-elixir
Version:
Mind elixir is a free open source mind map core.
137 lines (136 loc) • 4.09 kB
TypeScript
import type { Locale } from './i18n';
import type { Topic } from './types/dom';
import type { MindElixirData, MindElixirInstance } from './types/index';
export declare const selectNode: (this: MindElixirInstance, targetElement: Topic, isNewNode?: boolean, e?: MouseEvent) => void;
export declare const unselectNode: (this: MindElixirInstance) => void;
export declare const selectNodes: (this: MindElixirInstance, tpc: Topic[]) => void;
export declare const unselectNodes: (this: MindElixirInstance) => void;
export declare const clearSelection: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name getDataString
* @description Get all node data as string.
* @memberof MapInteraction
* @return {string}
*/
export declare const getDataString: (this: MindElixirInstance) => string;
/**
* @function
* @instance
* @name getData
* @description Get all node data as object.
* @memberof MapInteraction
* @return {Object}
*/
export declare const getData: (this: MindElixirInstance) => MindElixirData;
/**
* @function
* @instance
* @name getDataMd
* @description Get all node data as markdown.
* @memberof MapInteraction
* @return {String}
*/
export declare const getDataMd: (this: MindElixirInstance) => string;
/**
* @function
* @instance
* @name enableEdit
* @memberof MapInteraction
*/
export declare const enableEdit: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name disableEdit
* @memberof MapInteraction
*/
export declare const disableEdit: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name scale
* @description Change the scale of the mind map.
* @memberof MapInteraction
* @param {number}
*/
export declare const scale: (this: MindElixirInstance, scaleVal: number) => void;
/**
* Better to use with option `alignment: 'nodes'`.
*/
export declare const scaleFit: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name toCenter
* @description Reset position of the map to center.
* @memberof MapInteraction
*/
export declare const toCenter: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name install
* @description Install plugin.
* @memberof MapInteraction
*/
export declare const install: (this: MindElixirInstance, plugin: (instance: MindElixirInstance) => void) => void;
/**
* @function
* @instance
* @name focusNode
* @description Enter focus mode, set the target element as root.
* @memberof MapInteraction
* @param {TargetElement} el - Target element return by E('...'), default value: currentTarget.
*/
export declare const focusNode: (this: MindElixirInstance, el: Topic) => void;
/**
* @function
* @instance
* @name cancelFocus
* @description Exit focus mode.
* @memberof MapInteraction
*/
export declare const cancelFocus: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name initLeft
* @description Child nodes will distribute on the left side of the root node.
* @memberof MapInteraction
*/
export declare const initLeft: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name initRight
* @description Child nodes will distribute on the right side of the root node.
* @memberof MapInteraction
*/
export declare const initRight: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name initSide
* @description Child nodes will distribute on both left and right side of the root node.
* @memberof MapInteraction
*/
export declare const initSide: (this: MindElixirInstance) => void;
/**
* @function
* @instance
* @name setLocale
* @memberof MapInteraction
*/
export declare const setLocale: (this: MindElixirInstance, locale: Locale) => void;
export declare const expandNode: (this: MindElixirInstance, el: Topic, isExpand?: boolean) => void;
/**
* @function
* @instance
* @name refresh
* @description Refresh mind map, you can use it after modified `this.nodeData`
* @memberof MapInteraction
* @param {TargetElement} data mind elixir data
*/
export declare const refresh: (this: MindElixirInstance, data?: MindElixirData) => void;