import { z } from "zod"; import { ComponentType } from "preact"; //#region src/doclet-schema.d.ts declare const EventRefSchema: z.ZodString; type TEventRef = z.infer; declare const PackageRefSchema: z.ZodString; type TPackageRef = z.infer; declare const DocletMetaCodeSchema: z.ZodObject<{ funcscope: z.ZodOptional; id: z.ZodOptional; name: z.ZodOptional; node: z.ZodOptional>; paramnames: z.ZodOptional>; type: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>; type TDocletMetaCode = z.infer; declare const DocletMetaSchema: z.ZodObject<{ code: z.ZodOptional; id: z.ZodOptional; name: z.ZodOptional; node: z.ZodOptional>; paramnames: z.ZodOptional>; type: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>; columnno: z.ZodOptional; filename: z.ZodOptional; lineno: z.ZodOptional; path: z.ZodOptional; range: z.ZodOptional>; vars: z.ZodOptional>; }, z.core.$strip>; type TDocletMeta = z.infer; declare const DocletTypePropertySchema: z.ZodObject<{ expression: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>; type TDocletTypeProperty = z.infer; declare const DocletParamSchema: z.ZodObject<{ defaultvalue: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>; type TDocletParam = z.infer; /** * A generic type parameter (``). JSDoc has no native * concept of these, so the JSDoc bridge never populates `typeParams`; the * TypeDoc bridge fills it from each reflection's `typeParameters` so generics * render as a structured "Type Parameters" section instead of only living in the * signature string. `constraint` (the `extends` bound) and `default` are type * expressions kept as plain strings. */ declare const DocletTypeParamSchema: z.ZodObject<{ name: z.ZodString; constraint: z.ZodOptional; default: z.ZodOptional; description: z.ZodOptional>; }, z.core.$strip>; type TDocletTypeParam = z.infer; /** * One *additional* call signature of an overloaded function/method, beyond the * first. JSDoc has no overloads, so only the TypeDoc bridge populates * `overloads` (from `reflection.signatures[1..]`); the first signature stays on * the doclet's own `typeParams`/`params`/`returns`, so non-overloaded output is * unchanged. Each carries just the per-signature data that differs — generics, * parameters, return type, and an optional signature-specific description. */ declare const DocletOverloadSchema: z.ZodObject<{ typeParams: z.ZodOptional; default: z.ZodOptional; description: z.ZodOptional>; }, z.core.$strip>>>; params: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; returns: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; description: z.ZodOptional>; }, z.core.$strip>; type TDocletOverload = z.infer; declare const DocletEnumPropertySchema: z.ZodObject<{ comment: z.ZodOptional; defaultvalue: z.ZodOptional; description: z.ZodOptional>; kind: z.ZodLiteral<"member">; longname: z.ZodOptional; memberof: z.ZodOptional; meta: z.ZodOptional; id: z.ZodOptional; name: z.ZodOptional; node: z.ZodOptional>; paramnames: z.ZodOptional>; type: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>; columnno: z.ZodOptional; filename: z.ZodOptional; lineno: z.ZodOptional; path: z.ZodOptional; range: z.ZodOptional>; vars: z.ZodOptional>; }, z.core.$strip>>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; scope: z.ZodLiteral<"static">; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>; type TDocletEnumProperty = z.infer; declare const DocletKindSchema: z.ZodEnum<{ function: "function"; file: "file"; enum: "enum"; variable: "variable"; member: "member"; class: "class"; constant: "constant"; event: "event"; external: "external"; interface: "interface"; mixin: "mixin"; module: "module"; namespace: "namespace"; package: "package"; param: "param"; typedef: "typedef"; }>; type TDocletKind = z.infer; declare const DocletScopeSchema: z.ZodEnum<{ static: "static"; global: "global"; inner: "inner"; instance: "instance"; }>; type TDocletScope = z.infer; declare const DocletAccessSchema: z.ZodEnum<{ package: "package"; private: "private"; protected: "protected"; public: "public"; }>; type TDocletAccess = z.infer; declare const DocletTagSchema: z.ZodObject<{ originalTitle: z.ZodOptional; text: z.ZodOptional; title: z.ZodOptional; value: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>]>>; }, z.core.$strip>; type TDocletTag = z.infer; declare const DocletSchema: z.ZodObject<{ access: z.ZodOptional>; alias: z.ZodOptional; async: z.ZodOptional; augments: z.ZodOptional>; author: z.ZodOptional>; borrowed: z.ZodOptional; from: z.ZodOptional; }, z.core.$strip>>>; classdesc: z.ZodOptional; comment: z.ZodOptional; copyright: z.ZodOptional; defaultvalue: z.ZodOptional; defaultvaluetype: z.ZodOptional>; deprecated: z.ZodOptional>; description: z.ZodOptional>; examples: z.ZodOptional>; exceptions: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; extends: z.ZodOptional>; fires: z.ZodOptional>; forceMemberof: z.ZodOptional>; generator: z.ZodOptional; hideconstructor: z.ZodOptional; ignore: z.ZodOptional; implementations: z.ZodOptional>; implements: z.ZodOptional>; implementationOf: z.ZodOptional; inheritdoc: z.ZodOptional; inherited: z.ZodOptional; inherits: z.ZodOptional; isEnum: z.ZodOptional; isAccessor: z.ZodOptional; kind: z.ZodOptional>; license: z.ZodOptional; listens: z.ZodOptional>; longname: z.ZodOptional; memberof: z.ZodOptional; meta: z.ZodOptional; id: z.ZodOptional; name: z.ZodOptional; node: z.ZodOptional>; paramnames: z.ZodOptional>; type: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>; columnno: z.ZodOptional; filename: z.ZodOptional; lineno: z.ZodOptional; path: z.ZodOptional; range: z.ZodOptional>; vars: z.ZodOptional>; }, z.core.$strip>>; mixed: z.ZodOptional; mixes: z.ZodOptional>; modifies: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; override: z.ZodOptional; overrides: z.ZodOptional; overloads: z.ZodOptional; default: z.ZodOptional; description: z.ZodOptional>; }, z.core.$strip>>>; params: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; returns: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; description: z.ZodOptional>; }, z.core.$strip>>>; params: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; preserveName: z.ZodOptional; properties: z.ZodOptional; defaultvalue: z.ZodOptional; description: z.ZodOptional>; kind: z.ZodLiteral<"member">; longname: z.ZodOptional; memberof: z.ZodOptional; meta: z.ZodOptional; id: z.ZodOptional; name: z.ZodOptional; node: z.ZodOptional>; paramnames: z.ZodOptional>; type: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>; columnno: z.ZodOptional; filename: z.ZodOptional; lineno: z.ZodOptional; path: z.ZodOptional; range: z.ZodOptional>; vars: z.ZodOptional>; }, z.core.$strip>>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; scope: z.ZodLiteral<"static">; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ defaultvalue: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>]>>>; readonly: z.ZodOptional; remarks: z.ZodOptional; requires: z.ZodOptional>; returns: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; scope: z.ZodOptional>; see: z.ZodOptional>; since: z.ZodOptional; summary: z.ZodOptional; tags: z.ZodOptional; text: z.ZodOptional; title: z.ZodOptional; value: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>]>>; }, z.core.$strip>>>; this: z.ZodOptional; todo: z.ZodOptional>; tutorials: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; typeParams: z.ZodOptional; default: z.ZodOptional; description: z.ZodOptional>; }, z.core.$strip>>>; undocumented: z.ZodOptional; variable: z.ZodOptional>; variation: z.ZodOptional; version: z.ZodOptional; virtual: z.ZodOptional; yields: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; type TDoclet = z.infer; declare const TContactInfoSchema: z.ZodObject<{ email: z.ZodOptional; name: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>; type TContactInfo = z.infer; declare const TBugsInfoSchema: z.ZodObject<{ email: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>; type TBugsInfo = z.infer; declare const PackageDocletSchema: z.ZodObject<{ author: z.ZodOptional; name: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>]>>; bugs: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>]>>; contributors: z.ZodOptional; name: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>]>>>; dependencies: z.ZodOptional>; description: z.ZodOptional; devDependencies: z.ZodOptional>; engines: z.ZodOptional>; files: z.ZodOptional>; homepage: z.ZodOptional; keywords: z.ZodOptional>; kind: z.ZodLiteral<"package">; licenses: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>>>; longname: z.ZodOptional; main: z.ZodOptional; name: z.ZodOptional; repository: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>>; version: z.ZodOptional; }, z.core.$strip>; type TPackageDoclet = z.infer; declare const DocletListSchema: z.ZodArray>; alias: z.ZodOptional; async: z.ZodOptional; augments: z.ZodOptional>; author: z.ZodOptional>; borrowed: z.ZodOptional; from: z.ZodOptional; }, z.core.$strip>>>; classdesc: z.ZodOptional; comment: z.ZodOptional; copyright: z.ZodOptional; defaultvalue: z.ZodOptional; defaultvaluetype: z.ZodOptional>; deprecated: z.ZodOptional>; description: z.ZodOptional>; examples: z.ZodOptional>; exceptions: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; extends: z.ZodOptional>; fires: z.ZodOptional>; forceMemberof: z.ZodOptional>; generator: z.ZodOptional; hideconstructor: z.ZodOptional; ignore: z.ZodOptional; implementations: z.ZodOptional>; implements: z.ZodOptional>; implementationOf: z.ZodOptional; inheritdoc: z.ZodOptional; inherited: z.ZodOptional; inherits: z.ZodOptional; isEnum: z.ZodOptional; isAccessor: z.ZodOptional; kind: z.ZodOptional>; license: z.ZodOptional; listens: z.ZodOptional>; longname: z.ZodOptional; memberof: z.ZodOptional; meta: z.ZodOptional; id: z.ZodOptional; name: z.ZodOptional; node: z.ZodOptional>; paramnames: z.ZodOptional>; type: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>; columnno: z.ZodOptional; filename: z.ZodOptional; lineno: z.ZodOptional; path: z.ZodOptional; range: z.ZodOptional>; vars: z.ZodOptional>; }, z.core.$strip>>; mixed: z.ZodOptional; mixes: z.ZodOptional>; modifies: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; override: z.ZodOptional; overrides: z.ZodOptional; overloads: z.ZodOptional; default: z.ZodOptional; description: z.ZodOptional>; }, z.core.$strip>>>; params: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; returns: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; description: z.ZodOptional>; }, z.core.$strip>>>; params: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; preserveName: z.ZodOptional; properties: z.ZodOptional; defaultvalue: z.ZodOptional; description: z.ZodOptional>; kind: z.ZodLiteral<"member">; longname: z.ZodOptional; memberof: z.ZodOptional; meta: z.ZodOptional; id: z.ZodOptional; name: z.ZodOptional; node: z.ZodOptional>; paramnames: z.ZodOptional>; type: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>; columnno: z.ZodOptional; filename: z.ZodOptional; lineno: z.ZodOptional; path: z.ZodOptional; range: z.ZodOptional>; vars: z.ZodOptional>; }, z.core.$strip>>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; scope: z.ZodLiteral<"static">; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ defaultvalue: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>]>>>; readonly: z.ZodOptional; remarks: z.ZodOptional; requires: z.ZodOptional>; returns: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; scope: z.ZodOptional>; see: z.ZodOptional>; since: z.ZodOptional; summary: z.ZodOptional; tags: z.ZodOptional; text: z.ZodOptional; title: z.ZodOptional; value: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>]>>; }, z.core.$strip>>>; this: z.ZodOptional; todo: z.ZodOptional>; tutorials: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; typeParams: z.ZodOptional; default: z.ZodOptional; description: z.ZodOptional>; }, z.core.$strip>>>; undocumented: z.ZodOptional; variable: z.ZodOptional>; variation: z.ZodOptional; version: z.ZodOptional; virtual: z.ZodOptional; yields: z.ZodOptional; description: z.ZodOptional>; name: z.ZodOptional; nullable: z.ZodOptional>; optional: z.ZodOptional>; type: z.ZodOptional; names: z.ZodArray; }, z.core.$strip>>; variable: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ author: z.ZodOptional; name: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>]>>; bugs: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>]>>; contributors: z.ZodOptional; name: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>]>>>; dependencies: z.ZodOptional>; description: z.ZodOptional; devDependencies: z.ZodOptional>; engines: z.ZodOptional>; files: z.ZodOptional>; homepage: z.ZodOptional; keywords: z.ZodOptional>; kind: z.ZodLiteral<"package">; licenses: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>>>; longname: z.ZodOptional; main: z.ZodOptional; name: z.ZodOptional; repository: z.ZodOptional; url: z.ZodOptional; }, z.core.$strip>>; version: z.ZodOptional; }, z.core.$strip>]>>; type TDocletList = z.infer; declare function isPackageDoclet(doclet: unknown): doclet is TPackageDoclet; declare function isDoclet(doclet: unknown): doclet is TDoclet; //#endregion //#region src/salty.d.ts interface TJSDocSaltyMetadata { ___id: string; ___s: boolean; } interface TJSDocSaltyCollection { (query?: Partial | object | ((record: T & TJSDocSaltyMetadata) => boolean)): TJSDocSaltyCollection; get(): (T & TJSDocSaltyMetadata)[]; first(): (T & TJSDocSaltyMetadata) | false; last(): (T & TJSDocSaltyMetadata) | false; count(): number; insert(data: T | T[]): TJSDocSaltyCollection; update(values: Partial): TJSDocSaltyCollection; remove(): number; each(callback: (record: T & TJSDocSaltyMetadata, index: number) => void | false): TJSDocSaltyCollection; map(callback: (record: T & TJSDocSaltyMetadata, index: number) => U): U[]; order(sortString: string): TJSDocSaltyCollection; /** In-place sort on the underlying items array (e.g. "name asc, version desc") */ sort(keys: string): boolean; limit(n: number): TJSDocSaltyCollection; distinct(key: keyof T): TJSDocSaltyCollection[]; select(...keys: (keyof T)[]): TJSDocSaltyCollection[][]; } //#endregion //#region src/site/page.d.ts /** * Page-level types — one `Page` per top-level symbol (class, module, namespace, * mixin, interface, typedef) plus index/guide pages. See architecture Q2. */ /** * Kind of page; drives URL grouping, layout choice, and sidebar bucketing. * * `enum` / `function` / `variable` are standalone-page kinds the TypeDoc bridge * produces under the `'typedoc'` flavor (to match default TypeDoc, where these * are first-class entities with their own pages). The JSDoc bridge never emits * them — it keeps demoting enums/functions/variables to members — so JSDoc * output is unchanged. */ type PageKind = 'class' | 'module' | 'namespace' | 'mixin' | 'interface' | 'typedef' | 'enum' | 'function' | 'variable' | 'global' | 'index' | 'guide' | 'source'; /** * YAML-style frontmatter for an MDX page. Open-ended via the index signature so * authors can attach arbitrary metadata (e.g. SEO hints) without losing types. */ interface Frontmatter { title: string; kind: PageKind; /** JSDoc longname (e.g. `module:foo~Bar#method`). */ longname?: string; description?: string; /** * Sort order within `group`. For API pages this originates from a standalone * `@order N` tag or the `@category … order=` option; for docs/tutorials from * frontmatter `order`. Unset sorts last (alphabetically). */ order?: number; /** * Sidebar group label. May be a `/`-path to nest the page in the sidebar * (`"Core/Parsing"` → group `Core` ▸ subgroup `Parsing`); the first segment is * the top-level group. Populated from an API `@category` tag or a doc/tutorial * page's frontmatter group. */ group?: string; /** If true, omit from nav + search but still render. */ hidden?: boolean; [key: string]: unknown; } /** * A rendered heading within a page; used by the TOC island. `depth` is normally * h2..h6 — a page's single h1 is its title, kept out of the TOC. `depth: 1` only * appears when a page has *multiple* h1s (the author is using h1 as section * structure, not as a title), in which case they're surfaced like any other. */ interface Heading { depth: 1 | 2 | 3 | 4 | 5 | 6; text: string; /** Slug computed via `slugifyHeading` so anchors match sidebar links. */ id: string; } /** One emitted page. `body` is always an MDX string; `mdast` is optional. */ interface Page { /** Slug relative to site root — no leading slash, no `.html`. */ slug: string; frontmatter: Frontmatter; /** MDX source string (compiled by dwar at render time). */ body: string; /** Optional mdast tree; useful for in-process passes that want structured data. */ mdast?: import('mdast').Root; /** Pre-extracted headings so dwar can render a TOC without re-parsing. */ headings?: Heading[]; /** * Raw source for a `kind: 'source'` viewer page. When present, dwar renders * this file in a read-only editor island instead of compiling `body` as MDX * (so `body` is `''` for these pages). */ source?: { code: string; language: string; filename: string; }; } //#endregion //#region src/site/manifest.d.ts /** Recursive nav tree node. Leaves have `slug`; branches have `children`. */ interface NavNode { label: string; slug?: string; children?: NavNode[]; /** Optional grouping label; sibling nodes sharing a group render together. */ group?: string; /** Sort order within siblings. */ order?: number; /** * TypeDoc-only: when set on a branch node, the sidebar auto-opens it if ANY * descendant (not just a direct child) is the current page. JSDoc never sets * this — its branches keep the legacy direct-children-only auto-open check, so * JSDoc SSR output stays byte-identical. See rang's `NavEntry`. */ deepExpand?: boolean; /** * Absolute URL for an external menu link (e.g. a GitHub/npm link). Mutually * exclusive with `slug`; when set, the entry opens in a new tab. */ href?: string; /** True for an external link entry (`href` set) — render with `target="_blank"`. */ external?: boolean; /** * Link `target` attribute for a menu entry (e.g. `_blank`, `_self`). When * omitted, an external entry still defaults to `_blank`; an internal one omits * the attribute. */ target?: string; /** Extra CSS class(es) merged onto a menu entry's rendered link. */ class?: string; /** * Icon for the entry (menu items only), as a prefixed `source:code` string: * `simpleicons:` renders the `cdn.simpleicons.org` glyph painted with * the `fg` theme token (CSS-masked, so it swaps light/dark on its own), and * `lucide:` renders from the bundled lucide set (`home`, * `code-xml`, `globe`, `mail`, `external-link`; an unknown name → * `external-link`). */ icon?: string; /** * True for a top-region menu entry. The sidebar renders all menu entries above * the API sections, with a divider between. */ menu?: boolean; } /** * A single entry in the fuzzy search index the `cmdk` palette fetches. * * A page entry has `slug` = the page slug and `title` = the page title; a * **member entry** has `slug` = `page#heading-anchor` (a deep link to a member / * field / method heading), `title` = the member name, and `context` = the parent * page title. `description` + `content` are matched (so README prose, member * descriptions, and identifiers are all findable), not just the title; `excerpt` * is shown under page hits. */ interface SearchEntry { slug: string; title: string; /** Short plain-text snippet shown under a page hit. */ excerpt?: string; /** Page/member description — matched, and used as a member hit's subtitle. */ description?: string; /** Full plain-text body (identifiers preserved) — matched, never displayed. */ content?: string; /** For a member entry, the parent page title (shown as the hit's context). */ context?: string; } /** * One translatable API string in the locale-independent template setu emits. * * Every translatable doclet prose field (a description, a `@summary`, an * `@example` caption) becomes a slot keyed by the symbol's longname + field path * (bhasha's `apiSlotKey`). The slot carries the default-locale `sourceText` and a * content `hash` (bhasha's `sourceHash`) so aadesh can extract a catalog skeleton * and detect when a source string drifts (stale translation). Locale-invariant: * the same slot key appears on every build of the same symbol+field, so a * translation tracks its source across rebuilds. Names, type strings, enum * values, and `@example` code are NOT slots — they stay locale-invariant. */ interface SlotEntry { /** Stable catalog key — `api.#` (bhasha `apiSlotKey`). */ key: string; /** The default-locale source string this slot renders (HTML or Markdown). */ sourceText: string; /** Content hash of `sourceText` (bhasha `sourceHash`) for staleness detection. */ hash: string; } /** What setu hands to dwar. Self-contained: dwar should not re-read the doclet DB. */ interface SiteManifest { pages: Page[]; nav: NavNode[]; /** Package.json fields exposed for rendering (header, footer, OG tags, ...). */ pkg?: { name?: string; version?: string; description?: string; repository?: string; homepage?: string; }; /** Stable per-build identifier (e.g. timestamp + content hash) for cache busting. */ buildId: string; /** * The translatable API slots collected during this build — the * locale-independent template aadesh extracts catalogs from. setu always * populates it (possibly empty); dwar ignores it. A build *stamped* for a * locale carries the same slot set (keys/sources are locale-invariant); only * the page bodies differ. See {@link SlotEntry}. */ slots?: SlotEntry[]; /** * Top-level sidebar section labels that render as collapse toggles (the * resolved `collapsibleSidebarSections` opt). Populated by setu (default: all * present sections). dwar threads it into the sidebar/mobile-nav island props; * rang renders a header as a toggle when its label is in this list. An empty * list means every header is static (today's behavior). */ collapsibleGroups?: string[]; } /** Current schema version of the {@link ExtractManifest}. */ declare const EXTRACT_MANIFEST_VERSION = 1; /** * The minimal artifact the theme's localization **extract mode** writes to disk * for aadesh: just the translatable API slot template (chrome strings come from * bhasha's catalog, so they aren't duplicated here). aadesh spawns the jsdoc/ * typedoc pipeline with the theme signaled to emit this — instead of rendering — * then builds the per-locale catalogs from it. Regenerate-on-build, never * committed. See the localization plan, §4. */ interface ExtractManifest { /** Schema version ({@link EXTRACT_MANIFEST_VERSION}). */ version: number; /** The translatable API slots (longname+field keyed, with source + hash). */ slots: SlotEntry[]; } /** Project a built {@link SiteManifest} down to the {@link ExtractManifest} aadesh reads. */ declare function toExtractManifest(manifest: SiteManifest): ExtractManifest; /** Current schema version of the {@link BuildSpec}. */ declare const BUILD_SPEC_VERSION = 1; /** * The per-locale render instruction aadesh writes for the theme's **build mode** * (the localization plan §4: "template + filled catalogs → setu stamp → dwar * render → per-locale sites"). aadesh spawns the pipeline once per locale with * the theme pointed at this spec; the theme stamps the API translations * (`setu.stampSite`) and renders to `destination` with `basePath`. The default * locale renders unprefixed (`basePath: '/'`); others under `/`. */ interface BuildSpec { /** Schema version ({@link BUILD_SPEC_VERSION}). */ version: number; /** Locale code being rendered. */ locale: string; /** Default locale code — the fallback for untranslated chrome/API. */ defaultLocale: string; /** * `api.*` key → translated string, fed to `setu.stampSite`. Empty/omitted * entries fall back to the source text. The default locale typically passes * `{}` (identity → live source). */ apiMessages: Record; /** * `chrome.*` key → translated UI string, fed to dwar's `RenderOptions.locale` * so chrome renders in the locale (SSR + island seeding). The default locale * typically passes `{}` (identity → English fallback). */ chromeMessages: Record; /** Output directory for this locale's site. */ destination: string; /** Base-path prefix for this locale's links — `/`, or `/` for the default. */ basePath: string; /** * The UN-prefixed site base path (the default locale's base), for the language * switcher's cross-locale URLs. Same across every locale in the build. */ siteBasePath: string; /** All configured locales (code + optional display name) — feeds the switcher. */ locales: Array<{ code: string; name?: string; }>; /** * Absolute path of this locale's docs-overlay directory (a sibling * `docs./` of the configured `opts.docs`), when one exists. The bridge * overlays its files over the default docs by path — a translated doc wins, a * missing one falls back to the default. Omitted when the locale has no overlay * (the default-locale + untranslated locales render the default docs). */ docsDir?: string; } //#endregion //#region src/site/llms.d.ts /** Resolved `llmsTxt` options — every field defaulted by `validateLlmsTxt`. */ interface LlmsTxtConfig { /** Also emit `llms-full.txt` (every page's Markdown concatenated). */ full: boolean; /** * How API-reference pages are treated. `true` lists them with descriptions and * includes their bodies in `llms-full.txt`; `'index'` lists them as a bare * index (no descriptions) and omits their bodies from `llms-full.txt`; `false` * omits them from both files. */ api: boolean | 'index'; } /** * Page kinds that count as API reference — everything setu derives from doclets. * `index`/`guide` (home, README, docs, tutorials) and `source` are NOT API. */ declare const API_PAGE_KINDS: readonly PageKind[]; //#endregion //#region src/site/site-name.d.ts /** * Site name / logo contract. `siteName` is either plain text (shown in the * header, footer, and `` suffix) or a logo image set with per-theme * sources. */ /** * A logo image set. Values are image sources — a URL, a `data:` URI, or (when * processed by the bridge) a path it copies into the output. At least one key * must be set for a logo to render. */ interface SiteLogo { /** Used when the active theme has no dedicated image. */ default?: string; /** Used under the dark theme (falls back to `default`). */ dark?: string; /** Used under the light theme (falls back to `default`). */ light?: string; /** * Text label for the logo — used as the image `alt` and the `<title>` (browser * tab) suffix. Falls back to `pkg.name` when omitted. */ alt?: string; } /** Either plain text or a per-theme logo image set. */ type SiteName = string | SiteLogo; /** * Text label for the site — used for the `<title>` suffix, image `alt`, and the * footer when no logo applies. Returns the string form directly; for a logo set * its `alt`, then the supplied fallback (typically `pkg.name`). */ declare function siteNameText(siteName: SiteName | undefined, fallback?: string): string | undefined; /** * Resolve the per-theme logo sources, or `null` when `siteName` carries no * image (plain text or an empty set). Each theme falls back to `default`, then * to the other theme's image, so a single supplied image is reused everywhere * rather than leaving a theme with no logo. */ declare function resolveSiteLogo(siteName: SiteName | undefined): { light: string; dark: string; } | null; //#endregion //#region src/site/theme.d.ts /** A single color palette. Values may be any CSS color (the theme uses oklch). */ interface ThemeColors { bg: string; bgMuted: string; fg: string; fgMuted: string; accent: string; accentFg: string; border: string; /** Code-block header strip background. Optional — defaults to a neutral surface. */ codeHeaderBg?: string; /** Code-block header label text (the `CODE`/filename label). Optional. */ codeHeaderFg?: string; /** Highlighted code-line background (`@playground` / `highlight=`). Optional. */ codeHighlightBg?: string; } /** Visual design tokens consumed by both Tailwind generation and runtime themes. */ interface ThemeTokens { /** The light-mode palette (also the `:root` default). */ colors: ThemeColors; /** * Explicit dark-mode palette, emitted under `[data-theme="dark"]`. Any omitted * key falls back to the corresponding `colors` value. When absent entirely, * dark mode falls back to a bg/fg swap of `colors`. */ darkColors?: Partial<ThemeColors>; fonts: { /** Google Fonts family name for headings, e.g. `"Source Serif 4"`. */ heading: string; /** Google Fonts family name for body text, e.g. `"Roboto"`. */ body: string; /** Monospace font-family stack. Not loaded from Google Fonts. */ mono: string; }; shiki: { light: string; dark: string; }; /** Path or URL to a logo image. */ logo?: string; /** * Site identity shown in the header, footer, and `<title>` suffix. Either * plain text, or a per-theme logo image set (`{ default, dark, light }`). */ siteName?: SiteName; } /** * A single custom `<meta>` tag, expressed as its attribute map — each key/value * pair becomes one HTML attribute (`{ name, content }`, `{ property, content }`, * `{ "http-equiv", content }`, `{ charset }`, …). Emitted into `<head>` on every * page (see `ThemeConfig.meta`). */ type MetaTag = Record<string, string>; /** * One selectable action in the copy-page button's dropdown, in render order: * `copy` (copy markdown), `view` (open the .md), and the "Open in …" links. */ type CopyPageAction = 'copy' | 'view' | 'claude' | 'chatgpt' | 'perplexity'; /** * Scrollbar presentation mode (see `ThemeConfig.scrollbar`): * - `styled` — overlay bar, invisible at rest, painting only while scrolling * (`.clean-scrolling`) or on hover. The default. * - `visible` — the same thin themed bar, but always shown (no idle-hide). * - `native` — no scrollbar styling; the browser's own scrollbar (issue #281). */ type ScrollbarMode = 'styled' | 'visible' | 'native'; /** Copy-page button configuration. */ interface CopyPageConfig { /** Whether to render the button at all. Defaults to `true`. */ enabled?: boolean; /** * Which dropdown actions to show, in order. Omit for all of them; pass a * subset to trim the menu (e.g. drop `view` or `claude`); pass `[]` to show * just the primary "Copy page" button with no dropdown. */ actions?: CopyPageAction[]; } /** * Previous/next page navigation configuration. The footer pager links each * content page to its neighbors in sidebar reading order. */ interface PageNavConfig { /** Whether to render the prev/next pager at all. Defaults to `true`. */ enabled?: boolean; } /** The code-playground providers an `@example` / prose fence can be opened in. */ type PlaygroundProvider = 'codepen' | 'jsfiddle' | 'codesandbox'; /** * Code-playground configuration. `enabled` gates the feature; the per-provider * records are the **site-wide** runtime options forwarded to each provider when * a code block is opened (CodePen `js_external`/`js_pre_processor`/…, JSFiddle * `resources`/`wrap`, CodeSandbox dependencies). They're passed verbatim to the * browser island via dwar's page payload — there are no per-example overrides at * this layer (a block only picks *which* providers). */ interface PlaygroundConfig { /** Whether the playground feature is active at all. */ enabled?: boolean; /** Site-wide CodePen "define" prefill options. */ codepen?: Record<string, unknown>; /** Site-wide JSFiddle post options. */ jsfiddle?: Record<string, unknown>; /** Site-wide CodeSandbox define options. */ codesandbox?: Record<string, unknown>; } /** * Component override: either a Preact component, or a file path (string) that * dwar will compile + import at render time. See Q8. */ type Override<P> = ComponentType<P> | string; /** Optional per-slot component overrides. Anything omitted uses rang's default. */ interface ComponentOverrides { Sidebar?: Override<unknown>; TOC?: Override<unknown>; Header?: Override<unknown>; Footer?: Override<unknown>; Layout?: Override<unknown>; /** MDX component map — keys are MDX element names (e.g. `h1`, `code`, `Callout`). */ mdxComponents?: Record<string, ComponentType<any>>; } /** Top-level theme configuration handed to dwar.render. */ interface ThemeConfig { tokens: ThemeTokens; components?: ComponentOverrides; /** Sidebar layout strategy. */ sidebarLayout?: 'tree' | 'flat'; /** Base path under which the site is served (e.g. `/docs/`). */ basePath?: string; /** * Favicon URL, emitted as `<link rel="icon">` in every page's `<head>`. This * is the **resolved** href: the opts layer accepts a file path, but the bridge * copies it to a content-hashed `_assets/` asset and threads only the served * URL here, so `render()` stays pure (no file I/O). dwar derives the link * `type` from the extension (`.svg` → `image/svg+xml`, …). Omit for none — an * SVG favicon needs this link (browsers only auto-discover a root `favicon.ico`). */ favicon?: string; /** * Custom prompt for the copy-page button's "Open in ChatGPT/Claude/Perplexity" * actions. `{siteName}`, `{url}`, and `{mdUrl}` (the page's raw Markdown link) * placeholders are substituted at click time. Only the prompt + links are sent * (never the page body — the AI fetches `{mdUrl}`). Omit for a sensible default. */ aiPrompt?: string; /** Copy-page button config (enabled + which dropdown actions). Defaults to on, all actions. */ copyPage?: CopyPageConfig; /** * Previous/next page pager shown at the foot of each content page, linking to * the adjacent pages in sidebar reading order. Defaults to on; pass * `{ enabled: false }` to opt out. */ pageNav?: PageNavConfig; /** * Scrollbar presentation. `styled` (default) is the overlay bar that hides at * rest; `visible` keeps the themed bar always shown; `native` disables all * scrollbar styling and uses the browser's own scrollbar. dwar sets a * `data-scrollbar` attribute on `<html>` from this and (in `styled` only) * injects the idle-hide script. Omit for `styled`. */ scrollbar?: ScrollbarMode; /** * Code-playground config: which providers a code block can be opened in * (CodePen / JSFiddle / CodeSandbox) plus their site-wide runtime options. * dwar serializes this into a per-page JSON payload the `playground` island * reads — so `render()` stays pure (it only serializes config it's handed). * Omit (or `{ enabled: false }`) to leave the feature off. */ playground?: PlaygroundConfig; /** * Author-supplied footer HTML, rendered into rang's footer slot in place of * the default `Footer` on every page. This is the **resolved** value: the * opts layer accepts `string | { file }`, but the bridge reads the file form * from disk and threads only the final string here, so `render()` stays pure. * Trusted, author-controlled HTML (rendered verbatim, like v4's * `theme_opts.footer`); style it via `customCss`/`customCssLinks`. Omit for * the default footer. */ footer?: string; /** * Site-wide custom `<meta>` tags, emitted into every page's `<head>`. Each * entry is an attribute map (`{ name, content }`, `{ property, content }`, * etc.). dwar emits its own defaults (charset, viewport, the auto * description) first, then these — de-duping by identifying attribute * (`name` / `property` / `http-equiv` / `charset`) so an author tag replaces * the theme's competing default rather than duplicating it. Values are * escaped; invalid attribute names are dropped. Site-wide (no per-page meta). */ meta?: MetaTag[]; /** * Inline custom CSS. Emitted as a `<style>` in `<head>` AFTER the theme * stylesheet (and after any `customCssLinks`), so it can override theme * styles. Raw CSS — not escaped beyond a `</style>` break-out guard. */ customCss?: string; /** * Stylesheet hrefs to `<link>` in `<head>`, after the theme stylesheet (so * they can override). For custom CSS files: the bridge copies each file to a * content-hashed asset (`_assets/<name>.<hash>.css`) and passes its served * href here — so `render()` stays pure (no file I/O) and an unchanged file * keeps a stable, cacheable URL. Linked in array order. */ customCssLinks?: string[]; /** * Inline custom JS. Emitted as a classic `<script>` just before `</body>`, * after the theme's own scripts. Raw JS — guarded only against a `</script>` * break-out. */ customJs?: string; /** * Script srcs to reference (classic `<script src>`) just before `</body>`, * after the theme's own scripts. For custom JS files: the bridge copies each * to a content-hashed asset (`_assets/<name>.<hash>.js`) and passes its href * here. Referenced in array order. */ customJsLinks?: string[]; } //#endregion //#region src/site/render.d.ts /** A single emitted file. `path` is forward-slash, relative to destination root. */ interface OutputFile { path: string; contents: string | Uint8Array; } /** A page that failed to render and was skipped, with the reason. */ interface RenderError { /** Slug of the page that failed. */ slug: string; /** The error message (e.g. an MDX compile failure). */ message: string; /** 1-based source line of the failure, when the error carries a position. */ line?: number; /** 1-based source column of the failure (best-effort — see issue #333 spec). */ column?: number; /** A few numbered lines of `page.body` around the failure, with a caret. */ snippet?: string; } /** * A non-fatal authoring issue found while rendering a page — e.g. an unbalanced * inline-code backtick. Unlike a {@link RenderError} the page still renders; the * bridge surfaces these so the author can fix the source. Same positional shape * as `RenderError`, so {@link formatRenderError} prints both identically. */ interface RenderWarning { /** Slug of the page the issue was found on. */ slug: string; /** Human-readable description of the issue. */ message: string; /** 1-based source line in `page.body`, when known. */ line?: number; /** 1-based source column in `page.body`, when known (best-effort). */ column?: number; /** A few numbered lines of `page.body` around the issue, with a caret. */ snippet?: string; } /** * Format one skipped-page {@link RenderError} (or a {@link RenderWarning}, which * has the same shape) for a build log, so both bridges (JSDoc + TypeDoc) print * them identically. A positioned entry shows `slug (line L:C): message` followed * by its indented code-frame snippet; an unpositioned one falls back to the * legacy `slug: message` single line. */ declare function formatRenderError(error: RenderError | RenderWarning, indent?: string): string; /** Aggregated result returned by `dwar.render`. Pure — no I/O is performed here. */ interface RenderResult { files: OutputFile[]; /** Entries that callers should hand to Pagefind after writing files. */ search?: SearchEntry[]; /** * Pages that failed to render and were skipped. A single bad page (e.g. MDX * that won't compile) must not abort the whole build — render() collects the * failures here so the caller can surface them. Empty when all pages render. */ errors?: RenderError[]; /** * Non-fatal authoring issues found while rendering (e.g. unbalanced inline-code * backticks). The pages still rendered — these are surfaced so the author can * clean up the source. Empty/absent when nothing was flagged. */ warnings?: RenderWarning[]; stats: { /** Pages successfully rendered (excludes any in `errors`). */ pageCount: number; assetCount: number; cssBytes: number; jsBytes: number; durationMs: number; }; } /** * Options to `dwar.render`. There is intentionally no `embedSearchIndex` flag: * search index generation is a separate step (`runPagefindAgainstDir`) that * runs against the already-written output directory. See Q5. */ interface RenderOptions { theme: ThemeConfig; /** * Destination directory. Used only for resolving paths inside output `OutputFile.path` * entries — dwar never writes files itself. */ destination?: string; /** * Optional directory for an on-disk cache of the bundled island chunks. When * set, dwar caches the esbuild island bundle keyed on a content hash of its * inputs (rang's compiled output + the island entry sources + the preact * version), so a warm rebuild whose inputs are unchanged skips the ~0.4s * esbuild step — the big win for the `jsdoc --watch`/dev loop. This is the * one place render() touches disk and is opt-in: omit it (the default) and * render() stays pure. The bridge (the I/O layer) supplies it, typically * `<project>/node_modules/.cache/clean-jsdoc-theme`. */ islandCacheDir?: string; /** * Map from a doc image `src` (the root-relative `/_assets/<name>.<hash>.svg` * the bridge rewrote it to) to that SVG's raw markup. When an `<img>`'s `src` * is in this map, rang inlines the SVG into the page instead of `<img>`-ing it * — so its `[data-theme="dark"]` styles follow the theme toggle (an * `<img>`-loaded SVG only sees the OS `prefers-color-scheme`). The bridge reads * the SVGs (the I/O layer); render() just looks them up, staying pure. */ inlineSvgs?: Record<string, string>; /** * Active-locale info for a localized build (aadesh `build`). When present, dwar * renders chrome in this locale — it wraps the SSR page tree in bhasha's * `LanguageProvider` and seeds each island root from the per-page payload, and * sets `<html lang>`. Absent for a normal single-locale build, so that path's * output stays byte-identical. */ locale?: RenderLocale; /** * The site's public base URL (e.g. `https://example.com` or * `https://example.com/docs`). When set, dwar emits a `sitemap.xml` at the * output root listing every non-hidden page's canonical URL. Only the URL's * **origin** is used — the deploy sub-path comes from `theme.basePath`, so the * two never double-count (a bare origin works, and so does a full URL whose * path equals basePath). Omit it and no sitemap is emitted (today's behavior). */ siteUrl?: string; /** * Resolved `llmsTxt` config. When set AND {@link RenderOptions.siteUrl} is * usable, dwar emits `llms.txt` (+ `llms-full.txt` unless `full: false`) at the * output root — an llmstxt.org index linking each page's companion `.md`. * The bridge validates this and owns the "enabled but no siteUrl" warning, so * `render()` stays pure: a missing `siteUrl` here simply emits nothing. */ llmsTxt?: LlmsTxtConfig; } /** Active-locale chrome translations for a localized render. See {@link RenderOptions.locale}. */ interface RenderLocale { /** Active locale code (also the `<html lang>`). */ code: string; /** Default locale code — the fallback for any untranslated chrome key. */ defaultLocale: string; /** Chrome translations: full `chrome.*` key → translated string (non-empty only). */ messages: Record<string, string>; /** * The UN-prefixed site base path (the default locale's base), used to build the * language switcher's cross-locale URLs — `<siteBasePath>/<locale>/<slug>` for a * non-default locale, `<siteBasePath>/<slug>` for the default. Distinct from * `theme.basePath`, which is already prefixed with the active locale. */ siteBasePath?: string; /** * All configured locales (code + display label) for the switcher. When two or * more are present, dwar mounts a `language-switcher` island in the header. */ locales?: Array<{ code: string; label: string; }>; } //#endregion //#region src/site/islands.d.ts /** Stable string IDs for each island. The string is used as the `data-island` attribute. */ type IslandName = 'sidebar' | 'mobile-nav' | 'toc' | 'toc-mobile' | 'cmdk' | 'code-tabs' | 'copy-btn' | 'copy-page' | 'theme-toggle' | 'settings' | 'language-switcher' | 'code-viewer' | 'embed' | 'playground' | 'tabs'; /** Type-safe prop bag per island. Server-render and hydration share this map. */ interface IslandPropsMap { sidebar: { nav: NavNode[]; currentSlug: string; basePath?: string; collapsibleGroups?: string[]; }; 'mobile-nav': { nav: NavNode[]; currentSlug: string; siteName?: SiteName; basePath?: string; collapsibleGroups?: string[]; }; toc: { headings: Heading[]; }; 'toc-mobile': { headings: Heading[]; }; cmdk: { basePath: string; searchIndexUrl?: string; }; 'code-tabs': { tabs: Array<{ label: string; lang: string; code: string; }>; }; 'copy-btn': { text: string; }; 'copy-page': { mdUrl: string; siteName?: string; prompt?: string; actions?: CopyPageAction[]; }; 'theme-toggle': Record<string, never>; settings: Record<string, never>; 'language-switcher': { locales: Array<{ code: string; label: string; href: string; }>; current: string; }; 'code-viewer': { language: string; filename?: string; highlightLine?: number; }; embed: Record<string, never>; playground: Record<string, never>; tabs: Record<string, never>; } //#endregion //#region src/site/slug-rules.d.ts /** * Slugification rules shared between setu (sidebar / TOC generation) and dwar * (rendered heading anchors). Both sides MUST import from here so that anchor * IDs and sidebar links match. This addresses Risk R4. */ /** * GitHub-style heading slugifier: * - lowercase * - strip combining diacritics (after NFKD normalization) * - drop any character that isn't a letter, number, mark, space, or hyphen * - collapse runs of whitespace/hyphens into a single hyphen * - trim leading/trailing hyphens * - recompose to NFC so non-Latin slugs match what authors type in * `#fragment` links * * Letters/numbers/marks are matched per-script (Unicode-aware), so Devanagari * and Japanese headings produce meaningful, non-empty slugs — not the empty or * Latin-only degenerate slugs an ASCII-only class would yield. * * When `registry` is provided, repeated slugs are deduped by appending `-1`, * `-2`, ... — the registry tracks how many times each base slug has been seen * so callers can reuse it across all headings on a page. * * @example * const reg = new Map<string, number>(); * slugifyHeading('Hello World', reg); // 'hello-world' * slugifyHeading('Hello World', reg); // 'hello-world-1' */ declare function slugifyHeading(text: string, registry?: Map<string, number>): string; /** * Path slug for URLs: lowercases each part, replaces any run of * non-alphanumeric characters with `-`, trims hyphens, drops empty parts, and * joins with `/`. Slashes between parts are preserved; slashes inside a part * are not — split before calling if you want sub-paths. Unicode-aware, so * non-Latin path parts survive instead of collapsing to empty. * * @example * slugifyPath(['Foo Bar', 'Baz!']); // 'foo-bar/baz' */ declare function slugifyPath(parts: string[]): string; /** * Slug for a project-relative source file path. Used BOTH for the source * viewer page slug and the in-doc "Source: file:line" link target so the two * always agree. Normalizes backslashes to `/`, then per segment lowercases and * replaces any run of non-alphanumeric characters (including dots) with `-`, * trimming hyphens; empty segments are dropped. The extension is folded into * the segment (not stripped) so `foo.js` and `foo.ts` stay distinct. * * @example * slugifySourcePath('src/Foo.js'); // 'src/foo-js' * slugifySourcePath('lib\\util\\index.ts'); // 'lib/util/index-ts' */ declare function slugifySourcePath(relPath: string): string; //#endregion //#region src/site/base-path.d.ts /** * Base-path helpers — let the site be served from a sub-directory * (e.g. `https://example.com/doc/api`) by prefixing every emitted URL. * * Both functions are pure and browser-safe: utils is imported by rang in the * browser, so these use only the global `URL` (no node builtins) and never * throw — bad input fails safe to the root prefix `'/'`. */ /** * Normalize a developer-supplied base path into a canonical prefix: * - `'/'` for the site root, or * - `'/sub/dir'` — a leading slash, NO trailing slash — for a sub-directory. * * Accepts either a bare path (`'/doc/api/'`) or a full / protocol-relative URL * (`'https://example.com/doc/api'`, `'//host/doc/api'`); for a URL the pathname * is extracted. Empty / `undefined` / `'/'` → `'/'`. Fail-safe: anything that * can't be parsed sensibly returns `'/'` (never throws). * * @example * normalizeBasePath('/doc/api/'); // '/doc/api' * normalizeBasePath('https://example.com/doc/api'); // '/doc/api' * normalizeBasePath('https://example.com'); // '/' * normalizeBasePath(''); // '/' * normalizeBasePath(undefined); // '/' */ declare function normalizeBasePath(input: unknown): string; /** * Join a base-path prefix with a root-relative path, with no double slashes, * for any `basePath` value (`'/'`, `''`, or `'/doc/api'`). * * Backward compatible: `withBase('/', '/x')` returns `'/x'` unchanged, so with * the default root base every emitted URL is byte-identical to before. * * @example * withBase('/', '/x'); // '/x' * withBase('/doc/api', '/x'); // '/doc/api/x' * withBase('/doc/api', 'x'); // '/doc/api/x' */ declare function withBase(basePath: string | undefined, path: string): string; //#endregion //#region src/site/collapsible.d.ts /** `boolean` (all / none) or an explicit allowlist of section labels. */ type CollapsibleSidebarSections = boolean | string[]; /** * The distinct top-level section labels present in a nav tree, in first-seen * order. Mirrors rang's `groupNav` bucketing: a "section" is a run of non-menu * nodes sharing a truthy `group`. Menu entries and ungrouped nodes are ignored. */ declare function topLevelSectionLabels(nav: readonly NavNode[]): string[]; /** * Resolve the config against the sections actually present: * - `undefined` (default) or `true` → every present section is collapsible. * - `false` → none. * - `string[]` → only present sections whose label EXACTLY matches an entry * (case-sensitive), keeping present order. Non-matching entries are dropped * here and surfaced as a warning by the bridge (see * {@link unmatchedCollapsibleSections}). * The result is always a subset of `present`, so rang can trust it. */ declare function resolveCollapsibleSections(config: CollapsibleSidebarSections | undefined, present: readonly string[]): string[]; /** Array entries that matched no present section — for the bridge's warning. */ declare function unmatchedCollapsibleSections(config: CollapsibleSidebarSections | undefined, present: readonly string[]): string[]; /** * Normalize a raw opt value into the accepted shape, collecting human-readable * warnings (each bridge routes them to its own logger). Only `boolean` and * `string[]` are accepted; anything else falls back to `undefined` (default: * all sections collapsible) with a warning. */ declare function normalizeCollapsibleSidebarSections(raw: unknown): { value: CollapsibleSidebarSections | undefined; warnings: string[]; }; //#endregion //#region src/config/diagnostics.d.ts /** * Diagnostics model — the shared reporting spine for opts validation. Every * field validator collects {@link Diagnostic}s into a {@link DiagnosticBag}; * the caller decides the policy (log + continue vs. fail on errors), and * {@link formatDiagnostics} renders the bag for the console. * * Pure + node-free (rang imports utils in the browser) — no I/O, no `process`, * no color autodetection here. Color is an explicit opt passed by the caller. */ /** Severity of a diagnostic. Drives the caller's strict-mode policy. */ type DiagnosticLevel = 'error' | 'warning' | 'info'; /** A single, structured validation finding. */ interface Diagnostic { /** Severity — `error` is the only level a strict build fails on. */ level: DiagnosticLevel; /** Stable identifier, e.g. `'opts/unknown-key'` or `'fonts/not-google'`. */ code: string; /** What's wrong, in plain language. */ message: string; /** What to use instead — the actionable "reason" (e.g. "did you mean X?"). */ hint?: string; /** Opt path the finding applies to, e.g. `'siteName.alt'` or `'fonts.heading'`. */ path?: string; } /** Convenience extras for the {@link DiagnosticBag} level helpers. */ type DiagnosticExtras = Pick<Diagnostic, 'hint' | 'path'>; /** * An append-only collector of {@link Diagnostic}s. Validators share one bag so * the caller gets a single ordered list to format and to gate strict mode on. */ declare class DiagnosticBag { private readonly items; /** Append a fully-formed diagnostic. */ add(d: Diagnostic): void; /** Add an `error` — the level a strict build fails on. */ error(code: string, message: string, extras?: DiagnosticExtras): void; /** Add a `warning` — reported but never fatal (unless strict escalates it). */ warning(code: string, message: string, extras?: DiagnosticExtras): void; /** Add an `info` — purely advisory (e.g. "couldn't verify offline"). */ info(code: string, message: string, extras?: DiagnosticExtras): void; /** The diagnostics collected so far, in insertion order. */ get list(): readonly Diagnostic[]; /** `true` when at least one `error`-level diagnostic was collected. */ hasErrors(): boolean; } /** * Format a bag for the console — grouped by level (errors first), each line * carrying the code, message, optional path, and a `→` hint. `color` gates the * ANSI escapes (default off, so the output is plain/testable); the caller * passes `true` only for a real TTY. */ declare function formatDiagnostics(bag: DiagnosticBag, opts?: { color?: boolean; }): string; /** * A new bag holding only the `warning`-level diagnostics of `bag`, in the same * order. Lets a bridge re-print just the warnings at the END of a build, where * they are actually visible — validation runs before any render work, so its * output otherwise scrolls away behind the build log. */ declare function warningsOnly(bag: DiagnosticBag): DiagnosticBag; //#endregion //#region src/config/opts-schema.d.ts /** * A logo image set — mirrors `SiteLogo`. Only `default`/`dark`/`light`/`alt` * are recognized; extras are stripped. Each value is a string (URL, `data:` * URI, or a local path the bridge copies). */ declare const SiteLogoSchema: z.ZodObject<{ default: z.ZodOptional<z.ZodString>; dark: z.ZodOptional<z.ZodString>; light: z.ZodOptional<z.ZodString>; alt: z.ZodOptional<z.ZodString>; }, z.core.$strip>; type TSiteLogoOpt = z.infer<typeof SiteLogoSchema>; /** Recognized sub-keys of a `siteName` logo set, for typo suggestions. */ declare const SITE_LOGO_KEYS: readonly ["default", "dark", "light", "alt"]; /** `siteName` is plain text OR a logo set (mirrors `SiteName`). */ declare const SiteNameSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{ default: z.ZodOptional<z.ZodString>; dark: z.ZodOptional<z.ZodString>; light: z.ZodOptional<z.ZodString>; alt: z.ZodOptional<z.ZodString>; }, z.core.$strip>]>; type TSiteNameOpt = z.infer<typeof SiteNameSchema>; /** * Font overrides — `heading`/`body`/`mono`, each optionally prefixed with a * locale code (`ja:heading`) to override that locale only. `heading`/`body` are * Google Fonts family names (existence-checked later); `mono` is a CSS stack. * The `catchall` admits the `<locale>:slot` keys; `validateFonts` does the real * shape/slot validation (this schema is declarative — the runtime path uses it * for documentation/typing, not parsing). */ declare const FontsSchema: z.ZodObject<{ heading: z.ZodOptional<z.ZodString>; body: z.ZodOptional<z.ZodString>; mono: z.ZodOptional<z.ZodString>; }, z.core.$catchall<z.ZodString>>; type TFontsOpt = z.infer<typeof FontsSchema>; /** Recognized `fonts` sub-keys, for typo suggestions. */ declare const FONT_KEYS: readonly ["heading", "body", "mono"]; /** * A sidebar menu entry — mirrors setu's `MenuItem` plus the `href` alias the * bridge accepts. All fields optional; the bridge keeps only entries with an * `id` (built-in) or a link. */ declare const MenuItemSchema: z.ZodObject<{ id: z.ZodOptional<z.ZodString>; title: z.ZodOptional<z.ZodString>; link: z.ZodOptional<z.ZodString>; href: z.ZodOptional<z.ZodString>; icon: z.ZodOptional<z.ZodString>; target: z.ZodOptional<z.ZodString>; class: z.ZodOptional<z.ZodString>; }, z.core.$strip>; type TMenuItemOpt = z.infer<typeof MenuItemSchema>; /** `menu` is an ordered list of {@link MenuItemSchema} entries. */ declare const MenuSchema: z.ZodArray<z.ZodObject<{ id: z.ZodOptional<z.ZodString>; title: z.ZodOptional<z.ZodString>; link: z.ZodOptional<z.ZodString>; href: z.ZodOptional<z.ZodString>; icon: z.ZodOptional<z.ZodString>; target: z.ZodOptional<z.ZodString>; class: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; /** Valid copy-page dropdown actions (mirrors `CopyPageAction`). */ declare const COPY_PAGE_ACTIONS: readonly ["copy", "view", "claude", "chatgpt", "perplexity"]; /** Copy-page config object — mirrors `CopyPageConfig`. */ declare const CopyPageConfigSchema: z.ZodObject<{ enabled: z.ZodOptional<z.ZodBoolean>; actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{ copy: "copy"; view: "view"; claude: "claude"; chatgpt: "chatgpt"; perplexity: "perplexity"; }>>>; }, z.core.$strip>; type TCopyPageConfigOpt = z.infer<typeof CopyPageConfigSchema>; /** `copyPage` is a boolean shorthand OR a config object. */ declare const CopyPageSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{ enabled: z.ZodOptional<z.ZodBoolean>; actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{ copy: "copy"; view: "view"; claude: "claude"; chatgpt: "chatgpt"; perplexity: "perplexity"; }>>>; }, z.core.$strip>]>; /** Prev/next pager config object — mirrors `PageNavConfig`. */ declare const PageNavConfigSchema: z.ZodObject<{ enabled: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>; type TPageNavConfigOpt = z.infer<typeof PageNavConfigSchema>; /** `pageNav` is a boolean shorthand OR a config object. */ declare const PageNavSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{ enabled: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>]>; /** Valid code-playground providers (mirrors `PlaygroundProvider`). */ declare const PLAYGROUND_PROVIDERS: readonly ["codepen", "jsfiddle", "codesandbox"]; /** * `playground` config — mirrors `PlaygroundConfig`. `enableForAllExamples` opts * every `@example` in; `providers` is the default provider set + order; the * per-provider records hold site-wide runtime options. The records are lenient * (`z.unknown()` values) so each provider's API can grow without schema churn. */ declare const PlaygroundSchema: z.ZodObject<{ enableForAllExamples: z.ZodOptional<z.ZodBoolean>; providers: z.ZodOptional<z.ZodArray<z.ZodEnum<{ codepen: "codepen"; jsfiddle: "jsfiddle"; codesandbox: "codesandbox"; }>>>; codepen: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; jsfiddle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; codesandbox: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, z.core.$strip>; type TPlaygroundOpt = z.infer<typeof PlaygroundSchema>; /** * Footer file form — `{ file: "./footer.html" }`. Modeled as its own object so * a later reusable-partial shape (`{ file, css, js }`) is a non-breaking * extension; only `file` is recognized today (extras stripped). */ declare const FooterFileSchema: z.ZodObject<{ file: z.ZodString; }, z.core.$strip>; type TFooterFileOpt = z.infer<typeof FooterFileSchema>; /** * `footer` is a discriminated union: an inline HTML string (the common case, * v4 parity) OR a `{ file }` object the bridge reads from disk. The boundary * (`ThemeConfig.footer`) is always the resolved string — the union lives only * at the opts/bridge layer. */ declare const FooterSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{ file: z.ZodString; }, z.core.$strip>]>; type TFooterOpt = z.infer<typeof FooterSchema>; /** * `meta` is an array of attribute maps — each object's key/value pairs become * the attributes of one `<meta>` tag (`{ name, content }`, `{ property, content }`, * `{ "http-equiv", content }`, `{ charset }`, …). Maximally flexible (v4 parity); * dwar escapes the values, validates attribute names, and de-dupes against its * own head defaults. */ declare const MetaSchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>; type TMetaOpt = z.infer<typeof MetaSchema>; /** `sectionOrder` / `docGroups` — an ordered list of label strings. */ declare const StringListSchema: z.ZodArray<z.ZodString>; /** `defaultDocGroup` — a single group label. */ declare const DefaultDocGroupSchema: z.ZodString; /** `clubSidebarItems` — toggles prefix-grouped sidebar subtrees. */ declare const ClubSidebarItemsSchema: z.ZodBoolean; /** `collapsibleSidebarSections` — which top-level sidebar sections collapse. */ declare const CollapsibleSidebarSectionsSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>; /** `scrollbar` — scrollbar presentation mode. */ declare const ScrollbarSchema: z.ZodEnum<{ styled: "styled"; visible: "visible"; native: "native"; }>; /** `aiPrompt` — a custom copy-page LLM prompt. */ declare const AiPromptSchema: z.ZodString; /** `basePath` — site root path the renderer prefixes onto links. */ declare const BasePathSchema: z.ZodString; /** * The set of recognized top-level theme option names. The unknown-key policy * compares each incoming opt against this set (via Levenshtein) for typo * suggestions — keys NOT here and NOT a JSDoc-own opt may earn a "did you mean" * hint. Mirrors the theme-relevant `JSDocOpts` subset. */ declare const THEME_OPT_KEYS: readonly ["siteName", "fonts", "menu", "copyPage", "pageNav", "playground", "sectionOrder", "docs", "docGroups", "defaultDocGroup", "clubSidebarItems", "collapsibleSidebarSections", "scrollbar", "aiPrompt", "basePath", "siteUrl", "llmsTxt", "favicon", "footer", "meta", "locales", "defaultLocale", "customCss", "customCssFile", "customJs", "customJsFile", "hashCustomAssets", "progress"]; /** Union of the recognized theme option key names. */ type ThemeOptKey = (typeof THEME_OPT_KEYS)[number]; //#endregion //#region src/config/suggest.d.ts /** * Near-miss key suggestions — a small Levenshtein distance used to turn an * unknown opt key into a "did you mean X?" hint. Pure + node-free. * * Used by the unknown-key policy: for a key not in the recognized set, pick the * closest known key and, when it's close enough, surface it as a typo hint. */ /** * Levenshtein edit distance between two strings (insert/delete/substitute, each * cost 1). Iterative two-row DP — O(a·b) time, O(min) space. Comparison is * case-sensitive; lowercase both sides first if you want it case-insensitive. */ declare function levenshtein(a: string, b: string): number; /** * Suggest the closest entry in `candidates` to `input`, or `undefined` when * nothing is close enough. Matching is case-insensitive; `maxDistance` (default * `2`) is the inclusive edit-distance threshold — a far-off key (no candidate * within the threshold) returns `undefined` so we never invent a bad "did you * mean". Ties resolve to the first candidate at the best distance. */ declare function suggestKey(input: string, candidates: Iterable<string>, maxDistance?: number): string | undefined; //#endregion //#region src/config/format.d.ts /** * Small formatting helpers shared by the diagnostics output and the build * report — human-readable byte sizes, fixed-width column padding, and a tiny * ANSI color helper gated on a `color` boolean. * * Strictly node-free (rang imports utils in the browser): byte sizes use * `TextEncoder`, never `Buffer`; there is no `chalk` dependency and no TTY * autodetection — the caller decides whether color is on. */ /** * Byte length of a string or `Uint8Array`. Strings are measured as UTF-8 via * `TextEncoder` (not `Buffer.byteLength`) so this stays browser-safe. */ declare function byteLength(contents: string | Uint8Array): number; /** * Format a raw byte count as a human-readable size — `B` under 1 kB, then `kB` * / `MB` / `GB` with one decimal place (decimal/SI units, 1 kB = 1000 B, to * match the build-report convention). Negative inputs are clamped to `0`. */ declare function humanFileSize(bytes: number): string; /** * Pad `text` to `width` columns (measured in visible characters — assumes the * input carries no ANSI escapes, so apply color *after* padding). `align` * controls the side: `'left'` (default) right-pads, `'right'` left-pads. * Strings already at/over `width` are returned unchanged. */ declare function padColumn(text: string, width: number, align?: 'left' | 'right'): string; /** * Tiny ANSI color helper — each method colors `text` only when `enabled` is * `true`, so callers thread a single `color` boolean through. No `chalk` * dependency; the second arg keeps it a no-op for non-TTY / tests. */ declare const ansi: { red: (text: string, enabled: boolean) => string; yellow: (text: string, enabled: boolean) => string; green: (text: string, enabled: boolean) => string; cyan: (text: string, enabled: boolean) => string; /** Dimmed/gray — used for codes, paths, and separators. */ dim: (text: string, enabled: boolean) => string; }; //#endregion //#region src/config/site-name.d.ts /** * Validate `raw` (the user's `siteName` opt) into a clean {@link SiteName}, or * `undefined` when it carries nothing usable. Collects diagnostics into `bag`: * * - `string` → trimmed; empty → `undefined` (no diagnostic — an omitted name). * - object → only `{ default?, dark?, light?, alt? }` are recognized: * - unknown sub-keys → `warning` + a typo suggestion, then ignored. * - non-string values → `error` + hint, then dropped. * - a set with no image source AND no `alt` → `warning` (nothing to render). * - any other type (number/boolean/array/…) → `error`, returns `undefined`. */ declare function validateSiteName(raw: unknown, bag: DiagnosticBag): SiteName | undefined; //#endregion //#region src/config/google-fonts.d.ts /** * Google Fonts existence resolver — the ONLY networked piece of the config * surface, kept behind an injectable so `@clean-jsdoc-theme/utils` stays pure * and browser-safe. Nothing here imports `node:*` / `fs` / `Buffer`; it relies * only on the globals `fetch` and `AbortController` (present in Node 18+ and * every browser). * * The check is **fail-open**: a real `'missing'` answer needs a definitive * `400` from the CSS endpoint; anything ambiguous (network error, timeout, an * unexpected status) resolves to `'unknown'` so an offline build never breaks. */ /** The verdict for a single font family. */ type FontExistence = 'exists' | 'missing' | 'unknown'; /** Minimal slice of the `fetch` contract the resolver depends on. */ type FetchLike = (url: string, init?: { signal?: AbortSignal; headers?: Record<string, string>; }) => Promise<{ status: number; }>; /** Options for {@link createGoogleFontResolver}. All are injectable for tests. */ interface GoogleFontResolverOptions { /** `fetch` implementation. Defaults to the global `fetch`. */ fetch?: FetchLike; /** Per-request timeout in milliseconds (via `AbortController`). Default `3000`. */ timeoutMs?: number; /** * In-memory cache keyed by family name, so heading/body dedupe and repeat * builds within a process never refetch. Defaults to a fresh `Map`; inject * one to share or inspect it. */ cache?: Map<string, FontExistence>; } /** * Create a resolver `(family) => Promise<'exists'|'missing'|'unknown'>` backed * by the Google Fonts CSS endpoint. Results are cached per family for the life * of the resolver (one network round-trip per distinct family). * * Mapping: `200` → `'exists'`, `400` → `'missing'`, everything else (other * status, thrown error, abort/timeout) → `'unknown'` (**fail-open**). */ declare function createGoogleFontResolver(options?: GoogleFontResolverOptions): (family: string) => Promise<FontExistence>; //#endregion //#region src/config/fonts.d.ts /** One font triple — any subset of `{ heading, body, mono }`. */ interface FontSet { heading?: string; body?: string; mono?: string; } /** * The validated font overrides. The top-level `heading`/`body`/`mono` are the * default (and default-locale) fonts; `locales` carries per-locale overrides * (from `<code>:heading`-style keys). A locale that omits a slot falls back to * the top-level font, then to the theme default — resolved by the bridge per * build (each locale is its own static render). */ interface ValidatedFonts extends FontSet { /** Per-locale font overrides, keyed by locale code (e.g. `{ ja: { heading } }`). */ locales?: Record<string, FontSet>; } /** Resolver signature — supplied by the bridge (defaults to fail-open offline). */ type FontResolver = (family: string) => Promise<FontExistence>; /** * Validate `raw` (the user's `fonts` opt) into a clean {@link ValidatedFonts}. * Collects diagnostics into `bag`: * * - non-object (or array) → `error`, returns `{}`. * - keys whose slot is outside `{ heading, body, mono }` → `warning` + * suggestion, ignored. Keys may carry a `<locale>:` prefix (`ja:heading`) to * target one locale; the slot after the prefix is what's checked. * - non-string values → `error` + hint, dropped. * - for `heading`/`body` slots only (not `mono`), base AND per-locale, `await * fontResolver(name)`: * - `'missing'` → `error` (not a Google Font); the value is still returned so * the bridge can decide to fall back to its default. * - `'unknown'` → `info` (couldn't verify — offline?); used as-is. * - `'exists'` → ok. * * When no `fontResolver` is supplied the existence check is skipped silently * (shape validation still runs). */ declare function validateFonts(raw: unknown, bag: DiagnosticBag, fontResolver?: FontResolver): Promise<ValidatedFonts>; //#endregion //#region src/config/locales.d.ts /** One configured locale: its code and an optional display name for the switcher. */ interface LocaleConfig { /** Locale code, e.g. `'en'`, `'fr'`, `'pt-BR'`. */ code: string; /** Display label for the language switcher (defaults to the code if unset). */ name?: string; } /** Normalized locale configuration — the default is always present in `locales`. */ interface ValidatedLocales { /** All configured locales, in declaration order (includes the default). */ locales: LocaleConfig[]; /** The default locale's code — rendered unprefixed; every page must exist in it. */ defaultLocale: string; } /** * Validate `opts.locales` + `opts.defaultLocale` into a {@link ValidatedLocales}, * or `undefined` when localization is off (no `locales`). Collects diagnostics: * * - `locales` absent/empty → `undefined` (localization disabled; no diagnostic). * - a non-array `locales`, or an entry that is neither a non-empty string nor a * `{ code }` object, or a malformed/duplicate code → `error` (dropped). * - `defaultLocale` set but not among `locales` → `error` (falls back to the * first locale). `defaultLocale` unset → defaults to the first locale (`info`). */ declare function validateLocales(localesRaw: unknown, defaultLocaleRaw: unknown, bag: DiagnosticBag): ValidatedLocales | undefined; //#endregion //#region src/config/validate-opts.d.ts /** How `validateThemeOpts` treats keys not in {@link THEME_OPT_KEYS}. */ type UnknownKeyPolicy = 'suggest-typos' | 'warn-all' | 'ignore'; /** Input to {@link validateThemeOpts}. */ interface ValidateThemeOptsInput { /** Raw opts (JSDoc's flat `env.opts`, or a namespaced typedoc block). */ opts: Record<string, unknown>; /** * Google Fonts existence resolver (see `createGoogleFontResolver`). Omit to * skip the live `heading`/`body` check (shape validation still runs). */ fontResolver?: FontResolver; /** * Unknown-key handling. `'suggest-typos'` (default) only flags keys within an * edit-distance of a known theme key — safe for JSDoc's shared flat namespace. * `'warn-all'` flags every unrecognized key — for a dedicated namespaced block. * `'ignore'` flags nothing. */ unknownKeyPolicy?: UnknownKeyPolicy; /** * Keys that are valid in this namespace but aren't theme opts (e.g. JSDoc's * own `destination`/`template`/…). Never flagged, regardless of policy. */ knownNonThemeKeys?: ReadonlySet<string>; } /** * Clean, defaulted values for the bridge to consume directly. Only the keys * Phase 2 validates richly (`siteName`, `fonts`) are reshaped; the rest pass * through after the bridge's own `normalize*` step (Phase 4 folds those in). * `undefined` means "fall back to the theme default for this key". */ interface NormalizedThemeOpts { /** Validated site identity (text or logo set), or `undefined` if unusable/omitted. */ siteName: SiteName | undefined; /** Validated font overrides — a subset of `{ heading, body, mono }`. */ fonts: ValidatedFonts; /** Validated locale config, or `undefined` when localization is off. */ locales: ValidatedLocales | undefined; /** Validated public site URL, or `undefined` when unset/unusable. */ siteUrl: string | undefined; /** Resolved `llmsTxt` config, or `undefined` when the feature is off. */ llmsTxt: LlmsTxtConfig | undefined; } /** Result of {@link validateThemeOpts}. */ interface ValidateThemeOptsResult { /** Normalized, defaulted values for the bridge. */ value: NormalizedThemeOpts; /** Every finding from every validator, in one ordered bag. */ diagnostics: DiagnosticBag; } /** * Validate a raw opts object. Runs `siteName` + `fonts` validators (the latter * does the async Google Fonts check when a resolver is supplied) and the * unknown-key policy, all into one bag, then returns normalized values. Never * throws — strict-mode enforcement is the caller's job via * `result.diagnostics.hasErrors()`. */ declare function validateThemeOpts(input: ValidateThemeOptsInput): Promise<ValidateThemeOptsResult>; //#endregion //#region src/config/report.d.ts /** Input to {@link formatBuildReport}. */ interface BuildReportInput { /** Files emitted by the render (plus any extra written files, e.g. logos). */ files: OutputFile[]; /** Render stats — supplies the `built in …` duration when present. */ stats?: RenderResult['stats']; /** Absolute or display path the files were written to — the "where". */ destination: string; /** * Optional gzip sizer (e.g. `(b) => zlib.gzipSync(b).length`). Injected by * the caller so utils stays node-free; the gzip column appears only when set. */ gzipSizer?: (bytes: Uint8Array | string) => number; /** Whether to emit ANSI color. Default `false` (plain/testable). */ color?: boolean; /** * Cap the per-route table at the N largest routes, adding a `+N more pages` * line for the remainder (never silently truncated). Omit to list every * route (the recommended default). */ maxRoutes?: number; } /** * Render the Next.js-style build report as a single string. Routes are sorted * alphabetically by default; when `maxRoutes` is set, the N largest routes are * shown (sorted by route) followed by a `+N more pages` line. */ declare function formatBuildReport(input: BuildReportInput): string; //#endregion //#region src/config/scrollbar.d.ts declare function normalizeScrollbar(raw: unknown): { value: ScrollbarMode | undefined; warnings: string[]; }; //#endregion //#region src/config/site-url.d.ts /** * The absolute `http(s)` origin of `value`, or `null` when `value` isn't an * absolute http(s) URL. (`new URL('mailto:x').origin` yields the *string* * `'null'`, hence the explicit guard.) */ declare function httpOrigin(value: string): string | null; /** * Validate the `siteUrl` opt. Returns the trimmed URL when it's usable, else * `undefined` (with a `warning` — never fatal; `strict` escalates). `rawBasePath` * is the un-normalized `basePath` opt, used only to decide whether a dropped URL * path is worth warning about. */ declare function validateSiteUrl(raw: unknown, rawBasePath: unknown, bag: DiagnosticBag): string | undefined; //#endregion //#region src/config/llms-txt.d.ts /** `llmsTxt` object form — both fields optional, defaulted by the validator. */ declare const LlmsTxtConfigSchema: z.ZodObject<{ full: z.ZodOptional<z.ZodBoolean>; api: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"index">]>>; }, z.core.$strip>; /** `llmsTxt` is a boolean shorthand OR a config object. */ declare const LlmsTxtSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{ full: z.ZodOptional<z.ZodBoolean>; api: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"index">]>>; }, z.core.$strip>]>; /** * Resolve the `llmsTxt` opt. Returns `undefined` (feature off) when unset, * `false`, or malformed — and when `siteUrl` isn't usable, which warns, because * the author asked for a file they would otherwise never receive. */ declare function validateLlmsTxt(raw: unknown, siteUrl: string | undefined, bag: DiagnosticBag): LlmsTxtConfig | undefined; //#endregion export { API_PAGE_KINDS, AiPromptSchema, BUILD_SPEC_VERSION, BasePathSchema, BuildReportInput, BuildSpec, COPY_PAGE_ACTIONS, ClubSidebarItemsSchema, CollapsibleSidebarSections, CollapsibleSidebarSectionsSchema, ComponentOverrides, CopyPageAction, CopyPageConfig, CopyPageConfigSchema, CopyPageSchema, DefaultDocGroupSchema, Diagnostic, DiagnosticBag, DiagnosticLevel, DocletAccessSchema, DocletEnumPropertySchema, DocletKindSchema, DocletListSchema, DocletMetaCodeSchema, DocletMetaSchema, DocletOverloadSchema, DocletParamSchema, DocletSchema, DocletScopeSchema, DocletTagSchema, DocletTypeParamSchema, DocletTypePropertySchema, EXTRACT_MANIFEST_VERSION, EventRefSchema, ExtractManifest, FONT_KEYS, FetchLike, FontExistence, FontResolver, FontSet, FontsSchema, FooterFileSchema, FooterSchema, Frontmatter, GoogleFontResolverOptions, Heading, IslandName, IslandPropsMap, LlmsTxtConfig, LlmsTxtConfigSchema, LlmsTxtSchema, LocaleConfig, MenuItemSchema, MenuSchema, MetaSchema, MetaTag, NavNode, NormalizedThemeOpts, OutputFile, Override, PLAYGROUND_PROVIDERS, PackageDocletSchema, PackageRefSchema, Page, PageKind, PageNavConfig, PageNavConfigSchema, PageNavSchema, PlaygroundConfig, PlaygroundProvider, PlaygroundSchema, RenderError, RenderLocale, RenderOptions, RenderResult, RenderWarning, SITE_LOGO_KEYS, ScrollbarMode, ScrollbarSchema, SearchEntry, SiteLogo, SiteLogoSchema, SiteManifest, SiteName, SiteNameSchema, SlotEntry, StringListSchema, TBugsInfo, TBugsInfoSchema, TContactInfo, TContactInfoSchema, TCopyPageConfigOpt, TDoclet, TDocletAccess, TDocletEnumProperty, TDocletKind, TDocletList, TDocletMeta, TDocletMetaCode, TDocletOverload, TDocletParam, TDocletScope, TDocletTag, TDocletTypeParam, TDocletTypeProperty, TEventRef, TFontsOpt, TFooterFileOpt, TFooterOpt, THEME_OPT_KEYS, TJSDocSaltyCollection, TJSDocSaltyMetadata, TMenuItemOpt, TMetaOpt, TPackageDoclet, TPackageRef, TPageNavConfigOpt, TPlaygroundOpt, TSiteLogoOpt, TSiteNameOpt, ThemeColors, ThemeConfig, ThemeOptKey, ThemeTokens, UnknownKeyPolicy, ValidateThemeOptsInput, ValidateThemeOptsResult, ValidatedFonts, ValidatedLocales, ansi, byteLength, createGoogleFontResolver, formatBuildReport, formatDiagnostics, formatRenderError, httpOrigin, humanFileSize, isDoclet, isPackageDoclet, levenshtein, normalizeBasePath, normalizeCollapsibleSidebarSections, normalizeScrollbar, padColumn, resolveCollapsibleSections, resolveSiteLogo, siteNameText, slugifyHeading, slugifyPath, slugifySourcePath, suggestKey, toExtractManifest, topLevelSectionLabels, unmatchedCollapsibleSections, validateFonts, validateLlmsTxt, validateLocales, validateSiteName, validateSiteUrl, validateThemeOpts, warningsOnly, withBase }; //# sourceMappingURL=index.d.cts.map