@stainless-api/docs-ui 0.1.0-beta.10 → 0.1.0-beta.11

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 (225) hide show
  1. package/dist/breadcrumbs-Z-hEqjcp.d.ts +19 -0
  2. package/dist/chunk-Bp6m_JJh.js +13 -0
  3. package/dist/component-generics-DzI21jRn.js +35 -0
  4. package/dist/component-generics-q5Dqiu2D.d.ts +30 -0
  5. package/dist/components/breadcrumbs.d.ts +2 -11
  6. package/dist/components/breadcrumbs.js +16 -52
  7. package/dist/components/chat.d.ts +13 -5
  8. package/dist/components/chat.js +138 -74
  9. package/dist/components/dropdown.d.ts +2 -17
  10. package/dist/components/dropdown.js +4 -18
  11. package/dist/components/icons.d.ts +50 -27
  12. package/dist/components/icons.js +3 -34
  13. package/dist/components/index.d.ts +12 -9
  14. package/dist/components/index.js +16 -10
  15. package/dist/components/method.d.ts +2 -41
  16. package/dist/components/method.js +16 -44
  17. package/dist/components/overview.d.ts +2 -21
  18. package/dist/components/overview.js +16 -49
  19. package/dist/components/primitives.d.ts +2 -60
  20. package/dist/components/primitives.js +16 -117
  21. package/dist/components/properties.d.ts +2 -24
  22. package/dist/components/properties.js +16 -24
  23. package/dist/components/scripts/dropdown.d.ts +11 -4
  24. package/dist/components/scripts/dropdown.js +49 -63
  25. package/dist/components/sdk.d.ts +3 -78
  26. package/dist/components/sdk.js +16 -153
  27. package/dist/components/sidebar.d.ts +2 -22
  28. package/dist/components/sidebar.js +16 -30
  29. package/dist/components/snippets.d.ts +4 -28
  30. package/dist/components/snippets.js +16 -76
  31. package/dist/contexts/component-generics.d.ts +2 -25
  32. package/dist/contexts/component-generics.js +3 -24
  33. package/dist/contexts/component-types.d.ts +18 -4
  34. package/dist/contexts/component-types.js +1 -2
  35. package/dist/contexts/component.d.ts +31 -14
  36. package/dist/contexts/component.js +16 -14
  37. package/dist/contexts/docs.d.ts +2 -34
  38. package/dist/contexts/docs.js +3 -43
  39. package/dist/contexts/index.d.ts +20 -7
  40. package/dist/contexts/index.js +16 -15
  41. package/dist/contexts/markdown.d.ts +2 -13
  42. package/dist/contexts/markdown.js +4 -29
  43. package/dist/contexts/navigation.d.ts +3 -19
  44. package/dist/contexts/navigation.js +3 -14
  45. package/dist/contexts/search.d.ts +4 -13
  46. package/dist/contexts/search.js +16 -15
  47. package/dist/contexts/use-components.d.ts +16 -1
  48. package/dist/contexts/use-components.js +4 -3
  49. package/dist/contexts-DRxRO-xO.js +3747 -0
  50. package/dist/docs-Dh8kE1va.js +50 -0
  51. package/dist/docs-EUy-wfbA.d.ts +43 -0
  52. package/dist/dropdown-B7VyGMOw.d.ts +43 -0
  53. package/dist/dropdown-DtgAi6lb.js +62 -0
  54. package/dist/icons-DdKM-01E.js +753 -0
  55. package/dist/index-AicgPYKB.d.ts +239 -0
  56. package/dist/index-BhwLhiWk.d.ts +14 -0
  57. package/dist/index-YnpUtXLB.d.ts +16 -0
  58. package/dist/index.d.ts +22 -6
  59. package/dist/index.js +16 -7
  60. package/dist/languages/go.d.ts +13 -21
  61. package/dist/languages/go.js +16 -116
  62. package/dist/languages/http.d.ts +13 -25
  63. package/dist/languages/http.js +16 -130
  64. package/dist/languages/index.d.ts +13 -37
  65. package/dist/languages/index.js +16 -10
  66. package/dist/languages/java.d.ts +13 -23
  67. package/dist/languages/java.js +16 -120
  68. package/dist/languages/python.d.ts +13 -22
  69. package/dist/languages/python.js +16 -104
  70. package/dist/languages/ruby.d.ts +13 -22
  71. package/dist/languages/ruby.js +16 -125
  72. package/dist/languages/typescript.d.ts +13 -22
  73. package/dist/languages/typescript.js +16 -134
  74. package/dist/markdown/index.d.ts +11 -6
  75. package/dist/markdown/index.js +16 -80
  76. package/dist/markdown/md.d.ts +15 -11
  77. package/dist/markdown/md.js +3 -34
  78. package/dist/markdown/utils.d.ts +4 -17
  79. package/dist/markdown/utils.js +3 -30
  80. package/dist/markdown-BXfX1D7C.js +42 -0
  81. package/dist/markdown-nFyAEX_K.d.ts +22 -0
  82. package/dist/md-Dg8aOyMA.js +41 -0
  83. package/dist/method-DpsVuzZW.d.ts +71 -0
  84. package/dist/navigation-aoYZ_tl4.js +24 -0
  85. package/dist/navigation-nyXBY-75.d.ts +29 -0
  86. package/dist/overview-C8e-6jGr.d.ts +38 -0
  87. package/dist/pagefind-ChrPfuVv.js +15 -0
  88. package/dist/primitives-DWz23_Ub.d.ts +99 -0
  89. package/dist/properties-CF71V58d.d.ts +46 -0
  90. package/dist/routing-DQjbRxdJ.js +189 -0
  91. package/dist/routing-qc0V00-j.d.ts +51 -0
  92. package/dist/routing.d.ts +2 -44
  93. package/dist/routing.js +3 -169
  94. package/dist/sdk-Zg3Rggk3.d.ts +118 -0
  95. package/dist/search/index.d.ts +26 -1
  96. package/dist/search/index.js +332 -2
  97. package/dist/search/providers/algolia.d.ts +22 -7
  98. package/dist/search/providers/algolia.js +16 -64
  99. package/dist/search/providers/fuse.d.ts +16 -9
  100. package/dist/search/providers/fuse.js +29 -12
  101. package/dist/search/providers/pagefind.d.ts +7 -2
  102. package/dist/search/providers/pagefind.js +3 -19
  103. package/dist/search/providers/walker.d.ts +8 -5
  104. package/dist/search/providers/walker.js +28 -19
  105. package/dist/search/types.d.ts +3 -79
  106. package/dist/search/types.js +3 -24
  107. package/dist/search-B6loAGmB.d.ts +21 -0
  108. package/dist/sidebar-C8KirYjg.d.ts +35 -0
  109. package/dist/snippets-EUzM4fRO.d.ts +45 -0
  110. package/dist/style-pN9hCoec.d.ts +181 -0
  111. package/dist/style-rYbbxIR_.js +182 -0
  112. package/dist/style.d.ts +2 -179
  113. package/dist/style.js +3 -179
  114. package/dist/styles/main.css +740 -746
  115. package/dist/styles/main.js +1 -0
  116. package/dist/styles/primitives.css +436 -428
  117. package/dist/styles/primitives.js +1 -0
  118. package/dist/styles/resets.css +34 -41
  119. package/dist/styles/resets.js +1 -0
  120. package/dist/styles/search.css +248 -248
  121. package/dist/styles/search.js +1 -0
  122. package/dist/styles/sidebar.css +59 -60
  123. package/dist/styles/sidebar.js +1 -0
  124. package/dist/styles/snippets.css +87 -88
  125. package/dist/styles/snippets.js +1 -0
  126. package/dist/styles/variables.css +86 -89
  127. package/dist/styles/variables.js +1 -0
  128. package/dist/types-CTBDtD34.d.ts +82 -0
  129. package/dist/types-DFN4M1Sp.js +34 -0
  130. package/dist/use-components-D9E85p5x.js +7 -0
  131. package/dist/utils-BHwvUDKn.js +30 -0
  132. package/dist/utils-CJfFBNgT.js +32 -0
  133. package/dist/utils-DQhEbvUC.d.ts +20 -0
  134. package/dist/utils-nDazhti8.d.ts +11 -0
  135. package/dist/utils.d.ts +2 -7
  136. package/dist/utils.js +4 -27
  137. package/package.json +2 -2
  138. package/dist/components/breadcrumbs.js.map +0 -1
  139. package/dist/components/chat.js.map +0 -1
  140. package/dist/components/dropdown.js.map +0 -1
  141. package/dist/components/icons.js.map +0 -1
  142. package/dist/components/index.js.map +0 -1
  143. package/dist/components/method.js.map +0 -1
  144. package/dist/components/overview.js.map +0 -1
  145. package/dist/components/primitives.js.map +0 -1
  146. package/dist/components/properties.js.map +0 -1
  147. package/dist/components/scripts/dropdown.js.map +0 -1
  148. package/dist/components/sdk.js.map +0 -1
  149. package/dist/components/sidebar.js.map +0 -1
  150. package/dist/components/snippets.js.map +0 -1
  151. package/dist/contexts/component-generics.js.map +0 -1
  152. package/dist/contexts/component-types.js.map +0 -1
  153. package/dist/contexts/component.js.map +0 -1
  154. package/dist/contexts/docs.js.map +0 -1
  155. package/dist/contexts/index.js.map +0 -1
  156. package/dist/contexts/markdown.js.map +0 -1
  157. package/dist/contexts/navigation.js.map +0 -1
  158. package/dist/contexts/search.js.map +0 -1
  159. package/dist/contexts/use-components.js.map +0 -1
  160. package/dist/index.js.map +0 -1
  161. package/dist/languages/go.js.map +0 -1
  162. package/dist/languages/http.js.map +0 -1
  163. package/dist/languages/index.js.map +0 -1
  164. package/dist/languages/java.js.map +0 -1
  165. package/dist/languages/python.js.map +0 -1
  166. package/dist/languages/ruby.js.map +0 -1
  167. package/dist/languages/typescript.js.map +0 -1
  168. package/dist/markdown/index.js.map +0 -1
  169. package/dist/markdown/md.js.map +0 -1
  170. package/dist/markdown/utils.js.map +0 -1
  171. package/dist/mcp.js +0 -16105
  172. package/dist/routing.js.map +0 -1
  173. package/dist/search/form.d.ts +0 -13
  174. package/dist/search/form.js +0 -55
  175. package/dist/search/form.js.map +0 -1
  176. package/dist/search/index.js.map +0 -1
  177. package/dist/search/indexer.d.ts +0 -31
  178. package/dist/search/indexer.js +0 -212
  179. package/dist/search/indexer.js.map +0 -1
  180. package/dist/search/mcp.d.ts +0 -8
  181. package/dist/search/mcp.js +0 -43
  182. package/dist/search/mcp.js.map +0 -1
  183. package/dist/search/printer.d.ts +0 -6
  184. package/dist/search/printer.js +0 -43
  185. package/dist/search/printer.js.map +0 -1
  186. package/dist/search/providers/algolia.js.map +0 -1
  187. package/dist/search/providers/fuse.js.map +0 -1
  188. package/dist/search/providers/pagefind.js.map +0 -1
  189. package/dist/search/providers/walker.js.map +0 -1
  190. package/dist/search/results.d.ts +0 -21
  191. package/dist/search/results.js +0 -58
  192. package/dist/search/results.js.map +0 -1
  193. package/dist/search/state.d.ts +0 -29
  194. package/dist/search/state.js +0 -38
  195. package/dist/search/state.js.map +0 -1
  196. package/dist/search/types.js.map +0 -1
  197. package/dist/style.js.map +0 -1
  198. package/dist/types/sdkjson.d.ts +0 -1
  199. package/dist/types/sdkjson.js +0 -2
  200. package/dist/types/sdkjson.js.map +0 -1
  201. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.d.ts +0 -120
  202. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.js +0 -2
  203. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.js.map +0 -1
  204. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.d.ts +0 -100
  205. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.js +0 -3
  206. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.js.map +0 -1
  207. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.d.ts +0 -87
  208. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.js +0 -2
  209. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.js.map +0 -1
  210. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.d.ts +0 -110
  211. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.js +0 -3
  212. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.js.map +0 -1
  213. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.d.ts +0 -122
  214. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.js +0 -2
  215. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.js.map +0 -1
  216. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.d.ts +0 -146
  217. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.js +0 -3
  218. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.js.map +0 -1
  219. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.d.ts +0 -89
  220. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.js +0 -3
  221. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.js.map +0 -1
  222. package/dist/types/stainless-alias/lib/json-spec-v2/types.d.ts +0 -190
  223. package/dist/types/stainless-alias/lib/json-spec-v2/types.js +0 -105
  224. package/dist/types/stainless-alias/lib/json-spec-v2/types.js.map +0 -1
  225. package/dist/utils.js.map +0 -1
