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

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