@stainless-api/docs-ui 0.1.0-beta.6 → 0.1.0-beta.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/dist/breadcrumbs-BVskoBYz.d.ts +25 -0
  2. package/dist/breadcrumbs-C9LLJyuJ.d.ts +25 -0
  3. package/dist/breadcrumbs-CqA6kow2.js +63 -0
  4. package/dist/chunk-BN_g-Awi.js +18 -0
  5. package/dist/cli-0bJ66S1r.js +157 -0
  6. package/dist/component-CjJJYIxG.js +23 -0
  7. package/dist/component-generics-BC_P155r.d.ts +30 -0
  8. package/dist/component-generics-BkwbbxJF.d.ts +30 -0
  9. package/dist/component-generics-POFirVVb.js +45 -0
  10. package/dist/components/MaskedInput.d.ts +14 -0
  11. package/dist/components/MaskedInput.js +76 -0
  12. package/dist/components/breadcrumbs.d.ts +2 -0
  13. package/dist/components/breadcrumbs.js +9 -0
  14. package/dist/components/icons.d.ts +60 -0
  15. package/dist/components/icons.js +3 -0
  16. package/dist/components/index.d.ts +10 -0
  17. package/dist/components/index.js +18 -0
  18. package/dist/components/method.d.ts +2 -0
  19. package/dist/components/method.js +10 -0
  20. package/dist/components/overview.d.ts +2 -0
  21. package/dist/components/overview.js +11 -0
  22. package/dist/components/primitives.d.ts +2 -0
  23. package/dist/components/primitives.js +8 -0
  24. package/dist/components/properties.d.ts +2 -0
  25. package/dist/components/properties.js +9 -0
  26. package/dist/components/sdk.d.ts +2 -0
  27. package/dist/components/sdk.js +10 -0
  28. package/dist/components/sidebar.d.ts +2 -0
  29. package/dist/components/sidebar.js +9 -0
  30. package/dist/components/snippets.d.ts +3 -0
  31. package/dist/components/snippets.js +9 -0
  32. package/dist/components-FEHnQBJC.js +70 -0
  33. package/dist/contexts/component-generics.d.ts +2 -0
  34. package/dist/contexts/component-generics.js +3 -0
  35. package/dist/contexts/component-types.d.ts +16 -0
  36. package/dist/contexts/component-types.js +0 -0
  37. package/dist/contexts/component.d.ts +29 -0
  38. package/dist/contexts/component.js +28 -0
  39. package/dist/contexts/docs.d.ts +2 -0
  40. package/dist/contexts/docs.js +3 -0
  41. package/dist/contexts/index.d.ts +22 -0
  42. package/dist/contexts/index.js +7 -0
  43. package/dist/contexts/markdown.d.ts +2 -0
  44. package/dist/contexts/markdown.js +4 -0
  45. package/dist/contexts/navigation.d.ts +2 -0
  46. package/dist/contexts/navigation.js +3 -0
  47. package/dist/contexts/use-components.d.ts +14 -0
  48. package/dist/contexts/use-components.js +4 -0
  49. package/dist/contexts-CeV_L_Iy.js +39 -0
  50. package/dist/csharp-Dl2RIiYP.js +283 -0
  51. package/dist/docs--qWFuJCM.d.ts +46 -0
  52. package/dist/docs-DSFRsmbQ.d.ts +46 -0
  53. package/dist/docs-Di94viZV.js +54 -0
  54. package/dist/go-DuKdRGqU.js +303 -0
  55. package/dist/http-C7bu4oCl.js +331 -0
  56. package/dist/icons-BYKn5X8E.js +885 -0
  57. package/dist/index-C0qvL4yP.d.ts +15 -0
  58. package/dist/index-DE1vA8T2.d.ts +302 -0
  59. package/dist/index-DsFyACw9.d.ts +15 -0
  60. package/dist/index-FDM-j9s-.d.ts +302 -0
  61. package/dist/index-zNpvNvtN.d.ts +1691 -0
  62. package/dist/index.d.ts +19 -0
  63. package/dist/index.js +30 -7542
  64. package/dist/java-DSyzO-6F.js +403 -0
  65. package/dist/languages/cli.d.ts +11 -0
  66. package/dist/languages/cli.js +20 -0
  67. package/dist/languages/csharp.d.ts +11 -0
  68. package/dist/languages/csharp.js +9 -0
  69. package/dist/languages/go.d.ts +11 -0
  70. package/dist/languages/go.js +9 -0
  71. package/dist/languages/http.d.ts +11 -0
  72. package/dist/languages/http.js +19 -0
  73. package/dist/languages/index.d.ts +11 -0
  74. package/dist/languages/index.js +27 -0
  75. package/dist/languages/java.d.ts +11 -0
  76. package/dist/languages/java.js +9 -0
  77. package/dist/languages/python.d.ts +11 -0
  78. package/dist/languages/python.js +9 -0
  79. package/dist/languages/ruby.d.ts +11 -0
  80. package/dist/languages/ruby.js +9 -0
  81. package/dist/languages/typescript.d.ts +11 -0
  82. package/dist/languages/typescript.js +9 -0
  83. package/dist/languages-BO5YJ6cy.js +28 -0
  84. package/dist/markdown/index.d.ts +12 -0
  85. package/dist/markdown/index.js +105 -0
  86. package/dist/markdown/md.d.ts +15 -0
  87. package/dist/markdown/md.js +41 -0
  88. package/dist/markdown/printer.d.ts +13 -0
  89. package/dist/markdown/printer.js +98 -0
  90. package/dist/markdown/utils.d.ts +21 -0
  91. package/dist/markdown/utils.js +31 -0
  92. package/dist/markdown-B517MrZh.d.ts +22 -0
  93. package/dist/markdown-C7Tb41LZ.d.ts +22 -0
  94. package/dist/markdown-D2JWyRws.js +49 -0
  95. package/dist/method-BaQEZVlw.d.ts +59 -0
  96. package/dist/method-Dln4ZTIB.d.ts +59 -0
  97. package/dist/method-jTnA0G8m.js +90 -0
  98. package/dist/navigation-XhIgqXwM.d.ts +29 -0
  99. package/dist/navigation-aoYZ_tl4.js +24 -0
  100. package/dist/navigation-rKdts-BR.d.ts +29 -0
  101. package/dist/overview-B3kgyac2.d.ts +39 -0
  102. package/dist/overview-BnagZfH1.js +139 -0
  103. package/dist/overview-Dp-gGl3v.d.ts +39 -0
  104. package/dist/primitives-B6zu2rrx.d.ts +105 -0
  105. package/dist/primitives-DQLc9kN7.js +250 -0
  106. package/dist/primitives-VtUGoYwX.d.ts +105 -0
  107. package/dist/properties-Bun4nfUE.d.ts +54 -0
  108. package/dist/properties-DGL2J11L.js +131 -0
  109. package/dist/properties-ZOIqpkET.d.ts +54 -0
  110. package/dist/python-D8ABqtn1.js +269 -0
  111. package/dist/routing-Ce0_tBW6.js +197 -0
  112. package/dist/routing-CtbZJru_.d.ts +54 -0
  113. package/dist/routing.d.ts +2 -0
  114. package/dist/routing.js +3 -180
  115. package/dist/ruby-261jvCjl.js +387 -0
  116. package/dist/sdk-BebFnWYL.d.ts +118 -0
  117. package/dist/sdk-CIxaNoAs.d.ts +118 -0
  118. package/dist/sdk-GGpyGTao.js +338 -0
  119. package/dist/sidebar-BWno0E4w.js +85 -0
  120. package/dist/sidebar-CLsIJZZf.d.ts +36 -0
  121. package/dist/sidebar-D4m_pVpS.d.ts +36 -0
  122. package/dist/snippets-CwVjwsAo.d.ts +53 -0
  123. package/dist/snippets-Ym3mnHO3.d.ts +53 -0
  124. package/dist/snippets-kI8eNs1F.js +164 -0
  125. package/dist/spec.d.ts +65 -0
  126. package/dist/spec.js +167 -0
  127. package/dist/style-LwfvXElj.js +170 -0
  128. package/dist/style.d.ts +169 -0
  129. package/dist/style.js +3 -0
  130. package/dist/styles/main.css +722 -755
  131. package/dist/styles/main.js +0 -0
  132. package/dist/styles/primitives.css +322 -459
  133. package/dist/styles/primitives.js +0 -0
  134. package/dist/styles/resets.css +32 -41
  135. package/dist/styles/resets.js +0 -0
  136. package/dist/styles/search.css +192 -270
  137. package/dist/styles/search.js +0 -0
  138. package/dist/styles/sidebar.css +56 -61
  139. package/dist/styles/sidebar.js +0 -0
  140. package/dist/styles/variables.css +26 -89
  141. package/dist/styles/variables.js +0 -0
  142. package/dist/styles.css +3145 -0
  143. package/dist/styles.mjs +1 -0
  144. package/dist/typescript-D924WidI.js +449 -0
  145. package/dist/use-components-BUz3GbO4.js +7 -0
  146. package/dist/utils-D01mAUfQ.js +32 -0
  147. package/dist/utils.d.ts +14 -0
  148. package/dist/utils.js +3 -0
  149. package/package.json +73 -21
  150. package/dist/mcp.js +0 -16003
  151. package/dist/styles/snippets.css +0 -132
  152. package/src/components/breadcrumbs.tsx +0 -94
  153. package/src/components/chat.tsx +0 -154
  154. package/src/components/dropdown.tsx +0 -91
  155. package/src/components/icons.tsx +0 -584
  156. package/src/components/index.ts +0 -9
  157. package/src/components/method.tsx +0 -144
  158. package/src/components/overview.tsx +0 -159
  159. package/src/components/primitives.tsx +0 -284
  160. package/src/components/properties.tsx +0 -130
  161. package/src/components/scripts/dropdown.ts +0 -78
  162. package/src/components/sdk.tsx +0 -402
  163. package/src/components/sidebar.tsx +0 -99
  164. package/src/components/snippets.tsx +0 -179
  165. package/src/contexts/component-generics.tsx +0 -48
  166. package/src/contexts/component-types.tsx +0 -5
  167. package/src/contexts/component.tsx +0 -32
  168. package/src/contexts/docs.tsx +0 -75
  169. package/src/contexts/index.tsx +0 -17
  170. package/src/contexts/markdown.tsx +0 -43
  171. package/src/contexts/navigation.tsx +0 -44
  172. package/src/contexts/search.tsx +0 -28
  173. package/src/contexts/use-components.tsx +0 -4
  174. package/src/index.ts +0 -6
  175. package/src/languages/go.tsx +0 -281
  176. package/src/languages/http.tsx +0 -321
  177. package/src/languages/index.ts +0 -26
  178. package/src/languages/java.tsx +0 -358
  179. package/src/languages/python.tsx +0 -255
  180. package/src/languages/ruby.tsx +0 -320
  181. package/src/languages/typescript.tsx +0 -393
  182. package/src/markdown/index.ts +0 -107
  183. package/src/markdown/md.ts +0 -45
  184. package/src/markdown/utils.ts +0 -49
  185. package/src/routing.ts +0 -238
  186. package/src/search/form.tsx +0 -127
  187. package/src/search/index.tsx +0 -1
  188. package/src/search/indexer.ts +0 -246
  189. package/src/search/mcp.ts +0 -61
  190. package/src/search/printer.tsx +0 -86
  191. package/src/search/providers/algolia.ts +0 -88
  192. package/src/search/providers/fuse.ts +0 -19
  193. package/src/search/providers/pagefind.ts +0 -17
  194. package/src/search/providers/walker.ts +0 -30
  195. package/src/search/results.tsx +0 -181
  196. package/src/search/state.ts +0 -64
  197. package/src/search/types.ts +0 -116
  198. package/src/style.ts +0 -197
  199. package/src/styles/main.css +0 -993
  200. package/src/styles/primitives.css +0 -573
  201. package/src/styles/resets.css +0 -47
  202. package/src/styles/search.css +0 -342
  203. package/src/styles/sidebar.css +0 -87
  204. package/src/styles/snippets.css +0 -132
  205. package/src/styles/variables.css +0 -90
  206. package/src/utils.ts +0 -41
