@g3nomaly/analyze 0.1.0 → 0.1.2

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.
Files changed (97) hide show
  1. package/README.md +10 -5
  2. package/dist/api/bundle-builder.d.ts +29 -10
  3. package/dist/api/bundle-cache.d.ts +7 -4
  4. package/dist/api/bundle-loader.d.ts +10 -3
  5. package/dist/api/create-docs.d.ts +33 -14
  6. package/dist/api/embedding.d.ts +16 -7
  7. package/dist/api/errors.d.ts +13 -6
  8. package/dist/api/list.d.ts +20 -20
  9. package/dist/api/options.d.ts +18 -22
  10. package/dist/api/refs.d.ts +24 -21
  11. package/dist/api/scan.d.ts +24 -12
  12. package/dist/api/search.d.ts +27 -21
  13. package/dist/api/services.d.ts +9 -1
  14. package/dist/api/show.d.ts +15 -19
  15. package/dist/api/site-reader.d.ts +11 -3
  16. package/dist/api/site-writer.d.ts +30 -7
  17. package/dist/api/source.d.ts +23 -12
  18. package/dist/api/target.d.ts +2 -0
  19. package/dist/cli.js +670 -238
  20. package/dist/embeddings/index-builder.d.ts +3 -1
  21. package/dist/embeddings/model.d.ts +26 -13
  22. package/dist/embeddings/searcher.d.ts +24 -7
  23. package/dist/embeddings/vectors.d.ts +3 -1
  24. package/dist/embeddings/words.d.ts +7 -3
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +647 -229
  27. package/dist/model/index.d.ts +416 -188
  28. package/dist/model/registry.d.ts +204 -11
  29. package/dist/query/graph.d.ts +83 -26
  30. package/dist/query/name-search.d.ts +39 -21
  31. package/dist/query/semantic.d.ts +11 -3
  32. package/dist/retrieval/describe.d.ts +11 -4
  33. package/dist/retrieval/filter.d.ts +27 -8
  34. package/dist/retrieval/index.d.ts +1 -1
  35. package/dist/retrieval/markdown.d.ts +3 -2
  36. package/dist/retrieval/report.d.ts +147 -70
  37. package/dist/retrieval/resolve.d.ts +11 -7
  38. package/dist/retrieval/retriever.d.ts +34 -23
  39. package/dist/retrieval/summary.d.ts +6 -3
  40. package/dist/scanner/code/doc/clean.d.ts +31 -5
  41. package/dist/scanner/code/doc/index.d.ts +7 -1
  42. package/dist/scanner/code/doc/markdown.d.ts +6 -1
  43. package/dist/scanner/code/doc/python.d.ts +6 -1
  44. package/dist/scanner/code/doc/tagged.d.ts +13 -4
  45. package/dist/scanner/code/doc/types.d.ts +16 -5
  46. package/dist/scanner/code/doc/xml.d.ts +6 -1
  47. package/dist/scanner/code/example.d.ts +31 -10
  48. package/dist/scanner/code/extract.d.ts +56 -21
  49. package/dist/scanner/code/grammar.d.ts +20 -5
  50. package/dist/scanner/code/language.d.ts +100 -66
  51. package/dist/scanner/code/languages/index.d.ts +21 -7
  52. package/dist/scanner/code/languages/shared.d.ts +23 -4
  53. package/dist/scanner/code/planner.d.ts +50 -14
  54. package/dist/scanner/code/symbols.d.ts +86 -20
  55. package/dist/scanner/code/types.d.ts +48 -15
  56. package/dist/scanner/config.d.ts +42 -0
  57. package/dist/scanner/content.d.ts +49 -14
  58. package/dist/scanner/decisions/parse.d.ts +20 -11
  59. package/dist/scanner/decisions/planner.d.ts +20 -8
  60. package/dist/scanner/docs.d.ts +36 -19
  61. package/dist/scanner/files.d.ts +44 -19
  62. package/dist/scanner/glossary/parse.d.ts +17 -7
  63. package/dist/scanner/glossary/planner.d.ts +15 -8
  64. package/dist/scanner/glossary/terms.d.ts +57 -27
  65. package/dist/scanner/graph/builder.d.ts +80 -21
  66. package/dist/scanner/highlight.d.ts +32 -9
  67. package/dist/scanner/ignore.d.ts +25 -0
  68. package/dist/scanner/index.d.ts +5 -2
  69. package/dist/scanner/markdown/frontmatter.d.ts +18 -3
  70. package/dist/scanner/markdown/links.d.ts +19 -9
  71. package/dist/scanner/markdown/outline.d.ts +13 -5
  72. package/dist/scanner/markdown/renderer.d.ts +32 -13
  73. package/dist/scanner/openapi/planner.d.ts +20 -8
  74. package/dist/scanner/packages.d.ts +28 -0
  75. package/dist/scanner/reporter.d.ts +5 -2
  76. package/dist/scanner/scanner.d.ts +21 -7
  77. package/dist/scanner/schema/definitions.d.ts +18 -8
  78. package/dist/scanner/schema/describe.d.ts +44 -18
  79. package/dist/scanner/schema/planner.d.ts +6 -3
  80. package/dist/scanner/schema/registry.d.ts +23 -16
  81. package/dist/scanner/skills/classify.d.ts +2 -1
  82. package/dist/scanner/skills/layout.d.ts +27 -9
  83. package/dist/scanner/skills/planner.d.ts +19 -4
  84. package/dist/scanner/specs.d.ts +8 -2
  85. package/dist/scanner/sql/catalog.d.ts +21 -7
  86. package/dist/scanner/sql/cursor.d.ts +9 -4
  87. package/dist/scanner/sql/database.d.ts +6 -3
  88. package/dist/scanner/sql/parse.d.ts +62 -27
  89. package/dist/scanner/sql/planner.d.ts +6 -2
  90. package/dist/scanner/sql/query.d.ts +34 -21
  91. package/dist/scanner/sql/registry.d.ts +24 -10
  92. package/dist/scanner/sql/source.d.ts +1 -0
  93. package/dist/scanner/sql/statements.d.ts +9 -3
  94. package/dist/scanner/sql/tokens.d.ts +25 -12
  95. package/dist/scanner/tasks/layout.d.ts +22 -10
  96. package/dist/scanner/tasks/planner.d.ts +64 -9
  97. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
- import { type EdgeKind, type KindsIn, type NodeKind, type Section } from './registry';
1
+ import { type EdgeKind, type KindsIn, type NodeType, type Section } from './registry';
2
2
  /** Index of a node in {@link DocsBundle.nodes}. */
3
3
  export type NodeRef = number;
4
- export { ALL_NODE_KINDS, EDGE_KINDS, type EdgeKind, kindsIn, kindsWith, NODE_KINDS, type NodeGroup, type NodeKind, type NodeKindSpec, RELATION_FAMILIES, RELATION_FAMILY_NAMES, RELATION_KINDS, type RelationFamily, type RelationFamilySpec, type RelationKindSpec, SECTION_SPECS, SECTIONS, type Section, type SectionSpec, } from './registry';
4
+ export { ALL_NODE_KINDS, ALL_NODE_TYPES, EDGE_KINDS, type EdgeKind, kindsIn, kindsWith, isMemberKind, kindOf, NODE_KINDS, NODE_TYPES, type NodeGroup, type NodeKind, type NodeKindSpec, type NodeType, type NodeTypeSpec, RELATION_FAMILIES, RELATION_FAMILY_NAMES, RELATION_KINDS, type RelationFamily, type RelationFamilySpec, type RelationKindSpec, SECTION_SPECS, SECTIONS, type Section, type SectionSpec, } from './registry';
5
5
  /** Kinds of a declaration in code. */
