@stainless-api/docs-ui 0.1.0-beta.9 → 0.1.0-beta.91

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 (162) hide show
  1. package/dist/breadcrumbs-BaNU4WsC.d.ts +25 -0
  2. package/dist/chunk-pbuEa-1d.js +13 -0
  3. package/dist/component-generics-D9XaPlr8.d.ts +30 -0
  4. package/dist/component-generics-DYxBWv1v.js +42 -0
  5. package/dist/components/MaskedInput.d.ts +14 -0
  6. package/dist/components/MaskedInput.js +74 -0
  7. package/dist/components/breadcrumbs.d.ts +2 -0
  8. package/dist/components/breadcrumbs.js +61 -0
  9. package/dist/components/icons.d.ts +72 -0
  10. package/dist/components/icons.js +953 -0
  11. package/dist/components/index.d.ts +10 -0
  12. package/dist/components/index.js +72 -0
  13. package/dist/components/method.d.ts +2 -0
  14. package/dist/components/method.js +94 -0
  15. package/dist/components/overview.d.ts +2 -0
  16. package/dist/components/overview.js +139 -0
  17. package/dist/components/primitives.d.ts +2 -0
  18. package/dist/components/primitives.js +250 -0
  19. package/dist/components/properties.d.ts +2 -0
  20. package/dist/components/properties.js +143 -0
  21. package/dist/components/sdk-sidebar.d.ts +2 -0
  22. package/dist/components/sdk-sidebar.js +49 -0
  23. package/dist/components/sdk.d.ts +2 -0
  24. package/dist/components/sdk.js +487 -0
  25. package/dist/components/snippets.d.ts +2 -0
  26. package/dist/components/snippets.js +183 -0
  27. package/dist/components/stl-sidebar.d.ts +2 -0
  28. package/dist/components/stl-sidebar.js +111 -0
  29. package/dist/contexts/component-generics.d.ts +2 -0
  30. package/dist/contexts/component-generics.js +2 -0
  31. package/dist/contexts/component-types.d.ts +7 -0
  32. package/dist/contexts/component-types.js +0 -0
  33. package/dist/contexts/component.d.ts +20 -0
  34. package/dist/contexts/component.js +21 -0
  35. package/dist/contexts/docs.d.ts +2 -0
  36. package/dist/contexts/docs.js +89 -0
  37. package/dist/contexts/index.d.ts +6 -0
  38. package/dist/contexts/index.js +43 -0
  39. package/dist/contexts/markdown.d.ts +2 -0
  40. package/dist/contexts/markdown.js +62 -0
  41. package/dist/contexts/navigation.d.ts +2 -0
  42. package/dist/contexts/navigation.js +21 -0
  43. package/dist/contexts/use-components.d.ts +6 -0
  44. package/dist/contexts/use-components.js +5 -0
  45. package/dist/docs-D0qzNoXq.d.ts +62 -0
  46. package/dist/index-DFr9Mesr.d.ts +1776 -0
  47. package/dist/index-Dt9uPKZP.d.ts +464 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.js +7 -7542
  50. package/dist/languages/cli.d.ts +2 -0
  51. package/dist/languages/cli.js +164 -0
  52. package/dist/languages/csharp.d.ts +2 -0
  53. package/dist/languages/csharp.js +281 -0
  54. package/dist/languages/go.d.ts +2 -0
  55. package/dist/languages/go.js +301 -0
  56. package/dist/languages/http.d.ts +2 -0
  57. package/dist/languages/http.js +381 -0
  58. package/dist/languages/index.d.ts +2 -0
  59. package/dist/languages/index.js +30 -0
  60. package/dist/languages/java.d.ts +2 -0
  61. package/dist/languages/java.js +401 -0
  62. package/dist/languages/php.d.ts +2 -0
  63. package/dist/languages/php.js +310 -0
  64. package/dist/languages/python.d.ts +2 -0
  65. package/dist/languages/python.js +267 -0
  66. package/dist/languages/ruby.d.ts +2 -0
  67. package/dist/languages/ruby.js +385 -0
  68. package/dist/languages/terraform.d.ts +2 -0
  69. package/dist/languages/terraform.js +258 -0
  70. package/dist/languages/typescript.d.ts +2 -0
  71. package/dist/languages/typescript.js +447 -0
  72. package/dist/markdown/index.d.ts +11 -0
  73. package/dist/markdown/index.js +86 -0
  74. package/dist/markdown/md.d.ts +15 -0
  75. package/dist/markdown/md.js +39 -0
  76. package/dist/markdown/printer.d.ts +13 -0
  77. package/dist/markdown/printer.js +73 -0
  78. package/dist/markdown/utils.d.ts +28 -0
  79. package/dist/markdown/utils.js +31 -0
  80. package/dist/markdown-B30HO-Vy.d.ts +33 -0
  81. package/dist/method-BKJnP-rW.d.ts +59 -0
  82. package/dist/navigation-DGl8lR6w.d.ts +29 -0
  83. package/dist/overview-iH1evPEF.d.ts +39 -0
  84. package/dist/primitives-BHt-BuLf.d.ts +107 -0
  85. package/dist/properties-CCbMRhSX.d.ts +54 -0
  86. package/dist/routing-yTSG7nWM.d.ts +61 -0
  87. package/dist/routing.d.ts +2 -0
  88. package/dist/routing.js +174 -150
  89. package/dist/sdk-BengV7mg.d.ts +128 -0
  90. package/dist/sdk-sidebar-CRqLm3YO.d.ts +15 -0
  91. package/dist/spec.d.ts +65 -0
  92. package/dist/spec.js +165 -0
  93. package/dist/stl-sidebar-Pra9uCYo.d.ts +58 -0
  94. package/dist/style.d.ts +178 -0
  95. package/dist/style.js +178 -0
  96. package/dist/styles/main.css +765 -755
  97. package/dist/styles/primitives.css +359 -442
  98. package/dist/styles/resets.css +25 -41
  99. package/dist/styles/search.css +187 -270
  100. package/dist/styles/sidebar.css +155 -69
  101. package/dist/styles/variables.css +23 -89
  102. package/dist/styles.css +3171 -0
  103. package/dist/utils.d.ts +20 -0
  104. package/dist/utils.js +52 -0
  105. package/package.json +75 -22
  106. package/dist/mcp.js +0 -16003
  107. package/dist/styles/snippets.css +0 -132
  108. package/src/components/breadcrumbs.tsx +0 -94
  109. package/src/components/chat.tsx +0 -154
  110. package/src/components/dropdown.tsx +0 -91
  111. package/src/components/icons.tsx +0 -584
  112. package/src/components/index.ts +0 -9
  113. package/src/components/method.tsx +0 -146
  114. package/src/components/overview.tsx +0 -160
  115. package/src/components/primitives.tsx +0 -284
  116. package/src/components/properties.tsx +0 -130
  117. package/src/components/scripts/dropdown.ts +0 -78
  118. package/src/components/sdk.tsx +0 -403
  119. package/src/components/sidebar.tsx +0 -99
  120. package/src/components/snippets.tsx +0 -180
  121. package/src/contexts/component-generics.tsx +0 -48
  122. package/src/contexts/component-types.tsx +0 -5
  123. package/src/contexts/component.tsx +0 -32
  124. package/src/contexts/docs.tsx +0 -75
  125. package/src/contexts/index.tsx +0 -17
  126. package/src/contexts/markdown.tsx +0 -43
  127. package/src/contexts/navigation.tsx +0 -44
  128. package/src/contexts/search.tsx +0 -28
  129. package/src/contexts/use-components.tsx +0 -4
  130. package/src/index.ts +0 -6
  131. package/src/languages/go.tsx +0 -281
  132. package/src/languages/http.tsx +0 -321
  133. package/src/languages/index.ts +0 -26
  134. package/src/languages/java.tsx +0 -358
  135. package/src/languages/python.tsx +0 -255
  136. package/src/languages/ruby.tsx +0 -320
  137. package/src/languages/typescript.tsx +0 -393
  138. package/src/markdown/index.ts +0 -107
  139. package/src/markdown/md.ts +0 -45
  140. package/src/markdown/utils.ts +0 -49
  141. package/src/routing.ts +0 -238
  142. package/src/search/form.tsx +0 -127
  143. package/src/search/index.tsx +0 -1
  144. package/src/search/indexer.ts +0 -246
  145. package/src/search/mcp.ts +0 -61
  146. package/src/search/printer.tsx +0 -86
  147. package/src/search/providers/algolia.ts +0 -88
  148. package/src/search/providers/fuse.ts +0 -19
  149. package/src/search/providers/pagefind.ts +0 -17
  150. package/src/search/providers/walker.ts +0 -30
  151. package/src/search/results.tsx +0 -182
  152. package/src/search/state.ts +0 -64
  153. package/src/search/types.ts +0 -116
  154. package/src/style.ts +0 -196
  155. package/src/styles/main.css +0 -986
  156. package/src/styles/primitives.css +0 -580
  157. package/src/styles/resets.css +0 -39
  158. package/src/styles/search.css +0 -341
  159. package/src/styles/sidebar.css +0 -85
  160. package/src/styles/snippets.css +0 -130
  161. package/src/styles/variables.css +0 -86
  162. package/src/utils.ts +0 -41
