{"id":16644549,"url":"https://github.com/danielpza/typescript-infer-types","last_synced_at":"2026-05-22T21:34:19.717Z","repository":{"id":57383822,"uuid":"198520298","full_name":"danielpza/typescript-infer-types","owner":"danielpza","description":"Infer types from typescript code","archived":false,"fork":false,"pushed_at":"2020-07-13T22:28:00.000Z","size":16,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T00:14:52.752Z","etag":null,"topics":["generator","type-safety","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielpza.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-23T23:01:00.000Z","updated_at":"2019-07-25T00:34:16.000Z","dependencies_parsed_at":"2022-09-14T00:52:38.620Z","dependency_job_id":null,"html_url":"https://github.com/danielpza/typescript-infer-types","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpza%2Ftypescript-infer-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpza%2Ftypescript-infer-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpza%2Ftypescript-infer-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpza%2Ftypescript-infer-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielpza","download_url":"https://codeload.github.com/danielpza/typescript-infer-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243172099,"owners_count":20247887,"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":["generator","type-safety","typescript"],"created_at":"2024-10-12T08:11:40.917Z","updated_at":"2025-12-24T21:51:51.749Z","avatar_url":"https://github.com/danielpza.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typescript-infer-types\n\n[![npm version](https://img.shields.io/npm/v/typescript-infer-types.svg)](https://www.npmjs.com/package/typescript-infer-types)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nInfer types from typescript code.\n\nThis is currently under develop, feel free to try it and report any issues or features request you might have.\n\n## Install\n\n```sh\n$ npm i -g typescript-infer-types\n```\n\n## Example\n\n```ts\n// input.ts\nlet a = true;\n\nhello = \"world\";\n\nEXTERNAL.DEPP.VAR = a;\n\nEXTERNAL.foo(3);\n\nlet c = EXTERNAL.BAR;\nlet d = BAR;\n\nc = 3;\nd = 4;\n\nc = EXTERNAL.BARR;\n\nfoo(\"asdf\");\n```\n\nThen extract external definitions (outputs to stdout):\n\n```sh\n$ typescript-infer-types input.ts\ndeclare let hello: string;\ndeclare let EXTERNAL: { DEPP: { VAR: boolean }, foo: ((...args: [number]) =\u003e any), BAR: any, BARR: any };\ndeclare let BAR: any;\ndeclare let foo: ((...args: [string]) =\u003e any);\n```\n\n## Roadmap\n\n- [ ] Anotate variables (fix missing types in source code)\n- [ ] ...sugestions?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpza%2Ftypescript-infer-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielpza%2Ftypescript-infer-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpza%2Ftypescript-infer-types/lists"}