@stainless-api/docs-ui 0.1.0-beta.73 → 0.1.0-beta.75

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 (124) hide show
  1. package/dist/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
  2. package/dist/components/MaskedInput.d.ts +3 -3
  3. package/dist/components/MaskedInput.js +1 -1
  4. package/dist/components/breadcrumbs.d.ts +24 -1
  5. package/dist/components/breadcrumbs.js +62 -7
  6. package/dist/components/icons.d.ts +18 -13
  7. package/dist/components/icons.js +940 -2
  8. package/dist/components/index.d.ts +16 -14
  9. package/dist/components/index.js +72 -18
  10. package/dist/components/method.d.ts +58 -1
  11. package/dist/components/method.js +95 -8
  12. package/dist/components/overview.d.ts +38 -1
  13. package/dist/components/overview.js +137 -9
  14. package/dist/components/primitives.d.ts +104 -1
  15. package/dist/components/primitives.js +250 -6
  16. package/dist/components/properties.d.ts +53 -1
  17. package/dist/components/properties.js +138 -7
  18. package/dist/components/sdk-sidebar.d.ts +14 -1
  19. package/dist/components/sdk-sidebar.js +50 -8
  20. package/dist/components/sdk.d.ts +121 -1
  21. package/dist/components/sdk.js +405 -8
  22. package/dist/components/snippets.d.ts +70 -13
  23. package/dist/components/snippets.js +182 -7
  24. package/dist/components/stl-sidebar.d.ts +57 -1
  25. package/dist/components/stl-sidebar.js +105 -3
  26. package/dist/contexts/component-generics.d.ts +29 -1
  27. package/dist/contexts/component-generics.js +31 -1
  28. package/dist/contexts/component-types.d.ts +4 -15
  29. package/dist/contexts/component.d.ts +7 -17
  30. package/dist/contexts/component.js +22 -28
  31. package/dist/contexts/docs.d.ts +61 -1
  32. package/dist/contexts/docs.js +89 -1
  33. package/dist/contexts/index.d.ts +13 -14
  34. package/dist/contexts/index.js +44 -6
  35. package/dist/contexts/markdown.d.ts +21 -1
  36. package/dist/contexts/markdown.js +47 -2
  37. package/dist/contexts/navigation.d.ts +28 -1
  38. package/dist/contexts/navigation.js +22 -1
  39. package/dist/contexts/use-components.d.ts +1 -13
  40. package/dist/contexts/use-components.js +6 -2
  41. package/dist/{index-HDt5wRiR.d.ts → index-Cl6Gny0o.d.ts} +37 -2
  42. package/dist/index.d.ts +4 -14
  43. package/dist/index.js +7 -30
  44. package/dist/languages/cli.d.ts +38 -14
  45. package/dist/languages/cli.js +166 -20
  46. package/dist/languages/csharp.d.ts +42 -14
  47. package/dist/languages/csharp.js +283 -8
  48. package/dist/languages/go.d.ts +40 -14
  49. package/dist/languages/go.js +303 -8
  50. package/dist/languages/http.d.ts +46 -14
  51. package/dist/languages/http.js +390 -19
  52. package/dist/languages/index.d.ts +51 -14
  53. package/dist/languages/index.js +32 -28
  54. package/dist/languages/java.d.ts +43 -14
  55. package/dist/languages/java.js +403 -8
  56. package/dist/languages/php.d.ts +40 -0
  57. package/dist/languages/php.js +313 -0
  58. package/dist/languages/python.d.ts +40 -14
  59. package/dist/languages/python.js +269 -8
  60. package/dist/languages/ruby.d.ts +40 -14
  61. package/dist/languages/ruby.js +387 -8
  62. package/dist/languages/terraform.d.ts +48 -14
  63. package/dist/languages/terraform.js +243 -8
  64. package/dist/languages/typescript.d.ts +40 -14
  65. package/dist/languages/typescript.js +449 -8
  66. package/dist/markdown/index.d.ts +1 -2
  67. package/dist/markdown/index.js +1 -28
  68. package/dist/markdown/printer.d.ts +2 -2
  69. package/dist/markdown/printer.js +6 -30
  70. package/dist/markdown/utils.d.ts +3 -3
  71. package/dist/routing.d.ts +61 -2
  72. package/dist/routing.js +205 -2
  73. package/dist/spec.d.ts +2 -2
  74. package/dist/spec.js +2 -2
  75. package/dist/style.js +176 -1
  76. package/dist/use-strict-context-L0c8JKg4.js +16 -0
  77. package/dist/utils.d.ts +1 -1
  78. package/dist/utils.js +53 -2
  79. package/package.json +3 -3
  80. package/dist/breadcrumbs-Dei_5sHd.d.ts +0 -25
  81. package/dist/breadcrumbs-oUp-6oJK.js +0 -63
  82. package/dist/cli-BX9ofVCR.js +0 -166
  83. package/dist/component-Dl5ZEHxB.js +0 -23
  84. package/dist/component-generics-C9ALAcZI.d.ts +0 -30
  85. package/dist/component-generics-POFirVVb.js +0 -45
  86. package/dist/components-DQPlXEwE.js +0 -72
  87. package/dist/contexts-_NNW5yqC.js +0 -44
  88. package/dist/csharp-sn5CJu9t.js +0 -283
  89. package/dist/docs-YgoQ3bzY.js +0 -81
  90. package/dist/docs-x-kfjRMc.d.ts +0 -66
  91. package/dist/go-BoaAVmP0.js +0 -303
  92. package/dist/http-Ccj1dOvE.js +0 -389
  93. package/dist/icons-BYKn5X8E.js +0 -885
  94. package/dist/index-OCM-LZIo.d.ts +0 -428
  95. package/dist/java-BiLRuLuD.js +0 -403
  96. package/dist/languages-COjc0Nwx.js +0 -30
  97. package/dist/markdown-BszOPZhh.d.ts +0 -22
  98. package/dist/markdown-Cq3XEhrR.js +0 -49
  99. package/dist/method-DjzVBzZe.js +0 -96
  100. package/dist/method-KkWyhvKa.d.ts +0 -59
  101. package/dist/navigation-BZjwfN2P.d.ts +0 -29
  102. package/dist/navigation-aoYZ_tl4.js +0 -24
  103. package/dist/overview-BNmMeDUE.d.ts +0 -39
  104. package/dist/overview-Clq5psZe.js +0 -138
  105. package/dist/primitives-B8OnSXRP.d.ts +0 -105
  106. package/dist/primitives-BBUs_flm.js +0 -250
  107. package/dist/properties-BhlRtWo4.d.ts +0 -54
  108. package/dist/properties-DQU0NBzb.js +0 -138
  109. package/dist/python-nqOBH7GS.js +0 -269
  110. package/dist/routing-GvhEMw6E.js +0 -205
  111. package/dist/routing-qJMPICGo.d.ts +0 -61
  112. package/dist/ruby-BBc8HdIt.js +0 -387
  113. package/dist/sdk-C8C6IRQp.d.ts +0 -122
  114. package/dist/sdk-DzCHhEoX.js +0 -405
  115. package/dist/sdk-sidebar-CkjSLggl.js +0 -50
  116. package/dist/sdk-sidebar-lgNmf-ns.d.ts +0 -15
  117. package/dist/snippets-CLpNVNlA.js +0 -181
  118. package/dist/stl-sidebar-8jF9cdnn.d.ts +0 -58
  119. package/dist/stl-sidebar-DC5UOJiT.js +0 -106
  120. package/dist/style-DJIYkFhO.js +0 -178
  121. package/dist/terraform-DVx2ea2h.js +0 -243
  122. package/dist/typescript-Cmk-jBBw.js +0 -449
  123. package/dist/use-components-BUz3GbO4.js +0 -7
  124. package/dist/utils-D6zJxUZ9.js +0 -54
