{"id":20827248,"url":"https://github.com/ccnokes/ts-to-flow","last_synced_at":"2026-03-19T17:42:35.395Z","repository":{"id":88144323,"uuid":"496763247","full_name":"ccnokes/ts-to-flow","owner":"ccnokes","description":"Incomplete guide of going from TypeScript to Flow","archived":false,"fork":false,"pushed_at":"2022-09-30T23:29:04.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-07T04:41:25.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/ccnokes.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-05-26T20:30:04.000Z","updated_at":"2025-07-31T17:52:41.000Z","dependencies_parsed_at":"2023-07-23T19:45:18.768Z","dependency_job_id":null,"html_url":"https://github.com/ccnokes/ts-to-flow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ccnokes/ts-to-flow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccnokes%2Fts-to-flow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccnokes%2Fts-to-flow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccnokes%2Fts-to-flow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccnokes%2Fts-to-flow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccnokes","download_url":"https://codeload.github.com/ccnokes/ts-to-flow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccnokes%2Fts-to-flow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29251502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-11-17T23:11:34.187Z","updated_at":"2026-02-09T00:31:43.487Z","avatar_url":"https://github.com/ccnokes.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Converting common TS constructs to Flow\n\nA very incomplete guide of going from TypeScript to Flow. Not sure why you would do this unless you work at Meta 😅 . Otherwise, you probably want to go from flow to TS.  \n\nTry the two here: \n- [Flow playground](https://flow.org/try)\n- [TS playground](https://www.typescriptlang.org/play)\n\nAnother (out of date) reference: https://github.com/niieani/typescript-vs-flowtype\n\nAll examples show TS first, then Flow.\n\n## General\n\n### typeof\nUsage is same in the two.\n\n### keyof \n```ts\ntype Obj = {\n  a: 123\n}\ntype keys = keyof Obj;\n```\n\n```js\ntype Obj = {\n  a: 123\n}\n$Keys\u003cObj\u003e\n```\n\n### nullable/maybe types\nThis is actually sort of a sore spot in TS. If you have `strictNullChecks` on (recommended), it can make sense to have a global type that looks like this: \n```ts\ntype Nullable\u003cT\u003e = T | undefined | null;\n```\nIn flow, this concept is built-in with the `?` prefix operator.\n```js\n?string\n```\n\n### Partial\u003cT\u003e\nIn flow, `$Shape` is equivalent to `Partial`.\n```ts\ntype Obj = { id: number, name: string };\nPartial\u003cObj\u003e\n```\n\n```js\ntype Obj = { id: number, name: string };\n$Shape\u003cObj\u003e\n```\n\n## Built-ins\n\n### Record \n```ts\nRecord\u003cstring, string | null\u003e\n```\nThere's no built-in for this in flow.\n```js\n{[key: string]: ?string}\n```\n\n\n## React\n\n### ComponentProps\n```tsx\nReact.ComponentProps\u003ctypeof MyComponent\u003e['propName']\n```\n\n```js\nReact.ElementProps\u003ctypeof MyComponent\u003e['propName']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccnokes%2Fts-to-flow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccnokes%2Fts-to-flow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccnokes%2Fts-to-flow/lists"}