@stainless-api/docs-ui 0.1.0-beta.7 → 0.1.0-beta.70
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.
- package/dist/breadcrumbs-BhYwbXkc.d.ts +25 -0
- package/dist/breadcrumbs-Cvm5Ifm7.d.ts +25 -0
- package/dist/breadcrumbs-DA4WgDhR.js +63 -0
- package/dist/chunk-BN_g-Awi.js +18 -0
- package/dist/cli-F3kMmeoJ.js +166 -0
- package/dist/component-P9sn5yyG.js +23 -0
- package/dist/component-generics-ByGsYTc8.d.ts +30 -0
- package/dist/component-generics-POFirVVb.js +45 -0
- package/dist/component-generics-zU0Pqx8m.d.ts +30 -0
- package/dist/components/MaskedInput.d.ts +14 -0
- package/dist/components/MaskedInput.js +76 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +9 -0
- package/dist/components/icons.d.ts +60 -0
- package/dist/components/icons.js +3 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +19 -0
- package/dist/components/method.d.ts +2 -0
- package/dist/components/method.js +10 -0
- package/dist/components/overview.d.ts +2 -0
- package/dist/components/overview.js +11 -0
- package/dist/components/primitives.d.ts +2 -0
- package/dist/components/primitives.js +8 -0
- package/dist/components/properties.d.ts +2 -0
- package/dist/components/properties.js +9 -0
- package/dist/components/sdk-sidebar.d.ts +2 -0
- package/dist/components/sdk-sidebar.js +10 -0
- package/dist/components/sdk.d.ts +2 -0
- package/dist/components/sdk.js +10 -0
- package/dist/components/snippets.d.ts +3 -0
- package/dist/components/snippets.js +9 -0
- package/dist/components/stl-sidebar.d.ts +2 -0
- package/dist/components/stl-sidebar.js +5 -0
- package/dist/components-w1JmIrB0.js +71 -0
- package/dist/contexts/component-generics.d.ts +2 -0
- package/dist/contexts/component-generics.js +3 -0
- package/dist/contexts/component-types.d.ts +17 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +30 -0
- package/dist/contexts/component.js +30 -0
- package/dist/contexts/docs.d.ts +2 -0
- package/dist/contexts/docs.js +3 -0
- package/dist/contexts/index.d.ts +23 -0
- package/dist/contexts/index.js +7 -0
- package/dist/contexts/markdown.d.ts +2 -0
- package/dist/contexts/markdown.js +4 -0
- package/dist/contexts/navigation.d.ts +2 -0
- package/dist/contexts/navigation.js +3 -0
- package/dist/contexts/use-components.d.ts +15 -0
- package/dist/contexts/use-components.js +4 -0
- package/dist/contexts-CVj20VV4.js +41 -0
- package/dist/csharp-D6_jlynY.js +283 -0
- package/dist/docs-BmOB2f-I.js +61 -0
- package/dist/docs-g4IPmtZr.d.ts +48 -0
- package/dist/docs-z3fl2eW-.d.ts +48 -0
- package/dist/go-COaHV3Hc.js +303 -0
- package/dist/http-fOPCX17A.js +389 -0
- package/dist/icons-BYKn5X8E.js +885 -0
- package/dist/index-B8Zys1C2.d.ts +347 -0
- package/dist/index-C5Zmb2CI.d.ts +16 -0
- package/dist/index-CwjGm9zX.d.ts +1722 -0
- package/dist/index-D7PkxNgB.d.ts +16 -0
- package/dist/index-DIaM6Ync.d.ts +347 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +32 -7542
- package/dist/java-CxGSJVvv.js +403 -0
- package/dist/languages/cli.d.ts +12 -0
- package/dist/languages/cli.js +21 -0
- package/dist/languages/csharp.d.ts +12 -0
- package/dist/languages/csharp.js +9 -0
- package/dist/languages/go.d.ts +12 -0
- package/dist/languages/go.js +9 -0
- package/dist/languages/http.d.ts +12 -0
- package/dist/languages/http.js +20 -0
- package/dist/languages/index.d.ts +12 -0
- package/dist/languages/index.js +29 -0
- package/dist/languages/java.d.ts +12 -0
- package/dist/languages/java.js +9 -0
- package/dist/languages/python.d.ts +12 -0
- package/dist/languages/python.js +9 -0
- package/dist/languages/ruby.d.ts +12 -0
- package/dist/languages/ruby.js +9 -0
- package/dist/languages/terraform.d.ts +12 -0
- package/dist/languages/terraform.js +9 -0
- package/dist/languages/typescript.d.ts +12 -0
- package/dist/languages/typescript.js +9 -0
- package/dist/languages-B6eap2M6.js +30 -0
- package/dist/markdown/index.d.ts +12 -0
- package/dist/markdown/index.js +107 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +41 -0
- package/dist/markdown/printer.d.ts +13 -0
- package/dist/markdown/printer.js +100 -0
- package/dist/markdown/utils.d.ts +21 -0
- package/dist/markdown/utils.js +31 -0
- package/dist/markdown-CTKHMLVr.js +49 -0
- package/dist/markdown-Cdh0TSHp.d.ts +22 -0
- package/dist/markdown-Cibv9fDR.d.ts +22 -0
- package/dist/method-630cPKDl.d.ts +59 -0
- package/dist/method-BPDUyBlD.js +96 -0
- package/dist/method-BzkPRXGL.d.ts +59 -0
- package/dist/navigation-BW-SBvb4.d.ts +29 -0
- package/dist/navigation-DWYqC_HX.d.ts +29 -0
- package/dist/navigation-aoYZ_tl4.js +24 -0
- package/dist/overview-Cui1XtuC.d.ts +39 -0
- package/dist/overview-DFwfIK6k.js +138 -0
- package/dist/overview-RXc9iPzz.d.ts +39 -0
- package/dist/primitives-DJEqe_r1.js +250 -0
- package/dist/primitives-DhGxFYx6.d.ts +105 -0
- package/dist/primitives-MsH-h0bU.d.ts +105 -0
- package/dist/properties-BnbBKd5a.js +132 -0
- package/dist/properties-Bynmj9_H.d.ts +54 -0
- package/dist/properties-C9W4QJ_F.d.ts +54 -0
- package/dist/python-DsTuWCKE.js +269 -0
- package/dist/routing-C64k4fmX.js +205 -0
- package/dist/routing-Cm_9XJiQ.d.ts +61 -0
- package/dist/routing-utiR5mY3.d.ts +61 -0
- package/dist/routing.d.ts +2 -0
- package/dist/routing.js +3 -180
- package/dist/ruby-BncKp6hd.js +387 -0
- package/dist/sdk-BvZeXpsj.d.ts +122 -0
- package/dist/sdk-Bw99eXxA.js +399 -0
- package/dist/sdk-GMOw94wL.d.ts +122 -0
- package/dist/sdk-sidebar-NCBSWuUW.d.ts +15 -0
- package/dist/sdk-sidebar-VNY2-O1Y.d.ts +15 -0
- package/dist/sdk-sidebar-V_MTkVw8.js +50 -0
- package/dist/snippets-BehbU3rt.js +164 -0
- package/dist/snippets-Bj7Ey56K.d.ts +53 -0
- package/dist/snippets-CQQSDvg2.d.ts +53 -0
- package/dist/spec.d.ts +65 -0
- package/dist/spec.js +167 -0
- package/dist/stl-sidebar-CXzs_shz.d.ts +58 -0
- package/dist/stl-sidebar-DSkUHwcU.d.ts +58 -0
- package/dist/stl-sidebar-WtimNrk1.js +106 -0
- package/dist/style-HpXpcJ9v.js +172 -0
- package/dist/style.d.ts +171 -0
- package/dist/style.js +3 -0
- package/dist/styles/main.css +744 -754
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +327 -458
- package/dist/styles/primitives.js +0 -0
- package/dist/styles/resets.css +32 -41
- package/dist/styles/resets.js +0 -0
- package/dist/styles/search.css +192 -270
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +170 -69
- package/dist/styles/sidebar.js +0 -0
- package/dist/styles/variables.css +26 -89
- package/dist/styles/variables.js +0 -0
- package/dist/styles.css +3273 -0
- package/dist/styles.mjs +1 -0
- package/dist/terraform-B95X4rNK.js +243 -0
- package/dist/typescript-n46M9OtL.js +449 -0
- package/dist/use-components-BUz3GbO4.js +7 -0
- package/dist/utils-DPbkW1Tz.js +54 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +3 -0
- package/package.json +74 -22
- package/dist/mcp.js +0 -16003
- package/dist/styles/snippets.css +0 -132
- package/src/components/breadcrumbs.tsx +0 -94
- package/src/components/chat.tsx +0 -154
- package/src/components/dropdown.tsx +0 -91
- package/src/components/icons.tsx +0 -584
- package/src/components/index.ts +0 -9
- package/src/components/method.tsx +0 -144
- package/src/components/overview.tsx +0 -159
- package/src/components/primitives.tsx +0 -284
- package/src/components/properties.tsx +0 -130
- package/src/components/scripts/dropdown.ts +0 -78
- package/src/components/sdk.tsx +0 -402
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -179
- package/src/contexts/component-generics.tsx +0 -48
- package/src/contexts/component-types.tsx +0 -5
- package/src/contexts/component.tsx +0 -32
- package/src/contexts/docs.tsx +0 -75
- package/src/contexts/index.tsx +0 -17
- package/src/contexts/markdown.tsx +0 -43
- package/src/contexts/navigation.tsx +0 -44
- package/src/contexts/search.tsx +0 -28
- package/src/contexts/use-components.tsx +0 -4
- package/src/index.ts +0 -6
- package/src/languages/go.tsx +0 -281
- package/src/languages/http.tsx +0 -321
- package/src/languages/index.ts +0 -26
- package/src/languages/java.tsx +0 -358
- package/src/languages/python.tsx +0 -255
- package/src/languages/ruby.tsx +0 -320
- package/src/languages/typescript.tsx +0 -393
- package/src/markdown/index.ts +0 -107
- package/src/markdown/md.ts +0 -45
- package/src/markdown/utils.ts +0 -49
- package/src/routing.ts +0 -238
- package/src/search/form.tsx +0 -127
- package/src/search/index.tsx +0 -1
- package/src/search/indexer.ts +0 -246
- package/src/search/mcp.ts +0 -61
- package/src/search/printer.tsx +0 -86
- package/src/search/providers/algolia.ts +0 -88
- package/src/search/providers/fuse.ts +0 -19
- package/src/search/providers/pagefind.ts +0 -17
- package/src/search/providers/walker.ts +0 -30
- package/src/search/results.tsx +0 -181
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -197
- package/src/styles/main.css +0 -993
- package/src/styles/primitives.css +0 -572
- package/src/styles/resets.css +0 -47
- package/src/styles/search.css +0 -342
- package/src/styles/sidebar.css +0 -87
- package/src/styles/snippets.css +0 -132
- package/src/styles/variables.css +0 -90
- package/src/utils.ts +0 -41
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-BN_g-Awi.js";
|
|
2
|
+
import { n as useLanguageComponents } from "./contexts-CVj20VV4.js";
|
|
3
|
+
import { t as useComponents } from "./use-components-BUz3GbO4.js";
|
|
4
|
+
import { t as style_default } from "./style-HpXpcJ9v.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/languages/csharp.tsx
|
|
9
|
+
var csharp_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 TypeName({ type, optional }) {
|
|
22
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(useLanguageComponents().Type, { type }), optional && /* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: style_default.TextOperator,
|
|
24
|
+
children: "? "
|
|
25
|
+
})] });
|
|
26
|
+
}
|
|
27
|
+
function Type({ type }) {
|
|
28
|
+
const Lang = useLanguageComponents();
|
|
29
|
+
const { Join, SDKReference } = useComponents();
|
|
30
|
+
switch (type.kind) {
|
|
31
|
+
case "CSharpTypeReference": {
|
|
32
|
+
const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
|
|
33
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
34
|
+
className: style_default.Type,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx(SDKReference, {
|
|
37
|
+
stainlessPath: type.$ref,
|
|
38
|
+
children: type.typeName
|
|
39
|
+
}),
|
|
40
|
+
params && params.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
41
|
+
/* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: style_default.TypeBracket,
|
|
43
|
+
children: "<"
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx(Join, {
|
|
46
|
+
items: params,
|
|
47
|
+
limit: 3,
|
|
48
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: style_default.TextOperator,
|
|
50
|
+
children: ", "
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ jsx("span", {
|
|
54
|
+
className: style_default.TypeBracket,
|
|
55
|
+
children: ">"
|
|
56
|
+
})
|
|
57
|
+
] }) : null,
|
|
58
|
+
type.nullable && /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: style_default.TextOperator,
|
|
60
|
+
children: "?"
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
case "CSharpTypeClass":
|
|
66
|
+
case "CSharpTypeUnion": return /* @__PURE__ */ jsx("span", {
|
|
67
|
+
className: style_default.Type,
|
|
68
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: style_default.TypeKeyword,
|
|
70
|
+
children: "class"
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
case "CSharpTypeEnum":
|
|
74
|
+
case "CSharpTypeBoolean":
|
|
75
|
+
case "CSharpTypeFloat":
|
|
76
|
+
case "CSharpTypeDouble":
|
|
77
|
+
case "CSharpTypeInt":
|
|
78
|
+
case "CSharpTypeLong": return /* @__PURE__ */ jsx("span", {
|
|
79
|
+
className: style_default.Type,
|
|
80
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
81
|
+
className: style_default.TypeKeyword,
|
|
82
|
+
children: type.kind.slice(10)
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
case "CSharpTypeString": return /* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: style_default.Type,
|
|
87
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
88
|
+
className: style_default.TypeString,
|
|
89
|
+
children: "string"
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
case "CSharpTypeConstant": return /* @__PURE__ */ jsx("span", {
|
|
93
|
+
className: style_default.Type,
|
|
94
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
95
|
+
className: style_default.TypeKeyword,
|
|
96
|
+
children: "JsonElement"
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function MethodSignature({ decl }) {
|
|
102
|
+
const Lang = useLanguageComponents();
|
|
103
|
+
const { Join, Tooltip } = useComponents();
|
|
104
|
+
const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsxs(Tooltip, {
|
|
105
|
+
content: /* @__PURE__ */ jsx(Lang.Type, { type: param.typeAnnotation }),
|
|
106
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
107
|
+
className: style_default.TextIdentifier,
|
|
108
|
+
children: param.ident
|
|
109
|
+
}), param.hasDefault && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
110
|
+
" ",
|
|
111
|
+
/* @__PURE__ */ jsx("span", {
|
|
112
|
+
className: style_default.TextOperator,
|
|
113
|
+
children: "="
|
|
114
|
+
}),
|
|
115
|
+
" ",
|
|
116
|
+
/* @__PURE__ */ jsx("span", {
|
|
117
|
+
className: style_default.TextKeyword,
|
|
118
|
+
children: "default"
|
|
119
|
+
})
|
|
120
|
+
] })]
|
|
121
|
+
}) }, i));
|
|
122
|
+
return /* @__PURE__ */ jsx("div", {
|
|
123
|
+
className: style_default.MethodSignature,
|
|
124
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
125
|
+
className: style_default.SignatureTitle,
|
|
126
|
+
children: [
|
|
127
|
+
decl.returnType && /* @__PURE__ */ jsxs("span", {
|
|
128
|
+
className: style_default.SignatureReturns,
|
|
129
|
+
children: [/* @__PURE__ */ jsx(Lang.Type, { type: decl.returnType }), " "]
|
|
130
|
+
}),
|
|
131
|
+
decl.qualified && /* @__PURE__ */ jsx("span", {
|
|
132
|
+
className: style_default.SignatureQualified,
|
|
133
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
134
|
+
className: style_default.TextIdentifier,
|
|
135
|
+
children: decl.qualified?.slice(0, -decl.ident.length)
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsx("span", {
|
|
139
|
+
className: style_default.SignatureName,
|
|
140
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
141
|
+
className: style_default.TextIdentifier,
|
|
142
|
+
children: decl.ident
|
|
143
|
+
})
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ jsxs("span", {
|
|
146
|
+
className: style_default.MethodSignature,
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ jsx("span", {
|
|
149
|
+
className: style_default.SignatureParen,
|
|
150
|
+
children: "("
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ jsx("span", {
|
|
153
|
+
className: style_default.SignatureParams,
|
|
154
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
155
|
+
items: params,
|
|
156
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
157
|
+
className: style_default.TextOperator,
|
|
158
|
+
children: ", "
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsxs("span", {
|
|
163
|
+
className: style_default.SignatureParen,
|
|
164
|
+
children: [")", " "]
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
})
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function Property({ decl, children }) {
|
|
173
|
+
const Lang = useLanguageComponents();
|
|
174
|
+
if (!decl) return null;
|
|
175
|
+
switch (decl.kind) {
|
|
176
|
+
case "CSharpDeclProperty": {
|
|
177
|
+
const type = /* @__PURE__ */ jsx(Lang.Type, {
|
|
178
|
+
type: decl.type,
|
|
179
|
+
optional: decl.optional
|
|
180
|
+
});
|
|
181
|
+
return children({
|
|
182
|
+
name: decl.ident,
|
|
183
|
+
typeName: /* @__PURE__ */ jsx(Lang.TypeName, {
|
|
184
|
+
type: decl.type,
|
|
185
|
+
optional: decl.optional
|
|
186
|
+
}),
|
|
187
|
+
type
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
case "CSharpDeclConst": return children({
|
|
191
|
+
name: decl.ident,
|
|
192
|
+
typeName: "constant",
|
|
193
|
+
type: /* @__PURE__ */ jsx("span", {
|
|
194
|
+
className: constStyle[typeof decl.value],
|
|
195
|
+
children: JSON.stringify(decl.value)
|
|
196
|
+
})
|
|
197
|
+
});
|
|
198
|
+
case "CSharpDeclType": {
|
|
199
|
+
const typeName = decl.type.kind === "CSharpTypeUnion" ? "union" : decl.type.kind === "CSharpTypeEnum" ? "enum" : "class";
|
|
200
|
+
return children({
|
|
201
|
+
name: decl.ident,
|
|
202
|
+
typeName
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
case "CSharpDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function Declaration({ decl }) {
|
|
209
|
+
const Docs = useComponents();
|
|
210
|
+
const Lang = useLanguageComponents();
|
|
211
|
+
if (!decl) return null;
|
|
212
|
+
switch (decl.kind) {
|
|
213
|
+
case "CSharpDeclConst": return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Docs.Tooltip, {
|
|
214
|
+
content: JSON.stringify(decl.value),
|
|
215
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
216
|
+
className: style_default.TextIdentifier,
|
|
217
|
+
children: decl.ident
|
|
218
|
+
})
|
|
219
|
+
}) });
|
|
220
|
+
case "CSharpDeclType": {
|
|
221
|
+
const keyword = decl.type.kind === "CSharpTypeEnum" ? "enum" : "class";
|
|
222
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
223
|
+
/* @__PURE__ */ jsx("span", {
|
|
224
|
+
className: style_default.TextKeyword,
|
|
225
|
+
children: keyword
|
|
226
|
+
}),
|
|
227
|
+
" ",
|
|
228
|
+
/* @__PURE__ */ jsx("span", {
|
|
229
|
+
className: style_default.TextIdentifier,
|
|
230
|
+
children: decl.ident
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ jsx("span", {
|
|
233
|
+
className: style_default.TextPunctuation,
|
|
234
|
+
children: ":"
|
|
235
|
+
}),
|
|
236
|
+
decl.type.kind === "CSharpTypeUnion" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
237
|
+
" ",
|
|
238
|
+
/* @__PURE__ */ jsx(Docs.Tooltip, {
|
|
239
|
+
content: "A class that can be one of several variants.",
|
|
240
|
+
children: /* @__PURE__ */ jsx(Docs.Badge, {
|
|
241
|
+
id: "csharp-union",
|
|
242
|
+
children: "union"
|
|
243
|
+
})
|
|
244
|
+
}),
|
|
245
|
+
" "
|
|
246
|
+
] })
|
|
247
|
+
] });
|
|
248
|
+
}
|
|
249
|
+
case "CSharpDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
250
|
+
decl.optional === false && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
251
|
+
className: style_default.TextKeyword,
|
|
252
|
+
children: "required"
|
|
253
|
+
}), " "] }),
|
|
254
|
+
/* @__PURE__ */ jsx(Lang.Type, {
|
|
255
|
+
type: decl.type,
|
|
256
|
+
optional: decl.optional
|
|
257
|
+
}),
|
|
258
|
+
decl.nullable && !("nullable" in decl.type && decl.type.nullable) && /* @__PURE__ */ jsx("span", {
|
|
259
|
+
className: style_default.TextOperator,
|
|
260
|
+
children: "?"
|
|
261
|
+
}),
|
|
262
|
+
" ",
|
|
263
|
+
/* @__PURE__ */ jsx("span", {
|
|
264
|
+
className: style_default.TextIdentifier,
|
|
265
|
+
children: decl.ident
|
|
266
|
+
}),
|
|
267
|
+
decl.type.kind === "CSharpTypeConstant" && /* @__PURE__ */ jsxs(Fragment$1, { children: [" ", /* @__PURE__ */ jsx(Docs.Tooltip, {
|
|
268
|
+
content: /* @__PURE__ */ jsx("span", {
|
|
269
|
+
className: style_default.TextIdentifier,
|
|
270
|
+
children: decl.type.value
|
|
271
|
+
}),
|
|
272
|
+
children: /* @__PURE__ */ jsx(Docs.Badge, {
|
|
273
|
+
id: "csharp-constant",
|
|
274
|
+
children: "constant"
|
|
275
|
+
})
|
|
276
|
+
})] })
|
|
277
|
+
] });
|
|
278
|
+
case "CSharpDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
//#endregion
|
|
283
|
+
export { TypeName as a, Type as i, MethodSignature as n, csharp_exports as o, Property as r, Declaration as t };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/contexts/docs.tsx
|
|
5
|
+
const DocsContextDefaults = {
|
|
6
|
+
settings: {},
|
|
7
|
+
language: "node",
|
|
8
|
+
spec: null
|
|
9
|
+
};
|
|
10
|
+
const DocsContext = React$1.createContext(DocsContextDefaults);
|
|
11
|
+
function useDocs() {
|
|
12
|
+
return React$1.useContext(DocsContext);
|
|
13
|
+
}
|
|
14
|
+
function useSpec() {
|
|
15
|
+
return useDocs().spec;
|
|
16
|
+
}
|
|
17
|
+
function useSettings() {
|
|
18
|
+
return useDocs().settings;
|
|
19
|
+
}
|
|
20
|
+
function useSnippet(stainlessPath, language, variant) {
|
|
21
|
+
const defaultLanguage = useLanguage();
|
|
22
|
+
const snippetLanguage = [language ?? defaultLanguage, variant ?? "default"].join(".");
|
|
23
|
+
return useSpec()?.snippets?.[snippetLanguage]?.[stainlessPath];
|
|
24
|
+
}
|
|
25
|
+
function useDeclaration(stainlessPath, required, language) {
|
|
26
|
+
const defaultLanguage = useLanguage();
|
|
27
|
+
const decl = useSpec()?.decls?.[language ?? defaultLanguage]?.[stainlessPath];
|
|
28
|
+
if (required && !decl) throw new Error(`Declaration not found for '${stainlessPath}'`);
|
|
29
|
+
return decl;
|
|
30
|
+
}
|
|
31
|
+
function useAvailableLanguages(stainlessPath) {
|
|
32
|
+
const spec = useSpec();
|
|
33
|
+
return Object.keys(spec?.decls ?? {}).filter((lang) => spec?.decls?.[lang]?.[stainlessPath] !== void 0);
|
|
34
|
+
}
|
|
35
|
+
function useIgnoredResources() {
|
|
36
|
+
return ["(resource) webhooks > (model) unwrap_webhook_event > (schema)"];
|
|
37
|
+
}
|
|
38
|
+
function useResource(name) {
|
|
39
|
+
return useSpec()?.resources?.[name];
|
|
40
|
+
}
|
|
41
|
+
function useLanguage() {
|
|
42
|
+
return useDocs().language;
|
|
43
|
+
}
|
|
44
|
+
function useContentPanelLayout() {
|
|
45
|
+
return useDocs().settings?.contentPanelLayout ?? "double-pane";
|
|
46
|
+
}
|
|
47
|
+
function DocsProvider({ spec, language, settings, children }) {
|
|
48
|
+
const value = {
|
|
49
|
+
...DocsContextDefaults,
|
|
50
|
+
spec,
|
|
51
|
+
settings: settings ?? DocsContextDefaults.settings,
|
|
52
|
+
language: language ?? DocsContextDefaults.language
|
|
53
|
+
};
|
|
54
|
+
return /* @__PURE__ */ jsx(DocsContext.Provider, {
|
|
55
|
+
value,
|
|
56
|
+
children
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { useDocs as a, useResource as c, useSpec as d, useDeclaration as i, useSettings as l, useAvailableLanguages as n, useIgnoredResources as o, useContentPanelLayout as r, useLanguage as s, DocsProvider as t, useSnippet as u };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { _ as Spec, m as Resource, u as LanguageDeclNodes, v as SpecLanguage } from "./index-CwjGm9zX.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime46 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/contexts/docs.d.ts
|
|
6
|
+
type ContentPanelLayout = 'double-pane' | 'single-pane';
|
|
7
|
+
type PropertySettingsType = {
|
|
8
|
+
types?: 'simple' | 'rich';
|
|
9
|
+
includeModelProperties?: boolean | 'method-page';
|
|
10
|
+
collapseDescription?: boolean;
|
|
11
|
+
showTitle?: boolean;
|
|
12
|
+
expandDepth?: number;
|
|
13
|
+
};
|
|
14
|
+
type DocsContextType = {
|
|
15
|
+
language: SpecLanguage;
|
|
16
|
+
spec: Spec | null;
|
|
17
|
+
settings?: {
|
|
18
|
+
properties?: PropertySettingsType;
|
|
19
|
+
contentPanelLayout?: ContentPanelLayout;
|
|
20
|
+
virtualExpanders?: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
declare function useDocs(): DocsContextType;
|
|
24
|
+
declare function useSpec(): Spec | null;
|
|
25
|
+
declare function useSettings(): {
|
|
26
|
+
properties?: PropertySettingsType;
|
|
27
|
+
contentPanelLayout?: ContentPanelLayout;
|
|
28
|
+
virtualExpanders?: boolean;
|
|
29
|
+
} | undefined;
|
|
30
|
+
declare function useSnippet(stainlessPath: string, language?: SpecLanguage, variant?: string): string | undefined;
|
|
31
|
+
type Declaration = LanguageDeclNodes[SpecLanguage];
|
|
32
|
+
declare function useDeclaration<Required extends boolean>(stainlessPath: string, required: Required, language?: SpecLanguage): (Required extends true ? never : undefined) | Declaration;
|
|
33
|
+
declare function useAvailableLanguages(stainlessPath: string): SpecLanguage[];
|
|
34
|
+
declare function useIgnoredResources(): string[];
|
|
35
|
+
declare function useResource(name: string): Resource | undefined;
|
|
36
|
+
declare function useLanguage(): "http" | "node" | "python" | "go" | "typescript" | "terraform" | "ruby" | "java" | "kotlin" | "csharp" | "php" | "cli";
|
|
37
|
+
declare function useContentPanelLayout(): ContentPanelLayout;
|
|
38
|
+
type DocsProviderProps = DocsContextType & {
|
|
39
|
+
children: React$1.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
declare function DocsProvider({
|
|
42
|
+
spec,
|
|
43
|
+
language,
|
|
44
|
+
settings,
|
|
45
|
+
children
|
|
46
|
+
}: DocsProviderProps): react_jsx_runtime46.JSX.Element;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { DocsProviderProps as a, useContentPanelLayout as c, useIgnoredResources as d, useLanguage as f, useSpec as g, useSnippet as h, DocsProvider as i, useDeclaration as l, useSettings as m, Declaration as n, PropertySettingsType as o, useResource as p, DocsContextType as r, useAvailableLanguages as s, ContentPanelLayout as t, useDocs as u };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { _ as Spec, m as Resource, u as LanguageDeclNodes, v as SpecLanguage } from "./index-CwjGm9zX.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime76 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/contexts/docs.d.ts
|
|
6
|
+
type ContentPanelLayout = 'double-pane' | 'single-pane';
|
|
7
|
+
type PropertySettingsType = {
|
|
8
|
+
types?: 'simple' | 'rich';
|
|
9
|
+
includeModelProperties?: boolean | 'method-page';
|
|
10
|
+
collapseDescription?: boolean;
|
|
11
|
+
showTitle?: boolean;
|
|
12
|
+
expandDepth?: number;
|
|
13
|
+
};
|
|
14
|
+
type DocsContextType = {
|
|
15
|
+
language: SpecLanguage;
|
|
16
|
+
spec: Spec | null;
|
|
17
|
+
settings?: {
|
|
18
|
+
properties?: PropertySettingsType;
|
|
19
|
+
contentPanelLayout?: ContentPanelLayout;
|
|
20
|
+
virtualExpanders?: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
declare function useDocs(): DocsContextType;
|
|
24
|
+
declare function useSpec(): Spec | null;
|
|
25
|
+
declare function useSettings(): {
|
|
26
|
+
properties?: PropertySettingsType;
|
|
27
|
+
contentPanelLayout?: ContentPanelLayout;
|
|
28
|
+
virtualExpanders?: boolean;
|
|
29
|
+
} | undefined;
|
|
30
|
+
declare function useSnippet(stainlessPath: string, language?: SpecLanguage, variant?: string): string | undefined;
|
|
31
|
+
type Declaration = LanguageDeclNodes[SpecLanguage];
|
|
32
|
+
declare function useDeclaration<Required extends boolean>(stainlessPath: string, required: Required, language?: SpecLanguage): (Required extends true ? never : undefined) | Declaration;
|
|
33
|
+
declare function useAvailableLanguages(stainlessPath: string): SpecLanguage[];
|
|
34
|
+
declare function useIgnoredResources(): string[];
|
|
35
|
+
declare function useResource(name: string): Resource | undefined;
|
|
36
|
+
declare function useLanguage(): "cli" | "csharp" | "go" | "http" | "java" | "kotlin" | "node" | "php" | "python" | "ruby" | "terraform" | "typescript";
|
|
37
|
+
declare function useContentPanelLayout(): ContentPanelLayout;
|
|
38
|
+
type DocsProviderProps = DocsContextType & {
|
|
39
|
+
children: React$1.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
declare function DocsProvider({
|
|
42
|
+
spec,
|
|
43
|
+
language,
|
|
44
|
+
settings,
|
|
45
|
+
children
|
|
46
|
+
}: DocsProviderProps): react_jsx_runtime76.JSX.Element;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { DocsProviderProps as a, useContentPanelLayout as c, useIgnoredResources as d, useLanguage as f, useSpec as g, useSnippet as h, DocsProvider as i, useDeclaration as l, useSettings as m, Declaration as n, PropertySettingsType as o, useResource as p, DocsContextType as r, useAvailableLanguages as s, ContentPanelLayout as t, useDocs as u };
|