{"id":22055464,"url":"https://github.com/calasanmarko/typeclone","last_synced_at":"2025-08-07T07:32:31.829Z","repository":{"id":199713218,"uuid":"703502613","full_name":"calasanmarko/typeclone","owner":"calasanmarko","description":"Deeply expands TypeScript types into their own declaration file.","archived":false,"fork":false,"pushed_at":"2023-10-11T23:23:29.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T15:36:46.277Z","etag":null,"topics":["build","cli","clone","compiler","declaration","javascript","js","transpiler","ts","types","typescript","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/typeclone","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/calasanmarko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-10-11T11:12:36.000Z","updated_at":"2023-10-11T22:31:06.000Z","dependencies_parsed_at":"2024-10-06T17:26:14.678Z","dependency_job_id":"3b4ea0a1-e8c6-4ca4-99ed-129e56b21ea3","html_url":"https://github.com/calasanmarko/typeclone","commit_stats":null,"previous_names":["calasanmarko/typeclone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/calasanmarko/typeclone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calasanmarko%2Ftypeclone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calasanmarko%2Ftypeclone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calasanmarko%2Ftypeclone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calasanmarko%2Ftypeclone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calasanmarko","download_url":"https://codeload.github.com/calasanmarko/typeclone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calasanmarko%2Ftypeclone/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269219940,"owners_count":24380614,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["build","cli","clone","compiler","declaration","javascript","js","transpiler","ts","types","typescript","utility"],"created_at":"2024-11-30T16:07:22.416Z","updated_at":"2025-08-07T07:32:31.770Z","avatar_url":"https://github.com/calasanmarko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typeclone\nDeeply expands TypeScript types into their own declaration file.\n\n# Installation\nAvailable as a npm package.\n\nFor usage from code:\n```\nnpm install --save-dev typeclone\n```\n\nFor usage from the command line:\n```\nnpm install --global typeclone\n```\n\n# Usage\nAvailable both as a command-line utility and a TypeScript module. Gets all types in the input file, expands them, and then outputs them in a separate file. Useful for getting rid of dependencies when exporting inferred types.\n\nFor example, take this input file named `demo.ts`\n```\nimport { z } from \"zod\";\n\nconst demoSchema = z.object({\n    test: z.string(),\n    test2: z.number().nullable().optional(),\n});\n\nexport type Demo = z.infer\u003ctypeof demoSchema\u003e;\n```\n\nWe can now call either the command-line utility:\n```\ntypeclone demo.ts demo_out.d.ts\n```\n\nOr the JavaScript function:\n```\nimport { cloneTypes } from \"typeclone\";\n\ncloneTypes('demo.ts', 'demo_out.d.ts')\n```\n\nWhich will result in the output file `demo_out.d.ts` with the following contents:\n```\nexport declare type Demo = { test: string; test2?: number | null | undefined; }\n```\n\nCan output both `.ts` and `.d.ts` files, automatically detects which one based on the output file extension.\n\n# License\nMade by Marko Calasan, 2023.\n\nThis product is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalasanmarko%2Ftypeclone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalasanmarko%2Ftypeclone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalasanmarko%2Ftypeclone/lists"}