{"id":22442445,"url":"https://github.com/socsieng/typedoc-plugin-typescript-declaration","last_synced_at":"2025-08-01T18:33:10.566Z","repository":{"id":44972615,"uuid":"232633970","full_name":"socsieng/typedoc-plugin-typescript-declaration","owner":"socsieng","description":"Typedoc plugin to render to typescript declaration file","archived":false,"fork":false,"pushed_at":"2023-03-02T11:24:28.000Z","size":2070,"stargazers_count":2,"open_issues_count":13,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T03:02:52.781Z","etag":null,"topics":["plugin","typedoc","typedocplugin","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/socsieng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-08T18:44:13.000Z","updated_at":"2022-11-26T04:59:41.000Z","dependencies_parsed_at":"2023-02-03T11:00:28.370Z","dependency_job_id":null,"html_url":"https://github.com/socsieng/typedoc-plugin-typescript-declaration","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socsieng%2Ftypedoc-plugin-typescript-declaration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socsieng%2Ftypedoc-plugin-typescript-declaration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socsieng%2Ftypedoc-plugin-typescript-declaration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socsieng%2Ftypedoc-plugin-typescript-declaration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socsieng","download_url":"https://codeload.github.com/socsieng/typedoc-plugin-typescript-declaration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228397981,"owners_count":17913562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plugin","typedoc","typedocplugin","typescript"],"created_at":"2024-12-06T02:19:10.110Z","updated_at":"2024-12-06T02:19:10.851Z","avatar_url":"https://github.com/socsieng.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typedoc-plugin-typescript-declaration\n\n[![Build Status](https://github.com/socsieng/typedoc-plugin-typescript-declaration/workflows/build/badge.svg)](https://github.com/socsieng/typedoc-plugin-typescript-declaration/actions?query=workflow%3A%22build%22)\n[![NPM Version](https://badge.fury.io/js/typedoc-plugin-typescript-declaration.svg)](https://badge.fury.io/js/typedoc-plugin-typescript-declaration)\n\nThis is a Typedoc plugin that renders a TypeScript declaration file.\n\n## Installation\n\n```sh\nnpm install typedoc typedoc-plugin-typescript-declaration --save-dev\n```\n\n## Usage\n\nUsed as a plugin with Typedoc:\n\n```sh\n# generate Typedoc documentation as well as the type declaration\nnode_modules/.bin/typedoc --out docs --declarationFile docs/index.d.ts\n\n# generate type declaration file without Typedoc documentation (omit --out, or inclue --declarationOnly)\nnode_modules/.bin/typedoc --declarationFile docs/index.d.ts\n\n# generate type declaration file for a specific file\n# node_modules/.bin/typedoc --declarationFile \u003coutput-file\u003e [file]\nnode_modules/.bin/typedoc --declarationFile docs/index.d.ts src/index.ts\n\n# write declaration file for types with a max version of 1.0\nnode_modules/.bin/typedoc --out docs/v1.0 --declarationFile docs/v1.0/index.d.ts --maxVersion 1.0\n\n# write declaration file for types with a max version of 2.0\nnode_modules/.bin/typedoc --out docs/v2.0 --declarationFile docs/v2.0/index.d.ts --maxVersion 2.0\n```\n\nUsed as a stand alone cli (works with the same options above):\n\n```sh\n# using npx\nnpx typedoc-plugin-typescript-declaration --declarationFile index.d.ts\n\n# optionally install this package globally\nnpm install --global typedoc-plugin-typescript-declaration\n\n# generate type declaration file with max version 2.0\nnode_modules/.bin/typedoc-declare --declarationFile index.d.ts --maxVersion 2.0\n# when installed globally\ntypedoc-declare --declarationFile index.d.ts --maxVersion 2.0\n```\n\n## Why?\n\nReasons for using this plugin:\n\n- You publish and maintain TypeScript definitions\n- You have `@internal` or `@hidden` types in your documentation that you would like reflected in your type definitions\n- You would like to publish multiple versions of your type definitions from a single source of truth\n\n## Publish multiple versions\n\nYou can target multiple versions of the type definitions by using the `@since \u003cversion\u003e` tag and suppliying a maximum version number with `--maxVersion \u003cversion\u003e`. Any definitions tagged with a `@since` version greater than the `--maxVersion` will be filtered out.\n\n### Example\n\nSample file:\n\n```ts\nexport class MyClass {\n  originalFunction() {}\n\n  /**\n   * @since 1.0\n   */\n  newFunction() {}\n\n  /**\n   * @since 2.0\n   */\n  newerFunction() {}\n}\n```\n\nCommand:\n\n```sh\n# write declaration file for types with a max version of 1.0\nnode_modules/.bin/typedoc --declarationFile docs/v1.0/index.d.ts --maxVersion 1.0\n\n# write declaration file for types with a max version of 2.0\nnode_modules/.bin/typedoc --declarationFile docs/v2.0/index.d.ts --maxVersion 2.0\n```\n\n## Inlining `keyof` types\n\nYou can use this plugin to *@inline* `keyof` types directly into a union to produce a more concise document and `.d.ts` file.\n\nIn addition to comments for each of the keys will also be documented as part of the `@inline` type.\n\n### Example\n\nSample file:\n\n```ts\n/**\n * @inline\n */\ntype SwitchState = keyof {\n  /**\n   * Switch is on\n   */\n  on: string,\n  /**\n   * Switch is off\n   */\n  off: string,\n  /**\n   * State of the switch is uknown\n   * \n   * @since 2.0\n   */\n  unknown: string,\n};\n```\n\nProduces the following (with `--maxVersion 1.0`):\n\n```ts\n/**\n * Options:\n *\n * - `on`:\n *   Switch is on\n *\n * - `off`:\n *   Switch is off\n */\ntype SwitchState = \"on\" | \"off\";\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocsieng%2Ftypedoc-plugin-typescript-declaration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocsieng%2Ftypedoc-plugin-typescript-declaration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocsieng%2Ftypedoc-plugin-typescript-declaration/lists"}