@@ -1,21 +1,167 @@
1
- import "../docs-YgoQ3bzY.js";
2
- import "../component-generics-POFirVVb.js";
3
- import "../navigation-aoYZ_tl4.js";
4
- import "../markdown-Cq3XEhrR.js";
5
- import "../contexts-_NNW5yqC.js";
6
- import "../use-components-BUz3GbO4.js";
7
- import "../properties-DQU0NBzb.js";
8
- import "../method-DjzVBzZe.js";
9
- import "../primitives-BBUs_flm.js";
10
- import "../icons-BYKn5X8E.js";
11
- import "../sdk-DzCHhEoX.js";
12
- import "../snippets-CLpNVNlA.js";
13
- import "../overview-Clq5psZe.js";
14
- import "../breadcrumbs-oUp-6oJK.js";
15
- import "../stl-sidebar-DC5UOJiT.js";
16
- import "../sdk-sidebar-CkjSLggl.js";
17
- import "../components-DQPlXEwE.js";
18
- import "../http-Ccj1dOvE.js";
19
- import { a as TypeName, i as Type, n as MethodSignature, r as Property, t as Declaration } from "../cli-BX9ofVCR.js";
1
+ import { t as __exportAll } from "../chunk-BYypO7fO.js";
2
+ import "../use-strict-context-L0c8JKg4.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 { Type as Type$1, TypeName as TypeName$1 } from "./http.js";
7
+ import React from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
20
9
 
