docs: include JSDoc in cordis catalog blocks

This commit is contained in:
Tianyi Cui
2026-07-19 12:52:34 +08:00
parent 114ceee293
commit 30d1af3bbc
7 changed files with 1259 additions and 26 deletions

View File

@@ -80,7 +80,7 @@ function referencedTypes(seeds: string[], decls: Map<string, string>): { name: s
function render(): string {
const services = collectServices()
const events = collectEvents().sort((a, b) => a.name.localeCompare(b.name))
const types = referencedTypes(services.flatMap(service => service.methods), collectTypeDecls())
const types = referencedTypes(services.flatMap(service => service.methods.map(method => method.signature)), collectTypeDecls())
const lines: string[] = [
'/**',
' * Generated by scripts/gen-cordis-api.ts — do not edit by hand; run',
@@ -145,7 +145,7 @@ function render(): string {
lines.push(' methods: [],')
} else {
lines.push(' methods: [')
for (const method of service.methods) lines.push(` ${quote(method)},`)
for (const method of service.methods) lines.push(` ${quote(method.signature)},`)
lines.push(' ],')
}
lines.push(' },')