{"id":25000168,"url":"https://github.com/thinkmill/magical-types","last_synced_at":"2025-10-08T06:19:16.426Z","repository":{"id":40360843,"uuid":"195599359","full_name":"Thinkmill/magical-types","owner":"Thinkmill","description":"🔮 Document React components and other stuff typed with TypeScript magically","archived":false,"fork":false,"pushed_at":"2023-03-04T04:17:22.000Z","size":4821,"stargazers_count":77,"open_issues_count":5,"forks_count":2,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-10-01T06:38:03.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Thinkmill.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,"zenodo":null}},"created_at":"2019-07-07T01:55:50.000Z","updated_at":"2023-09-07T06:17:43.000Z","dependencies_parsed_at":"2025-04-12T08:44:51.340Z","dependency_job_id":"2d59c308-583e-48a4-8985-c58956708195","html_url":"https://github.com/Thinkmill/magical-types","commit_stats":null,"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/Thinkmill/magical-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkmill%2Fmagical-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkmill%2Fmagical-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkmill%2Fmagical-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkmill%2Fmagical-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thinkmill","download_url":"https://codeload.github.com/Thinkmill/magical-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkmill%2Fmagical-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278898979,"owners_count":26065103,"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-10-08T02:00:06.501Z","response_time":56,"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":"2025-02-04T19:31:43.491Z","updated_at":"2025-10-08T06:19:16.389Z","avatar_url":"https://github.com/Thinkmill.png","language":"TypeScript","readme":"# 🔮 magical-types\n\n\u003e Document React components and other stuff typed with TypeScript _magically_\n\n## Getting Started\n\n### Installing babel-plugin-macros\n\nmagical-types is used as a [Babel Macro](https://github.com/kentcdodds/babel-plugin-macros). Unless you're using Create React App or Gatsby, you'll need to install it and add it to your Babel config.\n\n```bash\nyarn add babel-plugin-macros\n```\n\n```json\n{\n  \"plugins\": [\"babel-plugin-macros\"]\n}\n```\n\n### Installing magical-types\n\n```bash\nyarn add @magical-types/macro\n```\n\n### Using it\n\n```tsx\nimport { PropTypes, FunctionTypes, RawTypes } from \"@magical-types/macro\";\n\ntype Props = {\n  someProp: string;\n};\n\nlet MyComponent = (props: Props) =\u003e {\n  return \u003cdiv /\u003e;\n};\n\n\u003cPropTypes component={MyComponent} /\u003e;\n\nfunction myFunctionThatDoesCoolStuff(someArgument: { thing: true }) {}\n\n\u003cFunctionTypes function={myFunctionThatDoesCoolStuff} /\u003e;\n\ntype SomeObject = { someProperty: boolean };\n\n\u003cRawTypes\u003cSomeObject\u003e /\u003e;\n\nfunction someFunctionThatReturnsAComponent() {\n  return MyComponent;\n}\n\nlet AnotherComp = someFunctionThatReturnsAComponent();\n\n\u003cPropTypes component={AnotherComp} /\u003e;\n```\n\n## Thanks/Inspiration\n\nThis project is mostly some ideas that I've been thinking about because of some of the constraints in [react-docgen](https://github.com/reactjs/react-docgen), [react-docgen-typescript](https://github.com/styleguidist/react-docgen-typescript) and [extract-react-types](https://github.com/atlassian/extract-react-types) and how some problems could be removed by changing some constraints, notably the removal of having to know what is and isn't a React component.\n\nThe code for rendering types is **heavily** based off [pretty-proptypes](https://github.com/atlassian/extract-react-types/tree/master/packages/pretty-proptypes).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkmill%2Fmagical-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinkmill%2Fmagical-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkmill%2Fmagical-types/lists"}