@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.
- package/dist/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
- package/dist/components/MaskedInput.d.ts +3 -3
- package/dist/components/MaskedInput.js +1 -1
- package/dist/components/breadcrumbs.d.ts +24 -1
- package/dist/components/breadcrumbs.js +62 -7
- package/dist/components/icons.d.ts +18 -13
- package/dist/components/icons.js +940 -2
- package/dist/components/index.d.ts +16 -14
- package/dist/components/index.js +72 -18
- package/dist/components/method.d.ts +58 -1
- package/dist/components/method.js +95 -8
- package/dist/components/overview.d.ts +38 -1
- package/dist/components/overview.js +137 -9
- package/dist/components/primitives.d.ts +104 -1
- package/dist/components/primitives.js +250 -6
- package/dist/components/properties.d.ts +53 -1
- package/dist/components/properties.js +138 -7
- package/dist/components/sdk-sidebar.d.ts +14 -1
- package/dist/components/sdk-sidebar.js +50 -8
- package/dist/components/sdk.d.ts +121 -1
- package/dist/components/sdk.js +405 -8
- package/dist/components/snippets.d.ts +70 -13
- package/dist/components/snippets.js +182 -7
- package/dist/components/stl-sidebar.d.ts +57 -1
- package/dist/components/stl-sidebar.js +105 -3
- package/dist/contexts/component-generics.d.ts +29 -1
- package/dist/contexts/component-generics.js +31 -1
- package/dist/contexts/component-types.d.ts +4 -15
- package/dist/contexts/component.d.ts +7 -17
- package/dist/contexts/component.js +22 -28
- package/dist/contexts/docs.d.ts +61 -1
- package/dist/contexts/docs.js +89 -1
- package/dist/contexts/index.d.ts +13 -14
- package/dist/contexts/index.js +44 -6
- package/dist/contexts/markdown.d.ts +21 -1
- package/dist/contexts/markdown.js +47 -2
- package/dist/contexts/navigation.d.ts +28 -1
- package/dist/contexts/navigation.js +22 -1
- package/dist/contexts/use-components.d.ts +1 -13
- package/dist/contexts/use-components.js +6 -2
- package/dist/{index-HDt5wRiR.d.ts → index-Cl6Gny0o.d.ts} +37 -2
- package/dist/index.d.ts +4 -14
- package/dist/index.js +7 -30
- package/dist/languages/cli.d.ts +38 -14
- package/dist/languages/cli.js +166 -20
- package/dist/languages/csharp.d.ts +42 -14
- package/dist/languages/csharp.js +283 -8
- package/dist/languages/go.d.ts +40 -14
- package/dist/languages/go.js +303 -8
- package/dist/languages/http.d.ts +46 -14
- package/dist/languages/http.js +390 -19
- package/dist/languages/index.d.ts +51 -14
- package/dist/languages/index.js +32 -28
- package/dist/languages/java.d.ts +43 -14
- package/dist/languages/java.js +403 -8
- package/dist/languages/php.d.ts +40 -0
- package/dist/languages/php.js +313 -0
- package/dist/languages/python.d.ts +40 -14
- package/dist/languages/python.js +269 -8
- package/dist/languages/ruby.d.ts +40 -14
- package/dist/languages/ruby.js +387 -8
- package/dist/languages/terraform.d.ts +48 -14
- package/dist/languages/terraform.js +243 -8
- package/dist/languages/typescript.d.ts +40 -14
- package/dist/languages/typescript.js +449 -8
- package/dist/markdown/index.d.ts +1 -2
- package/dist/markdown/index.js +1 -28
- package/dist/markdown/printer.d.ts +2 -2
- package/dist/markdown/printer.js +6 -30
- package/dist/markdown/utils.d.ts +3 -3
- package/dist/routing.d.ts +61 -2
- package/dist/routing.js +205 -2
- package/dist/spec.d.ts +2 -2
- package/dist/spec.js +2 -2
- package/dist/style.js +176 -1
- package/dist/use-strict-context-L0c8JKg4.js +16 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +53 -2
- package/package.json +3 -3
- package/dist/breadcrumbs-Dei_5sHd.d.ts +0 -25
- package/dist/breadcrumbs-oUp-6oJK.js +0 -63
- package/dist/cli-BX9ofVCR.js +0 -166
- package/dist/component-Dl5ZEHxB.js +0 -23
- package/dist/component-generics-C9ALAcZI.d.ts +0 -30
- package/dist/component-generics-POFirVVb.js +0 -45
- package/dist/components-DQPlXEwE.js +0 -72
- package/dist/contexts-_NNW5yqC.js +0 -44
- package/dist/csharp-sn5CJu9t.js +0 -283
- package/dist/docs-YgoQ3bzY.js +0 -81
- package/dist/docs-x-kfjRMc.d.ts +0 -66
- package/dist/go-BoaAVmP0.js +0 -303
- package/dist/http-Ccj1dOvE.js +0 -389
- package/dist/icons-BYKn5X8E.js +0 -885
- package/dist/index-OCM-LZIo.d.ts +0 -428
- package/dist/java-BiLRuLuD.js +0 -403
- package/dist/languages-COjc0Nwx.js +0 -30
- package/dist/markdown-BszOPZhh.d.ts +0 -22
- package/dist/markdown-Cq3XEhrR.js +0 -49
- package/dist/method-DjzVBzZe.js +0 -96
- package/dist/method-KkWyhvKa.d.ts +0 -59
- package/dist/navigation-BZjwfN2P.d.ts +0 -29
- package/dist/navigation-aoYZ_tl4.js +0 -24
- package/dist/overview-BNmMeDUE.d.ts +0 -39
- package/dist/overview-Clq5psZe.js +0 -138
- package/dist/primitives-B8OnSXRP.d.ts +0 -105
- package/dist/primitives-BBUs_flm.js +0 -250
- package/dist/properties-BhlRtWo4.d.ts +0 -54
- package/dist/properties-DQU0NBzb.js +0 -138
- package/dist/python-nqOBH7GS.js +0 -269
- package/dist/routing-GvhEMw6E.js +0 -205
- package/dist/routing-qJMPICGo.d.ts +0 -61
- package/dist/ruby-BBc8HdIt.js +0 -387
- package/dist/sdk-C8C6IRQp.d.ts +0 -122
- package/dist/sdk-DzCHhEoX.js +0 -405
- package/dist/sdk-sidebar-CkjSLggl.js +0 -50
- package/dist/sdk-sidebar-lgNmf-ns.d.ts +0 -15
- package/dist/snippets-CLpNVNlA.js +0 -181
- package/dist/stl-sidebar-8jF9cdnn.d.ts +0 -58
- package/dist/stl-sidebar-DC5UOJiT.js +0 -106
- package/dist/style-DJIYkFhO.js +0 -178
- package/dist/terraform-DVx2ea2h.js +0 -243
- package/dist/typescript-Cmk-jBBw.js +0 -449
- package/dist/use-components-BUz3GbO4.js +0 -7
- package/dist/utils-D6zJxUZ9.js +0 -54
|
@@ -1,9 +1,450 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../contexts-
|
|
6
|
-
import "../
|
|
7
|
-
import
|
|
1
|
+
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
+
import { useDeclaration, useLanguage, useSpec } from "../contexts/docs.js";
|
|
3
|
+
import "../use-strict-context-L0c8JKg4.js";
|
|
4
|
+
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
|
+
import { useComponents } from "../contexts/use-components.js";
|
|
6
|
+
import style_default from "../style.js";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
//#region src/languages/typescript.tsx
|
|
11
|
+
var typescript_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Declaration: () => Declaration,
|
|
13
|
+
MethodSignature: () => MethodSignature,
|
|
14
|
+
Property: () => Property,
|
|
15
|
+
Type: () => Type,
|
|
16
|
+
TypeName: () => TypeName
|
|
17
|
+
});
|
|
18
|
+
const ComplexTypes = {
|
|
19
|
+
TSTypeObject: "object",
|
|
20
|
+
TSTypeUnion: "union",
|
|
21
|
+
TSTypeInterface: "interface",
|
|
22
|
+
TSTypeIntersection: "intersection",
|
|
23
|
+
TSTypeArray: "array"
|
|
24
|
+
};
|
|
25
|
+
const constStyle = {
|
|
26
|
+
string: style_default.LiteralString,
|
|
27
|
+
number: style_default.LiteralNumeric,
|
|
28
|
+
boolean: style_default.LiteralBoolean
|
|
29
|
+
};
|
|
30
|
+
function Identifier({ name, optional }) {
|
|
31
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
32
|
+
className: style_default.TextIdentifier,
|
|
33
|
+
children: /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(name) ? name : JSON.stringify(name)
|
|
34
|
+
}), optional && /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: style_default.TextPunctuation,
|
|
36
|
+
children: "?"
|
|
37
|
+
})] });
|
|
38
|
+
}
|
|
39
|
+
function TypeParams({ params }) {
|
|
40
|
+
const Lang = useLanguageComponents();
|
|
41
|
+
const { Join } = useComponents();
|
|
42
|
+
if (!params?.length) return null;
|
|
43
|
+
const typeParams = params?.map((param, key) => param.constraint ? /* @__PURE__ */ jsxs(React$1.Fragment, { children: [
|
|
44
|
+
/* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: style_default.TypeReference,
|
|
46
|
+
children: param.name
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: style_default.TextKeyword,
|
|
50
|
+
children: "extends "
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: param.constraint })
|
|
53
|
+
] }, key) : /* @__PURE__ */ jsx(React$1.Fragment, { children: "param.name" }, key));
|
|
54
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
55
|
+
/* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: style_default.TypeBracket,
|
|
57
|
+
children: "<"
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx(Join, {
|
|
60
|
+
items: typeParams,
|
|
61
|
+
limit: 3,
|
|
62
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: style_default.TextOperator,
|
|
64
|
+
children: ", "
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ jsx("span", {
|
|
68
|
+
className: style_default.TypeBracket,
|
|
69
|
+
children: ">"
|
|
70
|
+
})
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
function TypePreview({ path }) {
|
|
74
|
+
const spec = useSpec();
|
|
75
|
+
const language = useLanguage();
|
|
76
|
+
const decl = useDeclaration(path, false);
|
|
77
|
+
const { Join } = useComponents();
|
|
78
|
+
if (!(decl && "children" in decl && decl.children && decl.children.length > 0) || decl && "type" in decl && decl.type !== void 0 && "kind" in decl["type"] && decl["type"]["kind"] === "TSTypeUnion") return;
|
|
79
|
+
const items = decl.children.map((prop, key) => {
|
|
80
|
+
const p = spec?.decls?.[language]?.[prop];
|
|
81
|
+
return /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: style_default.TypePropertyName,
|
|
83
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
84
|
+
className: style_default.TextIdentifier,
|
|
85
|
+
children: p && "key" in p ? p["key"] : null
|
|
86
|
+
})
|
|
87
|
+
}, key);
|
|
88
|
+
});
|
|
89
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
90
|
+
className: style_default.TypePreview,
|
|
91
|
+
"data-stldocs-type-preview": "properties",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: style_default.TypeBrace,
|
|
95
|
+
children: " {"
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ jsxs("span", {
|
|
98
|
+
className: style_default.TypePreviewContent,
|
|
99
|
+
children: [
|
|
100
|
+
" ",
|
|
101
|
+
/* @__PURE__ */ jsx(Join, {
|
|
102
|
+
items,
|
|
103
|
+
limit: 3,
|
|
104
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
105
|
+
className: style_default.TextOperator,
|
|
106
|
+
children: ", "
|
|
107
|
+
})
|
|
108
|
+
}),
|
|
109
|
+
" "
|
|
110
|
+
]
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ jsx("span", {
|
|
113
|
+
className: style_default.TypeBrace,
|
|
114
|
+
children: "} "
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function TypeName({ type }) {
|
|
120
|
+
const Lang = useLanguageComponents();
|
|
121
|
+
return ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
|
|
122
|
+
}
|
|
123
|
+
function Type({ type }) {
|
|
124
|
+
const Lang = useLanguageComponents();
|
|
125
|
+
const { Join, SDKReference } = useComponents();
|
|
126
|
+
switch (type.kind) {
|
|
127
|
+
case "TSTypeUnknown":
|
|
128
|
+
case "TSTypeUndefined":
|
|
129
|
+
case "TSTypeNever":
|
|
130
|
+
case "TSTypeVoid":
|
|
131
|
+
case "TSTypeNull":
|
|
132
|
+
case "TSTypeAny":
|
|
133
|
+
case "TSTypeBoolean":
|
|
134
|
+
case "TSTypeNumber": return /* @__PURE__ */ jsx("span", {
|
|
135
|
+
className: style_default.Type,
|
|
136
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
137
|
+
className: style_default.TypeKeyword,
|
|
138
|
+
children: type.kind.slice(6).toLowerCase()
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
case "TSTypeString": return /* @__PURE__ */ jsx("span", {
|
|
142
|
+
className: style_default.Type,
|
|
143
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
144
|
+
className: style_default.TypeString,
|
|
145
|
+
children: "string"
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
case "TSTypeLiteral": return /* @__PURE__ */ jsx("span", {
|
|
149
|
+
className: style_default.Type,
|
|
150
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
151
|
+
className: constStyle[typeof type.literal],
|
|
152
|
+
children: JSON.stringify(type.literal)
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
case "TSTypeArray": return /* @__PURE__ */ jsxs("span", {
|
|
156
|
+
className: style_default.Type,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx("span", {
|
|
159
|
+
className: style_default.TypeArray,
|
|
160
|
+
children: "Array<"
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
|
|
163
|
+
/* @__PURE__ */ jsx("span", {
|
|
164
|
+
className: style_default.TypeArray,
|
|
165
|
+
children: ">"
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
case "TSTypeReference": {
|
|
170
|
+
const name = type.ident.split(".").at(-1);
|
|
171
|
+
const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
|
|
172
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
173
|
+
className: style_default.Type,
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ jsx(SDKReference, {
|
|
176
|
+
stainlessPath: type.$ref,
|
|
177
|
+
children: name
|
|
178
|
+
}),
|
|
179
|
+
params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
180
|
+
/* @__PURE__ */ jsx("span", {
|
|
181
|
+
className: style_default.TypeBracket,
|
|
182
|
+
children: "<"
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsx(Join, {
|
|
185
|
+
items: params,
|
|
186
|
+
limit: 3,
|
|
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
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ jsx(TypePreview, { path: type.$ref })
|
|
198
|
+
]
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
case "TSTypeIntersection":
|
|
202
|
+
case "TSTypeUnion": {
|
|
203
|
+
const items = type.types.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
|
|
204
|
+
const delimiter = type.kind === "TSTypeUnion" ? "|" : "&";
|
|
205
|
+
return /* @__PURE__ */ jsx("span", {
|
|
206
|
+
className: style_default.Type,
|
|
207
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
208
|
+
className: style_default.TypePreview,
|
|
209
|
+
"data-stldocs-type-preview": "union",
|
|
210
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
211
|
+
className: style_default.TypePreviewContent,
|
|
212
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
213
|
+
items,
|
|
214
|
+
limit: 3,
|
|
215
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
216
|
+
className: style_default.TextOperator,
|
|
217
|
+
children: [
|
|
218
|
+
" ",
|
|
219
|
+
delimiter,
|
|
220
|
+
" "
|
|
221
|
+
]
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
case "TSTypeObject":
|
|
229
|
+
case "TSTypeInterface": {
|
|
230
|
+
const extend = type.kind === "TSTypeObject" ? null : type.extends?.map((ref, key) => /* @__PURE__ */ jsx(Lang.Type, { type: ref }, key));
|
|
231
|
+
const items = type.members.map((prop, key) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [
|
|
232
|
+
/* @__PURE__ */ jsx("span", {
|
|
233
|
+
className: style_default.TypePropertyName,
|
|
234
|
+
children: /* @__PURE__ */ jsx(Identifier, {
|
|
235
|
+
name: prop.ident,
|
|
236
|
+
optional: prop.optional
|
|
237
|
+
})
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ jsx("span", {
|
|
240
|
+
className: style_default.TextPunctuation,
|
|
241
|
+
children: ": "
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: prop.type })
|
|
244
|
+
] }, key));
|
|
245
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
246
|
+
className: style_default.Type,
|
|
247
|
+
children: [extend?.length && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
248
|
+
className: style_default.TypeKeyword,
|
|
249
|
+
children: " extends "
|
|
250
|
+
}), /* @__PURE__ */ jsx(Join, {
|
|
251
|
+
items: extend,
|
|
252
|
+
limit: 3,
|
|
253
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
254
|
+
className: style_default.TextOperator,
|
|
255
|
+
children: ", "
|
|
256
|
+
})
|
|
257
|
+
})] }), /* @__PURE__ */ jsxs("span", {
|
|
258
|
+
className: style_default.TypePreview,
|
|
259
|
+
"data-stldocs-type-preview": "properties",
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ jsx("span", {
|
|
262
|
+
className: style_default.TypeBrace,
|
|
263
|
+
children: "{ "
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ jsx("span", {
|
|
266
|
+
className: style_default.TypePreviewContent,
|
|
267
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
268
|
+
items,
|
|
269
|
+
limit: 3,
|
|
270
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
271
|
+
className: style_default.TextOperator,
|
|
272
|
+
children: ", "
|
|
273
|
+
})
|
|
274
|
+
})
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ jsx("span", {
|
|
277
|
+
className: style_default.TypeBrace,
|
|
278
|
+
children: "} "
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
})]
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function MethodSignature({ decl }) {
|
|
287
|
+
const Lang = useLanguageComponents();
|
|
288
|
+
const { Join, Tooltip } = useComponents();
|
|
289
|
+
const params = decl.signature.parameters.map((param, i) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
290
|
+
content: /* @__PURE__ */ jsx(Lang.Type, { type: param.type }),
|
|
291
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
292
|
+
className: style_default.TextIdentifier,
|
|
293
|
+
children: param.ident
|
|
294
|
+
})
|
|
295
|
+
}), param.optional && /* @__PURE__ */ jsx("span", {
|
|
296
|
+
className: style_default.TextPunctuation,
|
|
297
|
+
children: "?"
|
|
298
|
+
})] }, i));
|
|
299
|
+
return /* @__PURE__ */ jsx("div", {
|
|
300
|
+
className: style_default.MethodSignature,
|
|
301
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
302
|
+
className: style_default.SignatureTitle,
|
|
303
|
+
children: [
|
|
304
|
+
decl.signature.async && /* @__PURE__ */ jsx("span", {
|
|
305
|
+
className: style_default.TextKeyword,
|
|
306
|
+
children: "async "
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ jsx("span", {
|
|
309
|
+
className: style_default.SignatureQualified,
|
|
310
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
311
|
+
className: style_default.TextIdentifier,
|
|
312
|
+
children: decl.qualified?.slice(0, -decl.ident.length)
|
|
313
|
+
})
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ jsx("span", {
|
|
316
|
+
className: style_default.SignatureName,
|
|
317
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
318
|
+
className: style_default.TextIdentifier,
|
|
319
|
+
children: decl.ident
|
|
320
|
+
})
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ jsxs("span", {
|
|
323
|
+
className: style_default.MethodSignature,
|
|
324
|
+
children: [
|
|
325
|
+
decl.signature.typeParameters && /* @__PURE__ */ jsx(TypeParams, { params: decl.signature.typeParameters }),
|
|
326
|
+
/* @__PURE__ */ jsx("span", {
|
|
327
|
+
className: style_default.SignatureParen,
|
|
328
|
+
children: "("
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ jsx("span", {
|
|
331
|
+
className: style_default.SignatureParams,
|
|
332
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
333
|
+
items: params,
|
|
334
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
335
|
+
className: style_default.TextOperator,
|
|
336
|
+
children: ", "
|
|
337
|
+
})
|
|
338
|
+
})
|
|
339
|
+
}),
|
|
340
|
+
/* @__PURE__ */ jsx("span", {
|
|
341
|
+
className: style_default.SignatureParen,
|
|
342
|
+
children: ")"
|
|
343
|
+
}),
|
|
344
|
+
decl.signature.returns && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
345
|
+
className: style_default.TextPunctuation,
|
|
346
|
+
children: ": "
|
|
347
|
+
}), /* @__PURE__ */ jsx(Lang.Type, { type: decl.signature.returns })] })
|
|
348
|
+
]
|
|
349
|
+
})
|
|
350
|
+
]
|
|
351
|
+
})
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
function Property({ decl, children }) {
|
|
355
|
+
const Lang = useLanguageComponents();
|
|
356
|
+
if (!decl) return;
|
|
357
|
+
switch (decl.kind) {
|
|
358
|
+
case "TSDeclProperty": return children({
|
|
359
|
+
name: decl.key,
|
|
360
|
+
typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
|
|
361
|
+
type: decl.type.kind in ComplexTypes && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
362
|
+
});
|
|
363
|
+
case "TSDeclTypeAlias": return children({
|
|
364
|
+
name: decl.ident,
|
|
365
|
+
typeName: "alias",
|
|
366
|
+
type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
367
|
+
});
|
|
368
|
+
case "TSDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
|
|
369
|
+
case "TSDeclInterface": return children({ type: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
370
|
+
/* @__PURE__ */ jsx("span", {
|
|
371
|
+
className: style_default.TextIdentifier,
|
|
372
|
+
children: decl.ident
|
|
373
|
+
}),
|
|
374
|
+
decl.typeParameters && /* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
|
|
375
|
+
decl.extends?.flatMap((t, key) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
376
|
+
className: style_default.TextKeyword,
|
|
377
|
+
children: " extends "
|
|
378
|
+
}), /* @__PURE__ */ jsx(Lang.Type, { type: t })] }, `extends:${key}`))
|
|
379
|
+
] }) });
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function Declaration({ decl }) {
|
|
383
|
+
const Lang = useLanguageComponents();
|
|
384
|
+
if (!decl) return;
|
|
385
|
+
switch (decl.kind) {
|
|
386
|
+
case "TSDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
387
|
+
decl.declare && /* @__PURE__ */ jsx("span", {
|
|
388
|
+
className: style_default.TextKeyword,
|
|
389
|
+
children: "declare "
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ jsx("span", {
|
|
392
|
+
className: style_default.TypePropertyName,
|
|
393
|
+
children: /* @__PURE__ */ jsx(Identifier, {
|
|
394
|
+
name: decl.key,
|
|
395
|
+
optional: decl.optional
|
|
396
|
+
})
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ jsx("span", {
|
|
399
|
+
className: style_default.TextPunctuation,
|
|
400
|
+
children: ": "
|
|
401
|
+
}),
|
|
402
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
403
|
+
] });
|
|
404
|
+
case "TSDeclFunction": return /* @__PURE__ */ jsx(Lang.MethodSignature, { decl });
|
|
405
|
+
case "TSDeclTypeAlias": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
406
|
+
/* @__PURE__ */ jsx(Identifier, { name: decl.ident }),
|
|
407
|
+
/* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
|
|
408
|
+
/* @__PURE__ */ jsx("span", {
|
|
409
|
+
className: style_default.TextOperator,
|
|
410
|
+
children: " = "
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
413
|
+
] });
|
|
414
|
+
case "TSDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
|
|
415
|
+
case "TSDeclInterface": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
416
|
+
/* @__PURE__ */ jsx("span", {
|
|
417
|
+
className: style_default.TextIdentifier,
|
|
418
|
+
children: decl.ident
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
|
|
421
|
+
decl.extends?.map((t, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
422
|
+
className: style_default.TextKeyword,
|
|
423
|
+
children: " extends "
|
|
424
|
+
}), /* @__PURE__ */ jsx(Lang.Type, { type: t })] }, index)),
|
|
425
|
+
/* @__PURE__ */ jsx(TypePreview, { path: decl.stainlessPath })
|
|
426
|
+
] });
|
|
427
|
+
case "TSDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
428
|
+
/* @__PURE__ */ jsx("span", {
|
|
429
|
+
className: style_default.TextKeyword,
|
|
430
|
+
children: "class "
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ jsx("span", {
|
|
433
|
+
className: style_default.TextIdentifier,
|
|
434
|
+
children: decl.ident
|
|
435
|
+
}),
|
|
436
|
+
/* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
|
|
437
|
+
decl.superClass ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
438
|
+
className: style_default.TextKeyword,
|
|
439
|
+
children: " extends "
|
|
440
|
+
}), /* @__PURE__ */ jsx(Lang.Type, { type: decl.superClass })] }) : null,
|
|
441
|
+
decl.implements?.map((t, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
442
|
+
className: style_default.TextKeyword,
|
|
443
|
+
children: " implements "
|
|
444
|
+
}), /* @__PURE__ */ jsx(Lang.Type, { type: t })] }, index))
|
|
445
|
+
] });
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
//#endregion
|
|
450
|
+
export { Declaration, MethodSignature, Property, Type, TypeName, typescript_exports as t };
|
package/dist/markdown/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { d as Method, f as Model,
|
|
2
|
-
import "../sdk-C8C6IRQp.js";
|
|
1
|
+
import { d as Method, f as Model, h as Resource, i as DeclarationNode } from "../index-Cl6Gny0o.js";
|
|
3
2
|
import { EnvironmentType } from "./utils.js";
|
|
4
3
|
import { t as printer_d_exports } from "./printer.js";
|
|
5
4
|
import { Node } from "@markdoc/markdoc";
|
package/dist/markdown/index.js
CHANGED
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
import "../
|
|
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 "../typescript-Cmk-jBBw.js";
|
|
19
|
-
import "../java-BiLRuLuD.js";
|
|
20
|
-
import "../go-BoaAVmP0.js";
|
|
21
|
-
import "../python-nqOBH7GS.js";
|
|
22
|
-
import "../ruby-BBc8HdIt.js";
|
|
23
|
-
import "../http-Ccj1dOvE.js";
|
|
24
|
-
import "../csharp-sn5CJu9t.js";
|
|
25
|
-
import "../cli-BX9ofVCR.js";
|
|
26
|
-
import "../terraform-DVx2ea2h.js";
|
|
27
|
-
import "../languages-COjc0Nwx.js";
|
|
28
|
-
import "../component-Dl5ZEHxB.js";
|
|
1
|
+
import "../use-strict-context-L0c8JKg4.js";
|
|
29
2
|
import { code, fence, heading, item, list, paragraph, parse, strong, text } from "./md.js";
|
|
30
3
|
import { getDecl, getSnippet, stripMarkup } from "./utils.js";
|
|
31
4
|
import { declaration as declaration$1, methodSignature, t as printer_exports } from "./printer.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { S as Type, i as DeclarationNode } from "../index-Cl6Gny0o.js";
|
|
2
|
+
import { DocsLanguage } from "../routing.js";
|
|
3
3
|
|
|
4
4
|
//#region src/markdown/printer.d.ts
|
|
5
5
|
declare namespace printer_d_exports {
|
package/dist/markdown/printer.js
CHANGED
|
@@ -1,33 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "../chunk-
|
|
2
|
-
import {
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import {
|
|
7
|
-
import "../use-components-BUz3GbO4.js";
|
|
8
|
-
import { t as style_default } from "../style-DJIYkFhO.js";
|
|
9
|
-
import "../properties-DQU0NBzb.js";
|
|
10
|
-
import "../method-DjzVBzZe.js";
|
|
11
|
-
import "../primitives-BBUs_flm.js";
|
|
12
|
-
import "../icons-BYKn5X8E.js";
|
|
13
|
-
import "../sdk-DzCHhEoX.js";
|
|
14
|
-
import "../snippets-CLpNVNlA.js";
|
|
15
|
-
import "../overview-Clq5psZe.js";
|
|
16
|
-
import "../breadcrumbs-oUp-6oJK.js";
|
|
17
|
-
import "../stl-sidebar-DC5UOJiT.js";
|
|
18
|
-
import "../sdk-sidebar-CkjSLggl.js";
|
|
19
|
-
import "../components-DQPlXEwE.js";
|
|
20
|
-
import "../typescript-Cmk-jBBw.js";
|
|
21
|
-
import "../java-BiLRuLuD.js";
|
|
22
|
-
import "../go-BoaAVmP0.js";
|
|
23
|
-
import "../python-nqOBH7GS.js";
|
|
24
|
-
import "../ruby-BBc8HdIt.js";
|
|
25
|
-
import "../http-Ccj1dOvE.js";
|
|
26
|
-
import "../csharp-sn5CJu9t.js";
|
|
27
|
-
import "../cli-BX9ofVCR.js";
|
|
28
|
-
import "../terraform-DVx2ea2h.js";
|
|
29
|
-
import "../languages-COjc0Nwx.js";
|
|
30
|
-
import { t as ComponentProvider } from "../component-Dl5ZEHxB.js";
|
|
1
|
+
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
+
import { DocsProvider } from "../contexts/docs.js";
|
|
3
|
+
import "../use-strict-context-L0c8JKg4.js";
|
|
4
|
+
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
|
+
import style_default from "../style.js";
|
|
6
|
+
import { ComponentProvider } from "../contexts/component.js";
|
|
31
7
|
import "react";
|
|
32
8
|
import { jsx } from "react/jsx-runtime";
|
|
33
9
|
import { renderToStaticMarkup } from "react-dom/server";
|
package/dist/markdown/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { u as LanguageDeclNodes, v as Spec, y as SpecLanguage } from "../index-Cl6Gny0o.js";
|
|
2
|
+
import { DocsLanguage } from "../routing.js";
|
|
3
|
+
import { TransformRequestSnippetFn } from "../components/sdk.js";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/utils.d.ts
|
|
6
6
|
type EnvironmentType = {
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { d as Method, f as Model, h as Resource, v as Spec } from "./index-Cl6Gny0o.js";
|
|
2
|
+
|
|
3
|
+
//#region src/routing.d.ts
|
|
4
|
+
declare namespace routing_d_exports {
|
|
5
|
+
export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateMissingRouteList, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
|
|
6
|
+
}
|
|
7
|
+
declare const Languages: readonly ["http", "node", "python", "go", "typescript", "terraform", "ruby", "java", "kotlin", "csharp", "php", "cli"];
|
|
8
|
+
declare const SupportedLanguageSyntaxes: string[];
|
|
9
|
+
type DocsLanguage = (typeof Languages)[number];
|
|
10
|
+
declare const LanguageNames: Record<DocsLanguage, string>;
|
|
11
|
+
declare function getLanguageSnippet(language: DocsLanguage): "http.curl" | "node.default" | "python.default" | "go.default" | "typescript.default" | "terraform.default" | "ruby.default" | "java.default" | "kotlin.default" | "csharp.default" | "php.default" | "cli.default";
|
|
12
|
+
declare function isSupportedLanguage(language: string): language is DocsLanguage;
|
|
13
|
+
type ParsedStainlessPath = ReturnType<typeof parseStainlessPath>;
|
|
14
|
+
declare function parseStainlessPath(stainlessPath: string): {
|
|
15
|
+
resource: string[] | null;
|
|
16
|
+
method: string | null;
|
|
17
|
+
model: string | null;
|
|
18
|
+
routable: string | undefined;
|
|
19
|
+
} | null;
|
|
20
|
+
declare function trimStainlessPath(stainlessPath: string): string;
|
|
21
|
+
declare function getResource(stainlessPath: string): string | undefined;
|
|
22
|
+
declare function parseRoute(basePath: string, route: string): {
|
|
23
|
+
stainlessPath: string;
|
|
24
|
+
language: DocsLanguage;
|
|
25
|
+
};
|
|
26
|
+
declare function generateRoute(basePath: string, language: string, stainlessPath: string): string | null;
|
|
27
|
+
type SpecTreeEntry = {
|
|
28
|
+
data: Method | Resource | Model;
|
|
29
|
+
path: string[];
|
|
30
|
+
};
|
|
31
|
+
declare function walkTree(spec: Spec, includeModels?: boolean): Generator<SpecTreeEntry, void, any>;
|
|
32
|
+
type RouteEntry = {
|
|
33
|
+
title: string;
|
|
34
|
+
kind: SpecTreeEntry['data']['kind'];
|
|
35
|
+
language: DocsLanguage;
|
|
36
|
+
stainlessPath: string;
|
|
37
|
+
slug: string;
|
|
38
|
+
};
|
|
39
|
+
declare function generateRouteList({
|
|
40
|
+
spec,
|
|
41
|
+
languages,
|
|
42
|
+
excludeLanguages
|
|
43
|
+
}: {
|
|
44
|
+
spec: Spec;
|
|
45
|
+
languages?: DocsLanguage[];
|
|
46
|
+
excludeLanguages?: DocsLanguage[];
|
|
47
|
+
}): RouteEntry[];
|
|
48
|
+
declare function generateMissingRouteList({
|
|
49
|
+
spec,
|
|
50
|
+
basePath
|
|
51
|
+
}: {
|
|
52
|
+
spec: Spec;
|
|
53
|
+
basePath: string;
|
|
54
|
+
}): string[];
|
|
55
|
+
type ResourceOrMethod = Resource | Method;
|
|
56
|
+
declare function findNavigationPath(items: ResourceOrMethod[], target: string): string[] | undefined;
|
|
57
|
+
declare function expandToElement(el: HTMLElement | null): void;
|
|
58
|
+
declare function scrollToPath(stainlessPath: string): void;
|
|
59
|
+
declare function updateHistory(basePath: string, language: DocsLanguage, stainlessPath: string): void;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateMissingRouteList, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, routing_d_exports as t, trimStainlessPath, updateHistory, walkTree };
|