21
- export { Declaration, MethodSignature, Property, Type, TypeName };
10
+ //#region src/languages/cli.tsx
11
+ var cli_exports = /* @__PURE__ */ __exportAll({
12
+ Declaration: () => Declaration,
13
+ MethodSignature: () => MethodSignature,
14
+ Property: () => Property,
15
+ Type: () => Type,
16
+ TypeName: () => TypeName
17
+ });
18
+ const ComplexTypes = {
19
+ HttpTypeUnion: "union",
20
+ HttpTypeIntersection: "intersection"
21
+ };
22
+ const constStyle = {
23
+ string: style_default.LiteralString,
24
+ number: style_default.LiteralNumeric,
25
+ boolean: style_default.LiteralBoolean
26
+ };
27
+ function TypeName(props) {
28
+ return TypeName$1(props);
29
+ }
30
+ function Type({ type }) {
31
+ switch (type.kind) {
32
+ case "HttpTypeBinary": return /* @__PURE__ */ jsx("span", {
33
+ className: style_default.Type,
34
+ children: /* @__PURE__ */ jsx("span", {
35
+ className: style_default.TypePlain,
36
+ children: "file path"
37
+ })
38
+ });
39
+ default: return Type$1({ type });
40
+ }
41
+ }
42
+ function MethodSignature({ decl }) {
43
+ const { Join } = useComponents();
44
+ const params = decl.arguments?.map((arg, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
45
+ /* @__PURE__ */ jsx("span", {
46
+ className: style_default.TextOperator,
47
+ children: "<"
48
+ }),
49
+ /* @__PURE__ */ jsx("span", {
50
+ className: style_default.TextIdentifier,
51
+ children: arg.value
52
+ }),
53
+ /* @__PURE__ */ jsx("span", {
54
+ className: style_default.TextOperator,
55
+ children: ">"
56
+ })
57
+ ] }, i));
58
+ return /* @__PURE__ */ jsxs("div", {
59
+ className: style_default.MethodSignature,
60
+ children: [
61
+ /* @__PURE__ */ jsx("span", {
62
+ className: style_default.TextOperator,
63
+ children: "$ "
64
+ }),
65
+ /* @__PURE__ */ jsx("span", {
66
+ className: style_default.SignatureName,
67
+ children: /* @__PURE__ */ jsx("span", {
68
+ className: style_default.TextIdentifier,
69
+ children: decl.invocation.join(" ")
70
+ })
71
+ }),
72
+ params && /* @__PURE__ */ jsxs("span", {
73
+ className: style_default.MethodSignature,
74
+ children: [" ", /* @__PURE__ */ jsx(Join, {
75
+ items: params,
76
+ children: " "
77
+ })]
78
+ }),
79
+ decl.options && decl.options.length > 0 ? /* @__PURE__ */ jsx("span", {
80
+ className: style_default.TextOperator,
81
+ children: " [options]"
82
+ }) : null
83
+ ]
84
+ });
85
+ }
86
+ function renderVariantInfo(type) {
87
+ if (type.kind === "HttpTypeUnion" && type.types.every((t) => t.kind === "HttpTypeObject" || t.kind === "HttpTypeReference")) return /* @__PURE__ */ jsxs(Fragment$1, { children: [
88
+ "One of the following ",
89
+ type.types.length,
90
+ " object variants:"
91
+ ] });
92
+ }
93
+ function Property({ decl, children }) {
94
+ const Lang = useLanguageComponents();
95
+ if (!decl) return;
96
+ switch (decl.kind) {
97
+ case "CLIFlag":
98
+ case "CLISchemaProperty": {
99
+ const variants = decl.type ? renderVariantInfo(decl.type) : void 0;
100
+ return children({
101
+ name: /* @__PURE__ */ jsxs(Fragment$1, { children: [decl.kind === "CLIFlag" && "--", flagName(decl)] }),
102
+ typeName: decl.type ? /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }) : void 0,
103
+ type: decl.type && decl.type.kind in ComplexTypes && !variants && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
104
+ });
105
+ }
106
+ case "CLIFunction": return children({
107
+ name: decl.name,
108
+ typeName: "function"
109
+ });
110
+ case "CLIStdin": return children({ name: "stdin" });
111
+ case "CLICommand": return children({
112
+ name: decl.invocation.join(" "),
113
+ typeName: "command"
114
+ });
115
+ }
116
+ }
117
+ function flagName(node) {
118
+ if (node.kind === "CLIFlag" && node.flag) return typeof node.flag === "string" ? node.flag : node.flag.name || "";
119
+ return node.name ?? node.ident ?? "unknown";
120
+ }
121
+ function Declaration({ decl }) {
122
+ const Lang = useLanguageComponents();
123
+ if (!decl) return;
124
+ switch (decl.kind) {
125
+ case "CLICommand": return /* @__PURE__ */ jsx("span", {
126
+ className: style_default.TextIdentifier,
127
+ children: `$ ${decl.invocation.join(" ")}`
128
+ });
129
+ case "CLISchemaProperty":
130
+ case "CLIFlag":
131
+ if ("value" in decl) return /* @__PURE__ */ jsx("span", {
132
+ className: constStyle[typeof decl.value],
133
+ children: JSON.stringify(decl.value)
134
+ });
135
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
136
+ className: style_default.PropertyName,
137
+ children: /* @__PURE__ */ jsxs("span", {
138
+ className: style_default.TextIdentifier,
139
+ children: [decl.kind === "CLIFlag" && "--", flagName(decl)]
140
+ })
141
+ }), decl.type && /* @__PURE__ */ jsxs(Fragment$1, { children: [
142
+ /* @__PURE__ */ jsx("span", {
143
+ className: style_default.TextPunctuation,
144
+ children: ": "
145
+ }),
146
+ decl.optional && /* @__PURE__ */ jsx("span", {
147
+ className: style_default.TextPunctuation,
148
+ children: "optional "
149
+ }),
150
+ typeof decl.type === "string" ? /* @__PURE__ */ jsx("span", {
151
+ className: style_default.TextKeyword,
152
+ children: decl.type
153
+ }) : /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
154
+ ] })] });
155
+ case "CLIFunction": return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("span", {
156
+ className: style_default.TextIdentifier,
157
+ children: [decl.name, "()"]
158
+ }) });
159
+ case "CLIStdin": return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("span", {
160
+ className: style_default.TextIdentifier,
161
+ children: "stdin"
162
+ }) });
163
+ }
164
+ }
165
+
166
+ //#endregion
167
+ export { Declaration, MethodSignature, Property, Type, TypeName, cli_exports as t };
@@ -1,14 +1,42 @@
1
- import "../primitives-B8OnSXRP.js";
2
- import "../breadcrumbs-Dei_5sHd.js";
3
- import "../method-KkWyhvKa.js";
4
- import "../properties-BhlRtWo4.js";
5
- import "../sdk-C8C6IRQp.js";
6
- import { G as MethodSignature, J as PropertyProps, K as MethodSignatureProps, U as Declaration, W as DeclarationProps, X as TypeName, Y as Type, q as Property } from "../index-OCM-LZIo.js";
7
- import "../navigation-BZjwfN2P.js";
8
- import "../markdown-BszOPZhh.js";
9
- import "../component-generics-C9ALAcZI.js";
10
- import "../docs-x-kfjRMc.js";
11
- import "../overview-BNmMeDUE.js";
12
- import "../sdk-sidebar-lgNmf-ns.js";
13
- import "../stl-sidebar-8jF9cdnn.js";
14
- export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
1
+ import { r as CSharpAST } from "../index-Cl6Gny0o.js";
2
+ import { PropertyFn } from "./index.js";
3
+ import * as React$1 from "react";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
+
6
+ //#region src/languages/csharp.d.ts
7
+ declare namespace csharp_d_exports {
8
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
9
+ }
10
+ declare function TypeName({
11
+ type,
12
+ optional
13
+ }: TypeProps): react_jsx_runtime0.JSX.Element;
14
+ type TypeProps = {
15
+ type: CSharpAST.CSharpType;
16
+ optional?: boolean;
17
+ };
18
+ declare function Type({
19
+ type
20
+ }: TypeProps): react_jsx_runtime0.JSX.Element;
21
+ type MethodSignatureProps = {
22
+ decl: CSharpAST.CSharpDeclFunction;
23
+ };
24
+ declare function MethodSignature({
25
+ decl
26
+ }: MethodSignatureProps): react_jsx_runtime0.JSX.Element;
27
+ type PropertyProps = {
28
+ decl: CSharpAST.CSharpDeclaration;
29
+ children: PropertyFn;
30
+ };
31
+ declare function Property({
32
+ decl,
33
+ children
34
+ }: PropertyProps): React$1.ReactNode;
35
+ type DeclarationProps = {
36
+ decl: CSharpAST.CSharpDeclaration;
37
+ };
38
+ declare function Declaration({
39
+ decl
40
+ }: DeclarationProps): react_jsx_runtime0.JSX.Element | null | undefined;
41
+ //#endregion
42
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName, csharp_d_exports as t };
@@ -1,9 +1,284 @@
1
- import "../docs-YgoQ3bzY.js";
2
- import "../component-generics-POFirVVb.js";
3
- import "../navigation-aoYZ_tl4.js";
4
- import "../markdown-Cq3XEhrR.js";
5
- import "../contexts-_NNW5yqC.js";
6
- import "../use-components-BUz3GbO4.js";
7
- import { a as TypeName, i as Type, n as MethodSignature, r as Property, t as Declaration } from "../csharp-sn5CJu9t.js";
1
+ import { t as __exportAll } from "../chunk-BYypO7fO.js";
2
+ import "../use-strict-context-L0c8JKg4.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
8
 
