@stainless-api/docs-ui 0.1.0-beta.5 → 0.1.0-beta.51
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-BdYnaHA8.d.ts +20 -0
- package/dist/breadcrumbs-CA7GmW_8.d.ts +20 -0
- package/dist/breadcrumbs-nSFZO5Gf.js +63 -0
- package/dist/chunk-DRcLgZ1e.js +18 -0
- package/dist/component-DRO8kQSp.js +23 -0
- package/dist/component-generics-B6Fn47Mz.js +45 -0
- package/dist/component-generics-BHFUK06s.d.ts +30 -0
- package/dist/component-generics-BJSyydZ-.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 +55 -0
- package/dist/components/icons.js +3 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +18 -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.d.ts +2 -0
- package/dist/components/sdk.js +10 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +11 -0
- package/dist/components/snippets.d.ts +3 -0
- package/dist/components/snippets.js +9 -0
- package/dist/components-D7M-BwNI.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 +16 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +29 -0
- package/dist/contexts/component.js +27 -0
- package/dist/contexts/docs.d.ts +2 -0
- package/dist/contexts/docs.js +3 -0
- package/dist/contexts/index.d.ts +16 -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 +14 -0
- package/dist/contexts/use-components.js +4 -0
- package/dist/contexts-p3rRZDlM.js +39 -0
- package/dist/csharp-CDSxfCZE.js +283 -0
- package/dist/docs-BUS__I1m.d.ts +47 -0
- package/dist/docs-CXqi26jB.js +54 -0
- package/dist/docs-fKyo35eI.d.ts +47 -0
- package/dist/go-1c3S5ETL.js +303 -0
- package/dist/http-2QNWXH9t.js +330 -0
- package/dist/icons-Ckod9aod.js +869 -0
- package/dist/index-5Yl-BBg3.d.ts +15 -0
- package/dist/index-9LRO8R1a.d.ts +274 -0
- package/dist/index-CBIJwoyp.d.ts +13 -0
- package/dist/index-ClCZKGcw.d.ts +274 -0
- package/dist/index-pMKpm2Jk.d.ts +13 -0
- package/dist/index-q3bZhNWj.d.ts +15 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +29 -7542
- package/dist/java-BbjF_oUI.js +403 -0
- package/dist/languages/csharp.d.ts +11 -0
- package/dist/languages/csharp.js +9 -0
- package/dist/languages/go.d.ts +11 -0
- package/dist/languages/go.js +9 -0
- package/dist/languages/http.d.ts +11 -0
- package/dist/languages/http.js +19 -0
- package/dist/languages/index.d.ts +11 -0
- package/dist/languages/index.js +26 -0
- package/dist/languages/java.d.ts +11 -0
- package/dist/languages/java.js +9 -0
- package/dist/languages/python.d.ts +11 -0
- package/dist/languages/python.js +9 -0
- package/dist/languages/ruby.d.ts +11 -0
- package/dist/languages/ruby.js +9 -0
- package/dist/languages/typescript.d.ts +11 -0
- package/dist/languages/typescript.js +9 -0
- package/dist/languages-BCYZjzuS.js +26 -0
- package/dist/markdown/index.d.ts +12 -0
- package/dist/markdown/index.js +104 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +3 -0
- package/dist/markdown/printer.d.ts +2 -0
- package/dist/markdown/printer.js +28 -0
- package/dist/markdown/utils.d.ts +3 -0
- package/dist/markdown/utils.js +3 -0
- package/dist/markdown-C8o8WrwG.d.ts +22 -0
- package/dist/markdown-CqJohZei.d.ts +22 -0
- package/dist/markdown-CxdeWgjV.js +48 -0
- package/dist/md-oM2tUaCA.js +41 -0
- package/dist/method-CE08mUME.js +115 -0
- package/dist/method-CMt6uyix.d.ts +71 -0
- package/dist/method-r5UAB40b.d.ts +71 -0
- package/dist/navigation-9_4wRkcT.d.ts +29 -0
- package/dist/navigation-C5TN0SgC.js +24 -0
- package/dist/navigation-zuoWsXzh.d.ts +29 -0
- package/dist/overview-DXmLmmr7.d.ts +39 -0
- package/dist/overview-S2hUqPXA.js +139 -0
- package/dist/overview-ixhAhHj8.d.ts +39 -0
- package/dist/primitives-BIWfwN5L.js +258 -0
- package/dist/primitives-BVXfSSiS.d.ts +97 -0
- package/dist/primitives-Bl0wzAGo.d.ts +97 -0
- package/dist/printer-DBw4S_Jn.d.ts +13 -0
- package/dist/printer-bNxiG6UB.js +74 -0
- package/dist/properties-C-NU_ghj.d.ts +54 -0
- package/dist/properties-GT9ixNTg.d.ts +54 -0
- package/dist/properties-jlGW3USi.js +131 -0
- package/dist/python-USOwFDv_.js +279 -0
- package/dist/routing-CMqh1cTZ.d.ts +54 -0
- package/dist/routing-Wbb7YECB.js +194 -0
- package/dist/routing.d.ts +2 -0
- package/dist/routing.js +3 -180
- package/dist/ruby-CSvGbSLe.js +387 -0
- package/dist/sdk-B5W3VipN.d.ts +118 -0
- package/dist/sdk-CS6A3HW3.d.ts +118 -0
- package/dist/sdk-CSCbbn3O.js +336 -0
- package/dist/sidebar-C3fZrgmP.d.ts +36 -0
- package/dist/sidebar-CWyvCrJ0.js +81 -0
- package/dist/sidebar-CbCLUteD.d.ts +36 -0
- package/dist/snippets-BQLXEIf6.js +161 -0
- package/dist/snippets-C72s2IwS.d.ts +51 -0
- package/dist/snippets-DcFph7ir.d.ts +51 -0
- package/dist/spec.d.ts +65 -0
- package/dist/spec.js +167 -0
- package/dist/style-D7RO5ymE.d.ts +168 -0
- package/dist/style-gnVEeXFj.js +169 -0
- package/dist/style.d.ts +2 -0
- package/dist/style.js +3 -0
- package/dist/styles/main.css +727 -754
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +317 -461
- 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 +175 -274
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +59 -60
- 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 +2910 -0
- package/dist/styles.mjs +1 -0
- package/dist/typescript-DXG9psK3.js +449 -0
- package/dist/use-components-RWQbviGq.js +7 -0
- package/dist/utils-CqnL9Fc3.js +31 -0
- package/dist/utils-DGnJ6mcU.d.ts +21 -0
- package/dist/utils-D_1AWSRX.js +32 -0
- package/dist/utils-d8paVwKN.d.ts +14 -0
- package/dist/utils-uQbtk0-_.d.ts +21 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +3 -0
- package/package.json +73 -21
- 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 -573
- 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,387 @@
|
|
|
1
|
+
import { t as __export } from "./chunk-DRcLgZ1e.js";
|
|
2
|
+
import { a as useLanguage, l as useSpec, r as useDeclaration } from "./docs-CXqi26jB.js";
|
|
3
|
+
import { n as useLanguageComponents } from "./contexts-p3rRZDlM.js";
|
|
4
|
+
import { t as useComponents } from "./use-components-RWQbviGq.js";
|
|
5
|
+
import { t as style_default } from "./style-gnVEeXFj.js";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/languages/ruby.tsx
|
|
10
|
+
var ruby_exports = /* @__PURE__ */ __export({
|
|
11
|
+
Declaration: () => Declaration,
|
|
12
|
+
MethodSignature: () => MethodSignature,
|
|
13
|
+
Property: () => Property,
|
|
14
|
+
Type: () => Type,
|
|
15
|
+
TypeName: () => TypeName
|
|
16
|
+
});
|
|
17
|
+
const ComplexTypes = {
|
|
18
|
+
RubyTypeObject: "object",
|
|
19
|
+
RubyTypeUnion: "union",
|
|
20
|
+
RubyTypeIntersection: "intersection",
|
|
21
|
+
RubyTypeArray: "array",
|
|
22
|
+
RubyTypeMap: "hash"
|
|
23
|
+
};
|
|
24
|
+
const Keywords = {
|
|
25
|
+
RubyTypeBinary: "StringIO",
|
|
26
|
+
RubyTypeUnknown: "untyped",
|
|
27
|
+
RubyTypeNull: "nil",
|
|
28
|
+
RubyTypeInteger: "Integer",
|
|
29
|
+
RubyTypeFloat: "Float",
|
|
30
|
+
RubyTypeBoolean: "bool"
|
|
31
|
+
};
|
|
32
|
+
function TypeName({ type }) {
|
|
33
|
+
const Lang = useLanguageComponents();
|
|
34
|
+
return ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
|
|
35
|
+
}
|
|
36
|
+
const VALID_IDENTIFIER = /^[_A-Za-z][_A-Za-z0-9]*$/;
|
|
37
|
+
function TypePreview({ path }) {
|
|
38
|
+
const spec = useSpec();
|
|
39
|
+
const language = useLanguage();
|
|
40
|
+
const decl = useDeclaration(path, false);
|
|
41
|
+
const { Join } = useComponents();
|
|
42
|
+
if (!(decl && "children" in decl && decl.children && decl.children.length > 0) || "type" in decl && decl["type"] && "kind" in decl["type"] && decl["type"]?.["kind"] === "RubyTypeUnion") return;
|
|
43
|
+
const items = decl.children.map((prop, key) => {
|
|
44
|
+
const p = spec?.decls?.[language]?.[prop];
|
|
45
|
+
return /* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: style_default.TypePropertyName,
|
|
47
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: style_default.TextIdentifier,
|
|
49
|
+
children: p && "ident" in p ? p["ident"] : null
|
|
50
|
+
})
|
|
51
|
+
}, key);
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
54
|
+
className: style_default.TypePreview,
|
|
55
|
+
"data-stldocs-type-preview": "properties",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: style_default.TypeBrace,
|
|
59
|
+
children: " {"
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ jsxs("span", {
|
|
62
|
+
className: style_default.TypePreviewContent,
|
|
63
|
+
children: [
|
|
64
|
+
" ",
|
|
65
|
+
/* @__PURE__ */ jsx(Join, {
|
|
66
|
+
items,
|
|
67
|
+
limit: 3,
|
|
68
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: style_default.TextOperator,
|
|
70
|
+
children: ", "
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
" "
|
|
74
|
+
]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx("span", {
|
|
77
|
+
className: style_default.TypeBrace,
|
|
78
|
+
children: "} "
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function Type({ type }) {
|
|
84
|
+
const Lang = useLanguageComponents();
|
|
85
|
+
const { SDKReference, Join } = useComponents();
|
|
86
|
+
switch (type.kind) {
|
|
87
|
+
case "RubyTypeBinary":
|
|
88
|
+
case "RubyTypeUnknown":
|
|
89
|
+
case "RubyTypeNull":
|
|
90
|
+
case "RubyTypeInteger":
|
|
91
|
+
case "RubyTypeFloat":
|
|
92
|
+
case "RubyTypeBoolean": return /* @__PURE__ */ jsx("span", {
|
|
93
|
+
className: style_default.Type,
|
|
94
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
95
|
+
className: style_default.TypeKeyword,
|
|
96
|
+
children: Keywords[type.kind]
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
case "RubyTypeString": return /* @__PURE__ */ jsx("span", {
|
|
100
|
+
className: style_default.Type,
|
|
101
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
102
|
+
className: style_default.TypeString,
|
|
103
|
+
children: "String"
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
case "RubyTypeLiteral":
|
|
107
|
+
switch (typeof type.literal) {
|
|
108
|
+
case "string": return /* @__PURE__ */ jsx("span", {
|
|
109
|
+
className: style_default.Type,
|
|
110
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
111
|
+
className: style_default.LiteralString,
|
|
112
|
+
children: [":", type.literal.match(VALID_IDENTIFIER) ? type.literal : JSON.stringify(type.literal)]
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
case "number": return /* @__PURE__ */ jsx("span", {
|
|
116
|
+
className: style_default.Type,
|
|
117
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
118
|
+
className: style_default.LiteralNumeric,
|
|
119
|
+
children: JSON.stringify(type.literal)
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
case "boolean": return /* @__PURE__ */ jsx("span", {
|
|
123
|
+
className: style_default.Type,
|
|
124
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
125
|
+
className: style_default.LiteralBoolean,
|
|
126
|
+
children: JSON.stringify(type.literal)
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
case "RubyTypeArray": return /* @__PURE__ */ jsxs("span", {
|
|
132
|
+
className: style_default.Type,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx("span", {
|
|
135
|
+
className: style_default.TypeArray,
|
|
136
|
+
children: "Array["
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
|
|
139
|
+
/* @__PURE__ */ jsx("span", {
|
|
140
|
+
className: style_default.TypeArray,
|
|
141
|
+
children: "]"
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
case "RubyTypeMap": return /* @__PURE__ */ jsxs("span", {
|
|
146
|
+
className: style_default.Type,
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ jsx("span", {
|
|
149
|
+
className: style_default.TypeArray,
|
|
150
|
+
children: "Hash["
|
|
151
|
+
}),
|
|
152
|
+
type.indexType.kind === "RubyTypeString" ? /* @__PURE__ */ jsx("span", {
|
|
153
|
+
className: style_default.TypeString,
|
|
154
|
+
children: "Symbol"
|
|
155
|
+
}) : /* @__PURE__ */ jsx(Lang.Type, { type: type.indexType }),
|
|
156
|
+
", ",
|
|
157
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: type.itemType }),
|
|
158
|
+
/* @__PURE__ */ jsx("span", {
|
|
159
|
+
className: style_default.TypeArray,
|
|
160
|
+
children: "]"
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
});
|
|
164
|
+
case "RubyTypeReference": {
|
|
165
|
+
const name = type.ident.split(".").at(-1);
|
|
166
|
+
if (!type.typeParameters || type.typeParameters.length === 0) return /* @__PURE__ */ jsxs("span", {
|
|
167
|
+
className: style_default.Type,
|
|
168
|
+
children: [/* @__PURE__ */ jsx(SDKReference, {
|
|
169
|
+
stainlessPath: type.$ref,
|
|
170
|
+
children: name
|
|
171
|
+
}), /* @__PURE__ */ jsx(TypePreview, { path: type.$ref })]
|
|
172
|
+
});
|
|
173
|
+
const typeParameters = type.typeParameters.map((t, i) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, i));
|
|
174
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
175
|
+
className: style_default.Type,
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsx(SDKReference, {
|
|
178
|
+
stainlessPath: type.$ref,
|
|
179
|
+
children: name
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ jsx("span", {
|
|
182
|
+
className: style_default.TypeBracket,
|
|
183
|
+
children: "<"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx(Join, {
|
|
186
|
+
items: typeParameters,
|
|
187
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
188
|
+
className: style_default.TextOperator,
|
|
189
|
+
children: ", "
|
|
190
|
+
})
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ jsx("span", {
|
|
193
|
+
className: style_default.TypeBracket,
|
|
194
|
+
children: ">"
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ jsx(TypePreview, { path: type.$ref })
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
case "RubyTypeIntersection":
|
|
201
|
+
case "RubyTypeUnion": {
|
|
202
|
+
const items = type.types.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
|
|
203
|
+
const delimiter = type.kind === "RubyTypeUnion" ? "|" : "&";
|
|
204
|
+
return /* @__PURE__ */ jsx("span", {
|
|
205
|
+
className: style_default.Type,
|
|
206
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
207
|
+
className: style_default.TypePreview,
|
|
208
|
+
"data-stldocs-type-preview": "union",
|
|
209
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
210
|
+
className: style_default.TypePreviewContent,
|
|
211
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
212
|
+
items,
|
|
213
|
+
limit: 3,
|
|
214
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
215
|
+
className: style_default.TextOperator,
|
|
216
|
+
children: [
|
|
217
|
+
" ",
|
|
218
|
+
delimiter,
|
|
219
|
+
" "
|
|
220
|
+
]
|
|
221
|
+
})
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
case "RubyTypeBuiltinClass": return /* @__PURE__ */ jsx("span", {
|
|
228
|
+
className: style_default.TypeReference,
|
|
229
|
+
children: type.className
|
|
230
|
+
});
|
|
231
|
+
case "RubyTypeObject": {
|
|
232
|
+
const items = type.members.map((prop, key) => /* @__PURE__ */ jsx("span", {
|
|
233
|
+
className: style_default.TextIdentifier,
|
|
234
|
+
children: prop.ident
|
|
235
|
+
}, key));
|
|
236
|
+
return /* @__PURE__ */ jsx("span", {
|
|
237
|
+
className: style_default.Type,
|
|
238
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
239
|
+
className: style_default.TypePreview,
|
|
240
|
+
"data-stldocs-type-preview": "properties",
|
|
241
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
242
|
+
className: style_default.TypePreviewContent,
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ jsx("span", {
|
|
245
|
+
className: style_default.TypeBrace,
|
|
246
|
+
children: "{ "
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ jsx(Join, {
|
|
249
|
+
items,
|
|
250
|
+
limit: 3,
|
|
251
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
252
|
+
className: style_default.TextOperator,
|
|
253
|
+
children: ", "
|
|
254
|
+
})
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ jsx("span", {
|
|
257
|
+
className: style_default.TypeBrace,
|
|
258
|
+
children: "}"
|
|
259
|
+
})
|
|
260
|
+
]
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function MethodSignature({ decl }) {
|
|
268
|
+
const Lang = useLanguageComponents();
|
|
269
|
+
const { Join } = useComponents();
|
|
270
|
+
const params = decl.args.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsx("span", {
|
|
271
|
+
className: style_default.TextIdentifier,
|
|
272
|
+
children: param.ident
|
|
273
|
+
}) }, i));
|
|
274
|
+
return /* @__PURE__ */ jsx("div", {
|
|
275
|
+
className: style_default.MethodSignature,
|
|
276
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
277
|
+
className: style_default.SignatureTitle,
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ jsx("span", {
|
|
280
|
+
className: style_default.SignatureQualified,
|
|
281
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
282
|
+
className: style_default.TextIdentifier,
|
|
283
|
+
children: decl.qualified?.slice(0, -decl.ident.length)
|
|
284
|
+
})
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ jsx("span", {
|
|
287
|
+
className: style_default.SignatureName,
|
|
288
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
289
|
+
className: style_default.TextIdentifier,
|
|
290
|
+
children: decl.ident
|
|
291
|
+
})
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ jsxs("span", {
|
|
294
|
+
className: style_default.MethodSignature,
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ jsx("span", {
|
|
297
|
+
className: style_default.SignatureParen,
|
|
298
|
+
children: "("
|
|
299
|
+
}),
|
|
300
|
+
/* @__PURE__ */ jsx("span", {
|
|
301
|
+
className: style_default.SignatureParams,
|
|
302
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
303
|
+
items: params,
|
|
304
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
305
|
+
className: style_default.TextOperator,
|
|
306
|
+
children: ", "
|
|
307
|
+
})
|
|
308
|
+
})
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ jsx("span", {
|
|
311
|
+
className: style_default.SignatureParen,
|
|
312
|
+
children: ")"
|
|
313
|
+
}),
|
|
314
|
+
" -> ",
|
|
315
|
+
decl.returns ? /* @__PURE__ */ jsx(Lang.Type, { type: decl.returns }) : "void"
|
|
316
|
+
]
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
})
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function Property({ decl, children }) {
|
|
323
|
+
const Lang = useLanguageComponents();
|
|
324
|
+
switch (decl.kind) {
|
|
325
|
+
case "RubyDeclProperty": return children({
|
|
326
|
+
name: decl.ident,
|
|
327
|
+
typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
|
|
328
|
+
type: decl.type.kind in ComplexTypes && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
329
|
+
});
|
|
330
|
+
case "RubyDeclTypeAlias": return children({
|
|
331
|
+
name: decl.ident,
|
|
332
|
+
typeName: "alias",
|
|
333
|
+
type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
334
|
+
});
|
|
335
|
+
case "RubyDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
|
|
336
|
+
case "RubyDeclClass": return children({
|
|
337
|
+
name: decl.ident,
|
|
338
|
+
typeName: "class"
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function Declaration({ decl }) {
|
|
343
|
+
const Lang = useLanguageComponents();
|
|
344
|
+
if (!decl) return;
|
|
345
|
+
switch (decl.kind) {
|
|
346
|
+
case "RubyDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
347
|
+
/* @__PURE__ */ jsx("span", {
|
|
348
|
+
className: style_default.TypePropertyName,
|
|
349
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
350
|
+
className: style_default.TextIdentifier,
|
|
351
|
+
children: decl.ident
|
|
352
|
+
})
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ jsx("span", {
|
|
355
|
+
className: style_default.TextPunctuation,
|
|
356
|
+
children: ": "
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
359
|
+
] });
|
|
360
|
+
case "RubyDeclTypeAlias": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
361
|
+
/* @__PURE__ */ jsx("span", {
|
|
362
|
+
className: style_default.TextIdentifier,
|
|
363
|
+
children: decl.ident
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ jsx("span", {
|
|
366
|
+
className: style_default.TextOperator,
|
|
367
|
+
children: " = "
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
370
|
+
] });
|
|
371
|
+
case "RubyDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
372
|
+
/* @__PURE__ */ jsx("span", {
|
|
373
|
+
className: style_default.TextKeyword,
|
|
374
|
+
children: "class "
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ jsx("span", {
|
|
377
|
+
className: style_default.TextIdentifier,
|
|
378
|
+
children: decl.ident
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ jsx(TypePreview, { path: decl.stainlessPath })
|
|
381
|
+
] });
|
|
382
|
+
case "RubyDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
//#endregion
|
|
387
|
+
export { TypeName as a, Type as i, MethodSignature as n, ruby_exports as o, Property as r, Declaration as t };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { t as DocsLanguage } from "./routing-CMqh1cTZ.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime66 from "react/jsx-runtime";
|
|
4
|
+
import * as SDKJSON from "@stainless/sdk-json";
|
|
5
|
+
|
|
6
|
+
//#region src/components/sdk.d.ts
|
|
7
|
+
type PropertyModelContextType = {
|
|
8
|
+
modelPath?: string;
|
|
9
|
+
propertyPath?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const PropertyModelContext: React$1.Context<PropertyModelContextType>;
|
|
12
|
+
declare function usePropertyModel(): PropertyModelContextType;
|
|
13
|
+
type ReferenceNestingContextType = string[];
|
|
14
|
+
declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
|
|
15
|
+
declare function useReferenceNesting(): ReferenceNestingContextType;
|
|
16
|
+
type SDKSnippetLanguagesType = Record<SDKJSON.SnippetLanguage, {
|
|
17
|
+
name: string;
|
|
18
|
+
}>;
|
|
19
|
+
declare const SDKSnippetLanguages: SDKSnippetLanguagesType;
|
|
20
|
+
type TransformRequestSnippetFn = ({
|
|
21
|
+
snippet,
|
|
22
|
+
language
|
|
23
|
+
}: {
|
|
24
|
+
snippet: string;
|
|
25
|
+
language: DocsLanguage;
|
|
26
|
+
}) => string;
|
|
27
|
+
type SDKChildrenProps = {
|
|
28
|
+
paths: SDKJSON.ID[];
|
|
29
|
+
expand?: boolean;
|
|
30
|
+
depth?: number;
|
|
31
|
+
};
|
|
32
|
+
declare function SDKChildren({
|
|
33
|
+
paths,
|
|
34
|
+
expand,
|
|
35
|
+
depth
|
|
36
|
+
}: SDKChildrenProps): react_jsx_runtime66.JSX.Element;
|
|
37
|
+
type SDKDeclarationProps = {
|
|
38
|
+
path: string;
|
|
39
|
+
expand?: boolean;
|
|
40
|
+
depth?: number;
|
|
41
|
+
};
|
|
42
|
+
declare function SDKDeclaration({
|
|
43
|
+
path,
|
|
44
|
+
expand,
|
|
45
|
+
depth
|
|
46
|
+
}: SDKDeclarationProps): react_jsx_runtime66.JSX.Element;
|
|
47
|
+
type SDKConstraintsProps = {
|
|
48
|
+
constraints?: Record<string, any>;
|
|
49
|
+
};
|
|
50
|
+
declare function SDKConstraints({
|
|
51
|
+
constraints
|
|
52
|
+
}: SDKConstraintsProps): react_jsx_runtime66.JSX.Element | undefined;
|
|
53
|
+
type SDKIconProps = {
|
|
54
|
+
language: SDKJSON.SnippetLanguage;
|
|
55
|
+
size?: number;
|
|
56
|
+
};
|
|
57
|
+
declare function SDKIcon({
|
|
58
|
+
language
|
|
59
|
+
}: SDKIconProps): react_jsx_runtime66.JSX.Element | null;
|
|
60
|
+
type SDKRequestTitleProps = {
|
|
61
|
+
snippetLanguage: SDKJSON.SnippetLanguage;
|
|
62
|
+
};
|
|
63
|
+
declare function SDKRequestTitle({
|
|
64
|
+
snippetLanguage
|
|
65
|
+
}: SDKRequestTitleProps): react_jsx_runtime66.JSX.Element;
|
|
66
|
+
type SDKExampleProps = {
|
|
67
|
+
method: SDKJSON.Method;
|
|
68
|
+
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
69
|
+
};
|
|
70
|
+
declare function SDKExample({
|
|
71
|
+
method,
|
|
72
|
+
transformRequestSnippet
|
|
73
|
+
}: SDKExampleProps): react_jsx_runtime66.JSX.Element;
|
|
74
|
+
type SDKMethodProps = {
|
|
75
|
+
method: SDKJSON.Method;
|
|
76
|
+
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
77
|
+
};
|
|
78
|
+
declare function SDKMethodHeader({
|
|
79
|
+
method
|
|
80
|
+
}: SDKMethodProps): react_jsx_runtime66.JSX.Element;
|
|
81
|
+
declare function SDKMethodInfo({
|
|
82
|
+
method
|
|
83
|
+
}: SDKMethodProps): react_jsx_runtime66.JSX.Element;
|
|
84
|
+
declare function SDKMethod({
|
|
85
|
+
method,
|
|
86
|
+
transformRequestSnippet
|
|
87
|
+
}: SDKMethodProps): react_jsx_runtime66.JSX.Element;
|
|
88
|
+
type SDKModelProps = {
|
|
89
|
+
model: SDKJSON.Model;
|
|
90
|
+
};
|
|
91
|
+
declare function SDKModel({
|
|
92
|
+
model
|
|
93
|
+
}: SDKModelProps): react_jsx_runtime66.JSX.Element | null;
|
|
94
|
+
type SDKReferenceProps = {
|
|
95
|
+
stainlessPath: string;
|
|
96
|
+
children?: React$1.ReactNode;
|
|
97
|
+
};
|
|
98
|
+
declare function SDKReference({
|
|
99
|
+
stainlessPath,
|
|
100
|
+
children
|
|
101
|
+
}: SDKReferenceProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime66.JSX.Element | null | undefined;
|
|
102
|
+
type SDKLanguageBlockProps = {
|
|
103
|
+
language: DocsLanguage;
|
|
104
|
+
version: string;
|
|
105
|
+
install: string;
|
|
106
|
+
links: {
|
|
107
|
+
repo: string;
|
|
108
|
+
docs: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
declare function SDKLanguageBlock({
|
|
112
|
+
language,
|
|
113
|
+
version,
|
|
114
|
+
install,
|
|
115
|
+
links
|
|
116
|
+
}: SDKLanguageBlockProps): react_jsx_runtime66.JSX.Element;
|
|
117
|
+
//#endregion
|
|
118
|
+
export { TransformRequestSnippetFn as C, SDKSnippetLanguagesType as S, useReferenceNesting as T, SDKModelProps as _, SDKChildren as a, SDKRequestTitleProps as b, SDKDeclaration as c, SDKLanguageBlock as d, SDKMethod as f, SDKModel as g, SDKMethodProps as h, ReferenceNestingContextType as i, SDKExample as l, SDKMethodInfo as m, PropertyModelContextType as n, SDKConstraints as o, SDKMethodHeader as p, ReferenceNestingContext as r, SDKConstraintsProps as s, PropertyModelContext as t, SDKIcon as u, SDKReference as v, usePropertyModel as w, SDKSnippetLanguages as x, SDKRequestTitle as y };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { t as DocsLanguage } from "./routing-CMqh1cTZ.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime55 from "react/jsx-runtime";
|
|
4
|
+
import * as SDKJSON from "@stainless/sdk-json";
|
|
5
|
+
|
|
6
|
+
//#region src/components/sdk.d.ts
|
|
7
|
+
type PropertyModelContextType = {
|
|
8
|
+
modelPath?: string;
|
|
9
|
+
propertyPath?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const PropertyModelContext: React$1.Context<PropertyModelContextType>;
|
|
12
|
+
declare function usePropertyModel(): PropertyModelContextType;
|
|
13
|
+
type ReferenceNestingContextType = string[];
|
|
14
|
+
declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
|
|
15
|
+
declare function useReferenceNesting(): ReferenceNestingContextType;
|
|
16
|
+
type SDKSnippetLanguagesType = Record<SDKJSON.SnippetLanguage, {
|
|
17
|
+
name: string;
|
|
18
|
+
}>;
|
|
19
|
+
declare const SDKSnippetLanguages: SDKSnippetLanguagesType;
|
|
20
|
+
type TransformRequestSnippetFn = ({
|
|
21
|
+
snippet,
|
|
22
|
+
language
|
|
23
|
+
}: {
|
|
24
|
+
snippet: string;
|
|
25
|
+
language: DocsLanguage;
|
|
26
|
+
}) => string;
|
|
27
|
+
type SDKChildrenProps = {
|
|
28
|
+
paths: SDKJSON.ID[];
|
|
29
|
+
expand?: boolean;
|
|
30
|
+
depth?: number;
|
|
31
|
+
};
|
|
32
|
+
declare function SDKChildren({
|
|
33
|
+
paths,
|
|
34
|
+
expand,
|
|
35
|
+
depth
|
|
36
|
+
}: SDKChildrenProps): react_jsx_runtime55.JSX.Element;
|
|
37
|
+
type SDKDeclarationProps = {
|
|
38
|
+
path: string;
|
|
39
|
+
expand?: boolean;
|
|
40
|
+
depth?: number;
|
|
41
|
+
};
|
|
42
|
+
declare function SDKDeclaration({
|
|
43
|
+
path,
|
|
44
|
+
expand,
|
|
45
|
+
depth
|
|
46
|
+
}: SDKDeclarationProps): react_jsx_runtime55.JSX.Element;
|
|
47
|
+
type SDKConstraintsProps = {
|
|
48
|
+
constraints?: Record<string, any>;
|
|
49
|
+
};
|
|
50
|
+
declare function SDKConstraints({
|
|
51
|
+
constraints
|
|
52
|
+
}: SDKConstraintsProps): react_jsx_runtime55.JSX.Element | undefined;
|
|
53
|
+
type SDKIconProps = {
|
|
54
|
+
language: SDKJSON.SnippetLanguage;
|
|
55
|
+
size?: number;
|
|
56
|
+
};
|
|
57
|
+
declare function SDKIcon({
|
|
58
|
+
language
|
|
59
|
+
}: SDKIconProps): react_jsx_runtime55.JSX.Element | null;
|
|
60
|
+
type SDKRequestTitleProps = {
|
|
61
|
+
snippetLanguage: SDKJSON.SnippetLanguage;
|
|
62
|
+
};
|
|
63
|
+
declare function SDKRequestTitle({
|
|
64
|
+
snippetLanguage
|
|
65
|
+
}: SDKRequestTitleProps): react_jsx_runtime55.JSX.Element;
|
|
66
|
+
type SDKExampleProps = {
|
|
67
|
+
method: SDKJSON.Method;
|
|
68
|
+
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
69
|
+
};
|
|
70
|
+
declare function SDKExample({
|
|
71
|
+
method,
|
|
72
|
+
transformRequestSnippet
|
|
73
|
+
}: SDKExampleProps): react_jsx_runtime55.JSX.Element;
|
|
74
|
+
type SDKMethodProps = {
|
|
75
|
+
method: SDKJSON.Method;
|
|
76
|
+
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
77
|
+
};
|
|
78
|
+
declare function SDKMethodHeader({
|
|
79
|
+
method
|
|
80
|
+
}: SDKMethodProps): react_jsx_runtime55.JSX.Element;
|
|
81
|
+
declare function SDKMethodInfo({
|
|
82
|
+
method
|
|
83
|
+
}: SDKMethodProps): react_jsx_runtime55.JSX.Element;
|
|
84
|
+
declare function SDKMethod({
|
|
85
|
+
method,
|
|
86
|
+
transformRequestSnippet
|
|
87
|
+
}: SDKMethodProps): react_jsx_runtime55.JSX.Element;
|
|
88
|
+
type SDKModelProps = {
|
|
89
|
+
model: SDKJSON.Model;
|
|
90
|
+
};
|
|
91
|
+
declare function SDKModel({
|
|
92
|
+
model
|
|
93
|
+
}: SDKModelProps): react_jsx_runtime55.JSX.Element | null;
|
|
94
|
+
type SDKReferenceProps = {
|
|
95
|
+
stainlessPath: string;
|
|
96
|
+
children?: React$1.ReactNode;
|
|
97
|
+
};
|
|
98
|
+
declare function SDKReference({
|
|
99
|
+
stainlessPath,
|
|
100
|
+
children
|
|
101
|
+
}: SDKReferenceProps): string | number | bigint | boolean | react_jsx_runtime55.JSX.Element | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null | undefined;
|
|
102
|
+
type SDKLanguageBlockProps = {
|
|
103
|
+
language: DocsLanguage;
|
|
104
|
+
version: string;
|
|
105
|
+
install: string;
|
|
106
|
+
links: {
|
|
107
|
+
repo: string;
|
|
108
|
+
docs: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
declare function SDKLanguageBlock({
|
|
112
|
+
language,
|
|
113
|
+
version,
|
|
114
|
+
install,
|
|
115
|
+
links
|
|
116
|
+
}: SDKLanguageBlockProps): react_jsx_runtime55.JSX.Element;
|
|
117
|
+
//#endregion
|
|
118
|
+
export { TransformRequestSnippetFn as C, SDKSnippetLanguagesType as S, useReferenceNesting as T, SDKModelProps as _, SDKChildren as a, SDKRequestTitleProps as b, SDKDeclaration as c, SDKLanguageBlock as d, SDKMethod as f, SDKModel as g, SDKMethodProps as h, ReferenceNestingContextType as i, SDKExample as l, SDKMethodInfo as m, PropertyModelContextType as n, SDKConstraints as o, SDKMethodHeader as p, ReferenceNestingContext as r, SDKConstraintsProps as s, PropertyModelContext as t, SDKIcon as u, SDKReference as v, usePropertyModel as w, SDKSnippetLanguages as x, SDKRequestTitle as y };
|