clean-jsdoc-theme 4.3.0 → 5.0.0-alpha.1

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 (86) hide show
  1. package/README.md +117 -625
  2. package/dist/publish.d.mts +218 -0
  3. package/dist/publish.d.ts +218 -0
  4. package/dist/publish.js +641 -0
  5. package/dist/publish.js.map +1 -0
  6. package/dist/publish.mjs +605 -0
  7. package/dist/publish.mjs.map +1 -0
  8. package/package.json +65 -55
  9. package/.eslintignore +0 -5
  10. package/.eslintrc.js +0 -3
  11. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -43
  12. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -27
  13. package/.github/dependabot.yml +0 -9
  14. package/.github/pull_request_template.md +0 -16
  15. package/.github/workflows/codeql.yml +0 -72
  16. package/.github/workflows/greetings.yml +0 -16
  17. package/.prettierignore +0 -2
  18. package/.prettierrc +0 -5
  19. package/.stylelintignore +0 -4
  20. package/.stylelintrc +0 -18
  21. package/.travis.yml +0 -30
  22. package/CHANGELOG.md +0 -260
  23. package/CODE_OF_CONDUCT.md +0 -76
  24. package/CODE_OF_CONDUCT_HINDI.md +0 -61
  25. package/CONTRIBUTING.md +0 -36
  26. package/LICENSE +0 -21
  27. package/SECURITY.md +0 -21
  28. package/clean-jsdoc-theme-defaults.js +0 -37
  29. package/clean-jsdoc-theme-helper.js +0 -186
  30. package/css-property-order-fix.js +0 -56
  31. package/helpers/Environment.html +0 -3
  32. package/helpers/down-arrow.js +0 -9
  33. package/jsdoc-config.json +0 -102
  34. package/minify.js +0 -72
  35. package/publish.js +0 -1104
  36. package/static/fonts/Inconsolata-Regular.ttf +0 -0
  37. package/static/fonts/OpenSans-Regular.ttf +0 -0
  38. package/static/fonts/WorkSans-Bold.ttf +0 -0
  39. package/static/scripts/core.js +0 -726
  40. package/static/scripts/core.min.js +0 -23
  41. package/static/scripts/resize.js +0 -90
  42. package/static/scripts/search.js +0 -265
  43. package/static/scripts/search.min.js +0 -6
  44. package/static/scripts/third-party/Apache-License-2.0.txt +0 -202
  45. package/static/scripts/third-party/fuse.js +0 -9
  46. package/static/scripts/third-party/hljs-line-num-original.js +0 -369
  47. package/static/scripts/third-party/hljs-line-num.js +0 -1
  48. package/static/scripts/third-party/hljs-original.js +0 -5171
  49. package/static/scripts/third-party/hljs.js +0 -1
  50. package/static/scripts/third-party/popper.js +0 -5
  51. package/static/scripts/third-party/tippy.js +0 -1
  52. package/static/scripts/third-party/tocbot.js +0 -672
  53. package/static/scripts/third-party/tocbot.min.js +0 -1
  54. package/static/styles/clean-jsdoc-theme-base.css +0 -1159
  55. package/static/styles/clean-jsdoc-theme-dark.css +0 -412
  56. package/static/styles/clean-jsdoc-theme-light.css +0 -482
  57. package/static/styles/clean-jsdoc-theme-scrollbar.css +0 -30
  58. package/static/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
  59. package/static/styles/clean-jsdoc-theme.min.css +0 -1
  60. package/tmpl/augments.tmpl +0 -10
  61. package/tmpl/container.tmpl +0 -208
  62. package/tmpl/details.tmpl +0 -207
  63. package/tmpl/example.tmpl +0 -3
  64. package/tmpl/examples.tmpl +0 -48
  65. package/tmpl/exceptions.tmpl +0 -32
  66. package/tmpl/icons.tmpl +0 -73
  67. package/tmpl/include-target-script-and-styles.tmpl +0 -43
  68. package/tmpl/layout.tmpl +0 -167
  69. package/tmpl/mainpage.tmpl +0 -10
  70. package/tmpl/members.tmpl +0 -42
  71. package/tmpl/method.tmpl +0 -175
  72. package/tmpl/mobile-sidebar.tmpl +0 -21
  73. package/tmpl/navbar-actions.tmpl +0 -19
  74. package/tmpl/navbar-menu.tmpl +0 -25
  75. package/tmpl/navbar.tmpl +0 -14
  76. package/tmpl/params.tmpl +0 -131
  77. package/tmpl/properties.tmpl +0 -109
  78. package/tmpl/returns.tmpl +0 -19
  79. package/tmpl/search.tmpl +0 -17
  80. package/tmpl/sidebar-items.tmpl +0 -24
  81. package/tmpl/sidebar-title.tmpl +0 -8
  82. package/tmpl/sidebar.tmpl +0 -9
  83. package/tmpl/source.tmpl +0 -13
  84. package/tmpl/toc.tmpl +0 -4
  85. package/tmpl/tutorial.tmpl +0 -32
  86. package/tmpl/type.tmpl +0 -13