9
- export { Declaration, MethodSignature, Property, Type, TypeName };
9
+ //#region src/languages/csharp.tsx
10
+ var csharp_exports = /* @__PURE__ */ __exportAll({
11
+ Declaration: () => Declaration,
12
+ MethodSignature: () => MethodSignature,
13
+ Property: () => Property,
14
+ Type: () => Type,
15
+ TypeName: () => TypeName
16
+ });
17
+ const constStyle = {
18
+ string: style_default.LiteralString,
19
+ number: style_default.LiteralNumeric,
20
+ boolean: style_default.LiteralBoolean
21
+ };
22
+ function TypeName({ type, optional }) {
23
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(useLanguageComponents().Type, { type }), optional && /* @__PURE__ */ jsx("span", {
24
+ className: style_default.TextOperator,
25
+ children: "? "
26
+ })] });
27
+ }
28
+ function Type({ type }) {
29
+ const Lang = useLanguageComponents();
30
+ const { Join, SDKReference } = useComponents();
31
+ switch (type.kind) {
32
+ case "CSharpTypeReference": {
33
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
34
+ return /* @__PURE__ */ jsxs("span", {
35
+ className: style_default.Type,
36
+ children: [
37
+ /* @__PURE__ */ jsx(SDKReference, {
38
+ stainlessPath: type.$ref,
39
+ children: type.typeName
40
+ }),
41
+ params && params.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
42
+ /* @__PURE__ */ jsx("span", {
43
+ className: style_default.TypeBracket,
44
+ children: "<"
45
+ }),
46
+ /* @__PURE__ */ jsx(Join, {
47
+ items: params,
48
+ limit: 3,
49
+ children: /* @__PURE__ */ jsx("span", {
50
+ className: style_default.TextOperator,
51
+ children: ", "
52
+ })
53
+ }),
54
+ /* @__PURE__ */ jsx("span", {
55
+ className: style_default.TypeBracket,
56
+ children: ">"
57
+ })
58
+ ] }) : null,
59
+ type.nullable && /* @__PURE__ */ jsx("span", {
60
+ className: style_default.TextOperator,
61
+ children: "?"
62
+ })
63
+ ]
64
+ });
65
+ }
66
+ case "CSharpTypeClass":
67
+ case "CSharpTypeUnion": return /* @__PURE__ */ jsx("span", {
68
+ className: style_default.Type,
69
+ children: /* @__PURE__ */ jsx("span", {
70
+ className: style_default.TypeKeyword,
71
+ children: "class"
72
+ })
73
+ });
74
+ case "CSharpTypeEnum":
75
+ case "CSharpTypeBoolean":
76
+ case "CSharpTypeFloat":
77
+ case "CSharpTypeDouble":
78
+ case "CSharpTypeInt":
79
+ case "CSharpTypeLong": return /* @__PURE__ */ jsx("span", {
80
+ className: style_default.Type,
81
+ children: /* @__PURE__ */ jsx("span", {
82
+ className: style_default.TypeKeyword,
83
+ children: type.kind.slice(10)
84
+ })
85
+ });
86
+ case "CSharpTypeString": return /* @__PURE__ */ jsx("span", {
87
+ className: style_default.Type,
88
+ children: /* @__PURE__ */ jsx("span", {
89
+ className: style_default.TypeString,
90
+ children: "string"
91
+ })
92
+ });
93
+ case "CSharpTypeConstant": return /* @__PURE__ */ jsx("span", {
94
+ className: style_default.Type,
95
+ children: /* @__PURE__ */ jsx("span", {
96
+ className: style_default.TypeKeyword,
97
+ children: "JsonElement"
98
+ })
99
+ });
100
+ }
101
+ }
102
+ function MethodSignature({ decl }) {
103
+ const Lang = useLanguageComponents();
104
+ const { Join, Tooltip } = useComponents();
105
+ const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsxs(Tooltip, {
106
+ content: /* @__PURE__ */ jsx(Lang.Type, { type: param.typeAnnotation }),
107
+ children: [/* @__PURE__ */ jsx("span", {
108
+ className: style_default.TextIdentifier,
109
+ children: param.ident
110
+ }), param.hasDefault && /* @__PURE__ */ jsxs(Fragment$1, { children: [
111
+ " ",
112
+ /* @__PURE__ */ jsx("span", {
113
+ className: style_default.TextOperator,
114
+ children: "="
115
+ }),
116
+ " ",
117
+ /* @__PURE__ */ jsx("span", {
118
+ className: style_default.TextKeyword,
119
+ children: "default"
120
+ })
121
+ ] })]
122
+ }) }, i));
123
+ return /* @__PURE__ */ jsx("div", {
124
+ className: style_default.MethodSignature,
125
+ children: /* @__PURE__ */ jsxs("span", {
126
+ className: style_default.SignatureTitle,
127
+ children: [
128
+ decl.returnType && /* @__PURE__ */ jsxs("span", {
129
+ className: style_default.SignatureReturns,
130
+ children: [/* @__PURE__ */ jsx(Lang.Type, { type: decl.returnType }), " "]
131
+ }),
132
+ decl.qualified && /* @__PURE__ */ jsx("span", {
133
+ className: style_default.SignatureQualified,
134
+ children: /* @__PURE__ */ jsx("span", {
135
+ className: style_default.TextIdentifier,
136
+ children: decl.qualified?.slice(0, -decl.ident.length)
137
+ })
138
+ }),
139
+ /* @__PURE__ */ jsx("span", {
140
+ className: style_default.SignatureName,
141
+ children: /* @__PURE__ */ jsx("span", {
142
+ className: style_default.TextIdentifier,
143
+ children: decl.ident
144
+ })
145
+ }),
146
+ /* @__PURE__ */ jsxs("span", {
147
+ className: style_default.MethodSignature,
148
+ children: [
149
+ /* @__PURE__ */ jsx("span", {
150
+ className: style_default.SignatureParen,
151
+ children: "("
152
+ }),
153
+ /* @__PURE__ */ jsx("span", {
154
+ className: style_default.SignatureParams,
155
+ children: /* @__PURE__ */ jsx(Join, {
156
+ items: params,
157
+ children: /* @__PURE__ */ jsx("span", {
158
+ className: style_default.TextOperator,
159
+ children: ", "
160
+ })
161
+ })
162
+ }),
163
+ /* @__PURE__ */ jsxs("span", {
164
+ className: style_default.SignatureParen,
165
+ children: [")", " "]
166
+ })
167
+ ]
168
+ })
169
+ ]
170
+ })
171
+ });
172
+ }
173
+ function Property({ decl, children }) {
174
+ const Lang = useLanguageComponents();
175
+ if (!decl) return null;
176
+ switch (decl.kind) {
177
+ case "CSharpDeclProperty": {
178
+ const type = /* @__PURE__ */ jsx(Lang.Type, {
179
+ type: decl.type,
180
+ optional: decl.optional
181
+ });
182
+ return children({
183
+ name: decl.ident,
184
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, {
185
+ type: decl.type,
186
+ optional: decl.optional
187
+ }),
188
+ type
189
+ });
190
+ }
191
+ case "CSharpDeclConst": return children({
192
+ name: decl.ident,
193
+ typeName: "constant",
194
+ type: /* @__PURE__ */ jsx("span", {
195
+ className: constStyle[typeof decl.value],
196
+ children: JSON.stringify(decl.value)
197
+ })
198
+ });
199
+ case "CSharpDeclType": {
200
+ const typeName = decl.type.kind === "CSharpTypeUnion" ? "union" : decl.type.kind === "CSharpTypeEnum" ? "enum" : "class";
201
+ return children({
202
+ name: decl.ident,
203
+ typeName
204
+ });
205
+ }
206
+ case "CSharpDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
207
+ }
208
+ }
209
+ function Declaration({ decl }) {
210
+ const Docs = useComponents();
211
+ const Lang = useLanguageComponents();
212
+ if (!decl) return null;
213
+ switch (decl.kind) {
214
+ case "CSharpDeclConst": return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Docs.Tooltip, {
215
+ content: JSON.stringify(decl.value),
216
+ children: /* @__PURE__ */ jsx("span", {
217
+ className: style_default.TextIdentifier,
218
+ children: decl.ident
219
+ })
220
+ }) });
221
+ case "CSharpDeclType": {
222
+ const keyword = decl.type.kind === "CSharpTypeEnum" ? "enum" : "class";
223
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
224
+ /* @__PURE__ */ jsx("span", {
225
+ className: style_default.TextKeyword,
226
+ children: keyword
227
+ }),
228
+ " ",
229
+ /* @__PURE__ */ jsx("span", {
230
+ className: style_default.TextIdentifier,
231
+ children: decl.ident
232
+ }),
233
+ /* @__PURE__ */ jsx("span", {
234
+ className: style_default.TextPunctuation,
235
+ children: ":"
236
+ }),
237
+ decl.type.kind === "CSharpTypeUnion" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
238
+ " ",
239
+ /* @__PURE__ */ jsx(Docs.Tooltip, {
240
+ content: "A class that can be one of several variants.",
241
+ children: /* @__PURE__ */ jsx(Docs.Badge, {
242
+ id: "csharp-union",
243
+ children: "union"
244
+ })
245
+ }),
246
+ " "
247
+ ] })
248
+ ] });
249
+ }
250
+ case "CSharpDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
251
+ decl.optional === false && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
252
+ className: style_default.TextKeyword,
253
+ children: "required"
254
+ }), " "] }),
255
+ /* @__PURE__ */ jsx(Lang.Type, {
256
+ type: decl.type,
257
+ optional: decl.optional
258
+ }),
259
+ decl.nullable && !("nullable" in decl.type && decl.type.nullable) && /* @__PURE__ */ jsx("span", {
260
+ className: style_default.TextOperator,
261
+ children: "?"
262
+ }),
263
+ " ",
264
+ /* @__PURE__ */ jsx("span", {
265
+ className: style_default.TextIdentifier,
266
+ children: decl.ident
267
+ }),
268
+ decl.type.kind === "CSharpTypeConstant" && /* @__PURE__ */ jsxs(Fragment$1, { children: [" ", /* @__PURE__ */ jsx(Docs.Tooltip, {
269
+ content: /* @__PURE__ */ jsx("span", {
270
+ className: style_default.TextIdentifier,
271
+ children: decl.type.value
272
+ }),
273
+ children: /* @__PURE__ */ jsx(Docs.Badge, {
274
+ id: "csharp-constant",
275
+ children: "constant"
276
+ })
277
+ })] })
278
+ ] });
279
+ case "CSharpDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
280
+ }
281
+ }
282
+
283
+ //#endregion
284
+ export { Declaration, MethodSignature, Property, Type, TypeName, csharp_exports as t };
@@ -1,14 +1,40 @@
1
- import "../primitives-B8OnSXRP.js";
2
- import "../breadcrumbs-Dei_5sHd.js";
3
- import "../method-KkWyhvKa.js";
4
- import "../properties-BhlRtWo4.js";
5
- import "../sdk-C8C6IRQp.js";
6
- import { At as Property, Dt as DeclarationProps, Et as Declaration, Mt as Type, Nt as TypeName, Ot as MethodSignature, Pt as TypeProps, jt as PropertyProps, kt as MethodSignatureProps } from "../index-OCM-LZIo.js";
7
- import "../navigation-BZjwfN2P.js";
8
- import "../markdown-BszOPZhh.js";
9
- import "../component-generics-C9ALAcZI.js";
10
- import "../docs-x-kfjRMc.js";
11
- import "../overview-BNmMeDUE.js";
12
- import "../sdk-sidebar-lgNmf-ns.js";
13
- import "../stl-sidebar-8jF9cdnn.js";
14
- export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName, TypeProps };
1
+ import { a as GoAST } from "../index-Cl6Gny0o.js";
2
+ import { PropertyFn } from "./index.js";
3
+ import * as React$1 from "react";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
+
6
+ //#region src/languages/go.d.ts
7
+ declare namespace go_d_exports {
8
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName, TypeProps };
9
+ }
10
+ type TypeProps = {
11
+ type: GoAST.GoType;
12
+ };
13
+ declare function TypeName({
14
+ type
15
+ }: TypeProps): string | react_jsx_runtime0.JSX.Element;
16
+ declare function Type({
17
+ type
18
+ }: TypeProps): react_jsx_runtime0.JSX.Element;
19
+ type MethodSignatureProps = {
20
+ decl: GoAST.GoDeclFunction;
21
+ };
22
+ declare function MethodSignature({
23
+ decl
24
+ }: MethodSignatureProps): react_jsx_runtime0.JSX.Element;
25
+ type PropertyProps = {
26
+ decl: GoAST.GoDeclaration;
27
+ children: PropertyFn;
28
+ };
29
+ declare function Property({
30
+ decl,
31
+ children
32
+ }: PropertyProps): React$1.ReactNode;
33
+ type DeclarationProps = {
34
+ decl: GoAST.GoDeclaration;
35
+ };
36
+ declare function Declaration({
37
+ decl
38
+ }: DeclarationProps): react_jsx_runtime0.JSX.Element | undefined;
39
+ //#endregion
40
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName, TypeProps, go_d_exports as t };