@@ -1,130 +1,16 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useDeclaration, useLanguage, useLanguageComponents, useSpec } from '../contexts';
3
- import { useComponents } from '../contexts/use-components';
4
- import style from '../style';
5
- import React from 'react';
6
- import { PropertyToggle } from '../components';
7
- const ComplexTypes = {
8
- HttpTypeUnion: 'union',
9
- HttpTypeIntersection: 'intersection',
10
- };
11
- const constStyle = {
12
- string: style.LiteralString,
13
- number: style.LiteralNumeric,
14
- boolean: style.LiteralBoolean,
15
- };
16
- function Identifier({ name }) {
17
- return (_jsx(_Fragment, { children: _jsx("span", { className: style.TextIdentifier, children: /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(name) ? name : JSON.stringify(name) }) }));
18
- }
19
- function TypePreview({ path }) {
20
- const spec = useSpec();
21
- const language = useLanguage();
22
- const decl = useDeclaration(path);
23
- const { Join } = useComponents();
24
- if (!(decl && 'children' in decl && decl.children.length > 0) || decl['type']?.['kind'] === 'HttpTypeUnion')
25
- return;
26
- const items = decl.children.map((prop, key) => (_jsx("span", { className: style.TypePropertyName, children: _jsx("span", { className: style.TextIdentifier, children: spec?.decls?.[language]?.[prop]?.['key'] }) }, key)));
27
- return (_jsxs("span", { className: style.TypePreview, "data-stldocs-type-preview": "properties", children: [_jsx("span", { className: style.TypeBrace, children: ' { ' }), _jsx("span", { className: style.TypePreviewContent, children: _jsx(Join, { items: items, limit: 3, children: _jsx("span", { className: style.TextOperator, children: ", " }) }) }), _jsx("span", { className: style.TypeBrace, children: ' } ' })] }));
28
- }
29
- export function TypeName({ type }) {
30
- const Lang = useLanguageComponents();
31
- if (type.kind === 'HttpTypeArray')
32
- return _jsxs(_Fragment, { children: ["array of ", _jsx(Lang.TypeName, { type: type.elementType })] });
33
- if (type.kind === 'HttpTypeUnion' && type.types.every((t) => t.kind === 'HttpTypeLiteral'))
34
- return 'enum';
35
- if (type.kind === 'HttpTypeReference' && type.ident.split('.').at(-1) === 'Record')
36
- return 'map';
37
- return ComplexTypes[type.kind] ?? _jsx(Lang.Type, { type: type });
38
- }
39
- export function Type({ type }) {
40
- const Lang = useLanguageComponents();
41
- const { Join, SDKReference } = useComponents();
42
- switch (type.kind) {
43
- case 'HttpTypeUnknown':
44
- case 'HttpTypeUndefined':
45
- case 'HttpTypeNull':
46
- case 'HttpTypeBoolean':
47
- case 'HttpTypeNumber':
48
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypePlain, children: type.kind.slice(8).toLowerCase() }) }));
49
- case 'HttpTypeString':
50
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypePlain, children: "string" }) }));
51
- case 'HttpTypeLiteral':
52
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: constStyle[typeof type.literal], children: JSON.stringify(type.literal) }) }));
53
- case 'HttpTypeArray': {
54
- return (_jsxs("span", { className: style.Type, children: [_jsx("span", { className: style.TypeArray, children: 'array of ' }), _jsx(Lang.Type, { type: type.elementType })] }));
55
- }
56
- case 'HttpTypeIntersection':
57
- case 'HttpTypeUnion': {
58
- const items = type.types.map((t, key) => _jsx(Lang.Type, { type: t }, key));
59
- const delimiter = type.kind === 'HttpTypeUnion' ? 'or' : 'and';
60
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypePreview, "data-stldocs-type-preview": "union", children: _jsx("span", { className: style.TypePreviewContent, children: _jsx(Join, { items: items, limit: 3, children: _jsxs("span", { className: style.TextOperator, children: [" ", delimiter, " "] }) }) }) }) }));
61
- }
62
- case 'HttpTypeReference': {
63
- const name = type.ident.split('.').at(-1);
64
- const params = type.typeParameters?.map((param, key) => _jsx(Lang.Type, { type: param }, key));
65
- // TODO: come up with an unambiguous way to identify these on the sdkjson side
66
- // This is sketchy because it's possible for a user-defined type to be named "Record"
67
- if (name === 'Record' &&
68
- type.typeParameters?.length === 2 &&
69
- type.typeParameters?.at(0).kind === 'HttpTypeString')
70
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypeArray, children: "map" }), "[", params?.[1], "]"] }));
71
- return (_jsxs("span", { className: style.Type, children: [_jsx(SDKReference, { stainlessPath: type.$ref, children: name }), params && params.length > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypeBracket, children: '<' }), _jsx(Join, { items: params, limit: 3, children: _jsx("span", { className: style.TextOperator, children: ", " }) }), _jsx("span", { className: style.TypeBracket, children: '>' })] })), _jsx(TypePreview, { path: type.$ref })] }));
72
- }
73
- case 'HttpTypeObject':
74
- const items = type.members.map(({ ident }) => (_jsx("span", { className: style.TypePropertyName, children: _jsx(Identifier, { name: ident }) })));
75
- return (_jsxs("span", { className: style.Type, children: [_jsx("span", { className: style.TypePlain, children: "object" }), _jsxs("span", { className: style.TypePreview, "data-stldocs-type-preview": "properties", children: [_jsx("span", { className: style.TypeBrace, children: ' {' }), _jsxs("span", { className: style.TypePreviewContent, children: [' ', _jsx(Join, { items: items, limit: 3, children: _jsx("span", { className: style.TextOperator, children: ", " }) }), ' '] }), _jsx("span", { className: style.TypeBrace, children: '} ' })] })] }));
76
- }
77
- }
78
- export function MethodSignature({ decl }) {
79
- return null;
80
- }
81
- export function MethodInfo({ decl, children }) {
82
- const Docs = useComponents();
83
- const params = Object.entries(decl.paramsChildren)
84
- .filter(([_, value]) => value.length)
85
- .map(([location, value]) => (_jsx(React.Fragment, { children: _jsxs("div", { className: style.MethodParameters, "data-stldocs-property-group": location.at(0), children: [_jsxs("h5", { children: [location.at(0).toUpperCase(), location.slice(1), " Parameters", _jsx(PropertyToggle, { target: location.at(0) })] }), _jsx(Docs.SDKChildren, { paths: value })] }) }, location)));
86
- if (decl.bodyParamsChildren?.['application/json']?.length > 0)
87
- params.push(_jsxs("div", { className: style.MethodInfoSection, children: [_jsxs("h5", { children: ["Body Parameters", _jsx(PropertyToggle, { target: "body" })] }), _jsx("div", { className: style.MethodParameters, "data-stldocs-property-group": "body", children: _jsx(Docs.SDKChildren, { paths: decl.bodyParamsChildren?.['application/json'] }) })] }));
88
- return (_jsxs("div", { className: style.MethodInfo, children: [children && _jsx("div", { className: style.MethodContent, children: children }), params.length > 0 && params, decl.responseChildren.length > 0 && (_jsxs("div", { className: style.MethodInfoSection, children: [_jsxs("h5", { children: ["Returns", _jsx(PropertyToggle, { target: "returns" })] }), _jsx("div", { className: style.MethodReturns, "data-stldocs-property-group": "returns", children: _jsx(Docs.SDKChildren, { paths: decl.responseChildren }) })] }))] }));
89
- }
90
- function renderVariantInfo(type) {
91
- if (type.kind === 'HttpTypeUnion' &&
92
- type.types.every((t) => t.kind === 'HttpTypeObject' || t.kind === 'HttpTypeReference'))
93
- return _jsxs(_Fragment, { children: ["One of the following ", type.types.length, " object variants:"] });
94
- }
95
- export function Property({ decl, children }) {
96
- const Lang = useLanguageComponents();
97
- if (!decl)
98
- return;
99
- switch (decl.kind) {
100
- case 'HttpDeclProperty': {
101
- const variants = renderVariantInfo(decl.type);
102
- return children({
103
- name: decl.key,
104
- typeName: _jsx(Lang.TypeName, { type: decl.type }),
105
- type: decl.type.kind in ComplexTypes && !variants && _jsx(Lang.Type, { type: decl.type }),
106
- });
107
- }
108
- case 'HttpDeclTypeAlias':
109
- return children({
110
- name: decl.ident,
111
- typeName: _jsx(Lang.TypeName, { type: decl.type }),
112
- });
113
- case 'HttpDeclReference':
114
- return children({ type: _jsx(Lang.Type, { type: decl.type }) });
115
- }
116
- }
117
- export function Declaration({ decl }) {
118
- const Lang = useLanguageComponents();
119
- if (!decl)
120
- return;
121
- switch (decl.kind) {
122
- case 'HttpDeclProperty':
123
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypePropertyName, children: _jsx(Identifier, { name: decl.key }) }), _jsx("span", { className: style.TextPunctuation, children: ": " }), decl.optional && _jsx("span", { className: style.TextPunctuation, children: "optional " }), _jsx(Lang.Type, { type: decl.type })] }));
124
- case 'HttpDeclTypeAlias':
125
- return (_jsxs(_Fragment, { children: [_jsx(Identifier, { name: decl.ident }), _jsx("span", { className: style.TextOperator, children: " = " }), _jsx(Lang.Type, { type: decl.type })] }));
126
- case 'HttpDeclReference':
127
- return _jsx(Lang.Type, { type: decl.type });
128
- }
129
- }
130
- //# sourceMappingURL=http.js.map
1
+ import "../component-generics-DzI21jRn.js";
2
+ import "../docs-Dh8kE1va.js";
3
+ import "../navigation-aoYZ_tl4.js";
4
+ import "../markdown-BXfX1D7C.js";
5
+ import "../routing-DQjbRxdJ.js";
6
+ import "../style-rYbbxIR_.js";
7
+ import "../use-components-D9E85p5x.js";
8
+ import { C as TypeName, S as Type, b as MethodSignature, v as Declaration, x as Property, y as MethodInfo } from "../contexts-DRxRO-xO.js";
9
+ import "../icons-DdKM-01E.js";
10
+ import "../utils-CJfFBNgT.js";
11
+ import "../dropdown-DtgAi6lb.js";
12
+ import "../md-Dg8aOyMA.js";
13
+ import "../utils-BHwvUDKn.js";
14
+ import "../types-DFN4M1Sp.js";
15
+
16
+ export { Declaration, MethodInfo, MethodSignature, Property, Type, TypeName };
@@ -1,37 +1,13 @@
1
- import { type ReactNode } from 'react';
2
- import type { SDKJSON } from '../types/sdkjson';
3
- import * as typescript from './typescript';
4
- import * as java from './java';
5
- import { PropertyProps } from '../components';
6
- export * as go from './go';
7
- export * as python from './python';
8
- export * as ruby from './ruby';
9
- export * as http from './http';
10
- export { typescript, java };
11
- export declare const node: typeof typescript;
12
- export declare const kotlin: typeof java;
13
- export type PropertyFn = (params: PropertyProps) => ReactNode;
14
- export interface LanguageComponentDefinition {
15
- Declaration(props: {
16
- decl: SDKJSON.DeclarationNode;
17
- }): any;
18
- Property(props: {
19
- decl: SDKJSON.DeclarationNode;
20
- children: PropertyFn;
21
- }): any;
22
- TypeName(props: {
23
- type: SDKJSON.Type;
24
- optional?: boolean;
25
- }): any;
26
- Type(props: {
27
- type: SDKJSON.Type;
28
- optional?: boolean;
29
- }): any;
30
- MethodSignature(props: {
31
- decl: SDKJSON.DeclarationNode;
32
- }): any;
33
- MethodInfo?(props: {
34
- decl: SDKJSON.DeclarationNode;
35
- children?: ReactNode;
36
- }): any;
37
- }
1
+ import "../breadcrumbs-Z-hEqjcp.js";
2
+ import "../dropdown-B7VyGMOw.js";
3
+ import "../method-DpsVuzZW.js";
4
+ import "../primitives-DWz23_Ub.js";
5
+ import "../properties-CF71V58d.js";
6
+ import "../routing-qc0V00-j.js";
7
+ import "../sdk-Zg3Rggk3.js";
8
+ import "../snippets-EUzM4fRO.js";
9
+ import "../overview-C8e-6jGr.js";
10
+ import "../sidebar-C8KirYjg.js";
11
+ import "../index-YnpUtXLB.js";
12
+ import { N as python_d_exports, Q as java_d_exports, U as go_d_exports, a as node, h as http_d_exports, i as kotlin, n as PropertyFn, st as typescript_d_exports, t as LanguageComponentDefinition, w as ruby_d_exports } from "../index-AicgPYKB.js";
13
+ export { LanguageComponentDefinition, PropertyFn, go_d_exports as go, http_d_exports as http, java_d_exports as java, kotlin, node, python_d_exports as python, ruby_d_exports as ruby, typescript_d_exports as typescript };
@@ -1,10 +1,16 @@
1
- import * as typescript from './typescript';
2
- import * as java from './java';
3
- export * as go from './go';
4
- export * as python from './python';
5
- export * as ruby from './ruby';
6
- export * as http from './http';
7
- export { typescript, java };
8
- export const node = typescript;
9
- export const kotlin = java;
10
- //# sourceMappingURL=index.js.map
1
+ import "../component-generics-DzI21jRn.js";
2
+ import "../docs-Dh8kE1va.js";
3
+ import "../navigation-aoYZ_tl4.js";
4
+ import "../markdown-BXfX1D7C.js";
5
+ import "../routing-DQjbRxdJ.js";
6
+ import "../style-rYbbxIR_.js";
7
+ import "../use-components-D9E85p5x.js";
8
+ import { A as ruby_exports, H as go_exports, I as python_exports, J as java_exports, _ as node, et as typescript_exports, h as kotlin, w as http_exports } from "../contexts-DRxRO-xO.js";
9
+ import "../icons-DdKM-01E.js";
10
+ import "../utils-CJfFBNgT.js";
11
+ import "../dropdown-DtgAi6lb.js";
12
+ import "../md-Dg8aOyMA.js";
13
+ import "../utils-BHwvUDKn.js";
14
+ import "../types-DFN4M1Sp.js";
15
+
16
+ export { go_exports as go, http_exports as http, java_exports as java, kotlin, node, python_exports as python, ruby_exports as ruby, typescript_exports as typescript };
@@ -1,23 +1,13 @@
1
- import * as React from 'react';
2
- import type { JavaAST as AST } from '../types/sdkjson';
3
- import { PropertyFn } from '.';
4
- type TypeProps = {
5
- type: AST.JavaType;
6
- optional?: boolean;
7
- };
8
- export declare function TypeName({ type, optional }: TypeProps): import("react/jsx-runtime").JSX.Element | "List";
9
- export declare function Type({ type, optional }: TypeProps): import("react/jsx-runtime").JSX.Element;
10
- export type MethodSignatureProps = {
11
- decl: AST.JavaDeclFunction;
12
- };
13
- export declare function MethodSignature({ decl }: MethodSignatureProps): import("react/jsx-runtime").JSX.Element;
14
- export type PropertyProps = {
15
- decl: AST.JavaDeclaration;
16
- children?: PropertyFn;
17
- };
18
- export declare function Property({ decl, children }: PropertyProps): React.ReactNode;
19
- export type DeclarationProps = {
20
- decl: AST.JavaDeclaration;
21
- };
22
- export declare function Declaration({ decl }: DeclarationProps): import("react/jsx-runtime").JSX.Element | null | undefined;
23
- export {};
1
+ import "../breadcrumbs-Z-hEqjcp.js";
2
+ import "../dropdown-B7VyGMOw.js";
3
+ import "../method-DpsVuzZW.js";
4
+ import "../primitives-DWz23_Ub.js";
5
+ import "../properties-CF71V58d.js";
6
+ import "../routing-qc0V00-j.js";
7
+ import "../sdk-Zg3Rggk3.js";
8
+ import "../snippets-EUzM4fRO.js";
9
+ import "../overview-C8e-6jGr.js";
10
+ import "../sidebar-C8KirYjg.js";
11
+ import "../index-YnpUtXLB.js";
12
+ import { G as DeclarationProps, J as Property, K as MethodSignature, W as Declaration, X as Type, Y as PropertyProps, Z as TypeName, q as MethodSignatureProps } from "../index-AicgPYKB.js";
13
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
@@ -1,120 +1,16 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { useLanguage, useLanguageComponents } from '../contexts';
4
- import { useComponents } from '../contexts/use-components';
5
- import style from '../style';
6
- function showFullType(type) {
7
- return (type.kind === 'JavaTypeReference' &&
8
- (type.typeName === 'List' || (type.typeParameters && type.typeParameters.length > 0)));
9
- }
10
- const constStyle = {
11
- string: style.LiteralString,
12
- number: style.LiteralNumeric,
13
- boolean: style.LiteralBoolean,
14
- };
15
- export function TypeName({ type, optional }) {
16
- const Lang = useLanguageComponents();
17
- if (type.kind === 'JavaTypeReference' && type.typeName === 'List')
18
- return 'List';
19
- return _jsx(Lang.Type, { type: type, optional: optional });
20
- }
21
- export function Type({ type, optional }) {
22
- const language = useLanguage();
23
- const Lang = useLanguageComponents();
24
- const { Join, SDKReference } = useComponents();
25
- switch (type.kind) {
26
- case 'JavaTypeReference': {
27
- const name = type.typeName.split('.').at(-1);
28
- const params = type.typeParameters?.map((param, key) => (_jsx(Lang.Type, { type: param, optional: optional }, key)));
29
- return (_jsxs("span", { className: style.Type, children: [_jsx(SDKReference, { stainlessPath: type.$ref, children: name }), params && params.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypeBracket, children: '<' }), _jsx(Join, { items: params, limit: 3, children: _jsx("span", { className: style.TextOperator, children: ", " }) }), _jsx("span", { className: style.TypeBracket, children: '>' })] })) : null] }));
30
- }
31
- case 'JavaTypeClass':
32
- case 'JavaTypeUnion':
33
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: "class" }) }));
34
- case 'JavaTypeEnum':
35
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: language === 'kotlin' ? 'enum class' : 'enum' }) }));
36
- case 'JavaTypeVoid':
37
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: language === 'kotlin' ? 'Nothing?' : 'Void' }) }));
38
- case 'JavaTypeBoolean':
39
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: language === 'kotlin' || optional ? 'Boolean' : 'boolean' }) }));
40
- case 'JavaTypeDouble':
41
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: language === 'kotlin' || optional ? 'Double' : 'double' }) }));
42
- case 'JavaTypeLong':
43
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: language === 'kotlin' || optional ? 'Long' : 'long' }) }));
44
- case 'JavaTypeString':
45
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeString, children: "String" }) }));
46
- case 'JavaTypeConstant':
47
- return (_jsxs("span", { className: style.Type, children: [_jsx("span", { className: style.TypeKeyword, children: "JsonValue" }), ";"] }));
48
- }
49
- }
50
- export function MethodSignature({ decl }) {
51
- const Lang = useLanguageComponents();
52
- const language = useLanguage();
53
- const { Join, Tooltip } = useComponents();
54
- const params = decl.parameters.map((param, i) => (_jsx(React.Fragment, { children: _jsxs(Tooltip, { content: _jsx(Lang.Type, { type: param.typeAnnotation }), children: [_jsx("span", { className: style.TextIdentifier, children: param.ident }), param.hasDefault && (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: style.TextOperator, children: "=" }), " ", _jsx(Lang.Type, { type: param.typeAnnotation }), _jsx("span", { className: style.TextOperator, children: "." }), _jsx("span", { className: style.TextIdentifier, children: "none" }), _jsx("span", { className: style.TextOperator, children: "()" })] }))] }) }, i)));
55
- return (_jsx("div", { className: style.MethodSignature, children: _jsxs("span", { className: style.SignatureTitle, children: [decl.returnType && language !== 'kotlin' && (_jsxs("span", { className: style.SignatureReturns, children: [_jsx(Lang.Type, { type: decl.returnType }), ' '] })), decl.qualified && (_jsx("span", { className: style.SignatureQualified, children: _jsx("span", { className: style.TextIdentifier, children: decl.qualified?.slice(0, -decl.ident.length) }) })), _jsx("span", { className: style.SignatureName, children: _jsx("span", { className: style.TextIdentifier, children: decl.ident }) }), _jsxs("span", { className: style.MethodSignature, children: [_jsx("span", { className: style.SignatureParen, children: '(' }), _jsx("span", { className: style.SignatureParams, children: _jsx(Join, { items: params, children: _jsx("span", { className: style.TextOperator, children: ', ' }) }) }), _jsxs("span", { className: style.SignatureParen, children: [')', " "] }), decl.returnType && language === 'kotlin' && (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TextOperator, children: ":" }), " ", _jsx(Lang.Type, { type: decl.returnType })] }))] })] }) }));
56
- }
57
- export function Property({ decl, children }) {
58
- const Docs = useComponents();
59
- const Lang = useLanguageComponents();
60
- const language = useLanguage();
61
- if (!decl)
62
- return null;
63
- switch (decl.kind) {
64
- case 'JavaDeclProperty': {
65
- const typeRaw = _jsx(Lang.Type, { type: decl.type, optional: decl.optional });
66
- const typeWrapped = decl.optional ? (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypeKeyword, children: "Optional" }), _jsx("span", { className: style.TypeBracket, children: '<' }), typeRaw, _jsx("span", { className: style.TypeBracket, children: '>' })] })) : (typeRaw);
67
- const badges = (_jsx(_Fragment, { children: decl.type.kind === 'JavaTypeConstant' && (_jsx(Docs.Tooltip, { content: _jsx("span", { className: style.TextIdentifier, children: decl.type.value }), children: _jsx("span", { className: style.TextIdentifier, children: "constant" }) })) }));
68
- return children({
69
- name: decl.ident,
70
- typeName: _jsx(Lang.TypeName, { type: decl.type, optional: decl.optional }),
71
- type: showFullType(decl.type) && typeWrapped,
72
- badges,
73
- });
74
- }
75
- case 'JavaDeclConst':
76
- return children({
77
- name: decl.ident,
78
- typeName: 'const',
79
- type: _jsx("span", { className: constStyle[typeof decl.value], children: JSON.stringify(decl.value) }),
80
- });
81
- case 'JavaDeclType': {
82
- const typeName = decl.type.kind === 'JavaTypeUnion'
83
- ? 'union'
84
- : decl.type.kind === 'JavaTypeEnum'
85
- ? language === 'kotlin'
86
- ? 'enum class'
87
- : 'enum'
88
- : 'class';
89
- return children({ name: decl.ident, typeName });
90
- }
91
- case 'JavaDeclReference':
92
- return children({ type: _jsx(Lang.Type, { type: decl.type }) });
93
- }
94
- }
95
- export function Declaration({ decl }) {
96
- const Docs = useComponents();
97
- const Lang = useLanguageComponents();
98
- const language = useLanguage();
99
- if (!decl)
100
- return null;
101
- switch (decl.kind) {
102
- case 'JavaDeclConst':
103
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TextIdentifier, children: decl.ident }), _jsx("span", { className: style.TextPunctuation, children: '(' }), JSON.stringify(decl.value), _jsx("span", { className: style.TextPunctuation, children: ')' })] }));
104
- case 'JavaDeclType': {
105
- const keyword = decl.type.kind === 'JavaTypeEnum' ? (language === 'kotlin' ? 'enum class' : 'enum') : 'class';
106
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TextKeyword, children: keyword }), ' ', _jsx("span", { className: style.TextIdentifier, children: decl.ident }), _jsx("span", { className: style.TextPunctuation, children: ":" }), decl.type.kind === 'JavaTypeUnion' && (_jsxs(_Fragment, { children: [' ', _jsx(Docs.Tooltip, { content: "A class that can be one of several variants.", children: _jsx(Docs.Badge, { id: "java-union", children: "union" }) }), ' '] }))] }));
107
- }
108
- case 'JavaDeclProperty': {
109
- const inlineType = _jsx(Lang.Type, { type: decl.type, optional: decl.optional });
110
- const ident = (_jsx("span", { className: style.TypePropertyName, children: _jsx("span", { className: style.TextIdentifier, children: decl.ident }) }));
111
- const suffix = decl.type.kind === 'JavaTypeConstant' ? (_jsxs(_Fragment, { children: [' ', _jsx(Docs.Tooltip, { content: _jsx("span", { className: style.TextIdentifier, children: decl.type.value }), children: _jsx(Docs.Badge, { id: "java-constant", children: "constant" }) })] })) : null;
112
- if (language === 'kotlin')
113
- return (_jsxs(_Fragment, { children: [ident, _jsx("span", { className: style.TextPunctuation, children: ":" }), ' ', decl.optional ? (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypeReference, children: "Optional" }), _jsx("span", { className: style.TypeBracket, children: '<' }), inlineType, _jsx("span", { className: style.TypeBracket, children: '>' })] })) : (inlineType), suffix] }));
114
- return (_jsxs(_Fragment, { children: [decl.optional ? (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypeReference, children: "Optional" }), _jsx("span", { className: style.TypeBracket, children: '<' }), inlineType, _jsx("span", { className: style.TypeBracket, children: '>' })] })) : (inlineType), ' ', ident, suffix] }));
115
- }
116
- case 'JavaDeclReference':
117
- return _jsx(Lang.Type, { type: decl.type });
118
- }
119
- }
120
- //# sourceMappingURL=java.js.map
1
+ import "../component-generics-DzI21jRn.js";
2
+ import "../docs-Dh8kE1va.js";
3
+ import "../navigation-aoYZ_tl4.js";
4
+ import "../markdown-BXfX1D7C.js";
5
+ import "../routing-DQjbRxdJ.js";
6
+ import "../style-rYbbxIR_.js";
7
+ import "../use-components-D9E85p5x.js";
8
+ import { G as Property, K as Type, U as Declaration, W as MethodSignature, q as TypeName } from "../contexts-DRxRO-xO.js";
9
+ import "../icons-DdKM-01E.js";
10
+ import "../utils-CJfFBNgT.js";
11
+ import "../dropdown-DtgAi6lb.js";
12
+ import "../md-Dg8aOyMA.js";
13
+ import "../utils-BHwvUDKn.js";
14
+ import "../types-DFN4M1Sp.js";
15
+
16
+ export { Declaration, MethodSignature, Property, Type, TypeName };
@@ -1,22 +1,13 @@
1
- import * as React from 'react';
2
- import type { PythonAST as AST } from '../types/sdkjson';
3
- import { PropertyFn } from '.';
4
- type TypeProps = {
5
- type: AST.PythonType;
6
- };
7
- export declare function TypeName({ type }: TypeProps): string | import("react/jsx-runtime").JSX.Element;
8
- export declare function Type({ type }: TypeProps): import("react/jsx-runtime").JSX.Element;
9
- export type MethodSignatureProps = {
10
- decl: AST.PythonDeclFunction;
11
- };
12
- export declare function MethodSignature({ decl }: MethodSignatureProps): import("react/jsx-runtime").JSX.Element;
13
- export type PropertyProps = {
14
- decl: AST.PythonDeclaration;
15
- children?: PropertyFn;
16
- };
17
- export declare function Property({ decl, children }: PropertyProps): React.ReactNode;
18
- export type DeclarationProps = {
19
- decl: AST.PythonDeclaration;
20
- };
21
- export declare function Declaration({ decl }: DeclarationProps): import("react/jsx-runtime").JSX.Element | undefined;
22
- export {};
1
+ import "../breadcrumbs-Z-hEqjcp.js";
2
+ import "../dropdown-B7VyGMOw.js";
3
+ import "../method-DpsVuzZW.js";
4
+ import "../primitives-DWz23_Ub.js";
5
+ import "../properties-CF71V58d.js";
6
+ import "../routing-qc0V00-j.js";
7
+ import "../sdk-Zg3Rggk3.js";
8
+ import "../snippets-EUzM4fRO.js";
9
+ import "../overview-C8e-6jGr.js";
10
+ import "../sidebar-C8KirYjg.js";
11
+ import "../index-YnpUtXLB.js";
12
+ import { A as PropertyProps, D as MethodSignature, E as DeclarationProps, M as TypeName, O as MethodSignatureProps, T as Declaration, j as Type, k as Property } from "../index-AicgPYKB.js";
13
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
@@ -1,104 +1,16 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { useLanguageComponents } from '../contexts';
4
- import { useComponents } from '../contexts/use-components';
5
- import style from '../style';
6
- const constStyle = {
7
- string: style.LiteralString,
8
- number: style.LiteralNumeric,
9
- boolean: style.LiteralBoolean,
10
- };
11
- function showFullType(type) {
12
- if (type.kind !== 'PythonTypeReference')
13
- return false;
14
- return type.typeName === 'Optional' ? showFullType(type.typeParameters[0]) : type.typeParameters.length > 0;
15
- }
16
- export function TypeName({ type }) {
17
- const Lang = useLanguageComponents();
18
- if (type.kind === 'PythonTypeReference') {
19
- switch (type.typeName) {
20
- case 'Optional':
21
- return _jsx(Lang.TypeName, { type: type.typeParameters[0] });
22
- case 'List':
23
- case 'Iterable':
24
- case 'Literal':
25
- case 'Union':
26
- return type.typeName.toLowerCase();
27
- }
28
- }
29
- return _jsx(Lang.Type, { type: type });
30
- }
31
- export function Type({ type }) {
32
- const Lang = useLanguageComponents();
33
- const { Join, SDKReference } = useComponents();
34
- switch (type.kind) {
35
- case 'PythonTypeAny':
36
- case 'PythonTypeUnknown':
37
- case 'PythonTypeInt':
38
- case 'PythonTypeFloat':
39
- case 'PythonTypeBool':
40
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: type.kind.slice(10).toLowerCase() }) }));
41
- case 'PythonTypeString':
42
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeString, children: "str" }) }));
43
- case 'PythonTypeLiteral':
44
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: constStyle[typeof type.literal.value], children: JSON.stringify(type.literal.value) }) }));
45
- case 'PythonTypeArray':
46
- return (_jsxs("span", { className: style.Type, children: [_jsx("span", { className: style.TypeArray, children: 'Array<' }), _jsx(Lang.Type, { type: type.elementType }), _jsx("span", { className: style.TypeArray, children: '>' })] }));
47
- case 'PythonTypeClass':
48
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: "class" }) }));
49
- case 'PythonTypeMap':
50
- return (_jsx("span", { className: style.Type, children: _jsx("span", { className: style.TypeKeyword, children: "Dict" }) }));
51
- case 'PythonTypeReference': {
52
- const params = type.typeParameters?.map((param, key) => _jsx(Lang.Type, { type: param }, key));
53
- return (_jsxs("span", { className: style.Type, children: [_jsx("span", { className: type.typeName === 'Optional' ? style.TypeArray : '', children: _jsx(SDKReference, { stainlessPath: type.$ref, children: type.typeName }) }), params && params.length > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypeBracket, children: '[' }), _jsx(Join, { items: params, limit: 3, children: _jsx("span", { className: style.TextOperator, children: ", " }) }), _jsx("span", { className: style.TypeBracket, children: ']' })] }))] }));
54
- }
55
- }
56
- }
57
- export function MethodSignature({ decl }) {
58
- const Lang = useLanguageComponents();
59
- const { Join, Tooltip } = useComponents();
60
- const params = decl.parameters.map((param, i) => (_jsx(React.Fragment, { children: _jsx(Tooltip, { content: _jsx(Lang.Type, { type: param.type }), children: _jsx("span", { className: style.TextIdentifier, children: param.ident }) }) }, i)));
61
- return (_jsx("div", { className: style.MethodSignature, children: _jsxs("span", { className: style.SignatureTitle, children: [decl.async && _jsx("span", { className: style.TextKeyword, children: "async " }), decl.qualified && (_jsx("span", { className: style.SignatureQualified, children: _jsx("span", { className: style.TextIdentifier, children: decl.qualified?.slice(0, -decl.ident.length) }) })), _jsx("span", { className: style.SignatureName, children: _jsx("span", { className: style.TextIdentifier, children: decl.ident }) }), _jsxs("span", { className: style.MethodSignature, children: [_jsx("span", { className: style.SignatureParen, children: '(' }), _jsx("span", { className: style.SignatureParams, children: _jsx(Join, { items: params, children: _jsx("span", { className: style.TextOperator, children: ', ' }) }) }), _jsxs("span", { className: style.SignatureParen, children: [')', " "] }), decl.returns && (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TextOperator, children: ' -> ' }), _jsx(Lang.Type, { type: decl.returns })] }))] })] }) }));
62
- }
63
- export function Property({ decl, children }) {
64
- const Lang = useLanguageComponents();
65
- if (!decl)
66
- return;
67
- switch (decl.kind) {
68
- case 'PythonDeclProperty':
69
- return children({
70
- name: decl.ident,
71
- typeName: _jsx(Lang.TypeName, { type: decl.type }),
72
- type: showFullType(decl.type) && _jsx(Lang.Type, { type: decl.type }),
73
- });
74
- case 'PythonDeclClass':
75
- return children({ name: decl.ident, typeName: 'class' });
76
- case 'PythonDeclType':
77
- return children({
78
- name: decl.ident,
79
- typeName: 'type',
80
- type: _jsx(Lang.Type, { type: decl.type }),
81
- });
82
- case 'PythonDeclReference':
83
- return children({ type: _jsx(Lang.Type, { type: decl.type }) });
84
- }
85
- }
86
- export function Declaration({ decl }) {
87
- const Lang = useLanguageComponents();
88
- if (!decl)
89
- return;
90
- switch (decl.kind) {
91
- case 'PythonDeclProperty':
92
- const nullable = decl.type.kind === 'PythonTypeReference' &&
93
- decl.type.typeName === 'Optional' &&
94
- (decl.type.typeParameters ?? []).length > 0;
95
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypePropertyName, children: _jsx("span", { className: style.TextIdentifier, children: decl.ident }) }), _jsx("span", { className: style.TextPunctuation, children: ": " }), decl.optional && !nullable ? (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TypePlain, children: "Optional" }), _jsx("span", { className: style.TypeBracket, children: '[' }), _jsx(Lang.Type, { type: decl.type }), _jsx("span", { className: style.TypeBrace, children: ']' })] })) : (_jsx(Lang.Type, { type: decl.type }))] }));
96
- case 'PythonDeclClass':
97
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TextKeyword, children: "class " }), _jsx("span", { className: style.TextIdentifier, children: decl.ident }), _jsx("span", { className: style.TextPunctuation, children: ": " }), _jsx("span", { className: `${style.TypePreviewContent} ${style.TextPunctuation}`, children: "\u2026" })] }));
98
- case 'PythonDeclType':
99
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: style.TextIdentifier, children: decl.ident }), _jsx("span", { className: style.TextOperator, children: " = " }), _jsx(Lang.Type, { type: decl.type })] }));
100
- case 'PythonDeclReference':
101
- return _jsx(Lang.Type, { type: decl.type });
102
- }
103
- }
104
- //# sourceMappingURL=python.js.map
1
+ import "../component-generics-DzI21jRn.js";
2
+ import "../docs-Dh8kE1va.js";
3
+ import "../navigation-aoYZ_tl4.js";
4
+ import "../markdown-BXfX1D7C.js";
5
+ import "../routing-DQjbRxdJ.js";
6
+ import "../style-rYbbxIR_.js";
7
+ import "../use-components-D9E85p5x.js";
8
+ import { F as TypeName, M as MethodSignature, N as Property, P as Type, j as Declaration } from "../contexts-DRxRO-xO.js";
9
+ import "../icons-DdKM-01E.js";
10
+ import "../utils-CJfFBNgT.js";
11
+ import "../dropdown-DtgAi6lb.js";
12
+ import "../md-Dg8aOyMA.js";
13
+ import "../utils-BHwvUDKn.js";
14
+ import "../types-DFN4M1Sp.js";
15
+
16
+ export { Declaration, MethodSignature, Property, Type, TypeName };
@@ -1,22 +1,13 @@
1
- import * as React from 'react';
2
- import type { RubyAST as AST } from '../types/sdkjson';
3
- import { PropertyFn } from '.';
4
- type TypeProps = {
5
- type: AST.RubyType;
6
- };
7
- export declare function TypeName({ type }: TypeProps): string | import("react/jsx-runtime").JSX.Element;
8
- export declare function Type({ type }: TypeProps): import("react/jsx-runtime").JSX.Element;
9
- export type MethodSignatureProps = {
10
- decl: AST.RubyDeclFunction;
11
- };
12
- export declare function MethodSignature({ decl }: MethodSignatureProps): import("react/jsx-runtime").JSX.Element;
13
- export type PropertyProps = {
14
- decl: AST.RubyDeclaration;
15
- children?: PropertyFn;
16
- };
17
- export declare function Property({ decl, children }: PropertyProps): React.ReactNode;
18
- export type DeclarationProps = {
19
- decl: AST.RubyDeclaration;
20
- };
21
- export declare function Declaration({ decl }: DeclarationProps): import("react/jsx-runtime").JSX.Element | undefined;
22
- export {};
1
+ import "../breadcrumbs-Z-hEqjcp.js";
2
+ import "../dropdown-B7VyGMOw.js";
3
+ import "../method-DpsVuzZW.js";
4
+ import "../primitives-DWz23_Ub.js";
5
+ import "../properties-CF71V58d.js";
6
+ import "../routing-qc0V00-j.js";
7
+ import "../sdk-Zg3Rggk3.js";
8
+ import "../snippets-EUzM4fRO.js";
9
+ import "../overview-C8e-6jGr.js";
10
+ import "../sidebar-C8KirYjg.js";
11
+ import "../index-YnpUtXLB.js";
12
+ import { C as TypeName, S as Type, _ as DeclarationProps, b as Property, g as Declaration, v as MethodSignature, x as PropertyProps, y as MethodSignatureProps } from "../index-AicgPYKB.js";
13
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };