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