6
6
  export declare const SYMBOL_KINDS: readonly KindsIn<"symbol">[];
7
7
  /** A kind of a declaration in code. */
@@ -11,7 +11,7 @@ export declare const TYPE_KINDS: ReadonlySet<SymbolKind>;
11
11
  /** Kinds that own member symbols. */
12
12
  export declare const CONTAINER_KINDS: ReadonlySet<SymbolKind>;
13
13
  /**
14
- * Kinds of a file that has a page. See `NODE_KIND_REGISTRY` for what each one is.
14
+ * Kinds of a file that has a page. See `NODE_TYPE_REGISTRY` for what each one is.
15
15
  * A `glossary`, `decisions`, `schema`, `api`, `database` or `catalog` node has its entries as children.
16
16
  */
17
17
  export declare const FILE_KINDS: readonly KindsIn<"file">[];
@@ -29,47 +29,95 @@ export declare const ENTRY_KINDS: readonly KindsIn<"entry" | "symbol">[];
29
29
  export type EntryKind = KindsIn<'symbol' | 'entry'>;
30
30
  /** Kinds a node with an id can have: every kind but parameter and field. */
31
31
  export declare const LISTED_KINDS: readonly KindsIn<"entry" | "file" | "folder" | "section" | "source" | "symbol">[];
