Skip to content

Commit

Permalink
Add typespec support
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Apr 30, 2024
1 parent 33cb71d commit 0f24b24
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 93 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ TOML (toml)
Twig Template (twig)
TypeScript (ts,tsx)
TypeScript Typings (d.ts)
TypeSpec (tsp)
Unreal Script (uc,uci,upkg)
Ur/Web (ur,urs)
Ur/Web Project (urp)
Expand Down
95 changes: 61 additions & 34 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<th>451</th>
<th>7612</th>
<th>1546</th>
<th>397903</th>
<th>398391</th>
</tr><tr>
<th>Java</th>
<th>24</th>
Expand All @@ -39,12 +39,12 @@
</tr><tr>
<th>Markdown</th>
<th>11</th>
<th>1497</th>
<th>1498</th>
<th>362</th>
<th>0</th>
<th>1135</th>
<th>1136</th>
<th>0</th>
<th>60393</th>
<th>60408</th>
</tr><tr>
<th>Python</th>
<th>11</th>
Expand All @@ -56,13 +56,13 @@
<th>18844</th>
</tr><tr>
<th>YAML</th>
<th>8</th>
<th>394</th>
<th>9</th>
<th>930</th>
<th>66</th>
<th>61</th>
<th>267</th>
<th>62</th>
<th>802</th>
<th>0</th>
<th>12132</th>
<th>18996</th>
</tr><tr>
<th>CSS</th>
<th>5</th>
Expand Down Expand Up @@ -107,7 +107,7 @@
<th>92</th>
<th>912</th>
<th>104</th>
<th>41219</th>
<th>41231</th>
</tr><tr>
<th>C#</th>
<th>2</th>
Expand All @@ -126,6 +126,24 @@
<th>12</th>
<th>0</th>
<th>268</th>
</tr><tr>
<th>HTML</th>
<th>2</th>
<th>1612</th>
<th>0</th>
<th>0</th>
<th>1612</th>
<th>0</th>
<th>23396</th>
</tr><tr>
<th>JSON</th>
<th>2</th>
<th>9043</th>
<th>0</th>
<th>0</th>
<th>9043</th>
<th>0</th>
<th>139859</th>
</tr><tr>
<th>JavaServer Pages</th>
<th>2</th>
Expand Down Expand Up @@ -279,6 +297,15 @@
<th>3</th>
<th>0</th>
<th>76</th>
</tr><tr>
<th>CSV</th>
<th>1</th>
<th>88</th>
<th>0</th>
<th>0</th>
<th>88</th>
<th>0</th>
<th>2351</th>
</tr><tr>
<th>Cairo</th>
<th>1</th>
Expand Down Expand Up @@ -477,15 +504,6 @@
<th>10</th>
<th>0</th>
<th>245</th>
</tr><tr>
<th>HTML</th>
<th>1</th>
<th>824</th>
<th>0</th>
<th>0</th>
<th>824</th>
<th>0</th>
<th>11947</th>
</tr><tr>
<th>Hare</th>
<th>1</th>
Expand All @@ -504,15 +522,6 @@
<th>7</th>
<th>0</th>
<th>226</th>
</tr><tr>
<th>JSON</th>
<th>1</th>
<th>9024</th>
<th>8</th>
<th>0</th>
<th>9016</th>
<th>0</th>
<th>126488</th>
</tr><tr>
<th>JSONC</th>
<th>1</th>
Expand Down Expand Up @@ -657,6 +666,15 @@
<th>0</th>
<th>0</th>
<th>0</th>
</tr><tr>
<th>SQL</th>
<th>1</th>
<th>229</th>
<th>0</th>
<th>0</th>
<th>229</th>
<th>0</th>
<th>27013</th>
</tr><tr>
<th>Sieve</th>
<th>1</th>
Expand Down Expand Up @@ -702,6 +720,15 @@
<th>1</th>
<th>0</th>
<th>167</th>
</tr><tr>
<th>TypeSpec</th>
<th>1</th>
<th>19</th>
<th>4</th>
<th>0</th>
<th>15</th>
<th>0</th>
<th>264</th>
</tr><tr>
<th>V</th>
<th>1</th>
Expand Down Expand Up @@ -795,12 +822,12 @@
</tr></tbody>
<tfoot><tr>
<th>Total</th>
<th>209</th>
<th>94407</th>
<th>4639</th>
<th>5951</th>
<th>83817</th>
<th>215</th>
<th>96087</th>
<th>4635</th>
<th>5952</th>
<th>85500</th>
<th>2932</th>
<th>3144034</th>
<th>3205861</th>
</tr></tfoot>
</table></body></html>
19 changes: 19 additions & 0 deletions examples/language/typespec.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import "@typespec/http";

using TypeSpec.Http;

model Store {
name: string;
address: Address;
}

model Address {
street: string;
city: string;
}

@route("/stores")
interface Stores {
list(@query filter: string): Store[];
read(@path id: Store): Store;
}
Loading

0 comments on commit 0f24b24

Please sign in to comment.