{"id":20158648,"url":"https://github.com/ahaoboy/dts2rs","last_synced_at":"2026-05-12T06:37:17.907Z","repository":{"id":247416971,"uuid":"825698281","full_name":"ahaoboy/dts2rs","owner":"ahaoboy","description":"convert typescript to rust","archived":false,"fork":false,"pushed_at":"2024-07-10T14:03:35.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T13:28:06.078Z","etag":null,"topics":["rust","typescript","web"],"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/ahaoboy.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":"2024-07-08T10:34:26.000Z","updated_at":"2024-07-09T08:54:58.000Z","dependencies_parsed_at":"2024-07-09T16:46:05.963Z","dependency_job_id":null,"html_url":"https://github.com/ahaoboy/dts2rs","commit_stats":null,"previous_names":["ahaoboy/dts2rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahaoboy%2Fdts2rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahaoboy%2Fdts2rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahaoboy%2Fdts2rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahaoboy%2Fdts2rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahaoboy","download_url":"https://codeload.github.com/ahaoboy/dts2rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241596619,"owners_count":19988105,"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":["rust","typescript","web"],"created_at":"2024-11-13T23:51:34.298Z","updated_at":"2026-05-12T06:37:17.851Z","avatar_url":"https://github.com/ahaoboy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## dts2rs\n\nconvert typescript to rust\n\n```bash\ndts2rs ./examples --outdir=dist-rs\n```\n\n## rules\n\n### string/number/boolean\n```ts\ns: string\nn: number\nb: boolean\n```\n```rs\ns: String\nn: f32\nb: bool\n```\n\n### Optional\n\n```ts\nv?: number | null\n```\n\n```rs\nv: Option\u003cf32\u003e\n```\n\n### Array\n```ts\nv: boolean[]\n```\n```rs\nv: Vec\u003cbool\u003e\n```\n\n### struct\n```ts\nexport interface A{\n  a: number\n}\nexport interface B{\n  a: A\n}\n```\n\n```rs\npub struct A;\npub struct B{\n  a: A\n};\n```\n### HashMap\n```ts\nexport interface A{\n  a: { [key: string]: string; }\n}\n```\n\n```rs\npub struct A{\n  a: std::collections::HashMap\u003cString, String\u003e\n}\n```\n\n## Who's Using dts2rs?\n- [serde-jellyfin](https://github.com/ahaoboy/serde-jellyfin)\n\n## todo\n\n- [ ] support any type\n- [ ] custom convert function\n- [ ] more number type\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahaoboy%2Fdts2rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahaoboy%2Fdts2rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahaoboy%2Fdts2rs/lists"}