32
- /** Tells a symbol kind from the others. */
33
- export declare function isSymbolKind(kind: NodeKind): kind is SymbolKind;
34
- /** Tells the kind of a file with a page from the others. */
35
- export declare function isFileKind(kind: NodeKind): kind is FileKind;
36
- /** Tells an entry kind, a symbol included, from the others. */
37
- export declare function isEntryKind(kind: NodeKind): kind is EntryKind;
38
- /** What every node states, whatever its kind. */
39
- interface NodeBase<K extends NodeKind> {
32
+ /**
33
+ * Tells a symbol kind from the others.
34
+ *
35
+ * @param kind - Kind of a node, such as `class` or `function`.
36
+ */
37
+ export declare function isSymbolKind(kind: NodeType): kind is SymbolKind;
38
+ /**
39
+ * Tells the kind of a file with a page from the others.
40
+ *
41
+ * @param kind - Kind of a node, such as `skill` or `document`.
42
+ */
43
+ export declare function isFileKind(kind: NodeType): kind is FileKind;
44
+ /**
45
+ * Tells an entry kind, a symbol included, from the others.
46
+ *
47
+ * @param kind - Kind of a node, such as `term` or `table`.
48
+ */
49
+ export declare function isEntryKind(kind: NodeType): kind is EntryKind;
50
+ /**
51
+ * What every node states, whatever its kind.
52
+ *
53
+ * @property kind - Kind of the node, such as `class`, `table` or `parameter`.
54
+ * @property name - Shown in the tree: a file name, a symbol name, a parameter name.
55
+ * @property parent - The node this one belongs to. `null` for a section.
56
+ * @property slug - Segment of the node's route. Defaults to `name`.
57
+ */
58
+ interface NodeBase<K extends NodeType> {
40
59
  readonly kind: K;
41
- /** Shown in the tree: a file name, a symbol name, a parameter name. */
42
60
  readonly name: string;
43
- /** The node this one belongs to. `null` for a section. */
44
61
  readonly parent: NodeRef | null;
45
- /** Segment of the node's route. Defaults to `name`. */
46
62
  readonly slug?: string;
47
63
  }
48
- /** One of the top-level groups. */
64
+ /**
65
+ * One of the top-level groups.
66
+ *
67
+ * @property slug - Section slug, such as `code`.
68
+ */
49
69
  export interface SectionNode extends NodeBase<'section'> {
50
70
  readonly slug: Section;
51
71
  }
52
72
  /** A directory of the scanned repository. */
53
73
  export type FolderNode = NodeBase<'folder'>;
54
- /** A heading of a markdown page, for its table of contents. `id` is the anchor of the heading. */
74
+ /** What a package is: an `app` runs, a `library` is used by other packages, a `workspace` holds packages. */
75
+ export type PackageRole = 'app' | 'library' | 'workspace';
76
+ /**
77
+ * @brief A directory of the scanned repository with a package manifest, such as a `package.json` or a `Cargo.toml`.
78
+ *
79
+ * @property path - Display path of the directory, such as `packages/core`.
80
+ * @property packageName - Name the manifest gives, such as `@g3nomaly/core`, or the directory name when it gives none.
81
+ * @property manifest - Display path of the manifest, such as `packages/core/package.json`.
82
+ * @property version - Version the manifest gives, or `null`.
83
+ * @property description - Description the manifest gives, or `''`.
84
+ */
85
+ export interface PackageNode extends NodeBase<'package'> {
86
+ readonly path: string;
87
+ readonly packageName: string;
88
+ readonly role: PackageRole;
89
+ readonly manifest: string;
90
+ readonly version: string | null;
91
+ readonly description: string;
92
+ }
93
+ /**
94
+ * A heading of a markdown page, for its table of contents.
95
+ *
96
+ * @property id - Anchor of the heading.
97
+ * @property text - Heading text as plain text.
98
+ * @property depth - Heading level, such as `2` for `##`.
99
+ */
55
100
  export interface Heading {
56
101
  readonly id: string;
57
102
  readonly text: string;
58
103
  readonly depth: number;
59
104
  }
60
- /** What a file looks like on its page. */
105
+ /**
106
+ * @brief What a file looks like on its page.
107
+ *
108
+ * `markdown` holds the rendered HTML and the headings of the page, `text` a
109
+ * highlighted `<pre>` block (highlighted when the file is small enough),
110
+ * `image` a `data:` URI in `src`, and `omitted` the reason and size of a file
111
+ * that is left out.
112
+ */
61
113
  export type FileContent = {
62
114
  readonly format: 'markdown';
63
115
  readonly html: string;
64
116
  readonly headings: readonly Heading[];
65
- }
66
- /** A `<pre>` block, highlighted when the file is small enough. */
67
- | {
117
+ } | {
68
118
  readonly format: 'text';
69
119
  readonly html: string;
70
- }
71
- /** `src` is a `data:` URI. */
72
- | {
120
+ } | {
73
121
  readonly format: 'image';
74
122
  readonly src: string;
75
123
  } | {
@@ -77,117 +125,175 @@ export type FileContent = {
77
125
  readonly reason: 'binary' | 'large';
78
126
  readonly bytes: number;
79
127
  };
80
- /** What every file with a page states. */
128
+ /**
129
+ * What every file with a page states.
130
+ *
131
+ * @property path - Path as it is on disk, relative to the scanned root. For a `catalog`, the path of its directory.
132
+ * @property title - Frontmatter `title` or `name`, else the first heading, else the file name.
133
+ * @property description - Frontmatter `description`, or `''`.
134
+ * @property content - What the file looks like on its page.
135
+ */
81
136
  interface FileFacts {
82
- /** Path as it is on disk, relative to the scanned root. For a `catalog`, the path of its directory. */
83
137
  readonly path: string;
84
- /** Frontmatter `title` or `name`, else the first heading, else the file name. */
85
138
  readonly title: string;
86
- /** Frontmatter `description`, or `''`. */
87
139
  readonly description: string;
88
140
  readonly content: FileContent;
89
141
  }
90
142
  /**
91
- * A file shown as it is. A `skill` node is the skill's `SKILL.md`, and the skill's other files are its descendants.
143
+ * @brief A file shown as it is.
144
+ *
145
+ * A `skill` node is the skill's `SKILL.md`, and the skill's other files are its descendants.
92
146
  * For a `glossary` or `decisions` node, `content` is the text around its entries, and the entries are its children.
93
147
  * A `schema` node that is a JSON Schema has its definitions as children.
94
148
  * A `catalog` node has no content of its own: its queries are its children.
95
149
  */
96
150
  export interface FileNode extends NodeBase<Exclude<FileKind, 'api' | 'database' | 'plan' | 'phase'>>, FileFacts {
97
151
  }
98
- /** A base URL an API is served from. */
152
+ /**
153
+ * A base URL an API is served from.
154
+ *
155
+ * @property url - Base URL as the document writes it.
156
+ * @property description - Plain text, or `''`.
157
+ */
99
158
  export interface ApiServer {
100
159
  readonly url: string;
101
- /** Plain text, or `''`. */
102
160
  readonly description: string;
103
161
  }
104
- /** A group of operations of an OpenAPI document. */
162
+ /**
163
+ * A group of operations of an OpenAPI document.
164
+ *
165
+ * @property name - Name of the group.
166
+ * @property descriptionHtml - Description rendered as HTML.
167
+ */
105
168
  export interface ApiTag {
106
169
  readonly name: string;
107
170
  readonly descriptionHtml: string;
108
171
  }
109
172
  /**
110
- * An OpenAPI document. Its operations and its schema definitions are its
111
- * children. `title` is the title of the API, `description` its summary, and
112
- * `content` its description.
173
+ * @brief An OpenAPI document.
174
+ *
175
+ * Its operations and its schema definitions are its children. `title` is the
176
+ * title of the API, `description` its summary, and `content` its description.
177
+ *
178
+ * @property version - Version of the API, from `info.version`.
179
+ * @property specVersion - Version of the OpenAPI format the document is written in, such as `3.1.0`.
180
+ * @property servers - Base URLs the API is served from.
181
+ * @property tags - Tags the document declares, in its order. An operation can name a tag that is not listed here.
113
182
  */
114
183
  export interface ApiNode extends NodeBase<'api'>, FileFacts {
115
- /** Version of the API, from `info.version`. */
116
184
  readonly version: string;
117
- /** Version of the OpenAPI format the document is written in, such as `3.1.0`. */
118
185
  readonly specVersion: string;
119
186
  readonly servers: readonly ApiServer[];
120
- /** The tags the document declares, in its order. An operation can name a tag that is not listed here. */
121
187
  readonly tags: readonly ApiTag[];
122
188
  }
123
- /** A view or a trigger of a database schema. */
189
+ /**
190
+ * A view or a trigger of a database schema.
191
+ *
192
+ * @property kind - `view` or `trigger`.
193
+ * @property name - Name of the view or the trigger.
194
+ * @property table - The table a trigger fires on. `''` for a view.
195
+ * @property line - Line of the file where it is created.
196
+ * @property descriptionHtml - Description rendered as HTML.
197
+ * @property sqlHtml - The highlighted statement that creates it.
198
+ */
124
199
  export interface DatabaseObject {
125
200
  readonly kind: 'view' | 'trigger';
126
201
  readonly name: string;
127
- /** The table a trigger fires on. `''` for a view. */
128
202
  readonly table: string;
129
203
  readonly line: number;
130
204
  readonly descriptionHtml: string;
131
- /** The highlighted statement that creates it. */
132
205
  readonly sqlHtml: string;
133
206
  }
134
207
  /**
135
- * A `.sql` file that creates tables. Its tables are its children. `content`
136
- * is the comment that opens the file.
208
+ * @brief A `.sql` file that creates tables.
209
+ *
210
+ * Its tables are its children. `content` is the comment that opens the file.
211
+ *
212
+ * @property objects - Views and triggers, in file order.
137
213
  */
138
214
  export interface DatabaseNode extends NodeBase<'database'>, FileFacts {
139
- /** Views and triggers, in file order. */
140
215
  readonly objects: readonly DatabaseObject[];
141
216
  }
142
- /** A source file. Its symbols are its descendants. */
217
+ /**
218
+ * A source file. Its symbols are its descendants.
219
+ *
220
+ * @property path - Path of the file, relative to the scanned root.
221
+ * @property language - Name of the language of the file.
222
+ * @property annotationLabel - What the language calls its annotations: `Decorators`, `Attributes` or `Annotations`.
223
+ * @property content - The file's text. Set for a skill's code, `null` in the code section.
224
+ */
143
225
  export interface SourceNode extends NodeBase<'source'> {
144
226
  readonly path: string;
145
227
  readonly language: string;
146
- /** What the language calls its annotations: `Decorators`, `Attributes` or `Annotations`. */
147
228
  readonly annotationLabel: string;
148
- /** The file's text. Set for a skill's code, `null` in the code section. */
149
229
  readonly content: FileContent | null;
150
230
  }
151
231
  /** `[start, end, target]`: the characters `start` to `end` of a text name the node `target`. */
152
232
  export type TextLink = readonly [start: number, end: number, target: NodeRef];
153
- /** Source text in which some spans name other nodes, such as `Promise<Booking>` with `Booking` linked. */
233
+ /**
234
+ * Source text in which some spans name other nodes, such as `Promise<Booking>` with `Booking` linked.
235
+ *
236
+ * @property text - The text as written in the source.
237
+ * @property links - Spans of the text that name a node, in text order, not overlapping.
238
+ */
154
239
  export interface LinkedText {
155
240
  readonly text: string;
156
- /** In text order, not overlapping. */
157
241
  readonly links: readonly TextLink[];
158
242
  }
159
243
  /** Doc comment tags that are not folded into parameters, return value or fields. */
160
244
  export type DocTagKind = 'throws' | 'deprecated' | 'see' | 'since' | 'other';
161
- /** A tag of a doc comment, such as `@throws` or `@deprecated`. */
245
+ /**
246
+ * A tag of a doc comment, such as `@throws` or `@deprecated`.
247
+ *
248
+ * @property kind - Which tag it is: `throws`, `deprecated`, `see`, `since` or `other`.
249
+ * @property label - Original tag label, for example `typeParam`. Set when `kind` is `other`.
250
+ * @property subject - What the tag is about, such as the exception type of a `throws` tag, or `null`.
251
+ * @property html - Text of the tag as HTML.
252
+ */
162
253
  export interface DocTag {
163
254
  readonly kind: DocTagKind;
164
- /** Original tag label, for example `typeParam`. Set when `kind` is `other`. */
165
255
  readonly label?: string;
166
- /** What the tag is about, such as the exception type of a `throws` tag. */
167
256
  readonly subject: LinkedText | null;
168
257
  readonly html: string;
169
258
  }
170
- /** What a function returns: its type and the description of its doc comment. */
259
+ /**
260
+ * What a function returns: its type and the description of its doc comment.
261
+ *
262
+ * @property type - Return type, or `null` when none is known.
263
+ * @property descriptionHtml - Description of the return value as HTML.
264
+ */
171
265
  export interface ReturnInfo {
172
266
  readonly type: LinkedText | null;
173
267
  readonly descriptionHtml: string;
174
268
  }
175
- /** A highlighted usage example of a symbol. */
269
+ /**
270
+ * A highlighted usage example of a symbol.
271
+ *
272
+ * @property html - The highlighted code.
273
+ * @property origin - `documented` comes from the doc comment, `generated` from the signature.
274
+ */
176
275
  export interface SymbolExample {
177
276
  readonly html: string;
178
- /** `documented` comes from the doc comment, `generated` from the signature. */
179
277
  readonly origin: 'documented' | 'generated';
180
278
  }
181
- /** A class, function or other definition. Its parameters, fields and member symbols are its children. */
279
+ /**
280
+ * A class, function or other definition. Its parameters, fields and member symbols are its children.
281
+ *
282
+ * @property anchor - Unique within the file and safe in a URL hash.
283
+ * @property line - Line of the file where the declaration starts.
284
+ * @property signatureHtml - Highlighted declaration head. Empty for a type the scanner inferred from its members.
285
+ * @property modifiers - Keywords in front of the declaration, such as `export`, `static` or `async`.
286
+ * @property annotations - Decorators, attributes and annotations, verbatim.
287
+ * @property descriptionHtml - Description rendered as HTML.
288
+ * @property returns - What the symbol returns, or `null`.
289
+ * @property tags - Doc comment tags that are not folded into parameters, return value or fields.
290
+ * @property example - Usage example, or `null`.
291
+ */
182
292
  export interface SymbolNode extends NodeBase<SymbolKind> {
183
- /** Unique within the file and safe in a URL hash. */
184
293
  readonly anchor: string;
185
294
  readonly line: number;
186
- /** Highlighted declaration head. Empty for a type the scanner inferred from its members. */
187
295
  readonly signatureHtml: string;
188
- /** Keywords in front of the declaration, such as `export`, `static` or `async`. */
189
296
  readonly modifiers: readonly string[];
190
- /** Decorators, attributes and annotations, verbatim. */
191
297
  readonly annotations: readonly string[];
192
298
  readonly descriptionHtml: string;
193
299
  readonly returns: ReturnInfo | null;
@@ -196,203 +302,262 @@ export interface SymbolNode extends NodeBase<SymbolKind> {
196
302
  }
197
303
  /** Where an operation of an API takes a parameter from. */
198
304
  export type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
199
- /** What parameters and fields share: a declaration from the signature, a description from the doc comment. */
305
+ /**
306
+ * What parameters and fields share: a declaration from the signature, a description from the doc comment.
307
+ *
308
+ * @property type - Declared type, or `null`.
309
+ * @property defaultValue - Default value of a parameter, initializer of a field, value of an enum member. `null` when none.
310
+ * @property optional - Whether it may be left out.
311
+ * @property descriptionHtml - Description rendered as HTML.
312
+ * @property column - The table column a declaration of a query stands for: the column a
313
+ * parameter is compared with or stored in, the column a result column
314
+ * selects. Set when the statement shows one and the scan has that table.
315
+ */
200
316
  interface Declaration {
201
317
  readonly type: LinkedText | null;
202
- /** Default value of a parameter, initializer of a field, value of an enum member. */
203
318
  readonly defaultValue: string | null;
204
319
  readonly optional: boolean;
205
320
  readonly descriptionHtml: string;
206
- /**
207
- * The table column a declaration of a query stands for: the column a
208
- * parameter is compared with or stored in, the column a result column
209
- * selects. Set when the statement shows one and the scan has that table.
210
- */
211
321
  readonly column?: NodeRef;
212
322
  }
213
323
  /**
214
- * A parameter of a function, of a type's constructor, of an API operation or
215
- * of a query. `name` carries a variadic marker, as in `...rest`, or the
216
- * marker of a SQL placeholder, as in `:map_id`.
324
+ * @brief A parameter of a function, of a type's constructor, of an API operation or of a query.
325
+ *
326
+ * `name` carries a variadic marker, as in `...rest`, or the marker of a SQL placeholder, as in `:map_id`.
327
+ *
328
+ * @property location - Where an API operation takes it from. Set for a parameter of an API operation.
217
329
  */
218
330
  export interface ParameterNode extends NodeBase<'parameter'>, Declaration {
219
- /** Set for a parameter of an API operation. */
220
331
  readonly location?: ParameterLocation;
221
332
  }
222
333
  /**
223
- * A field, property or enum member of a type, a property of a schema
334
+ * @brief A field, property or enum member of a type, a property of a schema
224
335
  * definition, a column of a table, or a column of the rows a query returns.
336
+ *
337
+ * @property annotations - Further facts about the field, verbatim: annotations in code, constraints
338
+ * of a property such as `format: date`, constraints of a column such as
339
+ * `UNIQUE`, the expression behind a result column such as `COUNT(*)`.
225
340
  */
226
341
  export interface FieldNode extends NodeBase<'field'>, Declaration {
227
- /**
228
- * Further facts about the field, verbatim: annotations in code, constraints
229
- * of a property such as `format: date`, constraints of a column such as
230
- * `UNIQUE`, the expression behind a result column such as `COUNT(*)`.
231
- */
232
342
  readonly annotations: readonly string[];
233
343
  }
234
- /** One term of a glossary: a word of the project's language and what it means. */
344
+ /**
345
+ * One term of a glossary: a word of the project's language and what it means.
346
+ *
347
+ * @property anchor - Unique within the glossary and safe in a URL hash.
348
+ * @property group - Heading the glossary lists the term under, or `''`.
349
+ * @property definitionHtml - Definition rendered as HTML.
350
+ * @property avoid - Words the glossary tells writers to replace with this term.
351
+ */
235
352
  export interface TermNode extends NodeBase<'term'> {
236
- /** Unique within the glossary and safe in a URL hash. */
237
353
  readonly anchor: string;
238
- /** Heading the glossary lists the term under, or `''`. */
239
354
  readonly group: string;
240
355
  readonly definitionHtml: string;
241
- /** Words the glossary tells writers to replace with this term. */
242
356
  readonly avoid: readonly string[];
243
357
  }
244
- /** One decision of a decision log: what was decided and why. */
358
+ /**
359
+ * One decision of a decision log: what was decided and why.
360
+ *
361
+ * @property anchor - Unique within the log and safe in a URL hash.
362
+ * @property id - Number or id in front of the title, such as `3` or `ADR-0003`. `''` when the title has none.
363
+ * @property status - As written in the log, such as `accepted` or `superseded by 7`. `''` when the decision states none.
364
+ * @property date - As written in the log. `''` when the decision states none.
365
+ * @property html - Text of the decision rendered as HTML.
366
+ */
245
367
  export interface DecisionNode extends NodeBase<'decision'> {
246
- /** Unique within the log and safe in a URL hash. */
247
368
  readonly anchor: string;
248
- /** Number or id in front of the title, such as `3` or `ADR-0003`. `''` when the title has none. */
249
369
  readonly id: string;
250
- /** As written in the log, such as `accepted` or `superseded by 7`. `''` when the decision states none. */
251
370
  readonly status: string;
252
- /** As written in the log. `''` when the decision states none. */
253
371
  readonly date: string;
254
372
  readonly html: string;
255
373
  }
256
- /** One media type of a request body or a response, with the schema of its content. */
374
+ /**
375
+ * One media type of a request body or a response, with the schema of its content.
376
+ *
377
+ * @property mediaType - Such as `application/json`.
378
+ * @property schema - The schema as a type expression, such as `Booking[]`. `null` when the document gives none.
379
+ */
257
380
  export interface ApiContent {
258
- /** Such as `application/json`. */
259
381
  readonly mediaType: string;
260
- /** The schema as a type expression, such as `Booking[]`. `null` when the document gives none. */
261
382
  readonly schema: LinkedText | null;
262
383
  }
263
- /** The request body of an operation. */
384
+ /**
385
+ * The request body of an operation.
386
+ *
387
+ * @property required - Whether the body must be sent.
388
+ * @property descriptionHtml - Description rendered as HTML.
389
+ * @property content - Media types the body can have.
390
+ */
264
391
  export interface ApiRequestBody {
265
392
  readonly required: boolean;
266
393
  readonly descriptionHtml: string;
267
394
  readonly content: readonly ApiContent[];
268
395
  }
269
- /** One response of an operation. */
396
+ /**
397
+ * One response of an operation.
398
+ *
399
+ * @property status - Status code or range as the document writes it: `200`, `4XX`, `default`.
400
+ * @property descriptionHtml - Description rendered as HTML.
401
+ * @property content - Media types of the response body.
402
+ */
270
403
  export interface ApiResponse {
271
- /** Status code or range as the document writes it: `200`, `4XX`, `default`. */
272
404
  readonly status: string;
273
405
  readonly descriptionHtml: string;
274
406
  readonly content: readonly ApiContent[];
275
407
  }
276
408
  /**
277
- * One operation of an OpenAPI document: a method on a path, or a webhook.
409
+ * @brief One operation of an OpenAPI document: a method on a path, or a webhook.
410
+ *
278
411
  * `name` is the method and the path, as in `GET /bookings/{id}`. Its
279
412
  * parameters are its children.
413
+ *
414
+ * @property anchor - Unique within the document and safe in a URL hash.
415
+ * @property method - HTTP method in capitals.
416
+ * @property urlPath - Path template, such as `/bookings/{id}`. For a webhook, its name.
417
+ * @property operationId - `operationId` of the document, or `''`.
418
+ * @property tags - Tags the operation is listed under. A webhook without tags is listed under `Webhooks`.
419
+ * @property deprecated - Whether the document marks it deprecated.
420
+ * @property summary - One line of plain text, or `''`.
421
+ * @property descriptionHtml - Description rendered as HTML.
422
+ * @property requestBody - The request body, or `null`.
423
+ * @property responses - Responses, in the order of the document.
424
+ * @property security - The ways a caller can authenticate, each as the names of the security
425
+ * schemes it needs, joined with ` + `. Empty when the operation is open.
280
426
  */
281
427
  export interface OperationNode extends NodeBase<'operation'> {
282
- /** Unique within the document and safe in a URL hash. */
283
428
  readonly anchor: string;
284
- /** HTTP method in capitals. */
285
429
  readonly method: string;
286
- /** Path template, such as `/bookings/{id}`. For a webhook, its name. */
287
430
  readonly urlPath: string;
288
- /** `operationId` of the document, or `''`. */
289
431
  readonly operationId: string;
290
- /** Tags the operation is listed under. A webhook without tags is listed under `Webhooks`. */
291
432
  readonly tags: readonly string[];
292
433
  readonly deprecated: boolean;
293
- /** One line of plain text, or `''`. */
294
434
  readonly summary: string;
295
435
  readonly descriptionHtml: string;
296
436
  readonly requestBody: ApiRequestBody | null;
297
- /** In the order of the document. */
298
437
  readonly responses: readonly ApiResponse[];
299
- /**
300
- * The ways a caller can authenticate, each as the names of the security
301
- * schemes it needs, joined with ` + `. Empty when the operation is open.
302
- */
303
438
  readonly security: readonly string[];
304
439
  }
305
440
  /**
306
- * A named JSON Schema: the root schema of a file, an entry of its `$defs`, or
307
- * an entry of `components.schemas` of an OpenAPI document. Its properties are
308
- * its `field` children, nested ones under a dotted name such as `address.city`.
441
+ * @brief A named JSON Schema: the root schema of a file, an entry of its `$defs`, or
442
+ * an entry of `components.schemas` of an OpenAPI document.
443
+ *
444
+ * Its properties are its `field` children, nested ones under a dotted name such as `address.city`.
445
+ *
446
+ * @property anchor - Unique within the file and safe in a URL hash.
447
+ * @property type - What the schema allows, as a type expression: `object`, `string[]`, `Cat | Dog`. `null` when none is stated.
448
+ * @property descriptionHtml - Description rendered as HTML.
449
+ * @property constraints - Keywords that narrow the type, verbatim: `format: uuid`, `minimum: 0`.
450
+ * @property values - The values of an `enum` or a `const`, as JSON. Empty for every other schema.
451
+ * @property deprecated - Whether the document marks it deprecated.
309
452
  */
310
453
  export interface DefinitionNode extends NodeBase<'definition'> {
311
- /** Unique within the file and safe in a URL hash. */
312
454
  readonly anchor: string;
313
- /** What the schema allows, as a type expression: `object`, `string[]`, `Cat | Dog`. */
314
455
  readonly type: LinkedText | null;
315
456
  readonly descriptionHtml: string;
316
- /** Keywords that narrow the type, verbatim: `format: uuid`, `minimum: 0`. */
317
457
  readonly constraints: readonly string[];
318
- /** The values of an `enum` or a `const`, as JSON. Empty for every other schema. */
319
458
  readonly values: readonly string[];
320
459
  readonly deprecated: boolean;
321
460
  }
322
- /** A foreign key of a table. */
461
+ /**
462
+ * A foreign key of a table.
463
+ *
464
+ * @property name - Name of the constraint, or `''`.
465
+ * @property columns - Columns of this table, in key order.
466
+ * @property table - Name of the referenced table, as the statement writes it.
467
+ * @property target - The referenced table, when the scan has it, else `null`.
468
+ * @property referencedColumns - Columns of the referenced table, in key order. Its primary key when the statement names none.
469
+ * @property onDelete - Action in capitals, such as `CASCADE` or `SET NULL`. `''` when the statement states none.
470
+ * @property onUpdate - Action on update, in the same form as `onDelete`.
471
+ */
323
472
  export interface ForeignKey {
324
- /** Name of the constraint, or `''`. */
325
473
  readonly name: string;
326
- /** Columns of this table, in key order. */
327
474
  readonly columns: readonly string[];
328
- /** Name of the referenced table, as the statement writes it. */
329
475
  readonly table: string;
330
- /** The referenced table, when the scan has it. */
331
476
  readonly target: NodeRef | null;
332
- /** Columns of the referenced table, in key order. Its primary key when the statement names none. */
333
477
  readonly referencedColumns: readonly string[];
334
- /** Action in capitals, such as `CASCADE` or `SET NULL`. `''` when the statement states none. */
335
478
  readonly onDelete: string;
336
479
  readonly onUpdate: string;
337
480
  }
338
- /** An index on a table. */
481
+ /**
482
+ * An index on a table.
483
+ *
484
+ * @property name - Name of the index.
485
+ * @property columns - Indexed columns or expressions, in index order.
486
+ * @property unique - Whether the index is unique.
487
+ */
339
488
  export interface TableIndex {
340
489
  readonly name: string;
341
- /** Indexed columns or expressions, in index order. */
342
490
  readonly columns: readonly string[];
343
491
  readonly unique: boolean;
344
492
  }
345
- /** A table of a database schema. Its columns are its `field` children. */
493
+ /**
494
+ * A table of a database schema. Its columns are its `field` children.
495
+ *
496
+ * @property anchor - Unique within the file and safe in a URL hash.
497
+ * @property line - Line of the file where the table is created.
498
+ * @property descriptionHtml - Description rendered as HTML.
499
+ * @property primaryKey - Columns of the primary key, in key order. Empty for a table without one.
500
+ * @property foreignKeys - Foreign keys of the table.
501
+ * @property indexes - Indexes on the table.
502
+ * @property constraints - Table constraints that are no key, verbatim: `UNIQUE (a, b)`, `CHECK (a < b)`.
503
+ * @property options - Table options in capitals: `WITHOUT ROWID`, `STRICT`, `VIRTUAL`.
504
+ */
346
505
  export interface TableNode extends NodeBase<'table'> {
347
- /** Unique within the file and safe in a URL hash. */
348
506
  readonly anchor: string;
349
507
  readonly line: number;
350
508
  readonly descriptionHtml: string;
351
- /** Columns of the primary key, in key order. Empty for a table without one. */
352
509
  readonly primaryKey: readonly string[];
353
510
  readonly foreignKeys: readonly ForeignKey[];
354
511
  readonly indexes: readonly TableIndex[];
355
- /** Table constraints that are no key, verbatim: `UNIQUE (a, b)`, `CHECK (a < b)`. */
356
512
  readonly constraints: readonly string[];
357
- /** Table options in capitals: `WITHOUT ROWID`, `STRICT`, `VIRTUAL`. */
358
513
  readonly options: readonly string[];
359
514
  }
360
515
  /**
361
- * What running an entry of a query catalog does.
516
+ * @brief What running an entry of a query catalog does.
517
+ *
362
518
  * - `read`: it returns rows and changes nothing, as `SELECT` does.
363
519
  * - `write`: it changes rows or the schema, as `INSERT`, `UPDATE`, `DELETE` and `CREATE INDEX` do.
364
520
  * - `control`: it changes the state of the transaction or the connection, as `BEGIN`, `COMMIT` and `PRAGMA` do.
365
521
  */
366
522
  export type QueryEffect = 'read' | 'write' | 'control';
367
- /** A table an entry of a query catalog names, and what it does with it. */
523
+ /**
524
+ * A table an entry of a query catalog names, and what it does with it.
525
+ *
526
+ * @property name - Name of the table, as the statement writes it.
527
+ * @property target - The table, when the scan has it, else `null`.
528
+ * @property access - Whether the entry reads or writes it.
529
+ */
368
530
  export interface QueryTable {
369
- /** Name of the table, as the statement writes it. */
370
531
  readonly name: string;
371
- /** The table, when the scan has it. */
372
532
  readonly target: NodeRef | null;
373
533
  readonly access: 'read' | 'write';
374
534
  }
375
535
  /**
376
- * One entry of a query catalog: the SQL of one `.sql` file, or of one named
377
- * block of such a file. `name` is the name the code runs it by: the file name
536
+ * @brief One entry of a query catalog: the SQL of one `.sql` file, or of one named
537
+ * block of such a file.
538
+ *
539
+ * `name` is the name the code runs it by: the file name
378
540
  * without `.sql`, or the name of the block. Its placeholders are its
379
541
  * `parameter` children, and the columns of the rows it returns are its
380
542
  * `field` children.
543
+ *
544
+ * @property anchor - Unique within the catalog and safe in a URL hash.
545
+ * @property sourcePath - Path of the file the entry is in, relative to the scanned root.
546
+ * @property line - Line of the file where the statement starts.
547
+ * @property effect - What running the entry does.
548
+ * @property verb - The keywords that open the statement, in capitals: `SELECT`, `INSERT`, `BEGIN IMMEDIATE`.
549
+ * @property descriptionHtml - The comment above the statement, as HTML. `''` for an entry without one.
550
+ * @property sqlHtml - The highlighted SQL, as the file writes it.
551
+ * @property tables - The tables the SQL names, each once per access, in the order they first appear.
381
552
  */
382
553
  export interface QueryNode extends NodeBase<'query'> {
383
- /** Unique within the catalog and safe in a URL hash. */
384
554
  readonly anchor: string;
385
- /** Path of the file the entry is in, relative to the scanned root. */
386
555
  readonly sourcePath: string;
387
556
  readonly line: number;
388
557
  readonly effect: QueryEffect;
389
- /** The keywords that open the statement, in capitals: `SELECT`, `INSERT`, `BEGIN IMMEDIATE`. */
390
558
  readonly verb: string;
391
- /** The comment above the statement. `''` for an entry without one. */
392
559
  readonly descriptionHtml: string;
393
- /** The highlighted SQL, as the file writes it. */
394
560
  readonly sqlHtml: string;
395
- /** The tables the SQL names, each once per access, in the order they first appear. */
396
561
  readonly tables: readonly QueryTable[];
397
562
  }
398
563
  /** Where a plan, a phase or a task stands, in the order task-manager moves it through. */
@@ -403,64 +568,96 @@ export type TaskStatus = (typeof TASK_STATUSES)[number];
403
568
  export declare const TASK_PRIORITIES: readonly ['critical', 'high', 'medium', 'low'];
404
569
  /** One of {@link TASK_PRIORITIES}. */
405
570
  export type TaskPriority = (typeof TASK_PRIORITIES)[number];
406
- /** What every plan, phase and task of the task tree states in its frontmatter. */
571
+ /**
572
+ * What every plan, phase and task of the task tree states in its frontmatter.
573
+ *
574
+ * @property status - Where it stands.
575
+ * @property priority - How urgent it is.
576
+ * @property summary - One line of plain text.
577
+ * @property dependsOn - Names of the plans or phases, or ids of the tasks, this one waits for, as the file writes them.
578
+ */
407
579
  interface TrackedFacts {
408
580
  readonly status: TaskStatus;
409
581
  readonly priority: TaskPriority;
410
- /** One line of plain text. */
411
582
  readonly summary: string;
412
- /** Names of the plans or phases, or ids of the tasks, this one waits for, as the file writes them. */
413
583
  readonly dependsOn: readonly string[];
414
584
  }
415
585
  /**
416
- * A plan of the task tree: `<plan>/<plan>.md`. Its phases are its children,
417
- * and the decision log of its `decisions/` folder when it has one.
586
+ * @brief A plan of the task tree: `<plan>/<plan>.md`.
587
+ *
588
+ * Its phases are its children, and the decision log of its `decisions/` folder when it has one.
418
589
  * `name` is the plan's folder name, `title` its title.
419
590
  */
420
591
  export interface PlanNode extends NodeBase<'plan'>, FileFacts, TrackedFacts {
421
592
  }
422
- /** A phase of a plan: `<plan>/<phase>/<phase>.md`. Its tasks are its children. */
593
+ /**
594
+ * A phase of a plan: `<plan>/<phase>/<phase>.md`. Its tasks are its children.
595
+ *
596
+ * @property parallel - Whether its tasks can run side by side.
597
+ */
423
598
  export interface PhaseNode extends NodeBase<'phase'>, FileFacts, TrackedFacts {
424
- /** Whether its tasks can run side by side. */
425
599
  readonly parallel: boolean;
426
600
  }
427
- /** One task of a phase: `<phase>/tasks/<id>.md`, shown as an entry on the page of its phase. `name` is its title. */
601
+ /**
602
+ * One task of a phase: `<phase>/tasks/<id>.md`, shown as an entry on the page of its phase. `name` is its title.
603
+ *
604
+ * @property anchor - Unique within the phase and safe in a URL hash.
605
+ * @property id - Such as `TASK-006`.
606
+ * @property sourcePath - Path of the task file, relative to the scanned root.
607
+ * @property package - The package the task changes, as the file names it.
608
+ * @property complexity - From 1 for small to 5 for large. `null` when the file states none.
609
+ * @property html - Description rendered as HTML.
610
+ */
428
611
  export interface TaskNode extends NodeBase<'task'>, TrackedFacts {
429
- /** Unique within the phase and safe in a URL hash. */
430
612
  readonly anchor: string;
431
- /** Such as `TASK-006`. */
432
613
  readonly id: string;
433
- /** Path of the task file, relative to the scanned root. */
434
614
  readonly sourcePath: string;
435
- /** The package the task changes, as the file names it. */
436
615
  readonly package: string;
437
- /** From 1 for small to 5 for large. `null` when the file states none. */
438
616
  readonly complexity: number | null;
439
617
  readonly html: string;
440
618
  }
441
619
  /** A file node of any kind. */
442
620
  export type AnyFileNode = FileNode | ApiNode | DatabaseNode | PlanNode | PhaseNode;
443
621
  /** A node of any kind. */
444
- export type GraphNode = SectionNode | FolderNode | AnyFileNode | SourceNode | SymbolNode | TermNode | DecisionNode | OperationNode | DefinitionNode | TableNode | QueryNode | TaskNode | ParameterNode | FieldNode;
622
+ export type GraphNode = SectionNode | FolderNode | PackageNode | AnyFileNode | SourceNode | SymbolNode | TermNode | DecisionNode | OperationNode | DefinitionNode | TableNode | QueryNode | TaskNode | ParameterNode | FieldNode;
445
623
  /** An entry of any kind. */
446
624
  export type EntryNode = SymbolNode | TermNode | DecisionNode | OperationNode | DefinitionNode | TableNode | QueryNode | TaskNode;
447
- /** Tells a symbol node from the others. */
625
+ /**
626
+ * Tells a symbol node from the others.
627
+ *
628
+ * @param node - Node to test.
629
+ */
448
630
  export declare function isSymbolNode(node: GraphNode): node is SymbolNode;
449
- /** Tells an entry node, a symbol included, from the others. */
631
+ /**
632
+ * Tells an entry node, a symbol included, from the others.
633
+ *
634
+ * @param node - Node to test.
635
+ */
450
636
  export declare function isEntryNode(node: GraphNode): node is EntryNode;
451
- /** Tells a node of a file with a page from the others. */
637
+ /**
638
+ * Tells a node of a file with a page from the others.
639
+ *
640
+ * @param node - Node to test.
641
+ */
452
642
  export declare function isFileNode(node: GraphNode): node is AnyFileNode;
453
643
  /** Kinds of an entry that is described in markdown and can have parameters or fields. */
454
644
  export type DescribedNode = SymbolNode | OperationNode | DefinitionNode | TableNode | QueryNode;
455
645
  /**
456
646
  * Tells the entries with a `descriptionHtml` from the others.
457
647
  *
648
+ * @param node - Node to test.
458
649
  * @returns True for a symbol, an operation, a definition, a table and a query.
459
650
  */
460
651
  export declare function isDescribedNode(node: GraphNode): node is DescribedNode;
461
652
  /** A relation other than `parent` between two nodes, such as a parameter that has a class as its type. */
462
653
  export type Edge = readonly [from: NodeRef, kind: EdgeKind, to: NodeRef];
463
- /** What the bundle says about its own making. `generatedAt` is an ISO 8601 timestamp. */
654
+ /**
655
+ * What the bundle says about its own making.
656
+ *
657
+ * @property title - Title of the site.
658
+ * @property generatedAt - ISO 8601 timestamp of the generation.
659
+ * @property generator - Name of the tool that made the bundle.
660
+ */
464
661
  export interface BundleMeta {
465
662
  readonly title: string;
466
663
  readonly generatedAt: string;
@@ -469,41 +666,41 @@ export interface BundleMeta {
469
666
  /** Version of the layout of {@link SemanticIndex}. A reader skips an index of another version. */
470
667
  export declare const SEMANTIC_FORMAT = 3;
471
668
  /**
472
- * What a reader needs to search by meaning: a small text embedding model, one
473
- * vector per searchable node and the words of each node. An **embedding** is a
474
- * list of numbers that stands for the meaning of a text. Texts with a similar
475
- * meaning get similar numbers, so `vessel` is found by a search for `ship`.
669
+ * @brief What a reader needs to search by meaning: a small text embedding model,
670
+ * one vector per searchable node and the words of each node.
671
+ *
672
+ * An **embedding** is a list of numbers that stands for the meaning of a text.
673
+ * Texts with a similar meaning get similar numbers, so `vessel` is found by a search for `ship`.
476
674
  *
477
675
  * The model is a table with one vector per word. A contextual model computed
478
676
  * each vector in advance, from the word on its own. The vector of a text is
479
- * the mean of the vectors of its words, so a reader computes it without a
480
- * neural network and without a server.
677
+ * the mean of the vectors of its words, computed by the reader without a neural network.
678
+ *
679
+ * @property format - Layout version, `SEMANTIC_FORMAT`.
680
+ * @property model - Name of the embedding model, for display.
681
+ * @property dimensions - Length of every vector.
682
+ * @property vocabulary - The words of the model, joined with `\n`. The line number of a word is its row in `vocabularyVectors`.
683
+ * @property vocabularyVectors - Base64 of the model table: one row of `dimensions` values per word, each value in four bits.
684
+ * @property nodes - The nodes that have a vector, in the order of `nodeVectors`.
685
+ * @property nodeVectors - Base64 of signed bytes: one vector of length 1 per node, scaled to the range of a signed byte.
686
+ * @property words - Every word that carries meaning in the name or the text of a node, each once, joined with `\n`.
687
+ * @property nodeWords - For each node of `nodes`, the words of its name and the further words of
688
+ * its text, as line numbers in `words`. A one-word query is compared with
689
+ * these words, because the mean of a whole text hides a single word.
481
690
  */
482
691
  export interface SemanticIndex {
483
692
  readonly format: typeof SEMANTIC_FORMAT;
484
- /** Name of the embedding model, for display. */
485
693
  readonly model: string;
486
- /** Length of every vector. */
487
694
  readonly dimensions: number;
488
- /** The words of the model, joined with `\n`. The line number of a word is its row in `vocabularyVectors`. */
489
695
  readonly vocabulary: string;
490
- /** Base64 of the model table: one row of `dimensions` values per word, each value in four bits. */
491
696
  readonly vocabularyVectors: string;
492
- /** The nodes that have a vector, in the order of `nodeVectors`. */
493
697
  readonly nodes: readonly NodeRef[];
494
- /** Base64 of signed bytes: one vector of length 1 per node, scaled to the range of a signed byte. */
495
698
  readonly nodeVectors: string;
496
- /** Every word that carries meaning in the name or the text of a node, each once, joined with `\n`. */
497
699
  readonly words: string;
498
- /**
499
- * For each node of `nodes`, the words of its name and the further words of
500
- * its text, as line numbers in `words`. A one-word query is compared with
501
- * these words, because the mean of a whole text hides a single word.
502
- */
503
700
  readonly nodeWords: readonly (readonly [name: readonly number[], text: readonly number[]])[];
504
701
  }
505
702
  /**
506
- * The data contract between the scanner and the web app: the CLI serializes
703
+ * @brief The data contract between the scanner and the web app: the CLI serializes
507
704
  * one bundle into the generated HTML file, and the app reads it back.
508
705
  *
509
706
  * The bundle is a graph. A **node** is one thing the site shows: a folder, a
@@ -511,42 +708,73 @@ export interface SemanticIndex {
511
708
  * a database table, a query. `parent` puts every node in one tree, and that
512
709
  * tree is the navigation. An **edge** is any other relation between two nodes,
513
710
  * such as "this parameter has that class as its type".
711
+ *
712
+ * @property meta - What the bundle says about its making.
713
+ * @property nodes - Every node. A node comes after its parent, and siblings are in display order.
714
+ * @property edges - Relations other than `parent`.
715
+ * @property semantic - Index for search by meaning. Left out when the site was generated without embeddings.
514
716
  */
515
717
  export interface DocsBundle {
516
718
  readonly meta: BundleMeta;
517
- /** A node comes after its parent, and siblings are in display order. */
518
719
  readonly nodes: readonly GraphNode[];
519
720
  readonly edges: readonly Edge[];
520
- /** Left out when the site was generated without embeddings. */
521
721
  readonly semantic?: SemanticIndex;
522
722
  }
523
- /** Where a node is shown: a page, and for an entry an anchor on that page. */
723
+ /**
724
+ * Where a node is shown: a page, and for an entry an anchor on that page.
725
+ *
726
+ * @property path - Slugs from the section down, joined with `/` and not URL-encoded: `code/src/app.ts`.
727
+ * @property hash - Anchor of the entry on that page, without `#`. Set for an entry only.
728
+ */
524
729
  export interface Route {
525
- /** Slugs from the section down, joined with `/` and not URL-encoded: `code/src/app.ts`. */
526
730
  readonly path: string;
527
731
  readonly hash?: string;
528
732
  }
529
- /** The part of a node that decides its route. */
733
+ /**
734
+ * The part of a node that decides its route.
735
+ *
736
+ * @property kind - Kind of the node.
737
+ * @property name - Name of the node.
738
+ * @property parent - The node this one belongs to, or `null` for a section.
739
+ * @property slug - Segment of the route. Defaults to `name`.
740
+ * @property anchor - Anchor of an entry, which its route turns into the hash.
741
+ */
530
742
  export interface Routable {
531
- readonly kind: NodeKind;
743
+ readonly kind: NodeType;
532
744
  readonly name: string;
533
745
  readonly parent: NodeRef | null;
534
746
  readonly slug?: string;
535
747
  readonly anchor?: string;
536
748
  }
537
749
  /**
538
- * DOM id and URL hash of an entry on the page of its file: `symbol:App.run`,
539
- * `term:lane`, `decision:3-use-hash-routes`, `table:Booking`, `query:list_bookings`. The prefix keeps
540
- * entry anchors apart from heading anchors.
750
+ * @brief DOM id and URL hash of an entry on the page of its file.
751
+ *
752
+ * Examples: `symbol:App.run`, `term:lane`, `decision:3-use-hash-routes`,
753
+ * `table:Booking`, `query:list_bookings`. The kind is the prefix, so entry
754
+ * anchors never equal a heading anchor.
755
+ *
756
+ * @param kind - Kind of the entry, such as `symbol` or `term`.
757
+ * @param anchor - Anchor of the entry, unique within its file.
541
758
  */
542
759
  export declare function entryAnchor(kind: EntryKind, anchor: string): string;
543
760
  /**
544
- * Route of a node. Sections, folders and files are pages. An entry is an
545
- * anchor on the page of its file, and a parameter or field shares the route
546
- * of its symbol. The scanner and the web app both use this function.
761
+ * @brief Route of a node.
762
+ *
763
+ * Sections, folders and files are pages. An entry is an anchor on the page of
764
+ * its file, and a parameter or field shares the route of its symbol. The
765
+ * scanner and the web app both use this function.
766
+ *
767
+ * @param nodes - Nodes the route is read from, usually the nodes of a bundle.
768
+ * @param ref - Index of the node in `nodes`.
769
+ * @returns The page path, and the hash for an entry.
547
770
  */
548
771
  export declare function routeOf(nodes: readonly Routable[], ref: NodeRef): Route;
549
- /** Link to a route from inside the generated page: `#/code/src/app.ts#symbol:App.run`. */
772
+ /**
773
+ * Link to a route from inside the generated page: `#/code/src/app.ts#symbol:App.run`.
774
+ *
775
+ * @param route - Route to link to.
776
+ * @returns The hash link to the route.
777
+ */
550
778
  export declare function hrefOf(route: Route): string;
551
779
  /** Id of the `<script type="application/json">` element that holds the bundle. */
552
780
  export declare const DATA_ELEMENT_ID = "analyze-data";
@@ -554,7 +782,7 @@ export declare const DATA_ELEMENT_ID = "analyze-data";
554
782
  export declare const MOUNT_ELEMENT_ID = "analyze-root";
555
783
  /** `localStorage` key of the reader's color mode. The template reads it before first paint. */
556
784
  export declare const COLOR_MODE_STORAGE_KEY = "analyze:color-mode";
557
- /** Template marker the CLI replaces with the serialized bundle. Nothing in the web bundle imports it, so the marker stays out of it. */
785
+ /** Template marker the CLI replaces with the serialized bundle. */
558
786
  export declare const DATA_PLACEHOLDER = "__ANALYZE_DATA__";
559
- /** Template marker the CLI replaces with the title of the site. Like {@link DATA_PLACEHOLDER}, nothing in the web bundle imports it. */
787
+ /** Template marker the CLI replaces with the title of the site. */
560
788
  export declare const TITLE_PLACEHOLDER = "__ANALYZE_TITLE__";