api-docs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Generate API documentation from TypeScript/JavaScript source:
  1. Scan exports: Find all public functions, classes, and interfaces
  2. Extract JSDoc: Parse
    @param
    ,
    @returns
    ,
    @throws
    ,
    @example
    annotations
  3. Generate missing docs: Add JSDoc for undocumented public APIs
  4. OpenAPI spec: For HTTP endpoints, generate OpenAPI 3.0 definitions
Dispatch via MCP:
mcp__claude-flow__hooks_worker-dispatch({ trigger: "document", scope: "api" })
Conventions:
  • Every public export must have a JSDoc comment
  • Include
    @param
    with type and description
  • Include
    @returns
    with type and description
  • Include
    @throws
    for known error conditions
  • Include
    @example
    for non-obvious usage
从TypeScript/JavaScript源代码生成API文档:
  1. 扫描导出内容:查找所有公共函数、类和接口
  2. 提取JSDoc注释:解析
    @param
    @returns
    @throws
    @example
    注解
  3. 生成缺失文档:为未编写文档的公共API添加JSDoc注释
  4. OpenAPI规范:针对HTTP端点,生成OpenAPI 3.0定义
通过MCP调度:
mcp__claude-flow__hooks_worker-dispatch({ trigger: "document", scope: "api" })
约定:
  • 每个公共导出内容必须包含JSDoc注释
  • 包含带有类型和描述的
    @param
  • 包含带有类型和描述的
    @returns
  • 为已知错误条件添加
    @throws
  • 为非直观用法添加
    @example