{"id":14981915,"url":"https://github.com/kiikurage/babel-plugin-flow-to-typescript","last_synced_at":"2025-04-05T04:10:43.741Z","repository":{"id":31867199,"uuid":"129484280","full_name":"Kiikurage/babel-plugin-flow-to-typescript","owner":"Kiikurage","description":"Babel plugin to convert Flow code into TypeScript","archived":false,"fork":false,"pushed_at":"2023-01-04T21:37:07.000Z","size":861,"stargazers_count":161,"open_issues_count":18,"forks_count":33,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T03:06:10.569Z","etag":null,"topics":["babel","flow","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/babel-plugin-flow-to-typescript","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/Kiikurage.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":"2018-04-14T05:15:52.000Z","updated_at":"2025-03-17T15:00:28.000Z","dependencies_parsed_at":"2023-01-14T19:56:23.492Z","dependency_job_id":null,"html_url":"https://github.com/Kiikurage/babel-plugin-flow-to-typescript","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kiikurage%2Fbabel-plugin-flow-to-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kiikurage%2Fbabel-plugin-flow-to-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kiikurage%2Fbabel-plugin-flow-to-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kiikurage%2Fbabel-plugin-flow-to-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kiikurage","download_url":"https://codeload.github.com/Kiikurage/babel-plugin-flow-to-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"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":["babel","flow","javascript","typescript"],"created_at":"2024-09-24T14:04:28.560Z","updated_at":"2025-04-05T04:10:43.719Z","avatar_url":"https://github.com/Kiikurage.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-flow-to-typescript\n\n[Babel] plugin to convert [Flow] code into [TypeScript]\n\n## How to use\n\n```shell\n$ npm install -g @babel/cli @babel/core\n$ npm install babel-plugin-flow-to-typescript\n\n# you must use babel@^7.x.x\n$ babel --version\n7.4.4 (@babel/core 7.4.5)\n\n$ babel --plugins babel-plugin-flow-to-typescript ${SRC_FLOW_FILE} -o ${DEST_TS_FILE}\n```\n\n## Implementation status\n\n| Supported? | Syntax                | Flow                              | TypeScript                                      |\n| ---------- | --------------------- | --------------------------------- | ----------------------------------------------- |\n| ✅         | Maybe type            | `let a:?number`                   | `let a: number \\| null \\| undefined`            |\n| ✅         | Void type             | `void`                            | `void`                                          |\n| ✅         | Object type           | `Object`                          | `object`                                        |\n| ✅         | Mixed type            | `mixed`                           | `unknown`                                       |\n| ✅         | Function type         | `(A, B) =\u003e C`                     | `(x1: A, x2: B) =\u003e C`                           |\n| ✅         | Exact type            | `{\\| a: A \\|}`                    | `{ a: A }`                                      |\n| ✅         | Indexers              | `{ [A]: B }`                      | `{ [a: A]: B }`                                 |\n| ✅         | Existential type      | `Map\u003c*, *\u003e`                       | `Map\u003cany, any\u003e`                                 |\n| ✅         | Opaque types          | `opaque type A = B`               | `type A = B`                                    |\n| ✅         | Variance              | `interface A { +b: B, -c: C }`    | `interface A { readonly b: B, c: C }`           |\n| ✅         | Type parameter bounds | `function f\u003cA: string\u003e(a:A){}`    | `function f\u003cA extends string\u003e(a:A){}`           |\n| ✅         | Cast                  | `(a: A)`                          | `(a as A)`                                      |\n| ✅         | type/typeof import    | `import type A from 'module'`     | `import A from 'module'`                        |\n| ✅         | \\$Keys                | `$Keys\u003cX\u003e`                        | `keyof X`                                       |\n| ✅         | \\$Values              | `$Values\u003cX\u003e`                      | `X[keyof X]`                                    |\n| ✅         | \\$ReadOnly            | `$Readonly\u003cX\u003e`                    | `Readonly\u003cX\u003e`                                   |\n| ✅         | \\$Exact               | `$Exact\u003cX\u003e`                       | `X`                                             |\n| ✅         | \\$Diff                | `$Diff\u003cX, Y\u003e`                     | `Pick\u003cX, Exclude\u003ckeyof X, keyof Y\u003e\u003e`            |\n| ✅         | \\$PropertyType        | `$PropertyType\u003cT, k\u003e`             | `T[k]`                                          |\n| ✅         | \\$ElementType         | `$ElementType\u003cT, k\u003e`              | `T[k]`                                          |\n| ✅         | $Shape                | `$Shape\u003cT\u003e`                       | `Partial\u003cT\u003e`                                    |\n| ✅         | Class                 | `Class\u003cT\u003e`                        | `typeof T`                                      |\n| ✅         | typeof operator       | `typeof foo`                      | `typeof foo`                                    |\n| ✅         | JSX                   | -                                 | -                                               |\n| ✅         | Tuple type            | `[number, string]`                | `[number, string]`                              |\n| ✅         | Type alias            | `type A = string`                 | `type A = string`                               |\n| ✅         | Flow Ignore           | `$FlowFixMe`                      | `any`                                           |\n| ✅         | Interfaces            | `interface X { +prop: string }`   | `interface X { readonly prop: string }`         |\n| ✅         | Optional Members      | `a?.b`                            | `...`   |\n| ✅         | Declare functions     | `declare function x(false): true;`| `function x(x0: false): true;`                  |\n| ✅         | Declare Class         | `...`                             | `...`                                           |\n\n[babel]: https://github.com/babel/babel\n[flow]: https://github.com/facebook/flow\n[typescript]: https://github.com/Microsoft/TypeScript\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiikurage%2Fbabel-plugin-flow-to-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiikurage%2Fbabel-plugin-flow-to-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiikurage%2Fbabel-plugin-flow-to-typescript/lists"}