@@ -0,0 +1,331 @@
1
+ import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
+ import { a as useLanguage, l as useSpec, r as useDeclaration } from "./docs-Di94viZV.js";
3
+ import { n as useLanguageComponents } from "./contexts-CeV_L_Iy.js";
4
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
5
+ import { t as style_default } from "./style-LwfvXElj.js";
6
+ import { i as PropertyToggle } from "./properties-DGL2J11L.js";
7
+ import React from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+
10
+ //#region src/languages/http.tsx
11
+ var http_exports = /* @__PURE__ */ __exportAll({
12
+ Declaration: () => Declaration,
13
+ MethodInfo: () => MethodInfo,
14
+ MethodSignature: () => MethodSignature,
15
+ Property: () => Property,
16
+ Type: () => Type,
17
+ TypeName: () => TypeName
18
+ });
19
+ const ComplexTypes = {
20
+ HttpTypeUnion: "union",
21
+ HttpTypeIntersection: "intersection"
22
+ };
23
+ const constStyle = {
24
+ string: style_default.LiteralString,
25
+ number: style_default.LiteralNumeric,
26
+ boolean: style_default.LiteralBoolean
27
+ };
28
+ function Identifier({ name }) {
29
+ return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("span", {
30
+ className: style_default.TextIdentifier,
31
+ children: /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(name) ? name : JSON.stringify(name)
32
+ }) });
33
+ }
34
+ function TypePreview({ path }) {
35
+ const spec = useSpec();
36
+ const language = useLanguage();
37
+ const decl = useDeclaration(path, false);
38
+ const { Join } = useComponents();
39
+ if (!(decl && "children" in decl && decl.children && decl.children.length > 0) || "type" in decl && decl["type"] && "kind" in decl["type"] && decl["type"]["kind"] === "HttpTypeUnion") return;
40
+ const items = decl.children.map((prop, key) => {
41
+ const decl = spec?.decls?.[language]?.[prop];
42
+ const ident = decl && "key" in decl ? decl.key : decl && "ident" in decl ? decl.ident : null;
43
+ return /* @__PURE__ */ jsx("span", {
44
+ className: style_default.TypePropertyName,
45
+ children: /* @__PURE__ */ jsx("span", {
46
+ className: style_default.TextIdentifier,
47
+ children: ident
48
+ })
49
+ }, key);
50
+ });
51
+ return /* @__PURE__ */ jsxs("span", {
52
+ className: style_default.TypePreview,
53
+ "data-stldocs-type-preview": "properties",
54
+ children: [
55
+ /* @__PURE__ */ jsx("span", {
56
+ className: style_default.TypeBrace,
57
+ children: " { "
58
+ }),
59
+ /* @__PURE__ */ jsx("span", {
60
+ className: style_default.TypePreviewContent,
61
+ children: /* @__PURE__ */ jsx(Join, {
62
+ items,
63
+ limit: 3,
64
+ children: /* @__PURE__ */ jsx("span", {
65
+ className: style_default.TextOperator,
66
+ children: ", "
67
+ })
68
+ })
69
+ }),
70
+ /* @__PURE__ */ jsx("span", {
71
+ className: style_default.TypeBrace,
72
+ children: " } "
73
+ })
74
+ ]
75
+ });
76
+ }
77
+ function TypeName({ type }) {
78
+ const Lang = useLanguageComponents();
79
+ if (type.kind === "HttpTypeArray") return /* @__PURE__ */ jsxs(Fragment$1, { children: ["array of ", /* @__PURE__ */ jsx(Lang.TypeName, { type: type.elementType })] });
80
+ if (type.kind === "HttpTypeUnion" && type.types.every((t) => t.kind === "HttpTypeLiteral")) return "enum";
81
+ if (type.kind === "HttpTypeReference" && type.ident.split(".").at(-1) === "Record") return "map";
82
+ return ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
83
+ }
84
+ function Type({ type }) {
85
+ const Lang = useLanguageComponents();
86
+ const { Join, SDKReference } = useComponents();
87
+ switch (type.kind) {
88
+ case "HttpTypeUnknown":
89
+ case "HttpTypeUndefined":
90
+ case "HttpTypeNull":
91
+ case "HttpTypeBoolean":
92
+ case "HttpTypeNumber": return /* @__PURE__ */ jsx("span", {
93
+ className: style_default.Type,
94
+ children: /* @__PURE__ */ jsx("span", {
95
+ className: style_default.TypePlain,
96
+ children: type.kind.slice(8).toLowerCase()
97
+ })
98
+ });
99
+ case "HttpTypeString": return /* @__PURE__ */ jsx("span", {
100
+ className: style_default.Type,
101
+ children: /* @__PURE__ */ jsx("span", {
102
+ className: style_default.TypePlain,
103
+ children: "string"
104
+ })
105
+ });
106
+ case "HttpTypeLiteral": return /* @__PURE__ */ jsx("span", {
107
+ className: style_default.Type,
108
+ children: /* @__PURE__ */ jsx("span", {
109
+ className: constStyle[typeof type.literal],
110
+ children: JSON.stringify(type.literal)
111
+ })
112
+ });
113
+ case "HttpTypeArray": return /* @__PURE__ */ jsxs("span", {
114
+ className: style_default.Type,
115
+ children: [/* @__PURE__ */ jsx("span", {
116
+ className: style_default.TypeArray,
117
+ children: "array of "
118
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType })]
119
+ });
120
+ case "HttpTypeIntersection":
121
+ case "HttpTypeUnion": {
122
+ const items = type.types.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
123
+ const delimiter = type.kind === "HttpTypeUnion" ? "or" : "and";
124
+ return /* @__PURE__ */ jsx("span", {
125
+ className: style_default.Type,
126
+ children: /* @__PURE__ */ jsx("span", {
127
+ className: style_default.TypePreview,
128
+ "data-stldocs-type-preview": "union",
129
+ children: /* @__PURE__ */ jsx("span", {
130
+ className: style_default.TypePreviewContent,
131
+ children: /* @__PURE__ */ jsx(Join, {
132
+ items,
133
+ limit: 3,
134
+ children: /* @__PURE__ */ jsxs("span", {
135
+ className: style_default.TextOperator,
136
+ children: [
137
+ " ",
138
+ delimiter,
139
+ " "
140
+ ]
141
+ })
142
+ })
143
+ })
144
+ })
145
+ });
146
+ }
147
+ case "HttpTypeReference": {
148
+ const name = type.ident.split(".").at(-1);
149
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
150
+ if (name === "Record" && type.typeParameters?.length === 2 && type.typeParameters?.at(0).kind === "HttpTypeString") return /* @__PURE__ */ jsxs(Fragment$1, { children: [
151
+ /* @__PURE__ */ jsx("span", {
152
+ className: style_default.TypeArray,
153
+ children: "map"
154
+ }),
155
+ "[",
156
+ params?.[1],
157
+ "]"
158
+ ] });
159
+ return /* @__PURE__ */ jsxs("span", {
160
+ className: style_default.Type,
161
+ children: [
162
+ /* @__PURE__ */ jsx(SDKReference, {
163
+ stainlessPath: type.$ref,
164
+ children: name
165
+ }),
166
+ params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
167
+ /* @__PURE__ */ jsx("span", {
168
+ className: style_default.TypeBracket,
169
+ children: "<"
170
+ }),
171
+ /* @__PURE__ */ jsx(Join, {
172
+ items: params,
173
+ limit: 3,
174
+ children: /* @__PURE__ */ jsx("span", {
175
+ className: style_default.TextOperator,
176
+ children: ", "
177
+ })
178
+ }),
179
+ /* @__PURE__ */ jsx("span", {
180
+ className: style_default.TypeBracket,
181
+ children: ">"
182
+ })
183
+ ] }),
184
+ /* @__PURE__ */ jsx(TypePreview, { path: type.$ref })
185
+ ]
186
+ });
187
+ }
188
+ case "HttpTypeObject": {
189
+ const items = type.members.map(({ ident }) => /* @__PURE__ */ jsx("span", {
190
+ className: style_default.TypePropertyName,
191
+ children: /* @__PURE__ */ jsx(Identifier, { name: ident })
192
+ }, ident));
193
+ return /* @__PURE__ */ jsxs("span", {
194
+ className: style_default.Type,
195
+ children: [/* @__PURE__ */ jsx("span", {
196
+ className: style_default.TypePlain,
197
+ children: "object"
198
+ }), /* @__PURE__ */ jsxs("span", {
199
+ className: style_default.TypePreview,
200
+ "data-stldocs-type-preview": "properties",
201
+ children: [
202
+ /* @__PURE__ */ jsx("span", {
203
+ className: style_default.TypeBrace,
204
+ children: " {"
205
+ }),
206
+ /* @__PURE__ */ jsxs("span", {
207
+ className: style_default.TypePreviewContent,
208
+ children: [
209
+ " ",
210
+ /* @__PURE__ */ jsx(Join, {
211
+ items,
212
+ limit: 3,
213
+ children: /* @__PURE__ */ jsx("span", {
214
+ className: style_default.TextOperator,
215
+ children: ", "
216
+ })
217
+ }),
218
+ " "
219
+ ]
220
+ }),
221
+ /* @__PURE__ */ jsx("span", {
222
+ className: style_default.TypeBrace,
223
+ children: "} "
224
+ })
225
+ ]
226
+ })]
227
+ });
228
+ }
229
+ }
230
+ }
231
+ function MethodSignature({ decl }) {
232
+ return null;
233
+ }
234
+ function MethodInfo({ decl, children }) {
235
+ const Docs = useComponents();
236
+ const params = Object.entries(decl.paramsChildren).filter(([, value]) => value.length).map(([location, value]) => /* @__PURE__ */ jsx(React.Fragment, { children: /* @__PURE__ */ jsxs("div", {
237
+ className: style_default.MethodParameters,
238
+ "data-stldocs-property-group": location.at(0),
239
+ children: [/* @__PURE__ */ jsxs("h5", { children: [
240
+ location.at(0).toUpperCase(),
241
+ location.slice(1),
242
+ " Parameters",
243
+ /* @__PURE__ */ jsx(PropertyToggle, { target: location.at(0) })
244
+ ] }), /* @__PURE__ */ jsx(Docs.SDKChildren, { paths: value })]
245
+ }) }, location));
246
+ if ((decl.bodyParamsChildren?.["application/json"]?.length ?? 0) > 0) params.push(/* @__PURE__ */ jsxs("div", {
247
+ className: style_default.MethodInfoSection,
248
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Body Parameters", /* @__PURE__ */ jsx(PropertyToggle, { target: "body" })] }), /* @__PURE__ */ jsx("div", {
249
+ className: style_default.MethodParameters,
250
+ "data-stldocs-property-group": "body",
251
+ children: /* @__PURE__ */ jsx(Docs.SDKChildren, { paths: decl.bodyParamsChildren?.["application/json"] ?? [] })
252
+ })]
253
+ }, "method-info-section"));
254
+ return /* @__PURE__ */ jsxs("div", {
255
+ className: style_default.MethodInfo,
256
+ children: [
257
+ children && /* @__PURE__ */ jsx("div", {
258
+ className: style_default.MethodContent,
259
+ children
260
+ }),
261
+ params.length > 0 && params,
262
+ (decl.responseChildren?.length ?? 0) > 0 && /* @__PURE__ */ jsxs("div", {
263
+ className: style_default.MethodInfoSection,
264
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Returns", /* @__PURE__ */ jsx(PropertyToggle, { target: "returns" })] }), /* @__PURE__ */ jsx("div", {
265
+ className: style_default.MethodReturns,
266
+ "data-stldocs-property-group": "returns",
267
+ children: /* @__PURE__ */ jsx(Docs.SDKChildren, { paths: decl.responseChildren ?? [] })
268
+ })]
269
+ })
270
+ ]
271
+ });
272
+ }
273
+ function renderVariantInfo(type) {
274
+ if (type.kind === "HttpTypeUnion" && type.types.every((t) => t.kind === "HttpTypeObject" || t.kind === "HttpTypeReference")) return /* @__PURE__ */ jsxs(Fragment$1, { children: [
275
+ "One of the following ",
276
+ type.types.length,
277
+ " object variants:"
278
+ ] });
279
+ }
280
+ function Property({ decl, children }) {
281
+ const Lang = useLanguageComponents();
282
+ if (!decl) return;
283
+ switch (decl.kind) {
284
+ case "HttpDeclProperty": {
285
+ const variants = renderVariantInfo(decl.type);
286
+ return children({
287
+ name: decl.key,
288
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
289
+ type: decl.type.kind in ComplexTypes && !variants && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
290
+ });
291
+ }
292
+ case "HttpDeclTypeAlias": return children({
293
+ name: decl.ident,
294
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type })
295
+ });
296
+ case "HttpDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
297
+ }
298
+ }
299
+ function Declaration({ decl }) {
300
+ const Lang = useLanguageComponents();
301
+ if (!decl) return;
302
+ switch (decl.kind) {
303
+ case "HttpDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
304
+ /* @__PURE__ */ jsx("span", {
305
+ className: style_default.TypePropertyName,
306
+ children: /* @__PURE__ */ jsx(Identifier, { name: decl.key })
307
+ }),
308
+ /* @__PURE__ */ jsx("span", {
309
+ className: style_default.TextPunctuation,
310
+ children: ": "
311
+ }),
312
+ decl.optional && /* @__PURE__ */ jsx("span", {
313
+ className: style_default.TextPunctuation,
314
+ children: "optional "
315
+ }),
316
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
317
+ ] });
318
+ case "HttpDeclTypeAlias": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
319
+ /* @__PURE__ */ jsx(Identifier, { name: decl.ident }),
320
+ /* @__PURE__ */ jsx("span", {
321
+ className: style_default.TextOperator,
322
+ children: " = "
323
+ }),
324
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
325
+ ] });
326
+ case "HttpDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
327
+ }
328
+ }
329
+
330
+ //#endregion
331
+ export { Type as a, Property as i, MethodInfo as n, TypeName as o, MethodSignature as r, http_exports as s, Declaration as t };