{"id":17817903,"url":"https://github.com/0xtheprodev/babel-plugin-flow-generate-typedef","last_synced_at":"2026-01-31T02:31:08.000Z","repository":{"id":39637726,"uuid":"275307746","full_name":"0xTheProDev/babel-plugin-flow-generate-typedef","owner":"0xTheProDev","description":"Babel Plugin to Generate Library Definition for Libraries and Modules","archived":false,"fork":false,"pushed_at":"2023-01-06T15:14:23.000Z","size":612,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-12T22:13:48.631Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/0xTheProDev.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}},"created_at":"2020-06-27T05:41:38.000Z","updated_at":"2023-03-04T11:01:50.000Z","dependencies_parsed_at":"2023-02-06T05:47:20.614Z","dependency_job_id":null,"html_url":"https://github.com/0xTheProDev/babel-plugin-flow-generate-typedef","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xTheProDev/babel-plugin-flow-generate-typedef","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xTheProDev%2Fbabel-plugin-flow-generate-typedef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xTheProDev%2Fbabel-plugin-flow-generate-typedef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xTheProDev%2Fbabel-plugin-flow-generate-typedef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xTheProDev%2Fbabel-plugin-flow-generate-typedef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xTheProDev","download_url":"https://codeload.github.com/0xTheProDev/babel-plugin-flow-generate-typedef/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xTheProDev%2Fbabel-plugin-flow-generate-typedef/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28927132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T22:32:35.345Z","status":"online","status_checked_at":"2026-01-31T02:00:09.179Z","response_time":128,"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":[],"created_at":"2024-10-27T16:46:39.988Z","updated_at":"2026-01-31T02:31:07.984Z","avatar_url":"https://github.com/0xTheProDev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Features\n\n### 1. Persist type information\nAll Type defintion (and interface as well) should persist on output code as an exported value.\n**Better**: Add Treeshaking to remove unused type/interface information.\n\n#### Input\n```typescript\nexport type Person {\n  name: string,\n  age: number,\n}\n\ntype Car {\n  regno: string,\n  speed: number,\n}\n```\n\n#### Output\n```typescript\nexport type Person {\n  name: string,\n  age: number,\n}\n\nexport type Car {\n  regno: string,\n  speed: number,\n}\n```\n\n### 2. Convert Function Defintion to Declaration\nConvert exported function definitions to declarations while specifying input param types and output type.\n\n#### Input\n```typescript\nexport function addTwoNumber(a: number, b: number): number {\n  return a + b;\n}\n```\n\n#### Output\n```typescript\ndeclare function addTwoNumber(a: number, b: number): number;\n```\n\n### 3. Convert Class Definition to Interface Declaration\nConvert Classes to Interfaces iterating over `constructor` and/or caret expression, and, other public methods.\n\n**Better**: Avoid publishing life-cycle methods for `React.Component` child.\n\n#### Input\n```typescript\nexport class DialogWidget extends React.Component\u003cIncomingProps, InternalState\u003e {\n  componentDidMount() {\n    window.title = 'Home Page';\n  }\n\n  getCurrentTime(): number {\n    return Date.now();\n  }\n\n  render() {\n    return (\u003ch1\u003eHello World\u003c/h1\u003e);\n  }\n}\n```\n\n#### Output\n```typescript\nexport interface DialogWidget extends React.Component\u003cIncomingProps, InternalState\u003e {\n  getCurrentTime(): number;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xtheprodev%2Fbabel-plugin-flow-generate-typedef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xtheprodev%2Fbabel-plugin-flow-generate-typedef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xtheprodev%2Fbabel-plugin-flow-generate-typedef/lists"}