typejuice 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
typejuice 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
typejuice 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
操作系统 跨平台
软件类型 开源软件
开源组织
地区 不详
投 递 者 Alias_Travis
适用人群 未知
收录时间 2021-12-27

软件简介

typejuice 是 TypeScript 声明文件的文档生成器,灵感来自 godoc。

TypeScript 声明文件已经成为库中常见的附件,即使是那些用标准 JavaScript 编写的库,也是增强所暴露的API的自动完成行为的一种手段。

文档和这些声明文件之间有很多重叠之处。这个项目试图通过从.d.ts文件中提供类似于 godoc 的注释提取来弥补这一差距,同时也推断出类型和签名,所以你不必在两个不同的地方维护相同的信息。

typejuice 包含两个包:

  • typejuice:JavaScript 的 API 库
  • vit-plugin-typejuice:它的 Vite 插件

基础使用

import TypeJuice from 'typejuice'

const tj = new TypeJuice('./sample.d.ts')

console.log(tj.toMarkdown())

Vite 集成

import { dirname } from 'path'
import { fileURLToPath } from 'url'
import TypeJuice from 'vite-plugin-typejuice'

export default {
  plugins: [
    TypeJuice({
      // Defaults to process.cwd()
      typeRoot: resolve(dirname(fileURLToPath(import.meta.url)), 'types'),
      // Defaults to only 'md'
      extensions: ['md'],
    })
  ],
}
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
1 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部