{"id":2977,"date":"2024-01-09T00:00:22","date_gmt":"2024-01-08T16:00:22","guid":{"rendered":"https:\/\/7gugu.com\/?p=2977"},"modified":"2024-08-18T11:19:42","modified_gmt":"2024-08-18T03:19:42","slug":"protobuf2typescript","status":"publish","type":"post","link":"https:\/\/7gugu.com\/index.php\/2024\/01\/09\/protobuf2typescript\/","title":{"rendered":"[Raycast] Protobuf2TypeScript"},"content":{"rendered":"\n<p>A Raycast script which help front-end devloper to convert *.protobuf file into *.d.ts file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installtion Link<\/h2>\n\n\n\n<a title=\"Install protobuf2typescript Raycast Extension\" href=\"https:\/\/www.raycast.com\/7gugu\/protobuf2typescript\"><img decoding=\"async\" src=\"https:\/\/www.raycast.com\/7gugu\/protobuf2typescript\/install_button@2x.png?v=1.1\" height=\"64\" style=\"height: 64px;width: 256px\" alt=\"\"><\/a>\n\n\n\n<h2 class=\"wp-block-heading\">Screenshots<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"a3a198\" data-has-transparency=\"false\" style=\"--dominant-color: #a3a198;\" loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"625\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" src=\"https:\/\/114.132.121.208\/wp-content\/uploads\/2024\/01\/image-7.png\" alt=\"\" class=\"wp-image-4223 not-transparent\" srcset=\"https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-7.png 1000w, https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-7-300x188.png 300w, https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-7-768x480.png 768w\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"a1a096\" data-has-transparency=\"false\" style=\"--dominant-color: #a1a096;\" loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"625\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" src=\"https:\/\/114.132.121.208\/wp-content\/uploads\/2024\/01\/image-6.png\" alt=\"\" class=\"wp-image-4222 not-transparent\" srcset=\"https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-6.png 1000w, https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-6-300x188.png 300w, https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-6-768x480.png 768w\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"a2a197\" data-has-transparency=\"false\" style=\"--dominant-color: #a2a197;\" loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"625\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" src=\"https:\/\/114.132.121.208\/wp-content\/uploads\/2024\/01\/image-8.png\" alt=\"\" class=\"wp-image-4224 not-transparent\" srcset=\"https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-8.png 1000w, https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-8-300x188.png 300w, https:\/\/7gugu.com\/wp-content\/uploads\/2024\/01\/image-8-768x480.png 768w\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Example<\/h2>\n\n\n\n<p>Convert this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>message Person {\n  string name = 1;\n  int32 id = 2;\n  bool isFriend = 3;\n  repeated PhoneNumber phones = 4;\n}\n\nmessage PhoneNumber {\n  string number = 1;\n  PhoneType type = 2;\n}\n\nmessage AddressBook {\n  repeated Person people = 1;\n}<\/code><\/pre>\n\n\n\n<p>into this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>interface Person {\n  name: string;\n  id: number;\n  isFriend: boolean;\n  phones: PhoneNumber&#91;];\n}\n\ninterface PhoneNumber {\n  number: string;\n  type: PhoneType;\n}\n\ninterface AddressBook {\n  people: Person&#91;];\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Idea From<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/geotho\/protobuf-to-typescript\/tree\/master\">protobuf-to-typescript<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A Raycast script which help front-end devloper to conve &hellip; <a href=\"https:\/\/7gugu.com\/index.php\/2024\/01\/09\/protobuf2typescript\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c[Raycast] Protobuf2TypeScript\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2977","post","type-post","status-publish","format-standard","hentry","category-codetype"],"_links":{"self":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/posts\/2977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/comments?post=2977"}],"version-history":[{"count":1,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/posts\/2977\/revisions"}],"predecessor-version":[{"id":4225,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/posts\/2977\/revisions\/4225"}],"wp:attachment":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/media?parent=2977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/categories?post=2977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/tags?post=2977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}