@@ -0,0 +1,218 @@
1
+ import { CopyPageConfig, SiteLogo } from '@clean-jsdoc-theme/dwar';
2
+ import { DocInput, MenuItem } from '@clean-jsdoc-theme/setu';
3
+
4
+ interface JSDocOpts {
5
+ destination?: string;
6
+ package?: string;
7
+ /**
8
+ * Site identity from `jsdoc.json` (`"opts": { "siteName": ... }`). Either a
9
+ * string (shown in the header/footer and appended to each page's `<title>`),
10
+ * or a logo image set `{ default, dark, light, alt }`. Local image paths are
11
+ * copied into the output; `http(s)://` and `data:` values pass through. The
12
+ * `alt` text (or `pkg.name`) is used for the `<title>` suffix and image alt.
13
+ */
14
+ siteName?: string | SiteLogo;
15
+ /**
16
+ * Font overrides from `jsdoc.json` (`"opts": { "fonts": { ... } }`). Values
17
+ * are Google Fonts family names for `heading`/`body`; `mono` is a CSS stack.
18
+ */
19
+ fonts?: {
20
+ heading?: string;
21
+ body?: string;
22
+ mono?: string;
23
+ };
24
+ /**
25
+ * Project README as HTML. JSDoc renders the Markdown README (`-R`/`opts.readme`
26
+ * or one found in the source paths) and replaces this with the resulting HTML
27
+ * before calling `publish`. Rendered as the site home page.
28
+ */
29
+ readme?: string;
30
+ /** Path to the tutorials directory (`-u`/`opts.tutorials`); resolved tree arrives as the 3rd `publish` arg. */
31
+ tutorials?: string;
32
+ /**
33
+ * Path to a docs content directory (`jsdoc.json` `"opts": { "docs": "docs/" }`),
34
+ * resolved relative to the cwd. The bridge walks it recursively; each
35
+ * `*.md`/`*.markdown` (and `*.html`) file becomes a prose page at its clean,
36
+ * unprefixed slug (the relative path), grouped by frontmatter/directory. A root
37
+ * `index.md` becomes the home page. Unset → no docs site (today's behavior).
38
+ */
39
+ docs?: unknown;
40
+ /**
41
+ * Top-level doc-group display order (`jsdoc.json` `"opts": { "docGroups": [...] }`).
42
+ * An ordered list of doc-group labels controlling how the doc-group sidebar
43
+ * sections render (after the API sections). Omit for the default order.
44
+ */
45
+ docGroups?: unknown;
46
+ /**
47
+ * Group label assigned to a doc page that carries no frontmatter/directory
48
+ * group (`jsdoc.json` `"opts": { "defaultDocGroup": "Docs" }`). Omit to leave
49
+ * such pages ungrouped.
50
+ */
51
+ defaultDocGroup?: unknown;
52
+ /**
53
+ * Sidebar section order from `jsdoc.json` (`"opts": { "sectionOrder": [...] }`).
54
+ * An ordered list of section labels (e.g. `["Classes", "Tutorials"]`) that both
55
+ * filters and orders the sidebar sections; "Home" and "Source Files" are always
56
+ * shown regardless. Omit (or leave empty) for the default order.
57
+ */
58
+ sectionOrder?: unknown;
59
+ /**
60
+ * Full sidebar menu from `jsdoc.json` (`"opts": { "menu": [...] }`). An ordered
61
+ * list of `{ id, title, href, icon }` entries. When present it takes precedence
62
+ * over `sectionOrder` and controls the entire sidebar (built-ins, sections, and
63
+ * external links). See setu's {@link MenuItem}.
64
+ */
65
+ menu?: unknown;
66
+ /**
67
+ * Club related sidebar entries into prefix-grouped subtrees (`jsdoc.json`
68
+ * `"opts": { "clubSidebarItems": true }`). Groups entries within each section
69
+ * by the path segment before the first `/` (e.g. `queue/*` under a `queue`
70
+ * parent); a prefix with a single entry is left flat. Off by default.
71
+ */
72
+ clubSidebarItems?: unknown;
73
+ /**
74
+ * Custom prompt for the copy-page button's "Open in ChatGPT/Claude/Perplexity"
75
+ * actions (`jsdoc.json` `"opts": { "aiPrompt": "…" }`). `{siteName}`, `{url}`,
76
+ * and `{mdUrl}` (the page's raw Markdown link) placeholders are substituted at
77
+ * click time. Only the prompt + links are sent (the AI fetches `{mdUrl}`), so
78
+ * the query stays short for long docs. Omit for a sensible default.
79
+ */
80
+ aiPrompt?: unknown;
81
+ /**
82
+ * Copy-page button config (`jsdoc.json` `"opts": { "copyPage": … }`). Either a
83
+ * boolean (`false` hides the button) or an object `{ enabled?, actions? }`,
84
+ * where `actions` is an ordered subset of
85
+ * `["copy","view","claude","chatgpt","perplexity"]` (`[]` shows just the
86
+ * primary copy button). Defaults to enabled with all actions.
87
+ */
88
+ copyPage?: unknown;
89
+ /**
90
+ * Inline custom CSS (`jsdoc.json` `"opts": { "customCss": "…" }`), injected as
91
+ * a `<style>` after the theme stylesheet so it can override.
92
+ */
93
+ customCss?: unknown;
94
+ /**
95
+ * Path(s) to custom CSS file(s) (`"opts": { "customCssFile": "a.css" }` or an
96
+ * array). Each file is copied AS-IS (its own bytes) to
97
+ * `_assets/<name>.<hash>.css` and linked after the theme stylesheet. The
98
+ * `<hash>` is a content hash (see `hashCustomAssets`), so an unchanged file
99
+ * keeps a stable, cacheable URL.
100
+ */
101
+ customCssFile?: unknown;
102
+ /**
103
+ * Inline custom JS (`"opts": { "customJs": "…" }`), injected as a classic
104
+ * `<script>` before `</body>`, after the theme's own scripts.
105
+ */
106
+ customJs?: unknown;
107
+ /**
108
+ * Path(s) to custom JS file(s) (`"opts": { "customJsFile": "a.js" }` or an
109
+ * array). Each file is copied AS-IS to `_assets/<name>.<hash>.js` and
110
+ * referenced before `</body>`. See `hashCustomAssets`.
111
+ */
112
+ customJsFile?: unknown;
113
+ /**
114
+ * Whether to append a content hash to copied `customCssFile`/`customJsFile`
115
+ * asset names (`_assets/<name>.<hash>.css`). Defaults to `true` — the hash is
116
+ * derived from the file's content (NOT random), so an unchanged file yields
117
+ * the same URL across builds (cache-friendly) and a changed file cache-busts.
118
+ * Set `false` to copy with the original `<name>.css`/`.js` (no hash).
119
+ */
120
+ hashCustomAssets?: unknown;
121
+ /**
122
+ * JSDoc's default-template source options, read from `conf.templates.default`
123
+ * (or, as a fallback, nested under `opts.templates`):
124
+ * - `outputSourceFiles` — defaults to `true`; set `false` to suppress the
125
+ * per-file source viewer pages and the `Source: file:line` member links.
126
+ * - `sourceLinkToComment` — defaults to `false`. By default a `Source:`
127
+ * link lands on the first line of the declaration; set `true` to point it
128
+ * at the doclet's doc-comment line instead (the pre-v5 behavior).
129
+ */
130
+ templates?: {
131
+ default?: {
132
+ outputSourceFiles?: unknown;
133
+ sourceLinkToComment?: unknown;
134
+ };
135
+ };
136
+ [key: string]: unknown;
137
+ }
138
+ /**
139
+ * Resolve JSDoc's `templates.default.outputSourceFiles` flag. The `opts` arg
140
+ * `publish` receives is `env.opts` — the `opts` block — which does NOT carry the
141
+ * root-level `templates` block, so we probe in priority order and default ON:
142
+ * 1. `require('jsdoc/env').conf.templates.default.outputSourceFiles` (the
143
+ * canonical location at runtime; wrapped in try/catch so a missing
144
+ * `jsdoc/env` — e.g. in unit tests — never throws the build).
145
+ * 2. `opts.templates.default.outputSourceFiles` (in case a user nests it
146
+ * under `opts`).
147
+ * Resolves to `false` ONLY when one of those is exactly `=== false`; otherwise
148
+ * `true` (matching JSDoc's default-template default).
149
+ */
150
+ declare function outputSourceFilesEnabled(opts: JSDocOpts): boolean;
151
+ /**
152
+ * Resolve `templates.default.sourceLinkToComment`. Probed in the same priority
153
+ * order as {@link outputSourceFilesEnabled} (canonical `jsdoc/env` conf, then a
154
+ * nested `opts.templates` fallback). Resolves to `true` ONLY when one of those
155
+ * is exactly `=== true`; otherwise `false` (the default: links jump to code).
156
+ */
157
+ declare function sourceLinkToCommentEnabled(opts: JSDocOpts): boolean;
158
+ /**
159
+ * Validate `opts.sectionOrder` into a clean `string[]`, or `undefined` to fall
160
+ * back to setu's default order. Accepts only an array; trims string entries and
161
+ * drops non-strings/empties. An array that yields no usable labels → `undefined`.
162
+ */
163
+ declare function normalizeSectionOrder(raw: unknown): string[] | undefined;
164
+ /**
165
+ * Validate `opts.menu` into a clean `MenuItem[]`, or `undefined` when there's no
166
+ * usable menu. Accepts only an array of objects; trims string fields. The link
167
+ * URL is read from `link` (preferred) or `href`. Keeps only actionable entries —
168
+ * a built-in (`id`) or an external link (`link`/`href`).
169
+ */
170
+ declare function normalizeMenu(raw: unknown): MenuItem[] | undefined;
171
+ /**
172
+ * Validate `opts.copyPage` into a {@link CopyPageConfig}, or `undefined` to use
173
+ * the defaults (enabled, all actions). Accepts a boolean shorthand (`false`
174
+ * hides the button) or an object: `enabled` is read if boolean; `actions`, if an
175
+ * array, is filtered to the known action ids (preserving order, dropping
176
+ * unknowns/dupes) — an empty/all-invalid array still yields `[]` (primary button
177
+ * only), which is meaningful and kept.
178
+ */
179
+ declare function normalizeCopyPage(raw: unknown): CopyPageConfig | undefined;
180
+ /**
181
+ * Compute project-relative paths for a set of absolute source paths by stripping
182
+ * their longest common directory prefix. Returns a `Map<absPath, relPath>` with
183
+ * `relPath` normalized to forward slashes. Pure + exported for testing.
184
+ *
185
+ * Windows-aware: paths are split on both `/` and `\\`, and segment comparison is
186
+ * case-insensitive (NTFS is case-insensitive, and JSDoc's `meta.path` casing can
187
+ * differ from disk). The single-file case yields just its basename. If the paths
188
+ * share no common leading segment (e.g. different drives / UNC vs. drive), each
189
+ * file falls back to its basename so the index stays sane.
190
+ */
191
+ declare function computeRelPaths(absPaths: readonly string[]): Map<string, string>;
192
+ /**
193
+ * Recursively walk a docs directory and read each Markdown/HTML file into a
194
+ * {@link DocInput} for setu's docs front-end. Mirrors {@link collectSourceFiles}'s
195
+ * safe-probe style:
196
+ *
197
+ * - `path` is the file path relative to `dir`, POSIX-normalized (forward slashes)
198
+ * with the extension stripped (`<dir>/guides/advanced.md` → `'guides/advanced'`,
199
+ * `<dir>/index.md` → `'index'`).
200
+ * - `content` is the raw UTF-8 text (frontmatter stays embedded — setu parses it).
201
+ * - `type` is `'markdown'` for `.md`/`.markdown`, `'html'` for `.html`/`.htm`.
202
+ *
203
+ * Resilient by design: a missing/unreadable directory yields `[]` (never throws);
204
+ * dotfiles/dot-dirs and `node_modules`-like noise are skipped; a single
205
+ * unreadable file is warned about and skipped. Results are sorted by `path` so
206
+ * the output is stable build-to-build. Setu does no I/O — this is the only place
207
+ * the docs tree is read.
208
+ */
209
+ declare function collectDocs(dir: string): Promise<DocInput[]>;
210
+ /**
211
+ * Validate `opts.docGroups` into a clean `string[]`, or `undefined` to fall back
212
+ * to setu's default doc-group order. Mirrors {@link normalizeSectionOrder}:
213
+ * accepts only an array; trims string entries and drops non-strings/empties.
214
+ */
215
+ declare function normalizeDocGroups(raw: unknown): string[] | undefined;
216
+ declare function publish(data: unknown, opts: JSDocOpts, tutorials?: unknown): Promise<void>;
217
+
218
+ export { collectDocs, computeRelPaths, normalizeCopyPage, normalizeDocGroups, normalizeMenu, normalizeSectionOrder, outputSourceFilesEnabled, publish, sourceLinkToCommentEnabled };
@@ -0,0 +1,218 @@
1
+ import { CopyPageConfig, SiteLogo } from '@clean-jsdoc-theme/dwar';
2
+ import { DocInput, MenuItem } from '@clean-jsdoc-theme/setu';
3
+
4
+ interface JSDocOpts {
5
+ destination?: string;
6
+ package?: string;
7
+ /**
8
+ * Site identity from `jsdoc.json` (`"opts": { "siteName": ... }`). Either a
9
+ * string (shown in the header/footer and appended to each page's `<title>`),
10
+ * or a logo image set `{ default, dark, light, alt }`. Local image paths are
11
+ * copied into the output; `http(s)://` and `data:` values pass through. The
12
+ * `alt` text (or `pkg.name`) is used for the `<title>` suffix and image alt.
13
+ */
14
+ siteName?: string | SiteLogo;
15
+ /**
16
+ * Font overrides from `jsdoc.json` (`"opts": { "fonts": { ... } }`). Values
17
+ * are Google Fonts family names for `heading`/`body`; `mono` is a CSS stack.
18
+ */
19
+ fonts?: {
20
+ heading?: string;
21
+ body?: string;
22
+ mono?: string;
23
+ };
24
+ /**
25
+ * Project README as HTML. JSDoc renders the Markdown README (`-R`/`opts.readme`
26
+ * or one found in the source paths) and replaces this with the resulting HTML
27
+ * before calling `publish`. Rendered as the site home page.
28
+ */
29
+ readme?: string;
30
+ /** Path to the tutorials directory (`-u`/`opts.tutorials`); resolved tree arrives as the 3rd `publish` arg. */
31
+ tutorials?: string;
32
+ /**
33
+ * Path to a docs content directory (`jsdoc.json` `"opts": { "docs": "docs/" }`),
34
+ * resolved relative to the cwd. The bridge walks it recursively; each
35
+ * `*.md`/`*.markdown` (and `*.html`) file becomes a prose page at its clean,
36
+ * unprefixed slug (the relative path), grouped by frontmatter/directory. A root
37
+ * `index.md` becomes the home page. Unset → no docs site (today's behavior).
38
+ */
39
+ docs?: unknown;
40
+ /**
41
+ * Top-level doc-group display order (`jsdoc.json` `"opts": { "docGroups": [...] }`).
42
+ * An ordered list of doc-group labels controlling how the doc-group sidebar
43
+ * sections render (after the API sections). Omit for the default order.
44
+ */
45
+ docGroups?: unknown;
46
+ /**
47
+ * Group label assigned to a doc page that carries no frontmatter/directory
48
+ * group (`jsdoc.json` `"opts": { "defaultDocGroup": "Docs" }`). Omit to leave
49
+ * such pages ungrouped.
50
+ */
51
+ defaultDocGroup?: unknown;
52
+ /**
53
+ * Sidebar section order from `jsdoc.json` (`"opts": { "sectionOrder": [...] }`).
54
+ * An ordered list of section labels (e.g. `["Classes", "Tutorials"]`) that both
55
+ * filters and orders the sidebar sections; "Home" and "Source Files" are always
56
+ * shown regardless. Omit (or leave empty) for the default order.
57
+ */
58
+ sectionOrder?: unknown;
59
+ /**
60
+ * Full sidebar menu from `jsdoc.json` (`"opts": { "menu": [...] }`). An ordered
61
+ * list of `{ id, title, href, icon }` entries. When present it takes precedence
62
+ * over `sectionOrder` and controls the entire sidebar (built-ins, sections, and
63
+ * external links). See setu's {@link MenuItem}.
64
+ */
65
+ menu?: unknown;
66
+ /**
67
+ * Club related sidebar entries into prefix-grouped subtrees (`jsdoc.json`
68
+ * `"opts": { "clubSidebarItems": true }`). Groups entries within each section
69
+ * by the path segment before the first `/` (e.g. `queue/*` under a `queue`
70
+ * parent); a prefix with a single entry is left flat. Off by default.
71
+ */
72
+ clubSidebarItems?: unknown;
73
+ /**
74
+ * Custom prompt for the copy-page button's "Open in ChatGPT/Claude/Perplexity"
75
+ * actions (`jsdoc.json` `"opts": { "aiPrompt": "…" }`). `{siteName}`, `{url}`,
76
+ * and `{mdUrl}` (the page's raw Markdown link) placeholders are substituted at
77
+ * click time. Only the prompt + links are sent (the AI fetches `{mdUrl}`), so
78
+ * the query stays short for long docs. Omit for a sensible default.
79
+ */
80
+ aiPrompt?: unknown;
81
+ /**
82
+ * Copy-page button config (`jsdoc.json` `"opts": { "copyPage": … }`). Either a
83
+ * boolean (`false` hides the button) or an object `{ enabled?, actions? }`,
84
+ * where `actions` is an ordered subset of
85
+ * `["copy","view","claude","chatgpt","perplexity"]` (`[]` shows just the
86
+ * primary copy button). Defaults to enabled with all actions.
87
+ */
88
+ copyPage?: unknown;
89
+ /**
90
+ * Inline custom CSS (`jsdoc.json` `"opts": { "customCss": "…" }`), injected as
91
+ * a `<style>` after the theme stylesheet so it can override.
92
+ */
93
+ customCss?: unknown;
94
+ /**
95
+ * Path(s) to custom CSS file(s) (`"opts": { "customCssFile": "a.css" }` or an
96
+ * array). Each file is copied AS-IS (its own bytes) to
97
+ * `_assets/<name>.<hash>.css` and linked after the theme stylesheet. The
98
+ * `<hash>` is a content hash (see `hashCustomAssets`), so an unchanged file
99
+ * keeps a stable, cacheable URL.
100
+ */
101
+ customCssFile?: unknown;
102
+ /**
103
+ * Inline custom JS (`"opts": { "customJs": "…" }`), injected as a classic
104
+ * `<script>` before `</body>`, after the theme's own scripts.
105
+ */
106
+ customJs?: unknown;
107
+ /**
108
+ * Path(s) to custom JS file(s) (`"opts": { "customJsFile": "a.js" }` or an
109
+ * array). Each file is copied AS-IS to `_assets/<name>.<hash>.js` and
110
+ * referenced before `</body>`. See `hashCustomAssets`.
111
+ */
112
+ customJsFile?: unknown;
113
+ /**
114
+ * Whether to append a content hash to copied `customCssFile`/`customJsFile`
115
+ * asset names (`_assets/<name>.<hash>.css`). Defaults to `true` — the hash is
116
+ * derived from the file's content (NOT random), so an unchanged file yields
117
+ * the same URL across builds (cache-friendly) and a changed file cache-busts.
118
+ * Set `false` to copy with the original `<name>.css`/`.js` (no hash).
119
+ */
120
+ hashCustomAssets?: unknown;
121
+ /**
122
+ * JSDoc's default-template source options, read from `conf.templates.default`
123
+ * (or, as a fallback, nested under `opts.templates`):
124
+ * - `outputSourceFiles` — defaults to `true`; set `false` to suppress the
125
+ * per-file source viewer pages and the `Source: file:line` member links.
126
+ * - `sourceLinkToComment` — defaults to `false`. By default a `Source:`
127
+ * link lands on the first line of the declaration; set `true` to point it
128
+ * at the doclet's doc-comment line instead (the pre-v5 behavior).
129
+ */
130
+ templates?: {
131
+ default?: {
132
+ outputSourceFiles?: unknown;
133
+ sourceLinkToComment?: unknown;
134
+ };
135
+ };
136
+ [key: string]: unknown;
137
+ }
138
+ /**
139
+ * Resolve JSDoc's `templates.default.outputSourceFiles` flag. The `opts` arg
140
+ * `publish` receives is `env.opts` — the `opts` block — which does NOT carry the
141
+ * root-level `templates` block, so we probe in priority order and default ON:
142
+ * 1. `require('jsdoc/env').conf.templates.default.outputSourceFiles` (the
143
+ * canonical location at runtime; wrapped in try/catch so a missing
144
+ * `jsdoc/env` — e.g. in unit tests — never throws the build).
145
+ * 2. `opts.templates.default.outputSourceFiles` (in case a user nests it
146
+ * under `opts`).
147
+ * Resolves to `false` ONLY when one of those is exactly `=== false`; otherwise
148
+ * `true` (matching JSDoc's default-template default).
149
+ */
150
+ declare function outputSourceFilesEnabled(opts: JSDocOpts): boolean;
151
+ /**
152
+ * Resolve `templates.default.sourceLinkToComment`. Probed in the same priority
153
+ * order as {@link outputSourceFilesEnabled} (canonical `jsdoc/env` conf, then a
154
+ * nested `opts.templates` fallback). Resolves to `true` ONLY when one of those
155
+ * is exactly `=== true`; otherwise `false` (the default: links jump to code).
156
+ */
157
+ declare function sourceLinkToCommentEnabled(opts: JSDocOpts): boolean;
158
+ /**
159
+ * Validate `opts.sectionOrder` into a clean `string[]`, or `undefined` to fall
160
+ * back to setu's default order. Accepts only an array; trims string entries and
161
+ * drops non-strings/empties. An array that yields no usable labels → `undefined`.
162
+ */
163
+ declare function normalizeSectionOrder(raw: unknown): string[] | undefined;
164
+ /**
165
+ * Validate `opts.menu` into a clean `MenuItem[]`, or `undefined` when there's no
166
+ * usable menu. Accepts only an array of objects; trims string fields. The link
167
+ * URL is read from `link` (preferred) or `href`. Keeps only actionable entries —
168
+ * a built-in (`id`) or an external link (`link`/`href`).
169
+ */
170
+ declare function normalizeMenu(raw: unknown): MenuItem[] | undefined;
171
+ /**
172
+ * Validate `opts.copyPage` into a {@link CopyPageConfig}, or `undefined` to use
173
+ * the defaults (enabled, all actions). Accepts a boolean shorthand (`false`
174
+ * hides the button) or an object: `enabled` is read if boolean; `actions`, if an
175
+ * array, is filtered to the known action ids (preserving order, dropping
176
+ * unknowns/dupes) — an empty/all-invalid array still yields `[]` (primary button
177
+ * only), which is meaningful and kept.
178
+ */
179
+ declare function normalizeCopyPage(raw: unknown): CopyPageConfig | undefined;
180
+ /**
181
+ * Compute project-relative paths for a set of absolute source paths by stripping
182
+ * their longest common directory prefix. Returns a `Map<absPath, relPath>` with
183
+ * `relPath` normalized to forward slashes. Pure + exported for testing.
184
+ *
185
+ * Windows-aware: paths are split on both `/` and `\\`, and segment comparison is
186
+ * case-insensitive (NTFS is case-insensitive, and JSDoc's `meta.path` casing can
187
+ * differ from disk). The single-file case yields just its basename. If the paths
188
+ * share no common leading segment (e.g. different drives / UNC vs. drive), each
189
+ * file falls back to its basename so the index stays sane.
190
+ */
191
+ declare function computeRelPaths(absPaths: readonly string[]): Map<string, string>;
192
+ /**
193
+ * Recursively walk a docs directory and read each Markdown/HTML file into a
194
+ * {@link DocInput} for setu's docs front-end. Mirrors {@link collectSourceFiles}'s
195
+ * safe-probe style:
196
+ *
197
+ * - `path` is the file path relative to `dir`, POSIX-normalized (forward slashes)
198
+ * with the extension stripped (`<dir>/guides/advanced.md` → `'guides/advanced'`,
199
+ * `<dir>/index.md` → `'index'`).
200
+ * - `content` is the raw UTF-8 text (frontmatter stays embedded — setu parses it).
201
+ * - `type` is `'markdown'` for `.md`/`.markdown`, `'html'` for `.html`/`.htm`.
202
+ *
203
+ * Resilient by design: a missing/unreadable directory yields `[]` (never throws);
204
+ * dotfiles/dot-dirs and `node_modules`-like noise are skipped; a single
205
+ * unreadable file is warned about and skipped. Results are sorted by `path` so
206
+ * the output is stable build-to-build. Setu does no I/O — this is the only place
207
+ * the docs tree is read.
208
+ */
209
+ declare function collectDocs(dir: string): Promise<DocInput[]>;
210
+ /**
211
+ * Validate `opts.docGroups` into a clean `string[]`, or `undefined` to fall back
212
+ * to setu's default doc-group order. Mirrors {@link normalizeSectionOrder}:
213
+ * accepts only an array; trims string entries and drops non-strings/empties.
214
+ */
215
+ declare function normalizeDocGroups(raw: unknown): string[] | undefined;
216
+ declare function publish(data: unknown, opts: JSDocOpts, tutorials?: unknown): Promise<void>;
217
+
218
+ export { collectDocs, computeRelPaths, normalizeCopyPage, normalizeDocGroups, normalizeMenu, normalizeSectionOrder, outputSourceFilesEnabled, publish, sourceLinkToCommentEnabled };