@dogsbay/format-topicmap 0.2.0-beta.101
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/README.md +32 -0
- package/dist/edit-source.d.ts +29 -0
- package/dist/edit-source.d.ts.map +1 -0
- package/dist/edit-source.js +196 -0
- package/dist/edit-source.js.map +1 -0
- package/dist/edit.d.ts +95 -0
- package/dist/edit.d.ts.map +1 -0
- package/dist/edit.js +295 -0
- package/dist/edit.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/nav-file.d.ts +23 -0
- package/dist/nav-file.d.ts.map +1 -0
- package/dist/nav-file.js +48 -0
- package/dist/nav-file.js.map +1 -0
- package/dist/nav.d.ts +8 -0
- package/dist/nav.d.ts.map +1 -0
- package/dist/nav.js +37 -0
- package/dist/nav.js.map +1 -0
- package/dist/parse.d.ts +12 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +143 -0
- package/dist/parse.js.map +1 -0
- package/dist/paths.d.ts +12 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +55 -0
- package/dist/paths.js.map +1 -0
- package/dist/resolve.d.ts +13 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +140 -0
- package/dist/resolve.js.map +1 -0
- package/dist/serialize.d.ts +3 -0
- package/dist/serialize.d.ts.map +1 -0
- package/dist/serialize.js +28 -0
- package/dist/serialize.js.map +1 -0
- package/dist/types.d.ts +54 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @dogsbay/format-topicmap
|
|
2
|
+
|
|
3
|
+
Recursive YAML topic maps for Dogsbay — a DITA-map-equivalent way to author
|
|
4
|
+
documentation structure in plain, versionable YAML.
|
|
5
|
+
|
|
6
|
+
```yaml
|
|
7
|
+
# root.topicmap.yml
|
|
8
|
+
title: Product Docs
|
|
9
|
+
topics:
|
|
10
|
+
- navtitle: Getting Started
|
|
11
|
+
topics:
|
|
12
|
+
- href: welcome.md
|
|
13
|
+
- href: quickstart.md
|
|
14
|
+
- navtitle: Installing
|
|
15
|
+
href: installing/installing.topicmap.yml
|
|
16
|
+
format: topicmap # maps compose: teams own their own sub-maps
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { resolveTopicMap, topicMapToNav } from "@dogsbay/format-topicmap";
|
|
21
|
+
|
|
22
|
+
const { map, errors } = await resolveTopicMap("docs/root.topicmap.yml", {
|
|
23
|
+
loader: async (path) => fs.readFile(path, "utf8"),
|
|
24
|
+
variables: { product: "Dogsbay" },
|
|
25
|
+
});
|
|
26
|
+
const nav = topicMapToNav(map); // NavItem[] → nav.json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Features: unlimited nesting, cycle detection, minja variable resolution
|
|
30
|
+
(eval-free), `toc: false` exclusions, `singlePage` granularity roll-ups,
|
|
31
|
+
provenance metadata for DITA round-trip. Browser-safe (injected loader, no
|
|
32
|
+
Node APIs). See `CLAUDE.md` for the full API.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type AddRefInput, type MoveRefInput, type SetPropsInput, type EditResult, type ExistsFn } from "./edit.js";
|
|
2
|
+
import type { TopicMapEntry } from "./types.js";
|
|
3
|
+
export type MapEditOp = ({
|
|
4
|
+
kind: "add";
|
|
5
|
+
} & AddRefInput) | ({
|
|
6
|
+
kind: "move";
|
|
7
|
+
} & MoveRefInput) | {
|
|
8
|
+
kind: "remove";
|
|
9
|
+
at: string;
|
|
10
|
+
keepChildren?: boolean;
|
|
11
|
+
} | ({
|
|
12
|
+
kind: "set";
|
|
13
|
+
} & SetPropsInput);
|
|
14
|
+
export type SourceEditResult = EditResult<{
|
|
15
|
+
source: string;
|
|
16
|
+
pointer: string;
|
|
17
|
+
entry: TopicMapEntry;
|
|
18
|
+
changed?: string[];
|
|
19
|
+
childrenRemoved?: number;
|
|
20
|
+
childrenHoisted?: number;
|
|
21
|
+
from?: string;
|
|
22
|
+
target?: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Apply one structural edit to `source`. Returns the new source (untouched
|
|
26
|
+
* regions byte-identical) or a refusal (source untouched).
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyMapEdit(source: string, mapFile: string, op: MapEditOp, exists?: ExistsFn): SourceEditResult;
|
|
29
|
+
//# sourceMappingURL=edit-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-source.d.ts","sourceRoot":"","sources":["../src/edit-source.ts"],"names":[],"mappings":"AAuBA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAElB,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,SAAS,GACjB,CAAC;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GAAG,WAAW,CAAC,GAC/B,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GACtD,CAAC;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GAAG,aAAa,CAAC,CAAC;AAEtC,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AA+EH;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAsEhH"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural edits applied to the topic map SOURCE — comment-, key-order-,
|
|
3
|
+
* quoting- and unknown-key-preserving (plans/topicmap-editor.md: "unknown
|
|
4
|
+
* keys survive", "minimal diff"). This is what both the IDE's Structure
|
|
5
|
+
* panel and the agent's `map-*` verbs write through.
|
|
6
|
+
*
|
|
7
|
+
* Two layers, one truth:
|
|
8
|
+
* 1. the MODEL transforms in `edit.ts` run first on `parseTopicMap(source)`
|
|
9
|
+
* — addressing, guardrails (dangling href, self-include, move into own
|
|
10
|
+
* subtree, empty entry) and the result pointer; a refusal returns
|
|
11
|
+
* before anything is touched;
|
|
12
|
+
* 2. the SAME structural change is replayed on the `yaml` Document (CST-
|
|
13
|
+
* backed AST): nodes are moved/spliced/set in place, and everything
|
|
14
|
+
* not touched — comments, blank lines, anchors, unknown keys, scalar
|
|
15
|
+
* styles — comes back byte-identical from `doc.toString()`.
|
|
16
|
+
*
|
|
17
|
+
* Pointer parity: model indices must equal document indices, so a source
|
|
18
|
+
* whose parse reports ANY error (an entry the model dropped, a mistyped
|
|
19
|
+
* field) is refused with `map-has-errors` — editing it blind would delete
|
|
20
|
+
* what the parser could not represent. Fix the YAML in Source mode first.
|
|
21
|
+
*/
|
|
22
|
+
import { parseDocument, isMap, isSeq, isScalar, YAMLMap, YAMLSeq, Scalar } from "yaml";
|
|
23
|
+
import { parseTopicMap } from "./parse.js";
|
|
24
|
+
import { addRef, moveRef, removeRef, setProps, resolveAddress, } from "./edit.js";
|
|
25
|
+
const refuse = (code, message, extra) => ({ ok: false, code, message, ...(extra ? { extra } : {}) });
|
|
26
|
+
/** Strings a YAML 1.1 reader would take for a bool/null/number are quoted (`singlePage: 'yes'`), as serialize.ts does. */
|
|
27
|
+
const AMBIGUOUS = /^(?:yes|no|on|off|y|n|true|false|null|~|[-+]?(?:\d[\d_]*\.?[\d_]*|\.\d+)(?:e[-+]?\d+)?|0x[0-9a-f]+|0o[0-7]+)$/i;
|
|
28
|
+
const scalarFor = (value) => {
|
|
29
|
+
const sc = new Scalar(value);
|
|
30
|
+
if (typeof value === "string" && (value === "" || AMBIGUOUS.test(value) || /^\s|\s$/.test(value)))
|
|
31
|
+
sc.type = Scalar.QUOTE_SINGLE;
|
|
32
|
+
return sc;
|
|
33
|
+
};
|
|
34
|
+
/** Canonical key order for a NEW entry mapping (matches serialize.ts). */
|
|
35
|
+
const KEY_ORDER = ["navtitle", "href", "format", "toc", "singlePage", "meta", "topics"];
|
|
36
|
+
/** The YAMLSeq that holds the entries at `path` (root `topics`, or an entry's `topics`, created when `create`). */
|
|
37
|
+
/** `topics` of a mapping node as a YAMLSeq; `topics:` (null) or absent becomes an empty seq when `create`. */
|
|
38
|
+
function topicsSeq(node, create) {
|
|
39
|
+
const cur = node.get("topics", true);
|
|
40
|
+
if (isSeq(cur))
|
|
41
|
+
return cur;
|
|
42
|
+
const isNullish = cur === undefined || cur === null || (isScalar(cur) && cur.value === null);
|
|
43
|
+
if (!isNullish || !create)
|
|
44
|
+
return undefined;
|
|
45
|
+
const fresh = new YAMLSeq();
|
|
46
|
+
node.set("topics", fresh);
|
|
47
|
+
return fresh;
|
|
48
|
+
}
|
|
49
|
+
function seqAt(doc, path, create) {
|
|
50
|
+
const root = doc.contents;
|
|
51
|
+
if (!isMap(root))
|
|
52
|
+
return undefined;
|
|
53
|
+
let seq = topicsSeq(root, create);
|
|
54
|
+
if (!seq)
|
|
55
|
+
return undefined;
|
|
56
|
+
for (const idx of path) {
|
|
57
|
+
const entry = seq.items[idx];
|
|
58
|
+
if (!isMap(entry))
|
|
59
|
+
return undefined;
|
|
60
|
+
const child = topicsSeq(entry, create);
|
|
61
|
+
if (!child)
|
|
62
|
+
return undefined;
|
|
63
|
+
seq = child;
|
|
64
|
+
}
|
|
65
|
+
return seq;
|
|
66
|
+
}
|
|
67
|
+
function entryNodeAt(doc, path) {
|
|
68
|
+
if (!path.length)
|
|
69
|
+
return undefined;
|
|
70
|
+
const seq = seqAt(doc, path.slice(0, -1), false);
|
|
71
|
+
const node = seq?.items[path[path.length - 1]];
|
|
72
|
+
return isMap(node) ? node : undefined;
|
|
73
|
+
}
|
|
74
|
+
function newEntryNode(entry) {
|
|
75
|
+
const m = new YAMLMap();
|
|
76
|
+
for (const key of KEY_ORDER) {
|
|
77
|
+
const v = entry[key];
|
|
78
|
+
if (v === undefined)
|
|
79
|
+
continue;
|
|
80
|
+
if (key === "topics")
|
|
81
|
+
continue; // a new entry has none
|
|
82
|
+
m.set(key, typeof v === "string" ? scalarFor(v) : v);
|
|
83
|
+
}
|
|
84
|
+
return m;
|
|
85
|
+
}
|
|
86
|
+
/** Set a scalar key on an entry mapping, preserving position when it already exists; delete on undefined. */
|
|
87
|
+
function setKey(node, key, value) {
|
|
88
|
+
if (value === undefined) {
|
|
89
|
+
node.delete(key);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const existing = node.get(key, true);
|
|
93
|
+
const next = scalarFor(value);
|
|
94
|
+
if (isScalar(existing)) {
|
|
95
|
+
// keep the author's scalar style where the value type allows it (a quoted style always allows a string)
|
|
96
|
+
if (typeof value === "string" && typeof existing.value === "string" && existing.type && existing.type !== Scalar.PLAIN)
|
|
97
|
+
next.type = existing.type;
|
|
98
|
+
const pair = node.items.find((p) => isScalar(p.key) && p.key.value === key);
|
|
99
|
+
if (pair)
|
|
100
|
+
pair.value = next;
|
|
101
|
+
else
|
|
102
|
+
node.set(key, next);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
node.set(key, next);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Apply one structural edit to `source`. Returns the new source (untouched
|
|
110
|
+
* regions byte-identical) or a refusal (source untouched).
|
|
111
|
+
*/
|
|
112
|
+
export function applyMapEdit(source, mapFile, op, exists) {
|
|
113
|
+
const parsed = parseTopicMap(source, mapFile);
|
|
114
|
+
if (!parsed.map)
|
|
115
|
+
return refuse("map-invalid", parsed.errors[0]?.message ?? "invalid topic map");
|
|
116
|
+
if (parsed.errors.length) {
|
|
117
|
+
return refuse("map-has-errors", `the map has ${parsed.errors.length} parse error${parsed.errors.length === 1 ? "" : "s"}; fix them in Source mode before structural edits (${parsed.errors[0].message})`, { errors: parsed.errors });
|
|
118
|
+
}
|
|
119
|
+
const map = parsed.map;
|
|
120
|
+
const doc = parseDocument(source, { keepSourceTokens: true });
|
|
121
|
+
if (doc.errors.length)
|
|
122
|
+
return refuse("map-invalid", doc.errors[0].message);
|
|
123
|
+
if (!isMap(doc.contents))
|
|
124
|
+
return refuse("map-invalid", "topic map must be a mapping");
|
|
125
|
+
switch (op.kind) {
|
|
126
|
+
case "add": {
|
|
127
|
+
// resolve the parent BEFORE the model mutates (indices are positions)
|
|
128
|
+
const parent = resolveAddress(map, op.parent ?? "");
|
|
129
|
+
if (!parent.ok)
|
|
130
|
+
return parent;
|
|
131
|
+
const r = addRef(map, mapFile, op, exists);
|
|
132
|
+
if (!r.ok)
|
|
133
|
+
return r;
|
|
134
|
+
const seq = seqAt(doc, parent.path, true);
|
|
135
|
+
if (!seq)
|
|
136
|
+
return refuse("map-invalid", "cannot locate the parent in the document");
|
|
137
|
+
const index = op.index === undefined ? seq.items.length : Math.min(op.index, seq.items.length);
|
|
138
|
+
seq.items.splice(index, 0, newEntryNode(r.entry));
|
|
139
|
+
return { ok: true, source: doc.toString(), pointer: r.pointer, entry: r.entry, ...(r.target ? { target: r.target } : {}) };
|
|
140
|
+
}
|
|
141
|
+
case "move": {
|
|
142
|
+
const from = resolveAddress(map, op.from);
|
|
143
|
+
if (!from.ok)
|
|
144
|
+
return from;
|
|
145
|
+
const toParent = op.toParent === undefined ? { ok: true, path: from.path.slice(0, -1) } : resolveAddress(map, op.toParent);
|
|
146
|
+
if (!toParent.ok)
|
|
147
|
+
return toParent;
|
|
148
|
+
const r = moveRef(map, op);
|
|
149
|
+
if (!r.ok)
|
|
150
|
+
return r;
|
|
151
|
+
const srcSeq = seqAt(doc, from.path.slice(0, -1), false);
|
|
152
|
+
const dstSeq = seqAt(doc, toParent.path, true);
|
|
153
|
+
if (!srcSeq || !dstSeq)
|
|
154
|
+
return refuse("map-invalid", "cannot locate the entry in the document");
|
|
155
|
+
const [node] = srcSeq.items.splice(from.path[from.path.length - 1], 1);
|
|
156
|
+
const index = op.index === undefined ? dstSeq.items.length : Math.min(op.index, dstSeq.items.length);
|
|
157
|
+
dstSeq.items.splice(index, 0, node);
|
|
158
|
+
// an emptied `topics:` list on the old parent stays as `[]` — the author's key, kept
|
|
159
|
+
return { ok: true, source: doc.toString(), pointer: r.to, from: r.from, entry: r.entry };
|
|
160
|
+
}
|
|
161
|
+
case "remove": {
|
|
162
|
+
const at = resolveAddress(map, op.at);
|
|
163
|
+
if (!at.ok)
|
|
164
|
+
return at;
|
|
165
|
+
const r = removeRef(map, op);
|
|
166
|
+
if (!r.ok)
|
|
167
|
+
return r;
|
|
168
|
+
const seq = seqAt(doc, at.path.slice(0, -1), false);
|
|
169
|
+
const node = seq?.items[at.path[at.path.length - 1]];
|
|
170
|
+
if (!seq || !isMap(node))
|
|
171
|
+
return refuse("map-invalid", "cannot locate the entry in the document");
|
|
172
|
+
const children = op.keepChildren ? node.get("topics", true) : undefined;
|
|
173
|
+
const hoisted = isSeq(children) ? children.items : [];
|
|
174
|
+
seq.items.splice(at.path[at.path.length - 1], 1, ...hoisted);
|
|
175
|
+
return { ok: true, source: doc.toString(), pointer: r.pointer, entry: r.entry, childrenRemoved: r.childrenRemoved, childrenHoisted: r.childrenHoisted };
|
|
176
|
+
}
|
|
177
|
+
case "set": {
|
|
178
|
+
const at = resolveAddress(map, op.at);
|
|
179
|
+
if (!at.ok)
|
|
180
|
+
return at;
|
|
181
|
+
const r = setProps(map, mapFile, op, exists);
|
|
182
|
+
if (!r.ok)
|
|
183
|
+
return r;
|
|
184
|
+
const node = entryNodeAt(doc, at.path);
|
|
185
|
+
if (!node)
|
|
186
|
+
return refuse("map-invalid", "cannot locate the entry in the document");
|
|
187
|
+
// replay from the model's post-state so `format` bookkeeping matches
|
|
188
|
+
for (const key of r.changed)
|
|
189
|
+
setKey(node, key, r.entry[key]);
|
|
190
|
+
if (r.changed.includes("href") && !r.changed.includes("format"))
|
|
191
|
+
setKey(node, "format", r.entry.format);
|
|
192
|
+
return { ok: true, source: doc.toString(), pointer: r.pointer, entry: r.entry, changed: r.changed };
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=edit-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-source.js","sourceRoot":"","sources":["../src/edit-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EACL,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,cAAc,GAOf,MAAM,WAAW,CAAC;AAoBnB,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,KAA+B,EAAe,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAE5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EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QACtG,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/edit.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type TopicMap, type TopicMapEntry } from "./types.js";
|
|
2
|
+
export interface EditRefusal {
|
|
3
|
+
ok: false;
|
|
4
|
+
code: string;
|
|
5
|
+
message: string;
|
|
6
|
+
extra?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export type EditResult<T extends object = Record<string, never>> = ({
|
|
9
|
+
ok: true;
|
|
10
|
+
} & T) | EditRefusal;
|
|
11
|
+
export declare const parsePointer: (pointer: string) => number[] | undefined;
|
|
12
|
+
export declare const pointerOf: (path: number[]) => string;
|
|
13
|
+
/** The `topics` array a pointer's PARENT owns, plus the index. Read-only: never creates arrays. */
|
|
14
|
+
export declare const locate: (map: TopicMap, path: number[]) => {
|
|
15
|
+
siblings: TopicMapEntry[];
|
|
16
|
+
index: number;
|
|
17
|
+
entry: TopicMapEntry;
|
|
18
|
+
} | undefined;
|
|
19
|
+
/** The container to insert INTO (root or an entry's topics, created on demand for the write path). */
|
|
20
|
+
export declare const containerOf: (map: TopicMap, path: number[]) => TopicMapEntry[] | undefined;
|
|
21
|
+
/** Pointer of an entry by IDENTITY (after a splice, indices may have shifted). */
|
|
22
|
+
export declare const pathOfEntry: (map: TopicMap, target: TopicMapEntry) => number[] | undefined;
|
|
23
|
+
/** Workspace path an href points at (undefined for external / fragment-only). */
|
|
24
|
+
export declare const hrefTarget: (mapFile: string, href: string) => string | undefined;
|
|
25
|
+
/** A local href that resolves to the map itself is a self-include, whatever the format flag says. */
|
|
26
|
+
export declare const isSelfInclude: (mapFile: string, href: string) => boolean;
|
|
27
|
+
/** All entries matching an href or navtitle. */
|
|
28
|
+
export declare const findByHref: (map: TopicMap, href: string) => number[][];
|
|
29
|
+
/** Pointer, or unique href/navtitle (`@x` forces name matching), to a path. */
|
|
30
|
+
export declare const resolveAddress: (map: TopicMap, at: string) => EditResult<{
|
|
31
|
+
path: number[];
|
|
32
|
+
}>;
|
|
33
|
+
export interface FlatEntry {
|
|
34
|
+
pointer: string;
|
|
35
|
+
depth: number;
|
|
36
|
+
navtitle?: string;
|
|
37
|
+
href?: string;
|
|
38
|
+
format?: string;
|
|
39
|
+
toc?: boolean;
|
|
40
|
+
singlePage?: string;
|
|
41
|
+
children: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const flattenTopicMap: (map: TopicMap) => FlatEntry[];
|
|
44
|
+
/** Sync existence predicate over workspace-relative paths (the caller resolves it). */
|
|
45
|
+
export type ExistsFn = (workspacePath: string) => boolean;
|
|
46
|
+
export interface AddRefInput {
|
|
47
|
+
/** Optional when a navtitle is given (a title-only grouping entry). */
|
|
48
|
+
href?: string;
|
|
49
|
+
navtitle?: string;
|
|
50
|
+
/** Parent pointer/href; "" = root. */
|
|
51
|
+
parent?: string;
|
|
52
|
+
index?: number;
|
|
53
|
+
format?: "topicmap" | "md";
|
|
54
|
+
toc?: boolean;
|
|
55
|
+
singlePage?: "yes" | "no" | "children";
|
|
56
|
+
}
|
|
57
|
+
export declare const addRef: (map: TopicMap, mapFile: string, input: AddRefInput, exists?: ExistsFn) => EditResult<{
|
|
58
|
+
pointer: string;
|
|
59
|
+
entry: TopicMapEntry;
|
|
60
|
+
target?: string;
|
|
61
|
+
}>;
|
|
62
|
+
export interface MoveRefInput {
|
|
63
|
+
from: string;
|
|
64
|
+
/** New parent pointer/href; "" = root; undefined = same parent. */
|
|
65
|
+
toParent?: string;
|
|
66
|
+
index?: number;
|
|
67
|
+
}
|
|
68
|
+
export declare const moveRef: (map: TopicMap, input: MoveRefInput) => EditResult<{
|
|
69
|
+
from: string;
|
|
70
|
+
to: string;
|
|
71
|
+
entry: TopicMapEntry;
|
|
72
|
+
}>;
|
|
73
|
+
export declare const removeRef: (map: TopicMap, input: {
|
|
74
|
+
at: string;
|
|
75
|
+
keepChildren?: boolean;
|
|
76
|
+
}) => EditResult<{
|
|
77
|
+
pointer: string;
|
|
78
|
+
entry: TopicMapEntry;
|
|
79
|
+
childrenRemoved: number;
|
|
80
|
+
childrenHoisted: number;
|
|
81
|
+
}>;
|
|
82
|
+
export interface SetPropsInput {
|
|
83
|
+
at: string;
|
|
84
|
+
navtitle?: string | null;
|
|
85
|
+
href?: string | null;
|
|
86
|
+
format?: "topicmap" | "md" | null;
|
|
87
|
+
toc?: boolean | null;
|
|
88
|
+
singlePage?: "yes" | "no" | "children" | null;
|
|
89
|
+
}
|
|
90
|
+
export declare const setProps: (map: TopicMap, mapFile: string, input: SetPropsInput, exists?: ExistsFn) => EditResult<{
|
|
91
|
+
pointer: string;
|
|
92
|
+
changed: string[];
|
|
93
|
+
entry: TopicMapEntry;
|
|
94
|
+
}>;
|
|
95
|
+
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../src/edit.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAkB,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/E,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,KAAK,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AACD,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC;AASpG,eAAO,MAAM,YAAY,GAAI,SAAS,M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