@apify/docusaurus-plugin-typedoc-api 4.4.12 → 5.0.0
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/README.md +38 -296
- package/lib/components/AnchorLink.d.ts +5 -0
- package/lib/components/AnchorLink.d.ts.map +1 -0
- package/lib/components/AnchorLink.js +7 -26
- package/lib/components/AnchorLink.js.map +1 -1
- package/lib/components/ApiChangelog.d.ts +6 -0
- package/lib/components/ApiChangelog.d.ts.map +1 -0
- package/lib/components/ApiChangelog.js +7 -24
- package/lib/components/ApiChangelog.js.map +1 -1
- package/lib/components/ApiDataContext.d.ts +6 -0
- package/lib/components/ApiDataContext.d.ts.map +1 -0
- package/lib/components/ApiDataContext.js +12 -15
- package/lib/components/ApiDataContext.js.map +1 -1
- package/lib/components/ApiIndex.d.ts +14 -0
- package/lib/components/ApiIndex.d.ts.map +1 -0
- package/lib/components/ApiIndex.js +33 -93
- package/lib/components/ApiIndex.js.map +1 -1
- package/lib/components/ApiItem.d.ts +6 -0
- package/lib/components/ApiItem.d.ts.map +1 -0
- package/lib/components/ApiItem.js +131 -191
- package/lib/components/ApiItem.js.map +1 -1
- package/lib/components/ApiItemLayout.d.ts +14 -0
- package/lib/components/ApiItemLayout.d.ts.map +1 -0
- package/lib/components/ApiItemLayout.js +21 -97
- package/lib/components/ApiItemLayout.js.map +1 -1
- package/lib/components/ApiOptionsContext.d.ts +5 -0
- package/lib/components/ApiOptionsContext.d.ts.map +1 -0
- package/lib/components/ApiOptionsContext.js +5 -9
- package/lib/components/ApiOptionsContext.js.map +1 -1
- package/lib/components/ApiOptionsLayout.d.ts +4 -0
- package/lib/components/ApiOptionsLayout.d.ts.map +1 -0
- package/lib/components/ApiOptionsLayout.js +10 -34
- package/lib/components/ApiOptionsLayout.js.map +1 -1
- package/lib/components/ApiPage.d.ts +11 -0
- package/lib/components/ApiPage.d.ts.map +1 -0
- package/lib/components/ApiPage.js +50 -63
- package/lib/components/ApiPage.js.map +1 -1
- package/lib/components/Breadcrumb.d.ts +7 -0
- package/lib/components/Breadcrumb.d.ts.map +1 -0
- package/lib/components/Breadcrumb.js +17 -49
- package/lib/components/Breadcrumb.js.map +1 -1
- package/lib/components/Comment.d.ts +10 -0
- package/lib/components/Comment.d.ts.map +1 -0
- package/lib/components/Comment.js +33 -60
- package/lib/components/Comment.js.map +1 -1
- package/lib/components/CommentBadges.d.ts +9 -0
- package/lib/components/CommentBadges.d.ts.map +1 -0
- package/lib/components/CommentBadges.js +16 -28
- package/lib/components/CommentBadges.js.map +1 -1
- package/lib/components/DefaultValue.d.ts +10 -0
- package/lib/components/DefaultValue.d.ts.map +1 -0
- package/lib/components/DefaultValue.js +25 -55
- package/lib/components/DefaultValue.js.map +1 -1
- package/lib/components/Flags.d.ts +6 -0
- package/lib/components/Flags.d.ts.map +1 -0
- package/lib/components/Flags.js +11 -22
- package/lib/components/Flags.js.map +1 -1
- package/lib/components/Footer.d.ts +2 -0
- package/lib/components/Footer.d.ts.map +1 -0
- package/lib/components/Footer.js +4 -16
- package/lib/components/Footer.js.map +1 -1
- package/lib/components/Hierarchy.d.ts +6 -0
- package/lib/components/Hierarchy.d.ts.map +1 -0
- package/lib/components/Hierarchy.js +5 -25
- package/lib/components/Hierarchy.js.map +1 -1
- package/lib/components/Icon.d.ts +6 -0
- package/lib/components/Icon.d.ts.map +1 -0
- package/lib/components/Icon.js +10 -21
- package/lib/components/Icon.js.map +1 -1
- package/lib/components/Index.d.ts +9 -0
- package/lib/components/Index.d.ts.map +1 -0
- package/lib/components/Index.js +30 -113
- package/lib/components/Index.js.map +1 -1
- package/lib/components/Markdown.d.ts +5 -0
- package/lib/components/Markdown.d.ts.map +1 -0
- package/lib/components/Markdown.js +138 -202
- package/lib/components/Markdown.js.map +1 -1
- package/lib/components/Member.d.ts +5 -0
- package/lib/components/Member.d.ts.map +1 -0
- package/lib/components/Member.js +40 -69
- package/lib/components/Member.js.map +1 -1
- package/lib/components/MemberDeclaration.d.ts +5 -0
- package/lib/components/MemberDeclaration.d.ts.map +1 -0
- package/lib/components/MemberDeclaration.js +20 -71
- package/lib/components/MemberDeclaration.js.map +1 -1
- package/lib/components/MemberGetterSetter.d.ts +8 -0
- package/lib/components/MemberGetterSetter.d.ts.map +1 -0
- package/lib/components/MemberGetterSetter.js +13 -68
- package/lib/components/MemberGetterSetter.js.map +1 -1
- package/lib/components/MemberReference.d.ts +6 -0
- package/lib/components/MemberReference.d.ts.map +1 -0
- package/lib/components/MemberReference.js +18 -48
- package/lib/components/MemberReference.js.map +1 -1
- package/lib/components/MemberSignatureBody.d.ts +9 -0
- package/lib/components/MemberSignatureBody.d.ts.map +1 -0
- package/lib/components/MemberSignatureBody.js +85 -182
- package/lib/components/MemberSignatureBody.js.map +1 -1
- package/lib/components/MemberSignatureTitle.d.ts +11 -0
- package/lib/components/MemberSignatureTitle.d.ts.map +1 -0
- package/lib/components/MemberSignatureTitle.js +27 -81
- package/lib/components/MemberSignatureTitle.js.map +1 -1
- package/lib/components/MemberSignatures.d.ts +7 -0
- package/lib/components/MemberSignatures.d.ts.map +1 -0
- package/lib/components/MemberSignatures.js +18 -66
- package/lib/components/MemberSignatures.js.map +1 -1
- package/lib/components/MemberSources.d.ts +7 -0
- package/lib/components/MemberSources.d.ts.map +1 -0
- package/lib/components/MemberSources.js +10 -34
- package/lib/components/MemberSources.js.map +1 -1
- package/lib/components/Members.d.ts +6 -0
- package/lib/components/Members.d.ts.map +1 -0
- package/lib/components/Members.js +29 -49
- package/lib/components/Members.js.map +1 -1
- package/lib/components/MembersGroup.d.ts +6 -0
- package/lib/components/MembersGroup.d.ts.map +1 -0
- package/lib/components/MembersGroup.js +16 -40
- package/lib/components/MembersGroup.js.map +1 -1
- package/lib/components/Parameter.d.ts +6 -0
- package/lib/components/Parameter.d.ts.map +1 -0
- package/lib/components/Parameter.js +35 -171
- package/lib/components/Parameter.js.map +1 -1
- package/lib/components/Reflection.d.ts +6 -0
- package/lib/components/Reflection.d.ts.map +1 -0
- package/lib/components/Reflection.js +29 -132
- package/lib/components/Reflection.js.map +1 -1
- package/lib/components/SourceLink.d.ts +10 -0
- package/lib/components/SourceLink.d.ts.map +1 -0
- package/lib/components/SourceLink.js +16 -36
- package/lib/components/SourceLink.js.map +1 -1
- package/lib/components/Type.d.ts +12 -0
- package/lib/components/Type.d.ts.map +1 -0
- package/lib/components/Type.js +142 -464
- package/lib/components/Type.js.map +1 -1
- package/lib/components/TypeAndParent.d.ts +6 -0
- package/lib/components/TypeAndParent.d.ts.map +1 -0
- package/lib/components/TypeAndParent.js +11 -27
- package/lib/components/TypeAndParent.js.map +1 -1
- package/lib/components/TypeParameters.d.ts +6 -0
- package/lib/components/TypeParameters.d.ts.map +1 -0
- package/lib/components/TypeParameters.js +10 -38
- package/lib/components/TypeParameters.js.map +1 -1
- package/lib/components/TypeParametersGeneric.d.ts +6 -0
- package/lib/components/TypeParametersGeneric.d.ts.map +1 -0
- package/lib/components/TypeParametersGeneric.js +8 -27
- package/lib/components/TypeParametersGeneric.js.map +1 -1
- package/lib/components/VersionBanner.d.ts +2 -0
- package/lib/components/VersionBanner.d.ts.map +1 -0
- package/lib/components/VersionBanner.js +18 -49
- package/lib/components/VersionBanner.js.map +1 -1
- package/lib/hooks/useBreadcrumbs.d.ts +2 -0
- package/lib/hooks/useBreadcrumbs.d.ts.map +1 -0
- package/lib/hooks/useBreadcrumbs.js +5 -8
- package/lib/hooks/useBreadcrumbs.js.map +1 -1
- package/lib/hooks/useGitRefName.d.ts +2 -0
- package/lib/hooks/useGitRefName.d.ts.map +1 -0
- package/lib/hooks/useGitRefName.js +5 -8
- package/lib/hooks/useGitRefName.js.map +1 -1
- package/lib/hooks/useMinimalLayout.d.ts +2 -0
- package/lib/hooks/useMinimalLayout.d.ts.map +1 -0
- package/lib/hooks/useMinimalLayout.js +5 -8
- package/lib/hooks/useMinimalLayout.js.map +1 -1
- package/lib/hooks/useReflection.d.ts +4 -0
- package/lib/hooks/useReflection.d.ts.map +1 -0
- package/lib/hooks/useReflection.js +15 -21
- package/lib/hooks/useReflection.js.map +1 -1
- package/lib/hooks/useReflectionMap.d.ts +3 -0
- package/lib/hooks/useReflectionMap.d.ts.map +1 -0
- package/lib/hooks/useReflectionMap.js +5 -8
- package/lib/hooks/useReflectionMap.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +349 -361
- package/lib/index.js.map +1 -1
- package/lib/markdownLoader.d.ts +6 -0
- package/lib/markdownLoader.d.ts.map +1 -0
- package/lib/markdownLoader.js +6 -10
- package/lib/markdownLoader.js.map +1 -1
- package/lib/plugin/data.d.ts +21 -0
- package/lib/plugin/data.d.ts.map +1 -0
- package/lib/plugin/data.js +391 -429
- package/lib/plugin/data.js.map +1 -1
- package/lib/plugin/python/consts.d.ts +35 -0
- package/lib/plugin/python/consts.d.ts.map +1 -0
- package/lib/plugin/python/consts.js +44 -44
- package/lib/plugin/python/consts.js.map +1 -1
- package/lib/plugin/python/index.d.ts +12 -0
- package/lib/plugin/python/index.d.ts.map +1 -0
- package/lib/plugin/python/index.js +25 -36
- package/lib/plugin/python/index.js.map +1 -1
- package/lib/plugin/python/inheritance.d.ts +42 -0
- package/lib/plugin/python/inheritance.d.ts.map +1 -0
- package/lib/plugin/python/inheritance.js +148 -153
- package/lib/plugin/python/inheritance.js.map +1 -1
- package/lib/plugin/python/packageVersions.d.ts +7 -0
- package/lib/plugin/python/packageVersions.d.ts.map +1 -0
- package/lib/plugin/python/packageVersions.js +30 -38
- package/lib/plugin/python/packageVersions.js.map +1 -1
- package/lib/plugin/python/transformation.d.ts +80 -0
- package/lib/plugin/python/transformation.d.ts.map +1 -0
- package/lib/plugin/python/transformation.js +350 -392
- package/lib/plugin/python/transformation.js.map +1 -1
- package/lib/plugin/python/type-parsing/index.d.ts +34 -0
- package/lib/plugin/python/type-parsing/index.d.ts.map +1 -0
- package/lib/plugin/python/type-parsing/index.js +78 -85
- package/lib/plugin/python/type-parsing/index.js.map +1 -1
- package/lib/plugin/python/types.d.ts +112 -0
- package/lib/plugin/python/types.d.ts.map +1 -0
- package/lib/plugin/python/types.js +2 -2
- package/lib/plugin/python/types.js.map +1 -1
- package/lib/plugin/python/utils.d.ts +40 -0
- package/lib/plugin/python/utils.d.ts.map +1 -0
- package/lib/plugin/python/utils.js +74 -73
- package/lib/plugin/python/utils.js.map +1 -1
- package/lib/plugin/sidebar.d.ts +6 -0
- package/lib/plugin/sidebar.d.ts.map +1 -0
- package/lib/plugin/sidebar.js +94 -96
- package/lib/plugin/sidebar.js.map +1 -1
- package/lib/plugin/structure/0.23.d.ts +3 -0
- package/lib/plugin/structure/0.23.d.ts.map +1 -0
- package/lib/plugin/structure/0.23.js +33 -41
- package/lib/plugin/structure/0.23.js.map +1 -1
- package/lib/plugin/url.d.ts +6 -0
- package/lib/plugin/url.d.ts.map +1 -0
- package/lib/plugin/url.js +36 -46
- package/lib/plugin/url.js.map +1 -1
- package/lib/plugin/version.d.ts +5 -0
- package/lib/plugin/version.d.ts.map +1 -0
- package/lib/plugin/version.js +73 -78
- package/lib/plugin/version.js.map +1 -1
- package/lib/types.d.ts +142 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -2
- package/lib/types.js.map +1 -1
- package/lib/utils/helpers.d.ts +2 -0
- package/lib/utils/helpers.d.ts.map +1 -0
- package/lib/utils/helpers.js +5 -7
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/hierarchy.d.ts +8 -0
- package/lib/utils/hierarchy.d.ts.map +1 -0
- package/lib/utils/hierarchy.js +31 -33
- package/lib/utils/hierarchy.js.map +1 -1
- package/lib/utils/icons.d.ts +5 -0
- package/lib/utils/icons.d.ts.map +1 -0
- package/lib/utils/icons.js +82 -114
- package/lib/utils/icons.js.map +1 -1
- package/lib/utils/links.d.ts +2 -0
- package/lib/utils/links.d.ts.map +1 -0
- package/lib/utils/links.js +24 -41
- package/lib/utils/links.js.map +1 -1
- package/lib/utils/markdown.d.ts +4 -0
- package/lib/utils/markdown.d.ts.map +1 -0
- package/lib/utils/markdown.js +45 -54
- package/lib/utils/markdown.js.map +1 -1
- package/lib/utils/reexports.d.ts +5 -0
- package/lib/utils/reexports.d.ts.map +1 -0
- package/lib/utils/reexports.js +90 -90
- package/lib/utils/reexports.js.map +1 -1
- package/lib/utils/removeScopes.d.ts +2 -0
- package/lib/utils/removeScopes.d.ts.map +1 -0
- package/lib/utils/removeScopes.js +7 -0
- package/lib/utils/removeScopes.js.map +1 -0
- package/lib/utils/visibility.d.ts +6 -0
- package/lib/utils/visibility.d.ts.map +1 -0
- package/lib/utils/visibility.js +14 -19
- package/lib/utils/visibility.js.map +1 -1
- package/package.json +24 -17
- package/src/components/ApiIndex.tsx +1 -1
- package/src/index.ts +2 -2
- package/src/plugin/data.ts +3 -3
- package/src/plugin/python/index.ts +3 -3
- package/src/plugin/python/packageVersions.ts +3 -3
- package/src/plugin/sidebar.ts +1 -1
- package/src/plugin/url.ts +1 -1
- package/src/plugin/version.ts +1 -1
- package/src/utils/links.ts +1 -12
- package/src/utils/removeScopes.ts +10 -0
- /package/{assets/styles-8ad572ec.css → lib/components/styles.css} +0 -0
package/lib/components/Type.js
CHANGED
|
@@ -1,474 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const react = require('react');
|
|
4
|
-
const Link = require('@docusaurus/Link');
|
|
5
|
-
const useGlobalData = require('@docusaurus/useGlobalData');
|
|
6
|
-
const useReflectionMap = require('../hooks/useReflectionMap.js');
|
|
7
|
-
const MemberSignatureTitle = require('./MemberSignatureTitle.js');
|
|
8
|
-
const jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
const _interopDefault = e => e && e.__esModule ? e : {
|
|
10
|
-
default: e
|
|
11
|
-
};
|
|
12
|
-
const Link__default = /*#__PURE__*/_interopDefault(Link);
|
|
13
|
-
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
2
|
/* eslint-disable react/no-array-index-key */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
// https://github.com/TypeStrong/typedoc-default-themes/blob/master/src/default/partials/type.hbs
|
|
4
|
+
import { Fragment } from 'react';
|
|
5
|
+
import Link from '@docusaurus/Link';
|
|
6
|
+
import { usePluginData } from '@docusaurus/useGlobalData';
|
|
7
|
+
import { useReflectionMap } from '../hooks/useReflectionMap';
|
|
8
|
+
import { MemberSignatureTitle } from './MemberSignatureTitle';
|
|
9
|
+
export function extractDeclarationFromType(type) {
|
|
10
|
+
if (!type) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return type === null || type === void 0 ? void 0 : type.declaration;
|
|
21
14
|
}
|
|
22
15
|
function parens(element, needsParens) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
children: [needsParens && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28
|
-
className: "tsd-signature-symbol",
|
|
29
|
-
children: "("
|
|
30
|
-
}), element, needsParens && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
31
|
-
className: "tsd-signature-symbol",
|
|
32
|
-
children: ")"
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
16
|
+
if (!needsParens) {
|
|
17
|
+
return element;
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs(_Fragment, { children: [needsParens && _jsx("span", { className: "tsd-signature-symbol", children: "(" }), element, needsParens && _jsx("span", { className: "tsd-signature-symbol", children: ")" })] }));
|
|
35
20
|
}
|
|
36
|
-
function Type({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (type.value) {
|
|
56
|
-
// eslint-disable-next-line
|
|
57
|
-
type.type = 'literal';
|
|
58
|
-
return /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
59
|
-
type: type
|
|
60
|
-
});
|
|
21
|
+
export function Type({ needsParens = false, type: base }) {
|
|
22
|
+
var _a, _b, _c, _d, _e, _f;
|
|
23
|
+
const reflections = useReflectionMap();
|
|
24
|
+
const { isPython } = usePluginData('docusaurus-plugin-typedoc-api');
|
|
25
|
+
if (!base) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
// Cast to string since `type` doesnt include all string values in the union.
|
|
29
|
+
// https://github.com/TypeStrong/typedoc/blob/master/src/lib/output/themes/default/partials/type.tsx
|
|
30
|
+
switch (String(base.type)) {
|
|
31
|
+
case 'array': {
|
|
32
|
+
const type = base;
|
|
33
|
+
// If the array provides a non-empty "value" property, it's likely the default value of the array we want to render.
|
|
34
|
+
if (type.value) {
|
|
35
|
+
// eslint-disable-next-line
|
|
36
|
+
type.type = 'literal';
|
|
37
|
+
return _jsx(Type, { type: type });
|
|
38
|
+
}
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsx(Type, { needsParens: true, type: type.elementType }), _jsx("span", { className: "tsd-signature-symbol", children: "[]" })] }));
|
|
61
40
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
needsParens: true,
|
|
65
|
-
type: type.elementType
|
|
66
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
67
|
-
className: "tsd-signature-symbol",
|
|
68
|
-
children: "[]"
|
|
69
|
-
})]
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
case 'conditional':
|
|
73
|
-
{
|
|
74
|
-
const type = base;
|
|
75
|
-
return parens( /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
76
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
77
|
-
needsParens: true,
|
|
78
|
-
type: type.checkType
|
|
79
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
80
|
-
className: "tsd-signature-symbol",
|
|
81
|
-
children: " extends "
|
|
82
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
83
|
-
type: type.extendsType
|
|
84
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
85
|
-
className: "tsd-signature-symbol",
|
|
86
|
-
children: " ? "
|
|
87
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
88
|
-
type: type.trueType
|
|
89
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
90
|
-
className: "tsd-signature-symbol",
|
|
91
|
-
children: " : "
|
|
92
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
93
|
-
type: type.falseType
|
|
94
|
-
})]
|
|
95
|
-
}), needsParens);
|
|
96
|
-
}
|
|
97
|
-
case 'indexedAccess':
|
|
98
|
-
{
|
|
99
|
-
const type = base;
|
|
100
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
101
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
102
|
-
type: type.objectType
|
|
103
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
104
|
-
className: "tsd-signature-symbol",
|
|
105
|
-
children: "["
|
|
106
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
107
|
-
type: type.indexType
|
|
108
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
109
|
-
className: "tsd-signature-symbol",
|
|
110
|
-
children: "]"
|
|
111
|
-
})]
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
case 'inferred':
|
|
115
|
-
{
|
|
116
|
-
const type = base;
|
|
117
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
118
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
119
|
-
className: "tsd-signature-symbol",
|
|
120
|
-
children: "infer "
|
|
121
|
-
}), " ", type.name]
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
case 'intersection':
|
|
125
|
-
{
|
|
126
|
-
const type = base;
|
|
127
|
-
return parens( /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
128
|
-
children: type.types.map((t, i) => /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
129
|
-
children: [i > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
130
|
-
className: "tsd-signature-symbol",
|
|
131
|
-
children: " & "
|
|
132
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
133
|
-
needsParens: true,
|
|
134
|
-
type: t
|
|
135
|
-
})]
|
|
136
|
-
}, t.type + i))
|
|
137
|
-
}), needsParens);
|
|
138
|
-
}
|
|
139
|
-
case 'intrinsic':
|
|
140
|
-
{
|
|
141
|
-
const type = base;
|
|
142
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
143
|
-
className: "tsd-signature-type",
|
|
144
|
-
children: type.name
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
case 'literal':
|
|
148
|
-
{
|
|
149
|
-
const type = base;
|
|
150
|
-
if (isPython && (type.value === null || typeof type.value === 'object' && Object.keys(type.value).length === 0)) {
|
|
151
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
152
|
-
className: "tsd-signature-type",
|
|
153
|
-
children: "None"
|
|
154
|
-
});
|
|
41
|
+
case 'conditional': {
|
|
42
|
+
const type = base;
|
|
43
|
+
return parens(_jsxs(_Fragment, { children: [_jsx(Type, { needsParens: true, type: type.checkType }), _jsx("span", { className: "tsd-signature-symbol", children: " extends " }), _jsx(Type, { type: type.extendsType }), _jsx("span", { className: "tsd-signature-symbol", children: " ? " }), _jsx(Type, { type: type.trueType }), _jsx("span", { className: "tsd-signature-symbol", children: " : " }), _jsx(Type, { type: type.falseType })] }), needsParens);
|
|
155
44
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
case 'mapped':
|
|
162
|
-
{
|
|
163
|
-
const type = base;
|
|
164
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
165
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
166
|
-
className: "tsd-signature-symbol",
|
|
167
|
-
children: '{ '
|
|
168
|
-
}), type.readonlyModifier === '+' && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
169
|
-
className: "tsd-signature-symbol",
|
|
170
|
-
children: "readonly "
|
|
171
|
-
}), type.readonlyModifier === '-' && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
172
|
-
className: "tsd-signature-symbol",
|
|
173
|
-
children: "-readonly "
|
|
174
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
175
|
-
className: "tsd-signature-symbol",
|
|
176
|
-
children: "[ "
|
|
177
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
178
|
-
className: "tsd-signature-type",
|
|
179
|
-
children: type.parameter
|
|
180
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
181
|
-
className: "tsd-signature-symbol",
|
|
182
|
-
children: " in "
|
|
183
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
184
|
-
type: type.parameterType
|
|
185
|
-
}), type.nameType && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
186
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
187
|
-
className: "tsd-signature-symbol",
|
|
188
|
-
children: " as "
|
|
189
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
190
|
-
type: type.nameType
|
|
191
|
-
})]
|
|
192
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
193
|
-
className: "tsd-signature-symbol",
|
|
194
|
-
children: " ]"
|
|
195
|
-
}), type.optionalModifier === '+' && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
196
|
-
className: "tsd-signature-symbol",
|
|
197
|
-
children: "?: "
|
|
198
|
-
}), type.optionalModifier === '-' && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
199
|
-
className: "tsd-signature-symbol",
|
|
200
|
-
children: "-?: "
|
|
201
|
-
}), !type.optionalModifier && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
202
|
-
className: "tsd-signature-symbol",
|
|
203
|
-
children: ": "
|
|
204
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
205
|
-
type: type.templateType
|
|
206
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
207
|
-
className: "tsd-signature-symbol",
|
|
208
|
-
children: ' }'
|
|
209
|
-
})]
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
case 'optional':
|
|
213
|
-
{
|
|
214
|
-
const type = base;
|
|
215
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
216
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
217
|
-
type: type.elementType
|
|
218
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
219
|
-
className: "tsd-signature-symbol",
|
|
220
|
-
children: "?"
|
|
221
|
-
})]
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
case 'predicate':
|
|
225
|
-
{
|
|
226
|
-
const type = base;
|
|
227
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
228
|
-
children: [type.asserts && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
229
|
-
className: "tsd-signature-symbol",
|
|
230
|
-
children: "asserts "
|
|
231
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
232
|
-
className: "tsd-signature-type",
|
|
233
|
-
children: type.name
|
|
234
|
-
}), type.targetType && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
235
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
236
|
-
className: "tsd-signature-symbol",
|
|
237
|
-
children: " is "
|
|
238
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
239
|
-
type: type.targetType
|
|
240
|
-
})]
|
|
241
|
-
})]
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
case 'query':
|
|
245
|
-
{
|
|
246
|
-
const type = base;
|
|
247
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
248
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
249
|
-
className: "tsd-signature-symbol",
|
|
250
|
-
children: "typeof "
|
|
251
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
252
|
-
type: type.queryType
|
|
253
|
-
})]
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
case 'reference':
|
|
257
|
-
{
|
|
258
|
-
const type = base;
|
|
259
|
-
// eslint-disable-next-line
|
|
260
|
-
const reflectionIdentifier = type.target ?? type.id;
|
|
261
|
-
const ref = type.ref ?? (reflectionIdentifier ? reflections[Number(reflectionIdentifier)] : null);
|
|
262
|
-
const genericClass = ref?.id && !ref.sources ? 'tsd-signature-type-generic' : '';
|
|
263
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
264
|
-
children: [ref?.permalink ?? type.externalUrl ? /*#__PURE__*/jsxRuntime.jsx(Link__default.default, {
|
|
265
|
-
className: `tsd-signature-type ${genericClass}`,
|
|
266
|
-
"data-tsd-kind": ref?.kind ?? undefined,
|
|
267
|
-
to: ref?.permalink ?? type.externalUrl,
|
|
268
|
-
children: type.name
|
|
269
|
-
}) : /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
270
|
-
className: `tsd-signature-type ${genericClass}`,
|
|
271
|
-
children: type.name
|
|
272
|
-
}), type.typeArguments && type.typeArguments.length > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
273
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
274
|
-
className: "tsd-signature-symbol",
|
|
275
|
-
children: isPython ? '[' : '<'
|
|
276
|
-
}), type.typeArguments.map((t, i) => /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
277
|
-
children: [i > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
278
|
-
className: "tsd-signature-symbol",
|
|
279
|
-
children: ", "
|
|
280
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
281
|
-
type: t
|
|
282
|
-
})]
|
|
283
|
-
}, t.type + i)), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
284
|
-
className: "tsd-signature-symbol",
|
|
285
|
-
children: isPython ? ']' : '>'
|
|
286
|
-
})]
|
|
287
|
-
})]
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
case 'reflection':
|
|
291
|
-
{
|
|
292
|
-
const type = base;
|
|
293
|
-
const decl = type.declaration;
|
|
294
|
-
|
|
295
|
-
// object literal
|
|
296
|
-
if (decl?.children && decl.children.length > 0) {
|
|
297
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
298
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
299
|
-
className: "tsd-signature-symbol",
|
|
300
|
-
children: '{ '
|
|
301
|
-
}), decl.children.map((child, i) => /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
302
|
-
children: [i > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
303
|
-
className: "tsd-signature-symbol",
|
|
304
|
-
children: "; "
|
|
305
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
306
|
-
children: [child.name, /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
307
|
-
className: "tsd-signature-symbol",
|
|
308
|
-
children: [child.flags?.isOptional && '?', ": "]
|
|
309
|
-
}), child.type ? /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
310
|
-
type: child.type
|
|
311
|
-
}) : 'any']
|
|
312
|
-
})]
|
|
313
|
-
}, child.id ?? i)), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
314
|
-
className: "tsd-signature-symbol",
|
|
315
|
-
children: ' }'
|
|
316
|
-
})]
|
|
317
|
-
});
|
|
45
|
+
case 'indexedAccess': {
|
|
46
|
+
const type = base;
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsx(Type, { type: type.objectType }), _jsx("span", { className: "tsd-signature-symbol", children: "[" }), _jsx(Type, { type: type.indexType }), _jsx("span", { className: "tsd-signature-symbol", children: "]" })] }));
|
|
318
48
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
useArrow: true,
|
|
323
|
-
sig: decl.signatures[0]
|
|
324
|
-
});
|
|
49
|
+
case 'inferred': {
|
|
50
|
+
const type = base;
|
|
51
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: "infer " }), " ", type.name] }));
|
|
325
52
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
children:
|
|
329
|
-
className: "tsd-signature-symbol",
|
|
330
|
-
children: '{ '
|
|
331
|
-
}), decl.signatures.map((sig, i) => /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
332
|
-
children: [i > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
333
|
-
className: "tsd-signature-symbol",
|
|
334
|
-
children: "; "
|
|
335
|
-
}), /*#__PURE__*/jsxRuntime.jsx(MemberSignatureTitle.MemberSignatureTitle, {
|
|
336
|
-
sig: sig
|
|
337
|
-
})]
|
|
338
|
-
}, sig.id ?? i)), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
339
|
-
className: "tsd-signature-symbol",
|
|
340
|
-
children: ' }'
|
|
341
|
-
})]
|
|
342
|
-
}), needsParens);
|
|
53
|
+
case 'intersection': {
|
|
54
|
+
const type = base;
|
|
55
|
+
return parens(_jsx(_Fragment, { children: type.types.map((t, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "tsd-signature-symbol", children: " & " }), _jsx(Type, { needsParens: true, type: t })] }, t.type + i))) }), needsParens);
|
|
343
56
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
children: "["
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}),
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
className: "tsd-signature-symbol",
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
const type = base;
|
|
439
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
440
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
441
|
-
className: "tsd-signature-symbol",
|
|
442
|
-
children: "`"
|
|
443
|
-
}), type.head && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
444
|
-
className: "tsd-signature-type",
|
|
445
|
-
children: type.head
|
|
446
|
-
}), type.tail.map((t, i) => /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
447
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
448
|
-
className: "tsd-signature-symbol",
|
|
449
|
-
children: '${'
|
|
450
|
-
}), typeof t[0] !== 'string' && /*#__PURE__*/jsxRuntime.jsx(Type, {
|
|
451
|
-
type: t[0]
|
|
452
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
453
|
-
className: "tsd-signature-symbol",
|
|
454
|
-
children: '}'
|
|
455
|
-
}), typeof t[1] === 'string' && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
456
|
-
className: "tsd-signature-type",
|
|
457
|
-
children: t[1]
|
|
458
|
-
})]
|
|
459
|
-
}, i)), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
460
|
-
className: "tsd-signature-symbol",
|
|
461
|
-
children: "`"
|
|
462
|
-
})]
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
default:
|
|
466
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
467
|
-
className: "tsd-signature-type",
|
|
468
|
-
children: "void"
|
|
469
|
-
});
|
|
470
|
-
}
|
|
57
|
+
case 'intrinsic': {
|
|
58
|
+
const type = base;
|
|
59
|
+
return _jsx("span", { className: "tsd-signature-type", children: type.name });
|
|
60
|
+
}
|
|
61
|
+
case 'literal': {
|
|
62
|
+
const type = base;
|
|
63
|
+
if (isPython && (type.value === null
|
|
64
|
+
|| (typeof type.value === 'object' && Object.keys(type.value).length === 0))) {
|
|
65
|
+
return _jsx("span", { className: "tsd-signature-type", children: "None" });
|
|
66
|
+
}
|
|
67
|
+
return _jsx("span", { className: "tsd-signature-type", children: String(type.value) });
|
|
68
|
+
}
|
|
69
|
+
case 'mapped': {
|
|
70
|
+
const type = base;
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: '{ ' }), type.readonlyModifier === '+' && _jsx("span", { className: "tsd-signature-symbol", children: "readonly " }), type.readonlyModifier === '-' && (_jsx("span", { className: "tsd-signature-symbol", children: "-readonly " })), _jsx("span", { className: "tsd-signature-symbol", children: "[ " }), _jsx("span", { className: "tsd-signature-type", children: type.parameter }), _jsx("span", { className: "tsd-signature-symbol", children: " in " }), _jsx(Type, { type: type.parameterType }), type.nameType && (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: " as " }), _jsx(Type, { type: type.nameType })] })), _jsx("span", { className: "tsd-signature-symbol", children: " ]" }), type.optionalModifier === '+' && _jsx("span", { className: "tsd-signature-symbol", children: "?: " }), type.optionalModifier === '-' && _jsx("span", { className: "tsd-signature-symbol", children: "-?: " }), !type.optionalModifier && _jsx("span", { className: "tsd-signature-symbol", children: ": " }), _jsx(Type, { type: type.templateType }), _jsx("span", { className: "tsd-signature-symbol", children: ' }' })] }));
|
|
72
|
+
}
|
|
73
|
+
case 'optional': {
|
|
74
|
+
const type = base;
|
|
75
|
+
return (_jsxs(_Fragment, { children: [_jsx(Type, { type: type.elementType }), _jsx("span", { className: "tsd-signature-symbol", children: "?" })] }));
|
|
76
|
+
}
|
|
77
|
+
case 'predicate': {
|
|
78
|
+
const type = base;
|
|
79
|
+
return (_jsxs(_Fragment, { children: [type.asserts && _jsx("span", { className: "tsd-signature-symbol", children: "asserts " }), _jsx("span", { className: "tsd-signature-type", children: type.name }), type.targetType && (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: " is " }), _jsx(Type, { type: type.targetType })] }))] }));
|
|
80
|
+
}
|
|
81
|
+
case 'query': {
|
|
82
|
+
const type = base;
|
|
83
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: "typeof " }), _jsx(Type, { type: type.queryType })] }));
|
|
84
|
+
}
|
|
85
|
+
case 'reference': {
|
|
86
|
+
const type = base;
|
|
87
|
+
// eslint-disable-next-line
|
|
88
|
+
const reflectionIdentifier = (_a = type.target) !== null && _a !== void 0 ? _a : type.id;
|
|
89
|
+
const ref = (_b = type.ref) !== null && _b !== void 0 ? _b : (reflectionIdentifier ? reflections[Number(reflectionIdentifier)] : null);
|
|
90
|
+
const genericClass = (ref === null || ref === void 0 ? void 0 : ref.id) && !ref.sources ? 'tsd-signature-type-generic' : '';
|
|
91
|
+
return (_jsxs(_Fragment, { children: [((_c = ref === null || ref === void 0 ? void 0 : ref.permalink) !== null && _c !== void 0 ? _c : type.externalUrl) ? (_jsx(Link, { className: `tsd-signature-type ${genericClass}`, "data-tsd-kind": (_d = ref === null || ref === void 0 ? void 0 : ref.kind) !== null && _d !== void 0 ? _d : undefined, to: (_e = ref === null || ref === void 0 ? void 0 : ref.permalink) !== null && _e !== void 0 ? _e : type.externalUrl, children: type.name })) : (_jsx("span", { className: `tsd-signature-type ${genericClass}`, children: type.name })), type.typeArguments && type.typeArguments.length > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: isPython ? '[' : '<' }), type.typeArguments.map((t, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "tsd-signature-symbol", children: ", " }), _jsx(Type, { type: t })] }, t.type + i))), _jsx("span", { className: "tsd-signature-symbol", children: isPython ? ']' : '>' })] }))] }));
|
|
92
|
+
}
|
|
93
|
+
case 'reflection': {
|
|
94
|
+
const type = base;
|
|
95
|
+
const decl = type.declaration;
|
|
96
|
+
// object literal
|
|
97
|
+
if ((decl === null || decl === void 0 ? void 0 : decl.children) && decl.children.length > 0) {
|
|
98
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: '{ ' }), decl.children.map((child, i) => {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
return (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "tsd-signature-symbol", children: "; " }), _jsxs("span", { children: [child.name, _jsxs("span", { className: "tsd-signature-symbol", children: [((_a = child.flags) === null || _a === void 0 ? void 0 : _a.isOptional) && '?', ": "] }), child.type ? _jsx(Type, { type: child.type }) : 'any'] })] }, (_b = child.id) !== null && _b !== void 0 ? _b : i));
|
|
101
|
+
}), _jsx("span", { className: "tsd-signature-symbol", children: ' }' })] }));
|
|
102
|
+
}
|
|
103
|
+
if ((decl === null || decl === void 0 ? void 0 : decl.signatures) && decl.signatures.length === 1) {
|
|
104
|
+
return _jsx(MemberSignatureTitle, { hideName: true, useArrow: true, sig: decl.signatures[0] });
|
|
105
|
+
}
|
|
106
|
+
if ((decl === null || decl === void 0 ? void 0 : decl.signatures) && decl.signatures.length > 0) {
|
|
107
|
+
return parens(_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: '{ ' }), decl.signatures.map((sig, i) => {
|
|
108
|
+
var _a;
|
|
109
|
+
return (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "tsd-signature-symbol", children: "; " }), _jsx(MemberSignatureTitle, { sig: sig })] }, (_a = sig.id) !== null && _a !== void 0 ? _a : i));
|
|
110
|
+
}), _jsx("span", { className: "tsd-signature-symbol", children: ' }' })] }), needsParens);
|
|
111
|
+
}
|
|
112
|
+
return _jsx(_Fragment, { children: '{}' });
|
|
113
|
+
}
|
|
114
|
+
case 'rest': {
|
|
115
|
+
const type = base;
|
|
116
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: "..." }), _jsx(Type, { type: type.elementType })] }));
|
|
117
|
+
}
|
|
118
|
+
case 'tuple': {
|
|
119
|
+
const type = base;
|
|
120
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: "[" }), (_f = type.elements) === null || _f === void 0 ? void 0 : _f.map((t, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "tsd-signature-symbol", children: ", " }), _jsx(Type, { type: t })] }, t.type + i))), _jsx("span", { className: "tsd-signature-symbol", children: "]" })] }));
|
|
121
|
+
}
|
|
122
|
+
case 'typeOperator': {
|
|
123
|
+
const type = base;
|
|
124
|
+
return (_jsxs(_Fragment, { children: [_jsxs("span", { className: "tsd-signature-symbol", children: [type.operator, " "] }), _jsx(Type, { type: type.target })] }));
|
|
125
|
+
}
|
|
126
|
+
// case 'typeParameter': {
|
|
127
|
+
// const type = base as JSONOutput.TypeParameterType;
|
|
128
|
+
// return <span className="tsd-signature-type">{type.name}</span>;
|
|
129
|
+
// }
|
|
130
|
+
case 'union': {
|
|
131
|
+
const type = base;
|
|
132
|
+
return parens(_jsx(_Fragment, { children: type.types.map((t, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "tsd-signature-symbol", children: " | " }), _jsx(Type, { needsParens: true, type: t })] }, t.type + i))) }), needsParens);
|
|
133
|
+
}
|
|
134
|
+
case 'unknown': {
|
|
135
|
+
const type = base;
|
|
136
|
+
return _jsx("span", { className: "tsd-signature-type", children: type.name });
|
|
137
|
+
}
|
|
138
|
+
case 'named-tuple-member':
|
|
139
|
+
case 'namedTupleMember': {
|
|
140
|
+
const type = base;
|
|
141
|
+
return (_jsxs(_Fragment, { children: [type.name, _jsx("span", { className: "tsd-signature-symbol", children: type.isOptional ? '?: ' : ': ' }), _jsx(Type, { type: type.element })] }));
|
|
142
|
+
}
|
|
143
|
+
case 'template-literal':
|
|
144
|
+
case 'templateLiteral': {
|
|
145
|
+
const type = base;
|
|
146
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: "`" }), type.head && _jsx("span", { className: "tsd-signature-type", children: type.head }), type.tail.map((t, i) => (_jsxs(Fragment, { children: [_jsx("span", { className: "tsd-signature-symbol", children: '${' }), typeof t[0] !== 'string' && _jsx(Type, { type: t[0] }), _jsx("span", { className: "tsd-signature-symbol", children: '}' }), typeof t[1] === 'string' && _jsx("span", { className: "tsd-signature-type", children: t[1] })] }, i))), _jsx("span", { className: "tsd-signature-symbol", children: "`" })] }));
|
|
147
|
+
}
|
|
148
|
+
default:
|
|
149
|
+
return _jsx("span", { className: "tsd-signature-type", children: "void" });
|
|
150
|
+
}
|
|
471
151
|
}
|
|
472
|
-
|
|
473
|
-
exports.extractDeclarationFromType = extractDeclarationFromType;
|
|
474
|
-
//# sourceMappingURL=Type.js.map
|
|
152
|
+
//# sourceMappingURL=Type.js.map
|