@lingkkkk/atlas-mindmap 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.css ADDED
@@ -0,0 +1,237 @@
1
+ /* ../vanilla/src/styles.css */
2
+ .mm-root {
3
+ --mm-surface-base: #090d16;
4
+ --mm-focus-glow: rgba(91, 75, 191, 0.18);
5
+ --mm-grid-dot: rgba(131, 145, 181, 0.13);
6
+ --mm-canvas-top: rgba(13, 18, 31, 0.82);
7
+ --mm-canvas-bottom: rgba(7, 10, 18, 0.98);
8
+ --mm-color: #dfe7ff;
9
+ --mm-overlay-border: rgba(150, 160, 225, 0.22);
10
+ --mm-overlay-bg: rgba(17, 23, 43, 0.94);
11
+ --mm-overlay-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
12
+ --mm-overlay-text: #dce4ff;
13
+ --mm-overlay-hover: rgba(124, 108, 255, 0.25);
14
+ --mm-editor-border: #8f82ff;
15
+ --mm-editor-color: #fff;
16
+ --mm-editor-bg: #171e37;
17
+ --mm-editor-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
18
+ --mm-hud-border: rgba(127, 145, 211, 0.18);
19
+ --mm-hud-color: #aebbdc;
20
+ --mm-hud-bg: rgba(9, 14, 28, 0.84);
21
+ --mm-hud-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
22
+ --mm-hud-title: #d9e2ff;
23
+ --mm-hud-value: #e7ecff;
24
+ --mm-status-border: rgba(79, 230, 188, 0.28);
25
+ --mm-status-color: #bff9e8;
26
+ --mm-status-bg: rgba(12, 43, 39, 0.92);
27
+ --mm-error-border: rgba(255, 114, 142, 0.35);
28
+ --mm-error-color: #ffd2da;
29
+ --mm-error-bg: rgba(56, 18, 31, 0.94);
30
+ position: relative;
31
+ width: 100%;
32
+ height: 100%;
33
+ min-height: 320px;
34
+ overflow: hidden;
35
+ color: var(--mm-color);
36
+ background-color: var(--mm-surface-base);
37
+ background-image:
38
+ radial-gradient(
39
+ circle at 18% 12%,
40
+ var(--mm-focus-glow),
41
+ transparent 36%),
42
+ radial-gradient(
43
+ circle,
44
+ var(--mm-grid-dot) 0.85px,
45
+ transparent 1px),
46
+ linear-gradient(
47
+ 180deg,
48
+ var(--mm-canvas-top),
49
+ var(--mm-canvas-bottom));
50
+ background-position:
51
+ 0 0,
52
+ 0 0,
53
+ 0 0;
54
+ background-size:
55
+ auto,
56
+ 28px 28px,
57
+ auto;
58
+ outline: none;
59
+ user-select: none;
60
+ }
61
+ .mm-root[data-theme=light] {
62
+ --mm-surface-base: #f0f3f8;
63
+ --mm-focus-glow: rgba(105, 92, 224, 0.1);
64
+ --mm-grid-dot: rgba(74, 88, 119, 0.15);
65
+ --mm-canvas-top: rgba(248, 250, 255, 0.96);
66
+ --mm-canvas-bottom: rgba(236, 241, 248, 0.98);
67
+ --mm-color: #273149;
68
+ --mm-overlay-border: rgba(72, 84, 122, 0.18);
69
+ --mm-overlay-bg: rgba(255, 255, 255, 0.94);
70
+ --mm-overlay-shadow: 0 12px 28px rgba(42, 50, 75, 0.15);
71
+ --mm-overlay-text: #303b55;
72
+ --mm-overlay-hover: rgba(104, 87, 229, 0.12);
73
+ --mm-editor-border: #6758d9;
74
+ --mm-editor-color: #202840;
75
+ --mm-editor-bg: #fff;
76
+ --mm-editor-shadow: 0 14px 34px rgba(42, 50, 75, 0.2);
77
+ --mm-hud-border: rgba(72, 84, 122, 0.18);
78
+ --mm-hud-color: #59647d;
79
+ --mm-hud-bg: rgba(255, 255, 255, 0.88);
80
+ --mm-hud-shadow: 0 16px 36px rgba(42, 50, 75, 0.14);
81
+ --mm-hud-title: #303a52;
82
+ --mm-hud-value: #202940;
83
+ --mm-status-border: rgba(22, 139, 116, 0.24);
84
+ --mm-status-color: #126f5e;
85
+ --mm-status-bg: rgba(231, 250, 244, 0.96);
86
+ --mm-error-border: rgba(194, 54, 84, 0.24);
87
+ --mm-error-color: #9d2843;
88
+ --mm-error-bg: rgba(255, 238, 242, 0.96);
89
+ }
90
+ .mm-root:focus-visible {
91
+ box-shadow: inset 0 0 0 2px rgba(129, 119, 255, 0.72);
92
+ }
93
+ .mm-canvas {
94
+ position: absolute;
95
+ inset: 0;
96
+ display: block;
97
+ width: 100%;
98
+ height: 100%;
99
+ cursor: grab;
100
+ touch-action: none;
101
+ }
102
+ .mm-canvas:active {
103
+ cursor: grabbing;
104
+ }
105
+ .mm-overlay {
106
+ position: absolute;
107
+ inset: 0;
108
+ pointer-events: none;
109
+ }
110
+ .mm-shared-toolbar {
111
+ position: absolute;
112
+ z-index: 5;
113
+ display: flex;
114
+ gap: 4px;
115
+ padding: 5px;
116
+ border: 1px solid var(--mm-overlay-border);
117
+ border-radius: 11px;
118
+ background: var(--mm-overlay-bg);
119
+ box-shadow: var(--mm-overlay-shadow);
120
+ backdrop-filter: blur(14px);
121
+ pointer-events: auto;
122
+ }
123
+ .mm-shared-toolbar[hidden] {
124
+ display: none;
125
+ }
126
+ .mm-shared-toolbar button {
127
+ width: 28px;
128
+ height: 28px;
129
+ border: 0;
130
+ border-radius: 7px;
131
+ color: var(--mm-overlay-text);
132
+ background: transparent;
133
+ cursor: pointer;
134
+ }
135
+ .mm-shared-toolbar button:hover {
136
+ background: var(--mm-overlay-hover);
137
+ }
138
+ .mm-text-editor {
139
+ position: absolute;
140
+ z-index: 8;
141
+ box-sizing: border-box;
142
+ border: 2px solid var(--mm-editor-border);
143
+ border-radius: 11px;
144
+ padding: 0 12px;
145
+ color: var(--mm-editor-color);
146
+ background: var(--mm-editor-bg);
147
+ box-shadow: var(--mm-editor-shadow);
148
+ font:
149
+ 550 13px Inter,
150
+ system-ui,
151
+ sans-serif;
152
+ outline: none;
153
+ pointer-events: auto;
154
+ }
155
+ .mm-performance-hud {
156
+ position: absolute;
157
+ z-index: 3;
158
+ right: 16px;
159
+ bottom: 16px;
160
+ width: 232px;
161
+ padding: 13px 15px;
162
+ border: 1px solid var(--mm-hud-border);
163
+ border-radius: 14px;
164
+ color: var(--mm-hud-color);
165
+ background: var(--mm-hud-bg);
166
+ box-shadow: var(--mm-hud-shadow);
167
+ backdrop-filter: blur(15px);
168
+ font:
169
+ 500 11px/1.45 Inter,
170
+ system-ui,
171
+ sans-serif;
172
+ }
173
+ .mm-hud-title {
174
+ display: flex;
175
+ align-items: center;
176
+ gap: 7px;
177
+ margin-bottom: 9px;
178
+ color: var(--mm-hud-title);
179
+ font-size: 10px;
180
+ font-weight: 750;
181
+ letter-spacing: 0.13em;
182
+ }
183
+ .mm-live-dot {
184
+ width: 7px;
185
+ height: 7px;
186
+ border-radius: 50%;
187
+ background: #42e2b8;
188
+ box-shadow: 0 0 12px rgba(66, 226, 184, 0.75);
189
+ }
190
+ .mm-hud-grid {
191
+ display: grid;
192
+ grid-template-columns: 1fr auto;
193
+ gap: 4px 12px;
194
+ }
195
+ .mm-hud-grid strong {
196
+ color: var(--mm-hud-value);
197
+ font-variant-numeric: tabular-nums;
198
+ font-weight: 650;
199
+ text-align: right;
200
+ }
201
+ .mm-status {
202
+ position: absolute;
203
+ left: 50%;
204
+ bottom: 26px;
205
+ z-index: 10;
206
+ padding: 9px 14px;
207
+ border: 1px solid var(--mm-status-border);
208
+ border-radius: 9px;
209
+ color: var(--mm-status-color);
210
+ background: var(--mm-status-bg);
211
+ opacity: 0;
212
+ transform: translate(-50%, 10px);
213
+ transition: 160ms ease;
214
+ font:
215
+ 600 12px Inter,
216
+ system-ui,
217
+ sans-serif;
218
+ }
219
+ .mm-status[data-tone=error] {
220
+ border-color: var(--mm-error-border);
221
+ color: var(--mm-error-color);
222
+ background: var(--mm-error-bg);
223
+ }
224
+ .mm-status.is-visible {
225
+ opacity: 1;
226
+ transform: translate(-50%, 0);
227
+ }
228
+ @media (max-width: 720px) {
229
+ .mm-performance-hud {
230
+ right: 8px;
231
+ bottom: 8px;
232
+ width: 190px;
233
+ }
234
+ .mm-hud-grid {
235
+ gap-inline: 8px;
236
+ }
237
+ }
@@ -0,0 +1,486 @@
1
+ declare class EventEmitter<Events extends object> {
2
+ private readonly listeners;
3
+ on<Key extends keyof Events>(event: Key, listener: (payload: Events[Key]) => void): () => void;
4
+ emit<Key extends keyof Events>(event: Key, payload: Events[Key]): void;
5
+ clear(): void;
6
+ }
7
+
8
+ type TopicKind = 'central' | 'main' | 'subtopic' | 'floating' | 'summary-topic';
9
+ type StructureType = 'mind-map' | 'logic-chart' | 'tree-chart' | 'org-chart' | 'brace-map' | 'timeline' | 'fishbone' | 'matrix' | 'tree-table';
10
+ interface TopicStyle {
11
+ fill?: string;
12
+ border?: string;
13
+ color?: string;
14
+ fontSize?: number;
15
+ fontWeight?: number;
16
+ shape?: 'rounded' | 'pill' | 'rect' | 'underline';
17
+ }
18
+ interface TopicInput {
19
+ id: string;
20
+ text: string;
21
+ children?: TopicInput[];
22
+ expanded?: boolean;
23
+ kind?: TopicKind;
24
+ structure?: StructureType;
25
+ style?: TopicStyle;
26
+ markers?: string[];
27
+ labels?: string[];
28
+ note?: string;
29
+ hyperlink?: string;
30
+ image?: string;
31
+ attachment?: string;
32
+ equation?: string;
33
+ task?: {
34
+ progress: number;
35
+ dueAt?: string;
36
+ priority?: number;
37
+ };
38
+ extensions?: Record<string, unknown>;
39
+ }
40
+ interface Topic extends Omit<TopicInput, 'children'> {
41
+ parentId: string | null;
42
+ childIds: string[];
43
+ expanded: boolean;
44
+ kind: TopicKind;
45
+ }
46
+ type TopicPatch = Partial<Pick<Topic, 'text' | 'expanded' | 'kind' | 'structure' | 'style' | 'markers' | 'labels' | 'note' | 'hyperlink' | 'image' | 'attachment' | 'equation' | 'task' | 'extensions'>>;
47
+ interface MindMapErrorData {
48
+ code: string;
49
+ message: string;
50
+ recoverable: boolean;
51
+ cause?: unknown;
52
+ context?: Record<string, unknown>;
53
+ }
54
+ interface MindMapPlugin {
55
+ name: string;
56
+ version?: string;
57
+ install(host: unknown): void | Promise<void>;
58
+ destroy?(): void | Promise<void>;
59
+ }
60
+ interface RelationshipData {
61
+ id: string;
62
+ fromId: string;
63
+ toId: string;
64
+ text?: string;
65
+ controlPoints?: Array<{
66
+ x: number;
67
+ y: number;
68
+ }>;
69
+ extensions?: Record<string, unknown>;
70
+ }
71
+ interface BoundaryData {
72
+ id: string;
73
+ ownerTopicId: string;
74
+ startChildId?: string;
75
+ endChildId?: string;
76
+ text?: string;
77
+ extensions?: Record<string, unknown>;
78
+ }
79
+ interface SummaryData extends BoundaryData {
80
+ summaryTopicId: string;
81
+ }
82
+ interface MindMapDocumentData {
83
+ version: 1;
84
+ title?: string;
85
+ root: TopicInput;
86
+ relationships?: RelationshipData[];
87
+ boundaries?: BoundaryData[];
88
+ summaries?: SummaryData[];
89
+ extensions?: Record<string, unknown>;
90
+ }
91
+
92
+ declare class TopicStore {
93
+ readonly rootId: string;
94
+ private readonly topics;
95
+ private constructor();
96
+ static fromTree(root: TopicInput): TopicStore;
97
+ get size(): number;
98
+ has(id: string): boolean;
99
+ get(id: string): Topic;
100
+ tryGet(id: string): Topic | undefined;
101
+ values(): IterableIterator<Topic>;
102
+ clone(id: string): Topic;
103
+ add(parentId: string, input: TopicInput, index?: number): Topic;
104
+ update(id: string, patch: TopicPatch): Topic;
105
+ move(id: string, parentId: string, index?: number): Topic;
106
+ removeSubtree(id: string): Topic[];
107
+ restoreSubtree(topics: Topic[], parentId: string, index: number): void;
108
+ setExpanded(id: string, expanded: boolean): boolean;
109
+ toggle(id: string): boolean;
110
+ isAncestor(ancestorId: string, possibleDescendantId: string): boolean;
111
+ depthOf(id: string): number;
112
+ visibleIds(): string[];
113
+ toTree(): TopicInput;
114
+ }
115
+
116
+ type NewTopicInput = Omit<TopicInput, 'id' | 'children'> & {
117
+ id?: string;
118
+ };
119
+ type DocumentChangeType = 'add' | 'update' | 'delete' | 'move' | 'toggle' | 'reveal' | 'import' | 'undo' | 'redo';
120
+ interface DocumentChange {
121
+ type: DocumentChangeType;
122
+ topicId?: string;
123
+ label?: string;
124
+ layoutAffecting?: boolean;
125
+ }
126
+ type EngineEvents = {
127
+ 'document:change': DocumentChange;
128
+ error: MindMapErrorData;
129
+ };
130
+ interface SearchResult {
131
+ id: string;
132
+ text: string;
133
+ path: string[];
134
+ }
135
+ declare class MindMapEngine {
136
+ store: TopicStore;
137
+ private readonly events;
138
+ private readonly history;
139
+ private idSequence;
140
+ constructor(root: TopicInput);
141
+ static fromJSON(json: string): MindMapEngine;
142
+ get canUndo(): boolean;
143
+ get canRedo(): boolean;
144
+ on<Key extends keyof EngineEvents>(event: Key, listener: (payload: EngineEvents[Key]) => void): () => void;
145
+ addChild(parentId: string, input: NewTopicInput): Topic;
146
+ addSibling(topicId: string, input: NewTopicInput): Topic;
147
+ updateTopic(topicId: string, patch: TopicPatch): Topic;
148
+ deleteTopic(topicId: string): void;
149
+ moveTopic(topicId: string, parentId: string, index?: number): Topic;
150
+ toggleTopic(topicId: string): boolean;
151
+ setExpanded(topicId: string, expanded: boolean): void;
152
+ revealTopic(topicId: string): void;
153
+ search(query: string, limit?: number): SearchResult[];
154
+ undo(): boolean;
155
+ redo(): boolean;
156
+ exportJSON(): string;
157
+ importJSON(json: string): void;
158
+ private static parseDocument;
159
+ private createTopicInput;
160
+ private topicPath;
161
+ private commit;
162
+ }
163
+
164
+ interface HistoryEntry {
165
+ label: string;
166
+ redo(): void;
167
+ undo(): void;
168
+ }
169
+ declare class History {
170
+ private readonly undoEntries;
171
+ private readonly redoEntries;
172
+ get canUndo(): boolean;
173
+ get canRedo(): boolean;
174
+ execute(entry: HistoryEntry): void;
175
+ undo(): HistoryEntry | undefined;
176
+ redo(): HistoryEntry | undefined;
177
+ clear(): void;
178
+ }
179
+
180
+ declare class PluginManager {
181
+ private readonly host;
182
+ private readonly onError;
183
+ private readonly plugins;
184
+ constructor(host: unknown, onError: (plugin: MindMapPlugin, cause: unknown) => void);
185
+ use(plugin: MindMapPlugin): Promise<void>;
186
+ destroy(): Promise<void>;
187
+ }
188
+
189
+ interface Rect {
190
+ x: number;
191
+ y: number;
192
+ width: number;
193
+ height: number;
194
+ }
195
+ interface LayoutResult {
196
+ ids: string[];
197
+ indexById: Map<string, number>;
198
+ parentIndices: Int32Array;
199
+ x: Float32Array;
200
+ y: Float32Array;
201
+ width: Float32Array;
202
+ height: Float32Array;
203
+ depth: Uint16Array;
204
+ branchIndex: Uint16Array;
205
+ bounds: Rect;
206
+ maxDepth: number;
207
+ durationMs: number;
208
+ }
209
+ interface MindMapLayoutOptions {
210
+ columnGap?: number;
211
+ rootGap?: number;
212
+ rowGap?: number;
213
+ nodeHeight?: number;
214
+ minNodeWidth?: number;
215
+ maxNodeWidth?: number;
216
+ }
217
+
218
+ declare class MindMapLayout {
219
+ private readonly options;
220
+ constructor(options?: MindMapLayoutOptions);
221
+ layout(store: TopicStore): LayoutResult;
222
+ }
223
+
224
+ interface Point {
225
+ x: number;
226
+ y: number;
227
+ }
228
+ interface CameraState {
229
+ x: number;
230
+ y: number;
231
+ scale: number;
232
+ }
233
+ interface CameraOptions extends Partial<CameraState> {
234
+ minScale?: number;
235
+ maxScale?: number;
236
+ }
237
+ declare class Camera {
238
+ x: number;
239
+ y: number;
240
+ scale: number;
241
+ readonly minScale: number;
242
+ readonly maxScale: number;
243
+ constructor(options?: CameraOptions);
244
+ get state(): CameraState;
245
+ screenToWorld(point: Point): Point;
246
+ worldToScreen(point: Point): Point;
247
+ panBy(dx: number, dy: number): void;
248
+ zoomBy(factor: number, anchor: Point): void;
249
+ zoomTo(scale: number, anchor: Point): void;
250
+ fit(bounds: Rect, viewport: {
251
+ width: number;
252
+ height: number;
253
+ }, padding?: number): void;
254
+ center(bounds: Rect, viewport: {
255
+ width: number;
256
+ height: number;
257
+ }): void;
258
+ reset(): void;
259
+ viewport(width: number, height: number): Rect;
260
+ private clampScale;
261
+ }
262
+
263
+ interface FrameSample {
264
+ timestamp: number;
265
+ frameMs: number;
266
+ cullMs: number;
267
+ drawMs: number;
268
+ rendered: number;
269
+ }
270
+ interface MetricsSnapshot {
271
+ fps: number;
272
+ frameP50: number;
273
+ frameP95: number;
274
+ frameP99: number;
275
+ cullMs: number;
276
+ drawMs: number;
277
+ rendered: number;
278
+ sampleCount: number;
279
+ }
280
+ declare class RollingMetrics {
281
+ private readonly capacity;
282
+ private readonly samples;
283
+ constructor(capacity?: number);
284
+ record(sample: FrameSample): void;
285
+ snapshot(): MetricsSnapshot;
286
+ }
287
+
288
+ type LodLevel = 'dots' | 'blocks' | 'labels' | 'full';
289
+ type MindMapThemeName = 'dark' | 'light';
290
+ declare const resolveLod: (scale: number) => LodLevel;
291
+ interface CanvasRendererOptions {
292
+ canvas: HTMLCanvasElement;
293
+ camera?: Camera;
294
+ theme?: MindMapThemeName;
295
+ requestFrame?: (callback: FrameRequestCallback) => number;
296
+ cancelFrame?: (id: number) => void;
297
+ continuous?: boolean;
298
+ }
299
+ interface NodeScreenRect extends Rect {
300
+ id: string;
301
+ }
302
+ declare class CanvasRenderer {
303
+ readonly camera: Camera;
304
+ readonly metrics: RollingMetrics;
305
+ private readonly canvas;
306
+ private readonly context;
307
+ private readonly requestFrame;
308
+ private readonly cancelFrame;
309
+ private readonly spatialIndex;
310
+ private readonly candidates;
311
+ private store?;
312
+ private layout?;
313
+ private width;
314
+ private height;
315
+ private dpr;
316
+ private frameId;
317
+ private destroyed;
318
+ private continuous;
319
+ private themeName;
320
+ private palette;
321
+ private lastTimestamp;
322
+ private firstRenderTimestampMs;
323
+ private selectedIds;
324
+ private hoverId?;
325
+ private dragId?;
326
+ private dropTargetId?;
327
+ private dragPoint?;
328
+ private rootIndex;
329
+ private readonly rootChildren;
330
+ private rootBusBounds?;
331
+ constructor(options: CanvasRendererOptions);
332
+ get firstRenderAtMs(): number | null;
333
+ setScene(store: TopicStore, layout: LayoutResult): void;
334
+ resize(width: number, height: number, dpr?: number): void;
335
+ start(): void;
336
+ stop(): void;
337
+ invalidate(): void;
338
+ renderNow(timestamp?: number): void;
339
+ hitTest(screenPoint: Point): string | undefined;
340
+ getNodeScreenRect(id: string): NodeScreenRect | undefined;
341
+ setSelection(ids: Iterable<string>): void;
342
+ setHover(id?: string): void;
343
+ setDragState(id?: string, point?: Point, dropTargetId?: string): void;
344
+ get theme(): MindMapThemeName;
345
+ setTheme(theme: MindMapThemeName): void;
346
+ destroy(): void;
347
+ private onFrame;
348
+ private draw;
349
+ private drawRootBus;
350
+ private drawBranchEdges;
351
+ private cacheRootBus;
352
+ private drawTopic;
353
+ private drawDragPreview;
354
+ private assertAlive;
355
+ }
356
+
357
+ declare class SpatialIndex {
358
+ readonly cellSize: number;
359
+ private readonly buckets;
360
+ private layout?;
361
+ private marks;
362
+ private generation;
363
+ constructor(cellSize?: number);
364
+ build(layout: LayoutResult): void;
365
+ query(rect: Rect, output?: number[]): number[];
366
+ intersects(index: number, rect: Rect): boolean;
367
+ }
368
+
369
+ interface MindMapOptions {
370
+ container: HTMLElement | string;
371
+ document: TopicInput;
372
+ theme?: MindMapThemeName;
373
+ editable?: boolean;
374
+ continuousMetrics?: boolean;
375
+ requestFrame?: (callback: FrameRequestCallback) => number;
376
+ cancelFrame?: (id: number) => void;
377
+ }
378
+ interface ExpandAllOptions {
379
+ view?: 'preserve' | 'root' | 'branch' | 'fit';
380
+ }
381
+ interface FocusTopicOptions {
382
+ scale?: number;
383
+ }
384
+ interface PerformanceSnapshot extends MetricsSnapshot {
385
+ totalTopics: number;
386
+ layoutVisible: number;
387
+ renderRate: number;
388
+ layoutMs: number;
389
+ maxDepth: number;
390
+ scale: number;
391
+ domElements: number;
392
+ heapMB: number | null;
393
+ firstRenderAtMs: number | null;
394
+ }
395
+ declare class MindMap {
396
+ readonly container: HTMLElement;
397
+ readonly root: HTMLDivElement;
398
+ readonly canvas: HTMLCanvasElement;
399
+ readonly camera: Camera;
400
+ layout: LayoutResult;
401
+ private readonly engine;
402
+ private readonly layoutEngine;
403
+ private readonly renderer;
404
+ private readonly pluginManager;
405
+ private readonly toolbar;
406
+ private readonly editor;
407
+ private readonly hud;
408
+ private readonly status;
409
+ private readonly editable;
410
+ private readonly selection;
411
+ private readonly cleanups;
412
+ private resizeObserver?;
413
+ private hudTimer?;
414
+ private destroyed;
415
+ private panState?;
416
+ private dragState?;
417
+ private editingId?;
418
+ private hoveredId?;
419
+ constructor(options: MindMapOptions);
420
+ get totalTopics(): number;
421
+ get theme(): MindMapThemeName;
422
+ setTheme(theme: MindMapThemeName): void;
423
+ get canUndo(): boolean;
424
+ get canRedo(): boolean;
425
+ getTopic(id: string): Topic;
426
+ hasTopic(id: string): boolean;
427
+ addTopic(parentId: string, input: NewTopicInput): Topic;
428
+ addSibling(topicId: string, input: NewTopicInput): Topic;
429
+ updateTopic(topicId: string, patch: TopicPatch): Topic;
430
+ editTopic(topicId: string): void;
431
+ deleteTopic(topicId: string): void;
432
+ moveTopic(topicId: string, parentId: string, index?: number): Topic;
433
+ expand(topicId: string): void;
434
+ collapse(topicId: string): void;
435
+ toggle(topicId: string): boolean;
436
+ expandAll(options?: ExpandAllOptions): void;
437
+ collapseToLevel(level: number): void;
438
+ select(topicId: string, additive?: boolean): void;
439
+ clearSelection(): void;
440
+ getSelection(): string[];
441
+ search(query: string): SearchResult[];
442
+ focusTopic(topicId: string, options?: FocusTopicOptions): void;
443
+ undo(): boolean;
444
+ redo(): boolean;
445
+ zoomIn(): void;
446
+ zoomOut(): void;
447
+ zoomBy(factor: number, anchor?: Point): void;
448
+ zoomTo(scale: number, anchor?: Point): void;
449
+ panBy(dx: number, dy: number): void;
450
+ fitView(): void;
451
+ resetView(): void;
452
+ private centerReadableBranch;
453
+ resize(): void;
454
+ exportJSON(): string;
455
+ importJSON(json: string): void;
456
+ use(plugin: MindMapPlugin): Promise<void>;
457
+ getPerformanceSnapshot(): PerformanceSnapshot;
458
+ getCameraState(): CameraState;
459
+ destroy(): void;
460
+ private relayout;
461
+ private handleDocumentChange;
462
+ private createToolbar;
463
+ private createHud;
464
+ private installInteractions;
465
+ private onPointerDown;
466
+ private onPointerMove;
467
+ private onPointerUp;
468
+ private onKeyDown;
469
+ private onToolbarAction;
470
+ private openEditor;
471
+ private commitEditor;
472
+ private onEditorKeyDown;
473
+ private syncSelection;
474
+ private refreshToolbarPosition;
475
+ private positionToolbar;
476
+ private validDropTarget;
477
+ private pointerPoint;
478
+ private viewportSize;
479
+ private updateHud;
480
+ private setMetric;
481
+ private showStatus;
482
+ private listen;
483
+ private assertAlive;
484
+ }
485
+
486
+ export { type BoundaryData, Camera, type CameraOptions, type CameraState, CanvasRenderer, type CanvasRendererOptions, type DocumentChange, type DocumentChangeType, type EngineEvents, EventEmitter, type ExpandAllOptions, type FocusTopicOptions, type FrameSample, History, type HistoryEntry, type LayoutResult, type LodLevel, type MetricsSnapshot, MindMap, type MindMapDocumentData, MindMapEngine, type MindMapErrorData, MindMapLayout, type MindMapLayoutOptions, type MindMapOptions, type MindMapPlugin, type MindMapThemeName, type NewTopicInput, type NodeScreenRect, type PerformanceSnapshot, PluginManager, type Point, type Rect, type RelationshipData, RollingMetrics, type SearchResult, SpatialIndex, type StructureType, type SummaryData, type Topic, type TopicInput, type TopicKind, type TopicPatch, TopicStore, type TopicStyle, resolveLod };