@@ -0,0 +1,310 @@
1
+ import { t as __exportAll } from "../chunk-pbuEa-1d.js";
2
+ import { useLanguageComponents } from "../contexts/index.js";
3
+ import { useComponents } from "../contexts/use-components.js";
4
+ import style_default from "../style.js";
5
+ import * as React$1 from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/languages/php.tsx
8
+ var php_exports = /* @__PURE__ */ __exportAll({
9
+ Declaration: () => Declaration,
10
+ MethodSignature: () => MethodSignature,
11
+ Property: () => Property,
12
+ Type: () => Type,
13
+ TypeName: () => TypeName
14
+ });
15
+ const ComplexTypes = {
16
+ PHPTypeMapArray: "array",
17
+ PhpTypeListArray: "list",
18
+ PhpTypeUnion: "union"
19
+ };
20
+ const constStyle = {
21
+ string: style_default.LiteralString,
22
+ number: style_default.LiteralNumeric,
23
+ boolean: style_default.LiteralBoolean
24
+ };
25
+ function TypeName({ type }) {
26
+ const Lang = useLanguageComponents();
27
+ return ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
28
+ }
29
+ function Type({ type }) {
30
+ const Docs = useComponents();
31
+ const Lang = useLanguageComponents();
32
+ const { Join } = useComponents();
33
+ switch (type.kind) {
34
+ case "PhpTypeFloat":
35
+ case "PhpTypeInt":
36
+ case "PhpTypeBool":
37
+ case "PhpTypeNull":
38
+ case "PhpTypeMixed": return /* @__PURE__ */ jsx("span", {
39
+ className: style_default.Type,
40
+ children: /* @__PURE__ */ jsx("span", {
41
+ className: style_default.TypeKeyword,
42
+ children: type.kind.slice(7).toLowerCase()
43
+ })
44
+ });
45
+ case "PhpTypeString": return /* @__PURE__ */ jsx("span", {
46
+ className: style_default.Type,
47
+ children: /* @__PURE__ */ jsx("span", {
48
+ className: style_default.TypeString,
49
+ children: "string"
50
+ })
51
+ });
52
+ case "PhpTypeComplexBuiltin": return /* @__PURE__ */ jsx("span", {
53
+ className: style_default.Type,
54
+ children: /* @__PURE__ */ jsx("span", {
55
+ className: style_default.TypeKeyword,
56
+ children: type.typeName
57
+ })
58
+ });
59
+ case "PhpTypeLiteral": return /* @__PURE__ */ jsx("span", {
60
+ className: style_default.Type,
61
+ children: /* @__PURE__ */ jsx("span", {
62
+ className: constStyle[typeof type.literal],
63
+ children: JSON.stringify(type.literal)
64
+ })
65
+ });
66
+ case "PhpTypeDatetime": return /* @__PURE__ */ jsx("span", {
67
+ className: style_default.Type,
68
+ children: /* @__PURE__ */ jsx("span", {
69
+ className: style_default.TypeReference,
70
+ children: "\\Datetime"
71
+ })
72
+ });
73
+ case "PhpTypeReference": {
74
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
75
+ return /* @__PURE__ */ jsxs("span", {
76
+ className: style_default.Type,
77
+ children: [/* @__PURE__ */ jsx(Docs.SDKReference, {
78
+ stainlessPath: type.$ref,
79
+ children: type.typeName
80
+ }), params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
81
+ /* @__PURE__ */ jsx("span", {
82
+ className: style_default.TypeBracket,
83
+ children: "<"
84
+ }),
85
+ /* @__PURE__ */ jsx(Join, {
86
+ items: params,
87
+ limit: 3,
88
+ children: /* @__PURE__ */ jsx("span", {
89
+ className: style_default.TextOperator,
90
+ children: ", "
91
+ })
92
+ }),
93
+ /* @__PURE__ */ jsx("span", {
94
+ className: style_default.TypeBracket,
95
+ children: ">"
96
+ })
97
+ ] })]
98
+ });
99
+ }
100
+ case "PhpTypeMapArray": return /* @__PURE__ */ jsxs("span", {
101
+ className: style_default.Type,
102
+ children: [
103
+ /* @__PURE__ */ jsx("span", {
104
+ className: style_default.TypeArray,
105
+ children: "array<string,"
106
+ }),
107
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
108
+ /* @__PURE__ */ jsx("span", {
109
+ className: style_default.TypeArray,
110
+ children: ">"
111
+ })
112
+ ]
113
+ });
114
+ case "PhpTypeListArray": return /* @__PURE__ */ jsxs("span", {
115
+ className: style_default.Type,
116
+ children: [
117
+ /* @__PURE__ */ jsx("span", {
118
+ className: style_default.TypeArray,
119
+ children: "list<"
120
+ }),
121
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
122
+ /* @__PURE__ */ jsx("span", {
123
+ className: style_default.TypeArray,
124
+ children: ">"
125
+ })
126
+ ]
127
+ });
128
+ case "PhpTypeUnion": {
129
+ const items = type.types.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
130
+ return /* @__PURE__ */ jsx("span", {
131
+ className: style_default.Type,
132
+ children: /* @__PURE__ */ jsx("span", {
133
+ className: style_default.TypePreview,
134
+ "data-stldocs-type-preview": "union",
135
+ children: /* @__PURE__ */ jsx("span", {
136
+ className: style_default.TypePreviewContent,
137
+ children: /* @__PURE__ */ jsx(Join, {
138
+ items,
139
+ limit: 3,
140
+ children: /* @__PURE__ */ jsx("span", {
141
+ className: style_default.TextOperator,
142
+ children: " | "
143
+ })
144
+ })
145
+ })
146
+ })
147
+ });
148
+ }
149
+ }
150
+ }
151
+ function MethodSignature({ decl }) {
152
+ const Lang = useLanguageComponents();
153
+ const { Join } = useComponents();
154
+ const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [
155
+ param.optional && /* @__PURE__ */ jsx("span", {
156
+ className: style_default.TextPunctuation,
157
+ children: "?"
158
+ }),
159
+ /* @__PURE__ */ jsx(Lang.Type, { type: param.typeAnnotation }),
160
+ " ",
161
+ /* @__PURE__ */ jsx("span", {
162
+ className: style_default.TextIdentifier,
163
+ children: param.ident
164
+ }),
165
+ param.hasDefault && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
166
+ className: style_default.TextPunctuation,
167
+ children: " = "
168
+ }), /* @__PURE__ */ jsx("span", {
169
+ className: style_default.TextKeyword,
170
+ children: "default"
171
+ })] })
172
+ ] }, i));
173
+ return /* @__PURE__ */ jsx("div", {
174
+ className: style_default.MethodSignature,
175
+ children: /* @__PURE__ */ jsxs("span", {
176
+ className: style_default.SignatureTitle,
177
+ children: [
178
+ decl.qualified && /* @__PURE__ */ jsx("span", {
179
+ className: style_default.SignatureQualified,
180
+ children: /* @__PURE__ */ jsxs("span", {
181
+ className: style_default.TextIdentifier,
182
+ children: ["$client->", decl.qualified?.slice(0, -decl.ident.length)]
183
+ })
184
+ }),
185
+ /* @__PURE__ */ jsx("span", {
186
+ className: style_default.SignatureName,
187
+ children: /* @__PURE__ */ jsx("span", {
188
+ className: style_default.TextIdentifier,
189
+ children: decl.ident
190
+ })
191
+ }),
192
+ /* @__PURE__ */ jsxs("span", {
193
+ className: style_default.MethodSignature,
194
+ children: [
195
+ /* @__PURE__ */ jsx("span", {
196
+ className: style_default.SignatureParen,
197
+ children: "("
198
+ }),
199
+ /* @__PURE__ */ jsx("span", {
200
+ className: style_default.SignatureParams,
201
+ children: /* @__PURE__ */ jsx(Join, {
202
+ items: params,
203
+ children: /* @__PURE__ */ jsx("span", {
204
+ className: style_default.TextOperator,
205
+ children: ", "
206
+ })
207
+ })
208
+ }),
209
+ /* @__PURE__ */ jsx("span", {
210
+ className: style_default.SignatureParen,
211
+ children: ")"
212
+ }),
213
+ /* @__PURE__ */ jsx("span", {
214
+ className: style_default.TextPunctuation,
215
+ children: ": "
216
+ }),
217
+ decl.returnType ? /* @__PURE__ */ jsx(Lang.Type, { type: decl.returnType }) : /* @__PURE__ */ jsx("span", {
218
+ className: style_default.Type,
219
+ children: /* @__PURE__ */ jsx("span", {
220
+ className: style_default.TypeKeyword,
221
+ children: "void"
222
+ })
223
+ })
224
+ ]
225
+ })
226
+ ]
227
+ })
228
+ });
229
+ }
230
+ function Property({ decl, children }) {
231
+ const Lang = useLanguageComponents();
232
+ if (!decl) return;
233
+ switch (decl.kind) {
234
+ case "PhpDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
235
+ case "PhpDeclClassProperty":
236
+ case "PhpDeclParam": return children({
237
+ name: decl.ident,
238
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
239
+ type: decl.type.kind in ComplexTypes && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
240
+ });
241
+ }
242
+ }
243
+ function Declaration({ decl }) {
244
+ const Lang = useLanguageComponents();
245
+ if (!decl) return;
246
+ switch (decl.kind) {
247
+ case "PhpDeclClass":
248
+ case "PhpDeclAssocArray":
249
+ case "PhpDeclEnum": return /* @__PURE__ */ jsx(Fragment$1, { children: "Not yet implemented." });
250
+ case "PhpDeclReference": return /* @__PURE__ */ jsxs(Fragment$1, { children: [decl.scope && /* @__PURE__ */ jsxs("span", {
251
+ className: style_default.TextKeyword,
252
+ children: [decl.scope, " "]
253
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })] });
254
+ case "PhpDeclParam": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
255
+ /* @__PURE__ */ jsx("span", {
256
+ className: style_default.TextIdentifier,
257
+ children: decl.ident
258
+ }),
259
+ decl.isPositional ? /* @__PURE__ */ jsx("span", {
260
+ className: style_default.TextOperator,
261
+ children: ": "
262
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
263
+ className: style_default.TextOperator,
264
+ children: decl.optional ? "?:" : ": "
265
+ }), decl.optional && /* @__PURE__ */ jsx("span", {
266
+ className: style_default.TextOperator,
267
+ children: "optional "
268
+ })] }),
269
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
270
+ ] });
271
+ case "PhpDeclAssocArrayProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
272
+ /* @__PURE__ */ jsxs("span", {
273
+ className: style_default.LiteralString,
274
+ children: [
275
+ "'",
276
+ decl.ident,
277
+ "'"
278
+ ]
279
+ }),
280
+ decl.optional && /* @__PURE__ */ jsx("span", {
281
+ className: style_default.TextOperator,
282
+ children: "?"
283
+ }),
284
+ /* @__PURE__ */ jsx("span", {
285
+ className: style_default.TextOperator,
286
+ children: ": "
287
+ }),
288
+ decl.optional && /* @__PURE__ */ jsx("span", {
289
+ className: style_default.TextKeyword,
290
+ children: "optional "
291
+ }),
292
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
293
+ ] });
294
+ case "PhpDeclClassProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
295
+ decl.nullable && /* @__PURE__ */ jsx("span", {
296
+ className: style_default.TextOperator,
297
+ children: "?"
298
+ }),
299
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }),
300
+ " ",
301
+ /* @__PURE__ */ jsx("span", {
302
+ className: style_default.TextIdentifier,
303
+ children: decl.ident
304
+ })
305
+ ] });
306
+ case "PhpDeclMethod": return /* @__PURE__ */ jsx(Lang.MethodSignature, { decl });
307
+ }
308
+ }
309
+ //#endregion
310
+ export { Declaration, MethodSignature, Property, Type, TypeName, php_exports as t };
@@ -0,0 +1,2 @@
1
+ import { At as MethodSignatureProps, Dt as Declaration, Mt as PropertyProps, Nt as Type, Ot as DeclarationProps, Pt as TypeName, jt as Property, kt as MethodSignature } from "../index-Dt9uPKZP.js";
2
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
@@ -0,0 +1,267 @@
1
+ import { t as __exportAll } from "../chunk-pbuEa-1d.js";
2
+ import { useLanguageComponents } from "../contexts/index.js";
3
+ import { useComponents } from "../contexts/use-components.js";
4
+ import style_default from "../style.js";
5
+ import * as React$1 from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/languages/python.tsx
8
+ var python_exports = /* @__PURE__ */ __exportAll({
9
+ Declaration: () => Declaration,
10
+ MethodSignature: () => MethodSignature,
11
+ Property: () => Property,
12
+ Type: () => Type,
13
+ TypeName: () => TypeName
14
+ });
15
+ const constStyle = {
16
+ string: style_default.LiteralString,
17
+ number: style_default.LiteralNumeric,
18
+ boolean: style_default.LiteralBoolean
19
+ };
20
+ function showFullType(type) {
21
+ if (type.kind !== "PythonTypeReference") return false;
22
+ return type.typeName === "Optional" ? showFullType(type.typeParameters[0]) : type.typeParameters.length > 0;
23
+ }
24
+ function TypeName({ type }) {
25
+ const Lang = useLanguageComponents();
26
+ if (type.kind === "PythonTypeReference") switch (type.typeName) {
27
+ case "Optional": return /* @__PURE__ */ jsx(Lang.TypeName, { type: type.typeParameters[0] });
28
+ case "List":
29
+ case "Iterable":
30
+ case "Literal":
31
+ case "Union": return type.typeName.toLowerCase();
32
+ }
33
+ return /* @__PURE__ */ jsx(Lang.Type, { type });
34
+ }
35
+ function Type({ type }) {
36
+ const Lang = useLanguageComponents();
37
+ const { Join, SDKReference } = useComponents();
38
+ switch (type.kind) {
39
+ case "PythonTypeAny":
40
+ case "PythonTypeUnknown":
41
+ case "PythonTypeInt":
42
+ case "PythonTypeFloat":
43
+ case "PythonTypeBool": return /* @__PURE__ */ jsx("span", {
44
+ className: style_default.Type,
45
+ children: /* @__PURE__ */ jsx("span", {
46
+ className: style_default.TypeKeyword,
47
+ children: type.kind.slice(10).toLowerCase()
48
+ })
49
+ });
50
+ case "PythonTypeString": return /* @__PURE__ */ jsx("span", {
51
+ className: style_default.Type,
52
+ children: /* @__PURE__ */ jsx("span", {
53
+ className: style_default.TypeString,
54
+ children: "str"
55
+ })
56
+ });
57
+ case "PythonTypeLiteral": return /* @__PURE__ */ jsx("span", {
58
+ className: style_default.Type,
59
+ children: /* @__PURE__ */ jsx("span", {
60
+ className: constStyle[typeof type.literal.value],
61
+ children: JSON.stringify(type.literal.value)
62
+ })
63
+ });
64
+ case "PythonTypeArray": return /* @__PURE__ */ jsxs("span", {
65
+ className: style_default.Type,
66
+ children: [
67
+ /* @__PURE__ */ jsx("span", {
68
+ className: style_default.TypeArray,
69
+ children: "Array<"
70
+ }),
71
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
72
+ /* @__PURE__ */ jsx("span", {
73
+ className: style_default.TypeArray,
74
+ children: ">"
75
+ })
76
+ ]
77
+ });
78
+ case "PythonTypeClass": return /* @__PURE__ */ jsx("span", {
79
+ className: style_default.Type,
80
+ children: /* @__PURE__ */ jsx("span", {
81
+ className: style_default.TypeKeyword,
82
+ children: "class"
83
+ })
84
+ });
85
+ case "PythonTypeMap": return /* @__PURE__ */ jsx("span", {
86
+ className: style_default.Type,
87
+ children: /* @__PURE__ */ jsx("span", {
88
+ className: style_default.TypeKeyword,
89
+ children: "Dict"
90
+ })
91
+ });
92
+ case "PythonTypeReference": {
93
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
94
+ return /* @__PURE__ */ jsxs("span", {
95
+ className: style_default.Type,
96
+ children: [/* @__PURE__ */ jsx("span", {
97
+ className: type.typeName === "Optional" ? style_default.TypeArray : "",
98
+ children: /* @__PURE__ */ jsx(SDKReference, {
99
+ stainlessPath: type.$ref,
100
+ children: type.typeName
101
+ })
102
+ }), params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
103
+ /* @__PURE__ */ jsx("span", {
104
+ className: style_default.TypeBracket,
105
+ children: "["
106
+ }),
107
+ /* @__PURE__ */ jsx(Join, {
108
+ items: params,
109
+ limit: 3,
110
+ children: /* @__PURE__ */ jsx("span", {
111
+ className: style_default.TextOperator,
112
+ children: ", "
113
+ })
114
+ }),
115
+ /* @__PURE__ */ jsx("span", {
116
+ className: style_default.TypeBracket,
117
+ children: "]"
118
+ })
119
+ ] })]
120
+ });
121
+ }
122
+ }
123
+ }
124
+ function MethodSignature({ decl }) {
125
+ const Lang = useLanguageComponents();
126
+ const { Join, Tooltip } = useComponents();
127
+ const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsx(Tooltip, {
128
+ content: /* @__PURE__ */ jsx(Lang.Type, { type: param.type }),
129
+ children: /* @__PURE__ */ jsx("span", {
130
+ className: style_default.TextIdentifier,
131
+ children: param.ident
132
+ })
133
+ }) }, i));
134
+ return /* @__PURE__ */ jsx("div", {
135
+ className: style_default.MethodSignature,
136
+ children: /* @__PURE__ */ jsxs("span", {
137
+ className: style_default.SignatureTitle,
138
+ children: [
139
+ decl.async && /* @__PURE__ */ jsx("span", {
140
+ className: style_default.TextKeyword,
141
+ children: "async "
142
+ }),
143
+ decl.qualified && /* @__PURE__ */ jsx("span", {
144
+ className: style_default.SignatureQualified,
145
+ children: /* @__PURE__ */ jsx("span", {
146
+ className: style_default.TextIdentifier,
147
+ children: decl.qualified?.slice(0, -decl.ident.length)
148
+ })
149
+ }),
150
+ /* @__PURE__ */ jsx("span", {
151
+ className: style_default.SignatureName,
152
+ children: /* @__PURE__ */ jsx("span", {
153
+ className: style_default.TextIdentifier,
154
+ children: decl.ident
155
+ })
156
+ }),
157
+ /* @__PURE__ */ jsxs("span", {
158
+ className: style_default.MethodSignature,
159
+ children: [
160
+ /* @__PURE__ */ jsx("span", {
161
+ className: style_default.SignatureParen,
162
+ children: "("
163
+ }),
164
+ /* @__PURE__ */ jsx("span", {
165
+ className: style_default.SignatureParams,
166
+ children: /* @__PURE__ */ jsx(Join, {
167
+ items: params,
168
+ children: /* @__PURE__ */ jsx("span", {
169
+ className: style_default.TextOperator,
170
+ children: ", "
171
+ })
172
+ })
173
+ }),
174
+ /* @__PURE__ */ jsxs("span", {
175
+ className: style_default.SignatureParen,
176
+ children: [")", " "]
177
+ }),
178
+ decl.returns && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
179
+ className: style_default.TextOperator,
180
+ children: " -> "
181
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: decl.returns })] })
182
+ ]
183
+ })
184
+ ]
185
+ })
186
+ });
187
+ }
188
+ function Property({ decl, children }) {
189
+ const Lang = useLanguageComponents();
190
+ if (!decl) return;
191
+ switch (decl.kind) {
192
+ case "PythonDeclProperty": return children({
193
+ name: decl.ident,
194
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
195
+ type: showFullType(decl.type) && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
196
+ });
197
+ case "PythonDeclClass": return children({
198
+ name: decl.ident,
199
+ typeName: "class"
200
+ });
201
+ case "PythonDeclType": return children({
202
+ name: decl.ident,
203
+ typeName: "type",
204
+ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
205
+ });
206
+ case "PythonDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
207
+ }
208
+ }
209
+ function Declaration({ decl }) {
210
+ const Lang = useLanguageComponents();
211
+ if (!decl) return;
212
+ switch (decl.kind) {
213
+ case "PythonDeclProperty": {
214
+ const nullable = decl.type.kind === "PythonTypeReference" && decl.type.typeName === "Optional" && (decl.type.typeParameters ?? []).length > 0;
215
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
216
+ /* @__PURE__ */ jsx("span", {
217
+ className: style_default.TypePropertyName,
218
+ children: /* @__PURE__ */ jsx("span", {
219
+ className: style_default.TextIdentifier,
220
+ children: decl.ident
221
+ })
222
+ }),
223
+ /* @__PURE__ */ jsx("span", {
224
+ className: style_default.TextPunctuation,
225
+ children: ": "
226
+ }),
227
+ decl.optional && !nullable ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
228
+ /* @__PURE__ */ jsx("span", {
229
+ className: style_default.TypePlain,
230
+ children: "Optional"
231
+ }),
232
+ /* @__PURE__ */ jsx("span", {
233
+ className: style_default.TypeBracket,
234
+ children: "["
235
+ }),
236
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }),
237
+ /* @__PURE__ */ jsx("span", {
238
+ className: style_default.TypeBrace,
239
+ children: "]"
240
+ })
241
+ ] }) : /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
242
+ ] });
243
+ }
244
+ case "PythonDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
245
+ /* @__PURE__ */ jsx("span", {
246
+ className: style_default.TextKeyword,
247
+ children: "class "
248
+ }),
249
+ /* @__PURE__ */ jsx("span", {
250
+ className: style_default.TextIdentifier,
251
+ children: decl.ident
252
+ }),
253
+ /* @__PURE__ */ jsx("span", {
254
+ className: style_default.TextPunctuation,
255
+ children: ": "
256
+ }),
257
+ /* @__PURE__ */ jsx("span", {
258
+ className: `${style_default.TypePreviewContent} ${style_default.TextPunctuation}`,
259
+ children: "…"
260
+ })
261
+ ] });
262
+ case "PythonDeclType": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
263
+ case "PythonDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
264
+ }
265
+ }
266
+ //#endregion
267
+ export { Declaration, MethodSignature, Property, Type, TypeName, python_exports as t };
@@ -0,0 +1,2 @@
1
+ import { Ct as PropertyProps, St as Property, Tt as TypeName, bt as MethodSignature, vt as Declaration, wt as Type, xt as MethodSignatureProps, yt as DeclarationProps } from "../index-Dt9uPKZP.js";
2
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };