From 745531f20fcdcfc4f1ec675fb9ae61acc9a22b0e Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Sun, 8 Oct 2023 09:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=850.7.3-fix.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 +- simple-mind-map/types/index.d.ts | 18 +- .../types/src/constants/constant.d.ts | 112 ++++++------ .../types/src/constants/defaultOptions.d.ts | 157 ++++++++-------- .../types/src/core/render/Render.d.ts | 13 +- .../types/src/core/render/node/Node.d.ts | 6 +- .../types/src/core/render/node/Style.d.ts | 2 +- .../src/core/render/node/nodeCooperate.d.ts | 18 ++ .../core/render/node/nodeGeneralization.d.ts | 2 +- simple-mind-map/types/src/layouts/Base.d.ts | 2 +- .../src/layouts/CatalogOrganization.d.ts | 6 +- .../types/src/layouts/Fishbone.d.ts | 6 +- .../types/src/layouts/LogicalStructure.d.ts | 6 +- .../types/src/layouts/MindMap.d.ts | 6 +- .../src/layouts/OrganizationStructure.d.ts | 6 +- .../types/src/layouts/Timeline.d.ts | 6 +- .../types/src/layouts/VerticalTimeline.d.ts | 6 +- .../types/src/layouts/fishboneUtils.d.ts | 70 +++++++ simple-mind-map/types/src/themes/default.d.ts | 172 +++++++++--------- simple-mind-map/types/src/utils/index.d.ts | 5 +- 20 files changed, 348 insertions(+), 275 deletions(-) create mode 100644 simple-mind-map/types/src/core/render/node/nodeCooperate.d.ts diff --git a/index.html b/index.html index b161857a..fe7d6e09 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ 思绪思维导图
\ No newline at end of file + } \ No newline at end of file diff --git a/simple-mind-map/types/index.d.ts b/simple-mind-map/types/index.d.ts index 31567e7e..2b75cd02 100644 --- a/simple-mind-map/types/index.d.ts +++ b/simple-mind-map/types/index.d.ts @@ -95,6 +95,10 @@ declare class MindMap { beingDragNodeOpacity: number; }; tagsColorMap: {}; + cooperateStyle: { + avatarSize: number; + fontSize: number; + }; }); opt: any; el: any; @@ -159,14 +163,14 @@ declare class MindMap { destroy(): void; } declare namespace MindMap { - let pluginList: any[]; + const pluginList: any[]; function usePlugin(plugin: any, opt?: {}): typeof MindMap; function hasPlugin(plugin: any): number; function defineTheme(name: any, config?: {}): Error; } -import Event from './src/core/event/Event'; -import KeyCommand from './src/core/command/KeyCommand'; -import Command from './src/core/command/Command'; -import Render from './src/core/render/Render'; -import View from './src/core/view/View'; -import BatchExecution from './src/utils/BatchExecution'; +import Event from "./src/core/event/Event"; +import KeyCommand from "./src/core/command/KeyCommand"; +import Command from "./src/core/command/Command"; +import Render from "./src/core/render/Render"; +import View from "./src/core/view/View"; +import BatchExecution from "./src/utils/BatchExecution"; diff --git a/simple-mind-map/types/src/constants/constant.d.ts b/simple-mind-map/types/src/constants/constant.d.ts index bf00d5b9..3ac64ae7 100644 --- a/simple-mind-map/types/src/constants/constant.d.ts +++ b/simple-mind-map/types/src/constants/constant.d.ts @@ -4,81 +4,81 @@ export const themeList: { dark: boolean; }[]; export namespace CONSTANTS { - let CHANGE_THEME: string; - let CHANGE_LAYOUT: string; - let SET_DATA: string; - let TRANSFORM_TO_NORMAL_NODE: string; + const CHANGE_THEME: string; + const CHANGE_LAYOUT: string; + const SET_DATA: string; + const TRANSFORM_TO_NORMAL_NODE: string; namespace MODE { - let READONLY: string; - let EDIT: string; + const READONLY: string; + const EDIT: string; } namespace LAYOUT { - let LOGICAL_STRUCTURE: string; - let MIND_MAP: string; - let ORGANIZATION_STRUCTURE: string; - let CATALOG_ORGANIZATION: string; - let TIMELINE: string; - let TIMELINE2: string; - let FISHBONE: string; - let VERTICAL_TIMELINE: string; + const LOGICAL_STRUCTURE: string; + const MIND_MAP: string; + const ORGANIZATION_STRUCTURE: string; + const CATALOG_ORGANIZATION: string; + const TIMELINE: string; + const TIMELINE2: string; + const FISHBONE: string; + const VERTICAL_TIMELINE: string; } namespace DIR { - let UP: string; - let LEFT: string; - let DOWN: string; - let RIGHT: string; + const UP: string; + const LEFT: string; + const DOWN: string; + const RIGHT: string; } namespace KEY_DIR { - let LEFT_1: string; + const LEFT_1: string; export { LEFT_1 as LEFT }; - let UP_1: string; + const UP_1: string; export { UP_1 as UP }; - let RIGHT_1: string; + const RIGHT_1: string; export { RIGHT_1 as RIGHT }; - let DOWN_1: string; + const DOWN_1: string; export { DOWN_1 as DOWN }; } namespace SHAPE { - let RECTANGLE: string; - let DIAMOND: string; - let PARALLELOGRAM: string; - let ROUNDED_RECTANGLE: string; - let OCTAGONAL_RECTANGLE: string; - let OUTER_TRIANGULAR_RECTANGLE: string; - let INNER_TRIANGULAR_RECTANGLE: string; - let ELLIPSE: string; - let CIRCLE: string; + const RECTANGLE: string; + const DIAMOND: string; + const PARALLELOGRAM: string; + const ROUNDED_RECTANGLE: string; + const OCTAGONAL_RECTANGLE: string; + const OUTER_TRIANGULAR_RECTANGLE: string; + const INNER_TRIANGULAR_RECTANGLE: string; + const ELLIPSE: string; + const CIRCLE: string; } namespace MOUSE_WHEEL_ACTION { - let ZOOM: string; - let MOVE: string; + const ZOOM: string; + const MOVE: string; } namespace INIT_ROOT_NODE_POSITION { - let LEFT_2: string; + const LEFT_2: string; export { LEFT_2 as LEFT }; - export let TOP: string; - let RIGHT_2: string; + export const TOP: string; + const RIGHT_2: string; export { RIGHT_2 as RIGHT }; - export let BOTTOM: string; - export let CENTER: string; + export const BOTTOM: string; + export const CENTER: string; } namespace LAYOUT_GROW_DIR { - let LEFT_3: string; + const LEFT_3: string; export { LEFT_3 as LEFT }; - let TOP_1: string; + const TOP_1: string; export { TOP_1 as TOP }; - let RIGHT_3: string; + const RIGHT_3: string; export { RIGHT_3 as RIGHT }; - let BOTTOM_1: string; + const BOTTOM_1: string; export { BOTTOM_1 as BOTTOM }; } namespace PASTE_TYPE { - let CLIP_BOARD: string; - let CANVAS: string; + const CLIP_BOARD: string; + const CANVAS: string; } namespace SCROLL_BAR_DIR { - let VERTICAL: string; - let HORIZONTAL: string; + const VERTICAL: string; + const HORIZONTAL: string; } } export const initRootNodePositionMap: { @@ -91,19 +91,19 @@ export const layoutList: { export const layoutValueList: string[]; export const nodeDataNoStylePropList: string[]; export namespace commonCaches { - let measureCustomNodeContentSizeEl: any; - let measureRichtextNodeTextSizeEl: any; + const measureCustomNodeContentSizeEl: any; + const measureRichtextNodeTextSizeEl: any; } export namespace ERROR_TYPES { - let READ_CLIPBOARD_ERROR: string; - let PARSE_PASTE_DATA_ERROR: string; - let CUSTOM_HANDLE_CLIPBOARD_TEXT_ERROR: string; - let LOAD_CLIPBOARD_IMAGE_ERROR: string; - let BEFORE_TEXT_EDIT_ERROR: string; - let EXPORT_ERROR: string; + const READ_CLIPBOARD_ERROR: string; + const PARSE_PASTE_DATA_ERROR: string; + const CUSTOM_HANDLE_CLIPBOARD_TEXT_ERROR: string; + const LOAD_CLIPBOARD_IMAGE_ERROR: string; + const BEFORE_TEXT_EDIT_ERROR: string; + const EXPORT_ERROR: string; } export namespace a4Size { - let width: number; - let height: number; + const width: number; + const height: number; } export const cssContent: "\n /* 鼠标hover和激活时渲染的矩形 */\n .smm-hover-node{\n display: none;\n opacity: 0.6;\n stroke-width: 1;\n }\n\n .smm-node:not(.smm-node-dragging):hover .smm-hover-node{\n display: block;\n }\n\n .smm-node.active .smm-hover-node{\n display: block;\n opacity: 1;\n stroke-width: 2;\n }\n"; diff --git a/simple-mind-map/types/src/constants/defaultOptions.d.ts b/simple-mind-map/types/src/constants/defaultOptions.d.ts index 93dcb638..8a3bcc77 100644 --- a/simple-mind-map/types/src/constants/defaultOptions.d.ts +++ b/simple-mind-map/types/src/constants/defaultOptions.d.ts @@ -1,95 +1,100 @@ export namespace defaultOpt { - let readonly: boolean; - let layout: string; - let fishboneDeg: number; - let theme: string; - let themeConfig: {}; - let scaleRatio: number; - let mouseScaleCenterUseMousePosition: boolean; - let maxTag: number; - let expandBtnSize: number; - let imgTextMargin: number; - let textContentMargin: number; - let selectTranslateStep: number; - let selectTranslateLimit: number; - let customNoteContentShow: any; - let enableFreeDrag: boolean; + const readonly: boolean; + const layout: string; + const fishboneDeg: number; + const theme: string; + const themeConfig: {}; + const scaleRatio: number; + const mouseScaleCenterUseMousePosition: boolean; + const maxTag: number; + const expandBtnSize: number; + const imgTextMargin: number; + const textContentMargin: number; + const selectTranslateStep: number; + const selectTranslateLimit: number; + const customNoteContentShow: any; + const enableFreeDrag: boolean; namespace watermarkConfig { - let text: string; - let lineSpacing: number; - let textSpacing: number; - let angle: number; + const text: string; + const lineSpacing: number; + const textSpacing: number; + const angle: number; namespace textStyle { - let color: string; - let opacity: number; - let fontSize: number; + const color: string; + const opacity: number; + const fontSize: number; } } - let textAutoWrapWidth: number; - let customHandleMousewheel: any; - let mousewheelAction: string; - let mousewheelMoveStep: number; - let mousewheelZoomActionReverse: boolean; - let defaultInsertSecondLevelNodeText: string; - let defaultInsertBelowSecondLevelNodeText: string; + const textAutoWrapWidth: number; + const customHandleMousewheel: any; + const mousewheelAction: string; + const mousewheelMoveStep: number; + const mousewheelZoomActionReverse: boolean; + const defaultInsertSecondLevelNodeText: string; + const defaultInsertBelowSecondLevelNodeText: string; namespace expandBtnStyle { - let color_1: string; + const color_1: string; export { color_1 as color }; - export let fill: string; - let fontSize_1: number; + export const fill: string; + const fontSize_1: number; export { fontSize_1 as fontSize }; - export let strokeColor: string; + export const strokeColor: string; } namespace expandBtnIcon { - let open: string; - let close: string; + const open: string; + const close: string; } function expandBtnNumHandler(num: any): any; - let isShowExpandNum: boolean; - let enableShortcutOnlyWhenMouseInSvg: boolean; - let initRootNodePosition: any; - let exportPaddingX: number; - let exportPaddingY: number; - let nodeTextEditZIndex: number; - let nodeNoteTooltipZIndex: number; - let isEndNodeTextEditOnClickOuter: boolean; - let maxHistoryCount: number; - let alwaysShowExpandBtn: boolean; - let iconList: any[]; - let maxNodeCacheCount: number; - let defaultAssociativeLineText: string; - let fitPadding: number; - let enableCtrlKeyNodeSelection: boolean; - let useLeftKeySelectionRightKeyDrag: boolean; - let beforeTextEdit: any; - let isUseCustomNodeContent: boolean; - let customCreateNodeContent: any; - let customInnerElsAppendTo: any; - let nodeDragPlaceholderMaxSize: number; - let enableAutoEnterTextEditWhenKeydown: boolean; - let richTextEditFakeInPlace: boolean; - let customHandleClipboardText: any; - let disableMouseWheelZoom: boolean; + const isShowExpandNum: boolean; + const enableShortcutOnlyWhenMouseInSvg: boolean; + const initRootNodePosition: any; + const exportPaddingX: number; + const exportPaddingY: number; + const nodeTextEditZIndex: number; + const nodeNoteTooltipZIndex: number; + const isEndNodeTextEditOnClickOuter: boolean; + const maxHistoryCount: number; + const alwaysShowExpandBtn: boolean; + const iconList: any[]; + const maxNodeCacheCount: number; + const defaultAssociativeLineText: string; + const fitPadding: number; + const enableCtrlKeyNodeSelection: boolean; + const useLeftKeySelectionRightKeyDrag: boolean; + const beforeTextEdit: any; + const isUseCustomNodeContent: boolean; + const customCreateNodeContent: any; + const customInnerElsAppendTo: any; + const nodeDragPlaceholderMaxSize: number; + const enableAutoEnterTextEditWhenKeydown: boolean; + const richTextEditFakeInPlace: boolean; + const customHandleClipboardText: any; + const disableMouseWheelZoom: boolean; function errorHandler(code: any, error: any): void; - let resetCss: string; - let enableDblclickReset: boolean; - let minExportImgCanvasScale: number; - let hoverRectColor: string; - let hoverRectPadding: number; - let selectTextOnEnterEditText: boolean; - let deleteNodeActive: boolean; - let autoMoveWhenMouseInEdgeOnDrag: boolean; - let fit: boolean; + const resetCss: string; + const enableDblclickReset: boolean; + const minExportImgCanvasScale: number; + const hoverRectColor: string; + const hoverRectPadding: number; + const selectTextOnEnterEditText: boolean; + const deleteNodeActive: boolean; + const autoMoveWhenMouseInEdgeOnDrag: boolean; + const fit: boolean; namespace dragMultiNodeRectConfig { - export let width: number; - export let height: number; - let fill_1: string; + export const width: number; + export const height: number; + const fill_1: string; export { fill_1 as fill }; } - let dragPlaceholderRectFill: string; + const dragPlaceholderRectFill: string; namespace dragOpacityConfig { - let cloneNodeOpacity: number; - let beingDragNodeOpacity: number; + const cloneNodeOpacity: number; + const beingDragNodeOpacity: number; + } + const tagsColorMap: {}; + namespace cooperateStyle { + export const avatarSize: number; + const fontSize_2: number; + export { fontSize_2 as fontSize }; } - let tagsColorMap: {}; } diff --git a/simple-mind-map/types/src/core/render/Render.d.ts b/simple-mind-map/types/src/core/render/Render.d.ts index 346c7709..120a0ffd 100644 --- a/simple-mind-map/types/src/core/render/Render.d.ts +++ b/simple-mind-map/types/src/core/render/Render.d.ts @@ -22,6 +22,7 @@ declare class Render { currentBeingPasteType: string; setLayout(): void; layout: MindMap | CatalogOrganization | OrganizationStructure | Timeline | VerticalTimeline; + setData(data: any): void; bindEvent(): void; registerCommands(): void; selectAll(): void; @@ -87,9 +88,9 @@ declare class Render { expandToNodeUid(uid: any, callback?: () => void): void; findNodeByUid(uid: any): any; } -import TextEdit from './TextEdit'; -import MindMap from '../../layouts/MindMap'; -import CatalogOrganization from '../../layouts/CatalogOrganization'; -import OrganizationStructure from '../../layouts/OrganizationStructure'; -import Timeline from '../../layouts/Timeline'; -import VerticalTimeline from '../../layouts/VerticalTimeline'; +import TextEdit from "./TextEdit"; +import MindMap from "../../layouts/MindMap"; +import CatalogOrganization from "../../layouts/CatalogOrganization"; +import OrganizationStructure from "../../layouts/OrganizationStructure"; +import Timeline from "../../layouts/Timeline"; +import VerticalTimeline from "../../layouts/VerticalTimeline"; diff --git a/simple-mind-map/types/src/core/render/node/Node.d.ts b/simple-mind-map/types/src/core/render/node/Node.d.ts index 0991864c..69a1f5f7 100644 --- a/simple-mind-map/types/src/core/render/node/Node.d.ts +++ b/simple-mind-map/types/src/core/render/node/Node.d.ts @@ -25,6 +25,7 @@ declare class Node { isDrag: boolean; parent: any; children: any; + userList: any[]; group: any; shapeNode: any; hoverNode: any; @@ -42,6 +43,7 @@ declare class Node { _openExpandNode: any; _closeExpandNode: any; _fillExpandNode: any; + _userListGroup: any; _lines: any[]; _generalizationLine: any; _generalizationNode: any; @@ -114,5 +116,5 @@ declare class Node { getData(key: any): any; hasCustomStyle(): boolean; } -import Style from './Style'; -import Shape from './Shape'; +import Style from "./Style"; +import Shape from "./Shape"; diff --git a/simple-mind-map/types/src/core/render/node/Style.d.ts b/simple-mind-map/types/src/core/render/node/Style.d.ts index 3c78574f..35f67b51 100644 --- a/simple-mind-map/types/src/core/render/node/Style.d.ts +++ b/simple-mind-map/types/src/core/render/node/Style.d.ts @@ -32,5 +32,5 @@ declare class Style { hoverNode(node: any): void; } declare namespace Style { - let cacheStyle: any; + const cacheStyle: any; } diff --git a/simple-mind-map/types/src/core/render/node/nodeCooperate.d.ts b/simple-mind-map/types/src/core/render/node/nodeCooperate.d.ts new file mode 100644 index 00000000..61b696ed --- /dev/null +++ b/simple-mind-map/types/src/core/render/node/nodeCooperate.d.ts @@ -0,0 +1,18 @@ +declare namespace _default { + export { createUserListNode }; + export { updateUserListNode }; + export { createTextAvatar }; + export { createImageAvatar }; + export { addUser }; + export { removeUser }; +} +export default _default; +declare function createUserListNode(): void; +declare class createUserListNode { + _userListGroup: any; +} +declare function updateUserListNode(): void; +declare function createTextAvatar(item: any): any; +declare function createImageAvatar(item: any): any; +declare function addUser(userInfo: any): void; +declare function removeUser(userInfo: any): void; diff --git a/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts b/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts index 9382d87d..7dc71a37 100644 --- a/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts +++ b/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts @@ -29,4 +29,4 @@ declare class removeGeneralization { } declare function hideGeneralization(): void; declare function showGeneralization(): void; -import Node from './Node'; +import Node from "./Node"; diff --git a/simple-mind-map/types/src/layouts/Base.d.ts b/simple-mind-map/types/src/layouts/Base.d.ts index bf03b37c..0da0113c 100644 --- a/simple-mind-map/types/src/layouts/Base.d.ts +++ b/simple-mind-map/types/src/layouts/Base.d.ts @@ -40,4 +40,4 @@ declare class Base { }; getNodeActChildrenLength(node: any): any; } -import Lru from '../utils/Lru'; +import Lru from "../utils/Lru"; diff --git a/simple-mind-map/types/src/layouts/CatalogOrganization.d.ts b/simple-mind-map/types/src/layouts/CatalogOrganization.d.ts index d95995c2..53eb9010 100644 --- a/simple-mind-map/types/src/layouts/CatalogOrganization.d.ts +++ b/simple-mind-map/types/src/layouts/CatalogOrganization.d.ts @@ -1,15 +1,11 @@ export default CatalogOrganization; declare class CatalogOrganization extends Base { constructor(opt?: {}); - doLayout(callback: any): void; computedBaseValue(): void; computedLeftTopValue(): void; adjustLeftTopValue(): void; updateBrothersLeft(node: any, addWidth: any): void; updateBrothersTop(node: any, addHeight: any): void; - renderLine(node: any, lines: any, style: any): any[]; - renderExpandBtn(node: any, btn: any): void; - renderGeneralization(node: any, gLine: any, gNode: any): void; renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void; } -import Base from './Base'; +import Base from "./Base"; diff --git a/simple-mind-map/types/src/layouts/Fishbone.d.ts b/simple-mind-map/types/src/layouts/Fishbone.d.ts index cc213aa8..a3ee6033 100644 --- a/simple-mind-map/types/src/layouts/Fishbone.d.ts +++ b/simple-mind-map/types/src/layouts/Fishbone.d.ts @@ -3,7 +3,6 @@ declare class Fishbone extends Base { constructor(opt?: {}); indent: number; childIndent: number; - doLayout(callback: any): void; computedBaseValue(): void; computedLeftTopValue(): void; adjustLeftTopValue(): void; @@ -11,9 +10,6 @@ declare class Fishbone extends Base { updateBrothersLeft(node: any): void; updateBrothersTop(node: any, addHeight: any): void; checkIsTop(node: any): boolean; - renderLine(node: any, lines: any, style: any): any[]; - renderExpandBtn(node: any, btn: any): void; - renderGeneralization(node: any, gLine: any, gNode: any): void; renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void; } -import Base from './Base'; +import Base from "./Base"; diff --git a/simple-mind-map/types/src/layouts/LogicalStructure.d.ts b/simple-mind-map/types/src/layouts/LogicalStructure.d.ts index fcb0ea59..c7773b2c 100644 --- a/simple-mind-map/types/src/layouts/LogicalStructure.d.ts +++ b/simple-mind-map/types/src/layouts/LogicalStructure.d.ts @@ -1,17 +1,13 @@ export default LogicalStructure; declare class LogicalStructure extends Base { constructor(opt?: {}); - doLayout(callback: any): void; computedBaseValue(): void; computedTopValue(): void; adjustTopValue(): void; updateBrothers(node: any, addHeight: any): void; - renderLine(node: any, lines: any, style: any, lineStyle: any): void; renderLineStraight(node: any, lines: any, style: any): any[]; renderLineDirect(node: any, lines: any, style: any): any[]; renderLineCurve(node: any, lines: any, style: any): any[]; - renderExpandBtn(node: any, btn: any): void; - renderGeneralization(node: any, gLine: any, gNode: any): void; renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void; } -import Base from './Base'; +import Base from "./Base"; diff --git a/simple-mind-map/types/src/layouts/MindMap.d.ts b/simple-mind-map/types/src/layouts/MindMap.d.ts index 492d3b50..bef75a63 100644 --- a/simple-mind-map/types/src/layouts/MindMap.d.ts +++ b/simple-mind-map/types/src/layouts/MindMap.d.ts @@ -1,17 +1,13 @@ export default MindMap; declare class MindMap extends Base { constructor(opt?: {}); - doLayout(callback: any): void; computedBaseValue(): void; computedTopValue(): void; adjustTopValue(): void; updateBrothers(node: any, leftAddHeight: any, rightAddHeight: any): void; - renderLine(node: any, lines: any, style: any, lineStyle: any): void; renderLineStraight(node: any, lines: any, style: any): any[]; renderLineDirect(node: any, lines: any, style: any): any[]; renderLineCurve(node: any, lines: any, style: any): any[]; - renderExpandBtn(node: any, btn: any): void; - renderGeneralization(node: any, gLine: any, gNode: any): void; renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void; } -import Base from './Base'; +import Base from "./Base"; diff --git a/simple-mind-map/types/src/layouts/OrganizationStructure.d.ts b/simple-mind-map/types/src/layouts/OrganizationStructure.d.ts index ae5961c2..316c1400 100644 --- a/simple-mind-map/types/src/layouts/OrganizationStructure.d.ts +++ b/simple-mind-map/types/src/layouts/OrganizationStructure.d.ts @@ -1,16 +1,12 @@ export default OrganizationStructure; declare class OrganizationStructure extends Base { constructor(opt?: {}); - doLayout(callback: any): void; computedBaseValue(): void; computedLeftValue(): void; adjustLeftValue(): void; updateBrothers(node: any, addWidth: any): void; - renderLine(node: any, lines: any, style: any, lineStyle: any): void; renderLineDirect(node: any, lines: any, style: any): any[]; renderLineStraight(node: any, lines: any, style: any): any[]; - renderExpandBtn(node: any, btn: any): void; - renderGeneralization(node: any, gLine: any, gNode: any): void; renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void; } -import Base from './Base'; +import Base from "./Base"; diff --git a/simple-mind-map/types/src/layouts/Timeline.d.ts b/simple-mind-map/types/src/layouts/Timeline.d.ts index ccc17aa6..79120394 100644 --- a/simple-mind-map/types/src/layouts/Timeline.d.ts +++ b/simple-mind-map/types/src/layouts/Timeline.d.ts @@ -2,16 +2,12 @@ export default Timeline; declare class Timeline extends Base { constructor(opt: {}, layout: any); layout: any; - doLayout(callback: any): void; computedBaseValue(): void; computedLeftTopValue(): void; adjustLeftTopValue(): void; getNodeAreaHeight(node: any): number; updateBrothersLeft(node: any): void; updateBrothersTop(node: any, addHeight: any): void; - renderLine(node: any, lines: any, style: any): any[]; - renderExpandBtn(node: any, btn: any): void; - renderGeneralization(node: any, gLine: any, gNode: any): void; renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void; } -import Base from './Base'; +import Base from "./Base"; diff --git a/simple-mind-map/types/src/layouts/VerticalTimeline.d.ts b/simple-mind-map/types/src/layouts/VerticalTimeline.d.ts index 1127a694..64b93e35 100644 --- a/simple-mind-map/types/src/layouts/VerticalTimeline.d.ts +++ b/simple-mind-map/types/src/layouts/VerticalTimeline.d.ts @@ -2,18 +2,14 @@ export default VerticalTimeline; declare class VerticalTimeline extends Base { constructor(opt: {}, layout: any); layout: any; - doLayout(callback: any): void; computedBaseValue(): void; computedTopValue(): void; adjustLeftTopValue(): void; updateBrothers(node: any, addHeight: any): void; updateBrothersTop(node: any, addHeight: any): void; - renderLine(node: any, lines: any, style: any, lineStyle: any): void; renderLineStraight(node: any, lines: any, style: any): any[]; renderLineDirect(node: any, lines: any, style: any): any[]; renderLineCurve(node: any, lines: any, style: any): any[]; - renderExpandBtn(node: any, btn: any): void; - renderGeneralization(node: any, gLine: any, gNode: any): void; renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void; } -import Base from './Base'; +import Base from "./Base"; diff --git a/simple-mind-map/types/src/layouts/fishboneUtils.d.ts b/simple-mind-map/types/src/layouts/fishboneUtils.d.ts index 59e2ebde..1333d94c 100644 --- a/simple-mind-map/types/src/layouts/fishboneUtils.d.ts +++ b/simple-mind-map/types/src/layouts/fishboneUtils.d.ts @@ -1,5 +1,14 @@ declare namespace _default { namespace top { + function renderExpandBtn({ node, btn, expandBtnSize, translateX, translateY, width, height }: { + node: any; + btn: any; + expandBtnSize: any; + translateX: any; + translateY: any; + width: any; + height: any; + }): void; function renderExpandBtn({ node, btn, expandBtnSize, translateX, translateY, width, height }: { node: any; btn: any; @@ -20,11 +29,33 @@ declare namespace _default { maxy: any; ctx: any; }): void; + function renderLine({ node, line, top, x, lineLength, height, expandBtnSize, maxy, ctx }: { + node: any; + line: any; + top: any; + x: any; + lineLength: any; + height: any; + expandBtnSize: any; + maxy: any; + ctx: any; + }): void; function computedLeftTopValue({ layerIndex, node, ctx }: { layerIndex: any; node: any; ctx: any; }): void; + function computedLeftTopValue({ layerIndex, node, ctx }: { + layerIndex: any; + node: any; + ctx: any; + }): void; + function adjustLeftTopValueBefore({ node, parent, ctx, layerIndex }: { + node: any; + parent: any; + ctx: any; + layerIndex: any; + }): void; function adjustLeftTopValueBefore({ node, parent, ctx, layerIndex }: { node: any; parent: any; @@ -36,8 +67,22 @@ declare namespace _default { node: any; ctx: any; }): void; + function adjustLeftTopValueAfter({ parent, node, ctx }: { + parent: any; + node: any; + ctx: any; + }): void; } namespace bottom { + function renderExpandBtn({ node, btn, expandBtnSize, translateX, translateY, width, height }: { + node: any; + btn: any; + expandBtnSize: any; + translateX: any; + translateY: any; + width: any; + height: any; + }): void; function renderExpandBtn({ node, btn, expandBtnSize, translateX, translateY, width, height }: { node: any; btn: any; @@ -57,11 +102,31 @@ declare namespace _default { miny: any; ctx: any; }): void; + function renderLine({ node, line, top, x, lineLength, height, miny, ctx }: { + node: any; + line: any; + top: any; + x: any; + lineLength: any; + height: any; + miny: any; + ctx: any; + }): void; function computedLeftTopValue({ layerIndex, node, ctx }: { layerIndex: any; node: any; ctx: any; }): void; + function computedLeftTopValue({ layerIndex, node, ctx }: { + layerIndex: any; + node: any; + ctx: any; + }): void; + function adjustLeftTopValueBefore({ node, ctx, layerIndex }: { + node: any; + ctx: any; + layerIndex: any; + }): void; function adjustLeftTopValueBefore({ node, ctx, layerIndex }: { node: any; ctx: any; @@ -72,6 +137,11 @@ declare namespace _default { node: any; ctx: any; }): void; + function adjustLeftTopValueAfter({ parent, node, ctx }: { + parent: any; + node: any; + ctx: any; + }): void; } } export default _default; diff --git a/simple-mind-map/types/src/themes/default.d.ts b/simple-mind-map/types/src/themes/default.d.ts index 5d31dd45..011f01f6 100644 --- a/simple-mind-map/types/src/themes/default.d.ts +++ b/simple-mind-map/types/src/themes/default.d.ts @@ -1,139 +1,139 @@ declare namespace _default { - let paddingX: number; - let paddingY: number; - let imgMaxWidth: number; - let imgMaxHeight: number; - let iconSize: number; - let lineWidth: number; - let lineColor: string; - let lineDasharray: string; - let lineStyle: string; - let rootLineKeepSameInCurve: boolean; - let generalizationLineWidth: number; - let generalizationLineColor: string; - let generalizationLineMargin: number; - let generalizationNodeMargin: number; - let associativeLineWidth: number; - let associativeLineColor: string; - let associativeLineActiveWidth: number; - let associativeLineActiveColor: string; - let associativeLineTextColor: string; - let associativeLineTextFontSize: number; - let associativeLineTextLineHeight: number; - let associativeLineTextFontFamily: string; - let backgroundColor: string; - let backgroundImage: string; - let backgroundRepeat: string; - let backgroundPosition: string; - let backgroundSize: string; - let nodeUseLineStyle: boolean; + const paddingX: number; + const paddingY: number; + const imgMaxWidth: number; + const imgMaxHeight: number; + const iconSize: number; + const lineWidth: number; + const lineColor: string; + const lineDasharray: string; + const lineStyle: string; + const rootLineKeepSameInCurve: boolean; + const generalizationLineWidth: number; + const generalizationLineColor: string; + const generalizationLineMargin: number; + const generalizationNodeMargin: number; + const associativeLineWidth: number; + const associativeLineColor: string; + const associativeLineActiveWidth: number; + const associativeLineActiveColor: string; + const associativeLineTextColor: string; + const associativeLineTextFontSize: number; + const associativeLineTextLineHeight: number; + const associativeLineTextFontFamily: string; + const backgroundColor: string; + const backgroundImage: string; + const backgroundRepeat: string; + const backgroundPosition: string; + const backgroundSize: string; + const nodeUseLineStyle: boolean; namespace root { - let shape: string; - let fillColor: string; - let fontFamily: string; - let color: string; - let fontSize: number; - let fontWeight: string; - let fontStyle: string; - let lineHeight: number; - let borderColor: string; - let borderWidth: number; - let borderDasharray: string; - let borderRadius: number; - let textDecoration: string; + const shape: string; + const fillColor: string; + const fontFamily: string; + const color: string; + const fontSize: number; + const fontWeight: string; + const fontStyle: string; + const lineHeight: number; + const borderColor: string; + const borderWidth: number; + const borderDasharray: string; + const borderRadius: number; + const textDecoration: string; } namespace second { - let shape_1: string; + const shape_1: string; export { shape_1 as shape }; - export let marginX: number; - export let marginY: number; - let fillColor_1: string; + export const marginX: number; + export const marginY: number; + const fillColor_1: string; export { fillColor_1 as fillColor }; - let fontFamily_1: string; + const fontFamily_1: string; export { fontFamily_1 as fontFamily }; - let color_1: string; + const color_1: string; export { color_1 as color }; - let fontSize_1: number; + const fontSize_1: number; export { fontSize_1 as fontSize }; - let fontWeight_1: string; + const fontWeight_1: string; export { fontWeight_1 as fontWeight }; - let fontStyle_1: string; + const fontStyle_1: string; export { fontStyle_1 as fontStyle }; - let lineHeight_1: number; + const lineHeight_1: number; export { lineHeight_1 as lineHeight }; - let borderColor_1: string; + const borderColor_1: string; export { borderColor_1 as borderColor }; - let borderWidth_1: number; + const borderWidth_1: number; export { borderWidth_1 as borderWidth }; - let borderDasharray_1: string; + const borderDasharray_1: string; export { borderDasharray_1 as borderDasharray }; - let borderRadius_1: number; + const borderRadius_1: number; export { borderRadius_1 as borderRadius }; - let textDecoration_1: string; + const textDecoration_1: string; export { textDecoration_1 as textDecoration }; } namespace node { - let shape_2: string; + const shape_2: string; export { shape_2 as shape }; - let marginX_1: number; + const marginX_1: number; export { marginX_1 as marginX }; - let marginY_1: number; + const marginY_1: number; export { marginY_1 as marginY }; - let fillColor_2: string; + const fillColor_2: string; export { fillColor_2 as fillColor }; - let fontFamily_2: string; + const fontFamily_2: string; export { fontFamily_2 as fontFamily }; - let color_2: string; + const color_2: string; export { color_2 as color }; - let fontSize_2: number; + const fontSize_2: number; export { fontSize_2 as fontSize }; - let fontWeight_2: string; + const fontWeight_2: string; export { fontWeight_2 as fontWeight }; - let fontStyle_2: string; + const fontStyle_2: string; export { fontStyle_2 as fontStyle }; - let lineHeight_2: number; + const lineHeight_2: number; export { lineHeight_2 as lineHeight }; - let borderColor_2: string; + const borderColor_2: string; export { borderColor_2 as borderColor }; - let borderWidth_2: number; + const borderWidth_2: number; export { borderWidth_2 as borderWidth }; - let borderRadius_2: number; + const borderRadius_2: number; export { borderRadius_2 as borderRadius }; - let borderDasharray_2: string; + const borderDasharray_2: string; export { borderDasharray_2 as borderDasharray }; - let textDecoration_2: string; + const textDecoration_2: string; export { textDecoration_2 as textDecoration }; } namespace generalization { - let shape_3: string; + const shape_3: string; export { shape_3 as shape }; - let marginX_2: number; + const marginX_2: number; export { marginX_2 as marginX }; - let marginY_2: number; + const marginY_2: number; export { marginY_2 as marginY }; - let fillColor_3: string; + const fillColor_3: string; export { fillColor_3 as fillColor }; - let fontFamily_3: string; + const fontFamily_3: string; export { fontFamily_3 as fontFamily }; - let color_3: string; + const color_3: string; export { color_3 as color }; - let fontSize_3: number; + const fontSize_3: number; export { fontSize_3 as fontSize }; - let fontWeight_3: string; + const fontWeight_3: string; export { fontWeight_3 as fontWeight }; - let fontStyle_3: string; + const fontStyle_3: string; export { fontStyle_3 as fontStyle }; - let lineHeight_3: number; + const lineHeight_3: number; export { lineHeight_3 as lineHeight }; - let borderColor_3: string; + const borderColor_3: string; export { borderColor_3 as borderColor }; - let borderWidth_3: number; + const borderWidth_3: number; export { borderWidth_3 as borderWidth }; - let borderDasharray_3: string; + const borderDasharray_3: string; export { borderDasharray_3 as borderDasharray }; - let borderRadius_3: number; + const borderRadius_3: number; export { borderRadius_3 as borderRadius }; - let textDecoration_3: string; + const textDecoration_3: string; export { textDecoration_3 as textDecoration }; } } diff --git a/simple-mind-map/types/src/utils/index.d.ts b/simple-mind-map/types/src/utils/index.d.ts index 615e56b7..5eacba05 100644 --- a/simple-mind-map/types/src/utils/index.d.ts +++ b/simple-mind-map/types/src/utils/index.d.ts @@ -6,7 +6,7 @@ export function resizeImg(imgUrl: any, maxWidth: any, maxHeight: any): Promise; export function parseDataUrl(data: any): any; export function downloadFile(file: any, fileName: any): void; @@ -62,8 +62,9 @@ export function checkTwoRectIsOverlap(minx1: any, maxx1: any, miny1: any, maxy1: export function focusInput(el: any): void; export function selectAllInput(el: any): void; export function addDataToAppointNodes(appointNodes: any, data?: {}): any; -export function createUidForAppointNodes(appointNodes: any): any; +export function createUidForAppointNodes(appointNodes: any, createNewId?: boolean): any; export function formatDataToArray(data: any): any[]; export function getNodeIndex(node: any): any; export function generateColorByContent(str: any): string; export function htmlEscape(str: any): any; +export function isSameObject(a: any, b: any): boolean;