@stainless-api/docs-ui 0.1.0-beta.47 → 0.1.0-beta.49
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-nSFZO5Gf.js +63 -0
- package/dist/component-DRO8kQSp.js +23 -0
- package/dist/{component-generics-F0_Dx7UT.js → component-generics-B6Fn47Mz.js} +1 -1
- package/dist/{component-generics-DrrwsjTH.d.ts → component-generics-COP53CRn.d.ts} +2 -2
- package/dist/component-generics-fyFHB6qA.d.ts +30 -0
- package/dist/components/MaskedInput.d.ts +1 -1
- package/dist/components/MaskedInput.js +1 -1
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +7 -13
- package/dist/components/icons.js +1 -1
- package/dist/components/index.d.ts +9 -10
- package/dist/components/index.js +16 -13
- package/dist/components/method.d.ts +1 -1
- package/dist/components/method.js +8 -13
- package/dist/components/overview.d.ts +1 -1
- package/dist/components/overview.js +9 -13
- package/dist/components/primitives.d.ts +1 -1
- package/dist/components/primitives.js +6 -13
- package/dist/components/properties.d.ts +1 -1
- package/dist/components/properties.js +7 -13
- package/dist/components/sdk.d.ts +1 -2
- package/dist/components/sdk.js +8 -13
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +9 -13
- package/dist/components/snippets.d.ts +2 -3
- package/dist/components/snippets.js +7 -13
- package/dist/components-D7M-BwNI.js +71 -0
- package/dist/contexts/component-generics.d.ts +1 -1
- package/dist/contexts/component-generics.js +1 -1
- package/dist/contexts/component-types.d.ts +10 -11
- package/dist/contexts/component.d.ts +13 -14
- package/dist/contexts/component.js +25 -13
- package/dist/contexts/docs.d.ts +1 -1
- package/dist/contexts/docs.js +1 -1
- package/dist/contexts/index.d.ts +16 -19
- package/dist/contexts/index.js +6 -14
- package/dist/contexts/markdown.d.ts +1 -1
- package/dist/contexts/markdown.js +2 -2
- package/dist/contexts/navigation.d.ts +1 -2
- package/dist/contexts/navigation.js +1 -1
- package/dist/contexts/use-components.d.ts +9 -10
- package/dist/contexts/use-components.js +2 -2
- package/dist/contexts-p3rRZDlM.js +39 -0
- package/dist/csharp-CDSxfCZE.js +283 -0
- package/dist/docs-yYrp-uzs.d.ts +47 -0
- package/dist/go-1c3S5ETL.js +303 -0
- package/dist/http-2QNWXH9t.js +330 -0
- package/dist/{index-CeFeLPGr.d.ts → index-BQpRynot.d.ts} +8 -8
- package/dist/index-CnilsjrJ.d.ts +274 -0
- package/dist/{index-CTSOZqei.d.ts → index-Ct0NcQUK.d.ts} +1 -1
- package/dist/{index-Bt01VI67.d.ts → index-D6NhcxHd.d.ts} +6 -7
- package/dist/index-LboM0f0c.d.ts +15 -0
- package/dist/index-avtZIGmX.d.ts +13 -0
- package/dist/index.d.ts +18 -20
- package/dist/index.js +27 -13
- package/dist/java-BbjF_oUI.js +403 -0
- package/dist/languages/csharp.d.ts +10 -11
- package/dist/languages/csharp.js +7 -13
- package/dist/languages/go.d.ts +10 -11
- package/dist/languages/go.js +7 -13
- package/dist/languages/http.d.ts +10 -11
- package/dist/languages/http.js +17 -13
- package/dist/languages/index.d.ts +10 -11
- package/dist/languages/index.js +24 -13
- package/dist/languages/java.d.ts +10 -11
- package/dist/languages/java.js +7 -13
- package/dist/languages/python.d.ts +10 -11
- package/dist/languages/python.js +7 -13
- package/dist/languages/ruby.d.ts +10 -11
- package/dist/languages/ruby.js +7 -13
- package/dist/languages/typescript.d.ts +10 -11
- package/dist/languages/typescript.js +7 -13
- package/dist/languages-BCYZjzuS.js +26 -0
- package/dist/markdown/index.d.ts +4 -4
- package/dist/markdown/index.js +103 -14
- package/dist/markdown/md.js +1 -1
- package/dist/markdown/printer.d.ts +2 -0
- package/dist/markdown/printer.js +28 -0
- package/dist/markdown/utils.d.ts +2 -3
- package/dist/markdown/utils.js +1 -1
- package/dist/{markdown-Bx-mQFEj.js → markdown-CxdeWgjV.js} +1 -1
- package/dist/markdown-DA2cRtlr.d.ts +22 -0
- package/dist/method-CE08mUME.js +115 -0
- package/dist/{navigation-Cg69h_9U.d.ts → navigation-BfAVGPgw.d.ts} +3 -3
- package/dist/navigation-CjBnMcop.d.ts +29 -0
- package/dist/overview-DeZSiqFa.d.ts +39 -0
- package/dist/overview-S2hUqPXA.js +139 -0
- package/dist/primitives-BIWfwN5L.js +258 -0
- package/dist/primitives-CbqXZ-5f.d.ts +97 -0
- package/dist/printer-DBw4S_Jn.d.ts +13 -0
- package/dist/printer-DVZVkqAr.d.ts +13 -0
- package/dist/printer-bNxiG6UB.js +74 -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-BGBmkDBL.js → routing-Wbb7YECB.js} +1 -1
- package/dist/routing.d.ts +1 -1
- package/dist/routing.js +1 -1
- package/dist/ruby-CSvGbSLe.js +387 -0
- package/dist/{sdk-Ck0IERc7.d.ts → sdk-BOwYR0k6.d.ts} +1 -1
- package/dist/sdk-CSCbbn3O.js +336 -0
- package/dist/sdk-CdhDsvo3.d.ts +118 -0
- package/dist/sidebar-CWyvCrJ0.js +81 -0
- package/dist/snippets-BQLXEIf6.js +161 -0
- package/dist/snippets-CbVFNmfq.d.ts +51 -0
- package/dist/{snippets-XTXit9Ya.d.ts → snippets-Wjo2dJNw.d.ts} +1 -1
- package/dist/spec.d.ts +3 -3
- package/dist/spec.js +2 -2
- package/dist/style.d.ts +1 -1
- package/dist/style.js +1 -1
- package/dist/styles/resets.css +2 -1
- package/dist/styles.css +1099 -1
- package/dist/typescript-DXG9psK3.js +449 -0
- package/dist/{use-components-BAHidYIO.js → use-components-RWQbviGq.js} +1 -1
- package/dist/{utils-CJElSUwc.d.ts → utils-CTGH5e8c.d.ts} +2 -2
- package/dist/utils-DNKOwa7D.d.ts +21 -0
- package/dist/{utils-0z34vxY4.js → utils-D_1AWSRX.js} +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -2
- package/package.json +6 -20
- package/dist/contexts/search.d.ts +0 -4
- package/dist/contexts/search.js +0 -15
- package/dist/contexts-D3ClFTt3.js +0 -4117
- package/dist/pagefind-BHm6c3fb.js +0 -15
- package/dist/search/index.d.ts +0 -26
- package/dist/search/index.js +0 -334
- package/dist/search/mcp.d.ts +0 -13
- package/dist/search/mcp.js +0 -45
- package/dist/search/providers/algolia.d.ts +0 -25
- package/dist/search/providers/algolia.js +0 -15
- package/dist/search/providers/fuse.d.ts +0 -18
- package/dist/search/providers/fuse.js +0 -30
- package/dist/search/providers/pagefind.d.ts +0 -7
- package/dist/search/providers/pagefind.js +0 -3
- package/dist/search/providers/walker.d.ts +0 -9
- package/dist/search/providers/walker.js +0 -34
- package/dist/search/types.d.ts +0 -3
- package/dist/search/types.js +0 -3
- package/dist/search-B9SJyFXg.d.ts +0 -21
- package/dist/types-D7Ipu1J2.d.ts +0 -91
- package/dist/types-mRzd9aqe.js +0 -35
- /package/dist/{breadcrumbs-Bg3nNgu9.d.ts → breadcrumbs-DEyC9k79.d.ts} +0 -0
- /package/dist/{chunk-BWfJHHBp.js → chunk-DRcLgZ1e.js} +0 -0
- /package/dist/{docs-DGpIHBGY.d.ts → docs-B8-nCRaa.d.ts} +0 -0
- /package/dist/{docs-CNvEp0VL.js → docs-CXqi26jB.js} +0 -0
- /package/dist/{icons-DzBceOQw.js → icons-Ckod9aod.js} +0 -0
- /package/dist/{markdown-COcowhve.d.ts → markdown-C8o8WrwG.d.ts} +0 -0
- /package/dist/{md-D5AxFoS4.js → md-oM2tUaCA.js} +0 -0
- /package/dist/{method-DI8ARQ3m.d.ts → method-B6eAtYl2.d.ts} +0 -0
- /package/dist/{navigation-bydkHNUW.js → navigation-C5TN0SgC.js} +0 -0
- /package/dist/{overview-Bv43Hf_w.d.ts → overview-CswoJHww.d.ts} +0 -0
- /package/dist/{primitives-Br-H_CYo.d.ts → primitives-Caj5rKBc.d.ts} +0 -0
- /package/dist/{properties-RPXKwEeY.d.ts → properties-BkUlpvU4.d.ts} +0 -0
- /package/dist/{routing-nN1nc0jx.d.ts → routing-Dhmv52Fd.d.ts} +0 -0
- /package/dist/{sidebar-b3y7VIbU.d.ts → sidebar-BXz93vSy.d.ts} +0 -0
- /package/dist/{style-D8hwSwrv.d.ts → style-D7RO5ymE.d.ts} +0 -0
- /package/dist/{style-0miv2y38.js → style-gnVEeXFj.js} +0 -0
- /package/dist/{utils-CiZXDoFR.js → utils-CqnL9Fc3.js} +0 -0
- /package/dist/{utils-BcWczffA.d.ts → utils-d8paVwKN.d.ts} +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { a as useLanguage, s as useSettings } from "./docs-CXqi26jB.js";
|
|
2
|
+
import { t as useComponents } from "./use-components-RWQbviGq.js";
|
|
3
|
+
import { t as style_default } from "./style-gnVEeXFj.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ArrowDownWideNarrowIcon, ArrowUpNarrowWideIcon } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/properties.tsx
|
|
8
|
+
function PropertyToggle({ target }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
10
|
+
className: style_default.ExpandToggle,
|
|
11
|
+
"data-stldocs-property-toggle-expanded": "false",
|
|
12
|
+
"data-stldocs-property-toggle-target": target,
|
|
13
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
14
|
+
className: style_default.ExpandToggleContent,
|
|
15
|
+
children: ["Expand ", /* @__PURE__ */ jsx(ArrowDownWideNarrowIcon, {
|
|
16
|
+
className: style_default.Icon,
|
|
17
|
+
size: 16
|
|
18
|
+
})]
|
|
19
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
20
|
+
className: style_default.ExpandToggleContent,
|
|
21
|
+
children: ["Collapse ", /* @__PURE__ */ jsx(ArrowUpNarrowWideIcon, {
|
|
22
|
+
className: style_default.Icon,
|
|
23
|
+
size: 16
|
|
24
|
+
})]
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function PropertyDescription({ description }) {
|
|
29
|
+
const { Markdown } = useComponents();
|
|
30
|
+
if (description) return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: style_default.PropertyDescription,
|
|
32
|
+
children: /* @__PURE__ */ jsx(Markdown, { content: description })
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function PropertyTitle({ title }) {
|
|
36
|
+
const { Markdown } = useComponents();
|
|
37
|
+
if (title) return /* @__PURE__ */ jsx("div", {
|
|
38
|
+
className: style_default.PropertyTitle,
|
|
39
|
+
children: /* @__PURE__ */ jsx(Markdown, { content: title })
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function Property({ id, name, typeName, badges, type, declaration, description, title, deprecated, expand, additional, constraints, children }) {
|
|
43
|
+
const Docs = useComponents();
|
|
44
|
+
const language = useLanguage();
|
|
45
|
+
const properties = useSettings()?.properties;
|
|
46
|
+
const { collapseDescription, showTitle } = properties ?? {};
|
|
47
|
+
const types = properties?.types;
|
|
48
|
+
const textContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
typeof deprecated === "string" && /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: style_default.PropertyDeprecatedMessage,
|
|
51
|
+
children: deprecated
|
|
52
|
+
}),
|
|
53
|
+
description && /* @__PURE__ */ jsx(Docs.PropertyDescription, { description }),
|
|
54
|
+
constraints && /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: style_default.PropertyContent,
|
|
56
|
+
children: constraints
|
|
57
|
+
})
|
|
58
|
+
] });
|
|
59
|
+
const rich = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
+
/* @__PURE__ */ jsxs("div", {
|
|
61
|
+
className: style_default.PropertyDeclaration,
|
|
62
|
+
children: [
|
|
63
|
+
deprecated && /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: style_default.PropertyDeprecated,
|
|
65
|
+
children: "Deprecated"
|
|
66
|
+
}),
|
|
67
|
+
declaration,
|
|
68
|
+
badges && /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: style_default.PropertyBadges,
|
|
70
|
+
children: badges
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}),
|
|
74
|
+
title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
|
|
75
|
+
collapseDescription === false ? textContent : null
|
|
76
|
+
] });
|
|
77
|
+
const simple = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
+
name && /* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: style_default.PropertyHeader,
|
|
80
|
+
children: [
|
|
81
|
+
deprecated && /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: style_default.PropertyDeprecated,
|
|
83
|
+
children: "Deprecated"
|
|
84
|
+
}),
|
|
85
|
+
name && /* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: style_default.PropertyName,
|
|
87
|
+
children: name
|
|
88
|
+
}),
|
|
89
|
+
typeName && /* @__PURE__ */ jsx("span", {
|
|
90
|
+
className: style_default.PropertyTypeName,
|
|
91
|
+
children: typeName
|
|
92
|
+
}),
|
|
93
|
+
badges && /* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: style_default.PropertyBadges,
|
|
95
|
+
children: badges
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
}),
|
|
99
|
+
type && /* @__PURE__ */ jsx("div", {
|
|
100
|
+
className: style_default.PropertyType,
|
|
101
|
+
children: type
|
|
102
|
+
}),
|
|
103
|
+
title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
|
|
104
|
+
collapseDescription === false ? textContent : null
|
|
105
|
+
] });
|
|
106
|
+
const content = /* @__PURE__ */ jsx("div", {
|
|
107
|
+
id,
|
|
108
|
+
className: style_default.PropertyInfo,
|
|
109
|
+
children: types === "simple" ? simple : rich
|
|
110
|
+
});
|
|
111
|
+
return /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: style_default.Property,
|
|
113
|
+
"data-stldocs-language": language,
|
|
114
|
+
children: children || collapseDescription !== false && description ? /* @__PURE__ */ jsxs(Docs.Expander, {
|
|
115
|
+
summary: content,
|
|
116
|
+
muted: !children,
|
|
117
|
+
open: expand,
|
|
118
|
+
children: [
|
|
119
|
+
collapseDescription !== false ? textContent : null,
|
|
120
|
+
additional,
|
|
121
|
+
children && /* @__PURE__ */ jsx("div", {
|
|
122
|
+
className: style_default.PropertyChildren,
|
|
123
|
+
children
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
}) : content
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
export { PropertyToggle as i, PropertyDescription as n, PropertyTitle as r, Property as t };
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { t as __export } from "./chunk-DRcLgZ1e.js";
|
|
2
|
+
import { n as useLanguageComponents } from "./contexts-p3rRZDlM.js";
|
|
3
|
+
import { t as useComponents } from "./use-components-RWQbviGq.js";
|
|
4
|
+
import { t as style_default } from "./style-gnVEeXFj.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/python.tsx
|
|
9
|
+
var python_exports = /* @__PURE__ */ __export({
|
|
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 showFullType(type) {
|
|
22
|
+
if (type.kind !== "PythonTypeReference") return false;
|
|
23
|
+
return type.typeName === "Optional" ? showFullType(type.typeParameters[0]) : type.typeParameters.length > 0;
|
|
24
|
+
}
|
|
25
|
+
function TypeName({ type }) {
|
|
26
|
+
const Lang = useLanguageComponents();
|
|
27
|
+
if (type.kind === "PythonTypeReference") switch (type.typeName) {
|
|
28
|
+
case "Optional": return /* @__PURE__ */ jsx(Lang.TypeName, { type: type.typeParameters[0] });
|
|
29
|
+
case "List":
|
|
30
|
+
case "Iterable":
|
|
31
|
+
case "Literal":
|
|
32
|
+
case "Union": return type.typeName.toLowerCase();
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ jsx(Lang.Type, { type });
|
|
35
|
+
}
|
|
36
|
+
function Type({ type }) {
|
|
37
|
+
const Lang = useLanguageComponents();
|
|
38
|
+
const { Join, SDKReference } = useComponents();
|
|
39
|
+
switch (type.kind) {
|
|
40
|
+
case "PythonTypeAny":
|
|
41
|
+
case "PythonTypeUnknown":
|
|
42
|
+
case "PythonTypeInt":
|
|
43
|
+
case "PythonTypeFloat":
|
|
44
|
+
case "PythonTypeBool": return /* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: style_default.Type,
|
|
46
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: style_default.TypeKeyword,
|
|
48
|
+
children: type.kind.slice(10).toLowerCase()
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
case "PythonTypeString": return /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: style_default.Type,
|
|
53
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
54
|
+
className: style_default.TypeString,
|
|
55
|
+
children: "str"
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
case "PythonTypeLiteral": return /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: style_default.Type,
|
|
60
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: constStyle[typeof type.literal.value],
|
|
62
|
+
children: JSON.stringify(type.literal.value)
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
case "PythonTypeArray": return /* @__PURE__ */ jsxs("span", {
|
|
66
|
+
className: style_default.Type,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: style_default.TypeArray,
|
|
70
|
+
children: "Array<"
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
|
|
73
|
+
/* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: style_default.TypeArray,
|
|
75
|
+
children: ">"
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
case "PythonTypeClass": return /* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: style_default.Type,
|
|
81
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: style_default.TypeKeyword,
|
|
83
|
+
children: "class"
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
case "PythonTypeMap": return /* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: style_default.Type,
|
|
88
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: style_default.TypeKeyword,
|
|
90
|
+
children: "Dict"
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
case "PythonTypeReference": {
|
|
94
|
+
const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
|
|
95
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
96
|
+
className: style_default.Type,
|
|
97
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
98
|
+
className: type.typeName === "Optional" ? style_default.TypeArray : "",
|
|
99
|
+
children: /* @__PURE__ */ jsx(SDKReference, {
|
|
100
|
+
stainlessPath: type.$ref,
|
|
101
|
+
children: type.typeName
|
|
102
|
+
})
|
|
103
|
+
}), params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
104
|
+
/* @__PURE__ */ jsx("span", {
|
|
105
|
+
className: style_default.TypeBracket,
|
|
106
|
+
children: "["
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ jsx(Join, {
|
|
109
|
+
items: params,
|
|
110
|
+
limit: 3,
|
|
111
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
112
|
+
className: style_default.TextOperator,
|
|
113
|
+
children: ", "
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ jsx("span", {
|
|
117
|
+
className: style_default.TypeBracket,
|
|
118
|
+
children: "]"
|
|
119
|
+
})
|
|
120
|
+
] })]
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function MethodSignature({ decl }) {
|
|
126
|
+
const Lang = useLanguageComponents();
|
|
127
|
+
const { Join, Tooltip } = useComponents();
|
|
128
|
+
const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsx(Tooltip, {
|
|
129
|
+
content: /* @__PURE__ */ jsx(Lang.Type, { type: param.type }),
|
|
130
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
131
|
+
className: style_default.TextIdentifier,
|
|
132
|
+
children: param.ident
|
|
133
|
+
})
|
|
134
|
+
}) }, i));
|
|
135
|
+
return /* @__PURE__ */ jsx("div", {
|
|
136
|
+
className: style_default.MethodSignature,
|
|
137
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
138
|
+
className: style_default.SignatureTitle,
|
|
139
|
+
children: [
|
|
140
|
+
decl.async && /* @__PURE__ */ jsx("span", {
|
|
141
|
+
className: style_default.TextKeyword,
|
|
142
|
+
children: "async "
|
|
143
|
+
}),
|
|
144
|
+
decl.qualified && /* @__PURE__ */ jsx("span", {
|
|
145
|
+
className: style_default.SignatureQualified,
|
|
146
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
147
|
+
className: style_default.TextIdentifier,
|
|
148
|
+
children: decl.qualified?.slice(0, -decl.ident.length)
|
|
149
|
+
})
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsx("span", {
|
|
152
|
+
className: style_default.SignatureName,
|
|
153
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
154
|
+
className: style_default.TextIdentifier,
|
|
155
|
+
children: decl.ident
|
|
156
|
+
})
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ jsxs("span", {
|
|
159
|
+
className: style_default.MethodSignature,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ jsx("span", {
|
|
162
|
+
className: style_default.SignatureParen,
|
|
163
|
+
children: "("
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsx("span", {
|
|
166
|
+
className: style_default.SignatureParams,
|
|
167
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
168
|
+
items: params,
|
|
169
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
170
|
+
className: style_default.TextOperator,
|
|
171
|
+
children: ", "
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ jsxs("span", {
|
|
176
|
+
className: style_default.SignatureParen,
|
|
177
|
+
children: [")", " "]
|
|
178
|
+
}),
|
|
179
|
+
decl.returns && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
180
|
+
className: style_default.TextOperator,
|
|
181
|
+
children: " -> "
|
|
182
|
+
}), /* @__PURE__ */ jsx(Lang.Type, { type: decl.returns })] })
|
|
183
|
+
]
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function Property({ decl, children }) {
|
|
190
|
+
const Lang = useLanguageComponents();
|
|
191
|
+
if (!decl) return;
|
|
192
|
+
switch (decl.kind) {
|
|
193
|
+
case "PythonDeclProperty": return children({
|
|
194
|
+
name: decl.ident,
|
|
195
|
+
typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
|
|
196
|
+
type: showFullType(decl.type) && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
197
|
+
});
|
|
198
|
+
case "PythonDeclClass": return children({
|
|
199
|
+
name: decl.ident,
|
|
200
|
+
typeName: "class"
|
|
201
|
+
});
|
|
202
|
+
case "PythonDeclType": return children({
|
|
203
|
+
name: decl.ident,
|
|
204
|
+
typeName: "type",
|
|
205
|
+
type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
206
|
+
});
|
|
207
|
+
case "PythonDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function Declaration({ decl }) {
|
|
211
|
+
const Lang = useLanguageComponents();
|
|
212
|
+
if (!decl) return;
|
|
213
|
+
switch (decl.kind) {
|
|
214
|
+
case "PythonDeclProperty": {
|
|
215
|
+
const nullable = decl.type.kind === "PythonTypeReference" && decl.type.typeName === "Optional" && (decl.type.typeParameters ?? []).length > 0;
|
|
216
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
217
|
+
/* @__PURE__ */ jsx("span", {
|
|
218
|
+
className: style_default.TypePropertyName,
|
|
219
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
220
|
+
className: style_default.TextIdentifier,
|
|
221
|
+
children: decl.ident
|
|
222
|
+
})
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx("span", {
|
|
225
|
+
className: style_default.TextPunctuation,
|
|
226
|
+
children: ": "
|
|
227
|
+
}),
|
|
228
|
+
decl.optional && !nullable ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
229
|
+
/* @__PURE__ */ jsx("span", {
|
|
230
|
+
className: style_default.TypePlain,
|
|
231
|
+
children: "Optional"
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ jsx("span", {
|
|
234
|
+
className: style_default.TypeBracket,
|
|
235
|
+
children: "["
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type }),
|
|
238
|
+
/* @__PURE__ */ jsx("span", {
|
|
239
|
+
className: style_default.TypeBrace,
|
|
240
|
+
children: "]"
|
|
241
|
+
})
|
|
242
|
+
] }) : /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
243
|
+
] });
|
|
244
|
+
}
|
|
245
|
+
case "PythonDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
246
|
+
/* @__PURE__ */ jsx("span", {
|
|
247
|
+
className: style_default.TextKeyword,
|
|
248
|
+
children: "class "
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ jsx("span", {
|
|
251
|
+
className: style_default.TextIdentifier,
|
|
252
|
+
children: decl.ident
|
|
253
|
+
}),
|
|
254
|
+
/* @__PURE__ */ jsx("span", {
|
|
255
|
+
className: style_default.TextPunctuation,
|
|
256
|
+
children: ": "
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ jsx("span", {
|
|
259
|
+
className: `${style_default.TypePreviewContent} ${style_default.TextPunctuation}`,
|
|
260
|
+
children: "…"
|
|
261
|
+
})
|
|
262
|
+
] });
|
|
263
|
+
case "PythonDeclType": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
264
|
+
/* @__PURE__ */ jsx("span", {
|
|
265
|
+
className: style_default.TextIdentifier,
|
|
266
|
+
children: decl.ident
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ jsx("span", {
|
|
269
|
+
className: style_default.TextOperator,
|
|
270
|
+
children: " = "
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
273
|
+
] });
|
|
274
|
+
case "PythonDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
//#endregion
|
|
279
|
+
export { TypeName as a, Type as i, MethodSignature as n, python_exports as o, Property as r, Declaration as t };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as SDKJSON from "@stainless/sdk-json";
|
|
2
|
+
|
|
3
|
+
//#region src/routing.d.ts
|
|
4
|
+
declare namespace routing_d_exports {
|
|
5
|
+
export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, 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"];
|
|
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";
|
|
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: SDKJSON.Method | SDKJSON.Resource | SDKJSON.Model;
|
|
29
|
+
path: string[];
|
|
30
|
+
};
|
|
31
|
+
declare function walkTree(spec: SDKJSON.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: SDKJSON.Spec;
|
|
45
|
+
languages?: DocsLanguage[];
|
|
46
|
+
excludeLanguages?: DocsLanguage[];
|
|
47
|
+
}): RouteEntry[];
|
|
48
|
+
type ResourceOrMethod = SDKJSON.Resource | SDKJSON.Method;
|
|
49
|
+
declare function findNavigationPath(items: ResourceOrMethod[], target: string): string[] | undefined;
|
|
50
|
+
declare function expandToElement(el: HTMLElement | null): void;
|
|
51
|
+
declare function scrollToPath(stainlessPath: string): void;
|
|
52
|
+
declare function updateHistory(basePath: string, language: DocsLanguage, stainlessPath: string): void;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { routing_d_exports as _, RouteEntry as a, updateHistory as b, expandToElement as c, generateRouteList as d, getLanguageSnippet as f, parseStainlessPath as g, parseRoute as h, ParsedStainlessPath as i, findNavigationPath as l, isSupportedLanguage as m, LanguageNames as n, SpecTreeEntry as o, getResource as p, Languages as r, SupportedLanguageSyntaxes as s, DocsLanguage as t, generateRoute as u, scrollToPath as v, walkTree as x, trimStainlessPath as y };
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RouteEntry, b as updateHistory, c as expandToElement, d as generateRouteList, f as getLanguageSnippet, g as parseStainlessPath, h as parseRoute, i as ParsedStainlessPath, l as findNavigationPath, m as isSupportedLanguage, n as LanguageNames, o as SpecTreeEntry, p as getResource, r as Languages, s as SupportedLanguageSyntaxes, t as DocsLanguage, u as generateRoute, v as scrollToPath, x as walkTree, y as trimStainlessPath } from "./routing-
|
|
1
|
+
import { a as RouteEntry, b as updateHistory, c as expandToElement, d as generateRouteList, f as getLanguageSnippet, g as parseStainlessPath, h as parseRoute, i as ParsedStainlessPath, l as findNavigationPath, m as isSupportedLanguage, n as LanguageNames, o as SpecTreeEntry, p as getResource, r as Languages, s as SupportedLanguageSyntaxes, t as DocsLanguage, u as generateRoute, v as scrollToPath, x as walkTree, y as trimStainlessPath } from "./routing-CMqh1cTZ.js";
|
|
2
2
|
export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
|
package/dist/routing.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as walkTree, a as findNavigationPath, c as getLanguageSnippet, d as parseRoute, f as parseStainlessPath, g as updateHistory, h as trimStainlessPath, i as expandToElement, l as getResource, m as scrollToPath, n as Languages, o as generateRoute, r as SupportedLanguageSyntaxes, s as generateRouteList, t as LanguageNames, u as isSupportedLanguage } from "./routing-
|
|
1
|
+
import { _ as walkTree, a as findNavigationPath, c as getLanguageSnippet, d as parseRoute, f as parseStainlessPath, g as updateHistory, h as trimStainlessPath, i as expandToElement, l as getResource, m as scrollToPath, n as Languages, o as generateRoute, r as SupportedLanguageSyntaxes, s as generateRouteList, t as LanguageNames, u as isSupportedLanguage } from "./routing-Wbb7YECB.js";
|
|
2
2
|
|
|
3
3
|
export { LanguageNames, Languages, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
|