{"id":16006622,"url":"https://github.com/nikku/bio-dts","last_synced_at":"2025-03-17T20:30:55.983Z","repository":{"id":152240404,"uuid":"612460830","full_name":"nikku/bio-dts","owner":"nikku","description":"Generate type definitions from JavaScript","archived":false,"fork":false,"pushed_at":"2025-01-10T22:31:25.000Z","size":314,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T04:35:17.058Z","etag":null,"topics":["javascript","type-generation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/nikku.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["nikku"]}},"created_at":"2023-03-11T02:27:00.000Z","updated_at":"2025-02-03T15:02:14.000Z","dependencies_parsed_at":"2024-02-28T23:41:16.036Z","dependency_job_id":"5b6d7336-ba39-40ae-b505-09e7480f37d4","html_url":"https://github.com/nikku/bio-dts","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikku%2Fbio-dts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikku%2Fbio-dts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikku%2Fbio-dts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikku%2Fbio-dts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikku","download_url":"https://codeload.github.com/nikku/bio-dts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878486,"owners_count":20362433,"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":["javascript","type-generation"],"created_at":"2024-10-08T11:42:47.901Z","updated_at":"2025-03-17T20:30:55.978Z","avatar_url":"https://github.com/nikku.png","language":"JavaScript","funding_links":["https://github.com/sponsors/nikku"],"categories":[],"sub_categories":[],"readme":"# bio-dts\n\n[![CI](https://github.com/nikku/bio-dts/actions/workflows/CI.yml/badge.svg)](https://github.com/nikku/bio-dts/actions/workflows/CI.yml)\n\nUtilities to generate sane and clean type definitions from JavaScript files.\n\n## About\n\nThis module provides `pre` and `post` processing helpers to a type definition pipeline.\n\nYou can use it [via API](#api) or through a simple [generator cli](#usage).\n\n\n## Usage\n\n```sh\nnpx bio-dts --outDir dist/types -r lib\n```\n\n\n## Features\n\nGenerates clean type definitions from ES5 code bases:\n\n* ES5 prototypical classes + inheritance\n* Optional parameters before required ones\n* Function overloading (via `@overlord` annotations, actually works!)\n* Converts JSDoc to [TSDoc](https://github.com/microsoft/tsdoc)\n* Only exposed documented parameters\n* Validates, where needed declared parameters\n\nCheckout the [test fixtures](./test/fixtures) for full coverage.\n\n\n## API\n\n```js\nimport {\n  preTransform,\n  postTransform,\n  generateTypes\n} from 'bio-dts';\n\nimport * as typescript from 'typescript';\n\n// transform JS so it keeps the shape,\n// but is properly digestable by the typescript\n// compiler\nconst transformedCode = preTransform(jsCode);\n\n// post process typescript compiler type code\n// removing internals, and fixing up the definitions\nconst transformedCode = postTransform(tsCode);\n\n// execute the full pipeline, including invoking the\n// typescript compiler\ngenerateTypes(files, {\n  outDir: 'dist'\n}, typescript);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikku%2Fbio-dts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikku%2Fbio-dts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikku%2Fbio-dts/lists"}