@xyo-network/react-typedoc 2.64.0 → 2.64.2
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/browser/CommentViewer.js +3 -2
- package/dist/browser/CommentViewer.js.map +1 -1
- package/dist/browser/JsonViewerButton.js +4 -3
- package/dist/browser/JsonViewerButton.js.map +1 -1
- package/dist/browser/ProjectTwoPanelReflectionViewer.js +513 -5
- package/dist/browser/ProjectTwoPanelReflectionViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/Container.js +294 -7
- package/dist/browser/ReflectionViewer/Container.js.map +1 -1
- package/dist/browser/ReflectionViewer/Declaration.js +208 -7
- package/dist/browser/ReflectionViewer/Declaration.js.map +1 -1
- package/dist/browser/ReflectionViewer/DeclarationContainer.js +355 -6
- package/dist/browser/ReflectionViewer/DeclarationContainer.js.map +1 -1
- package/dist/browser/ReflectionViewer/NameViewer.js +157 -15
- package/dist/browser/ReflectionViewer/NameViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/Project.js +296 -7
- package/dist/browser/ReflectionViewer/Project.js.map +1 -1
- package/dist/browser/ReflectionViewer/ReflectionGroupViewer.js +237 -17
- package/dist/browser/ReflectionViewer/ReflectionGroupViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/ReflectionViewer.js +185 -9
- package/dist/browser/ReflectionViewer/ReflectionViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.js +107 -5
- package/dist/browser/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildArrayString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildArrayString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildIntersectionString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildIntersectionString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReferenceString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReferenceString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReflectionString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReflectionString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildTypeString.js +63 -6
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildTypeString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildUnionString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildUnionString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/index.js +115 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/index.js.map +1 -1
- package/dist/browser/ReflectionViewer/index.js +412 -8
- package/dist/browser/ReflectionViewer/index.js.map +1 -1
- package/dist/browser/SourceViewer.js +3 -2
- package/dist/browser/SourceViewer.js.map +1 -1
- package/dist/browser/TreeViewer/Reflection.js +3 -2
- package/dist/browser/TreeViewer/Reflection.js.map +1 -1
- package/dist/browser/TreeViewer/ReflectionGroup.js +231 -11
- package/dist/browser/TreeViewer/ReflectionGroup.js.map +1 -1
- package/dist/browser/TreeViewer/index.js +299 -2
- package/dist/browser/TreeViewer/index.js.map +1 -1
- package/dist/browser/TwoPanelReflectionViewer.js +344 -18
- package/dist/browser/TwoPanelReflectionViewer.js.map +1 -1
- package/dist/browser/createLookup.js +2 -1
- package/dist/browser/createLookup.js.map +1 -1
- package/dist/browser/index.js +611 -9
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/resolveChildren.js +2 -1
- package/dist/browser/resolveChildren.js.map +1 -1
- package/dist/browser/trimFlagLabel.js +2 -1
- package/dist/browser/trimFlagLabel.js.map +1 -1
- package/dist/docs.json +72 -72
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ReflectionViewer/ReflectionViewer.tsx"],"sourcesContent":["import { FlexCol } from '@xylabs/react-flexbox'\nimport type { ReflectionFlags } from 'typedoc'\n\nimport { CommentViewer } from '../CommentViewer'\nimport { SomeReflection } from '../SomeReflection'\nimport { NameViewer } from './NameViewer'\nimport { FlagFilter, ReflectionViewerProps } from './ReflectionViewerProps'\n\nconst hide = (flags?: ReflectionFlags, hiddenFlags: FlagFilter[] = []) => {\n let hide = false\n hiddenFlags.map((hiddenFlag) => {\n if (flags?.[hiddenFlag]) {\n hide = true\n }\n })\n return hide\n}\n\nexport const ReflectionViewer: React.FC<ReflectionViewerProps> = ({ variant, nameViewer, children, reflection, hiddenFlags, ...props }) => {\n const someReflection = reflection as SomeReflection\n\n return hide(reflection?.flags, hiddenFlags) ? null : (\n <FlexCol title=\"ReflectionViewer\" alignItems=\"stretch\" {...props}>\n {nameViewer === undefined ? (\n <NameViewer marginY={0.25} variant={variant} reflection={someReflection} reflectionViewer={ReflectionViewer} />\n ) : (\n nameViewer\n )}\n {reflection.comment ? <CommentViewer comment={reflection.comment} /> : null}\n {/*sources && reflection.sources && children ? (\n <>\n {reflection.sources.map((source, index) => {\n return <SourceViewer key={index} source={source} />\n })}\n </>\n ) : null*/}\n {someReflection.parameters?.map((parameter) => {\n return <ReflectionViewer hiddenFlags={hiddenFlags} marginY={0.25} marginX={1} key={parameter.id} reflection={parameter} />\n }) ?? null}\n {children}\n </FlexCol>\n )\n}\n"],"mappings":"AAsBI,SAEI,KAFJ;AAtBJ,SAAS,eAAe;AAGxB,SAAS,qBAAqB;AAE9B,SAAS,kBAAkB;AAG3B,MAAM,OAAO,CAAC,OAAyB,cAA4B,CAAC,MAAM;AACxE,MAAIA,QAAO;AACX,cAAY,IAAI,CAAC,eAAe;AAC9B,QAAI,QAAQ,UAAU,GAAG;AACvB,MAAAA,QAAO;AAAA,IACT;AAAA,EACF,CAAC;AACD,SAAOA;AACT;AAEO,MAAM,mBAAoD,CAAC,EAAE,SAAS,YAAY,UAAU,YAAY,aAAa,GAAG,MAAM,MAAM;AACzI,QAAM,iBAAiB;AAEvB,SAAO,KAAK,YAAY,OAAO,WAAW,IAAI,OAC5C,qBAAC,WAAQ,OAAM,oBAAmB,YAAW,WAAW,GAAG,OACxD;AAAA,mBAAe,SACd,oBAAC,cAAW,SAAS,MAAM,SAAkB,YAAY,gBAAgB,kBAAkB,kBAAkB,IAE7G;AAAA,IAED,WAAW,UAAU,oBAAC,iBAAc,SAAS,WAAW,SAAS,IAAK;AAAA,IAQtE,eAAe,YAAY,IAAI,CAAC,cAAc;AAC7C,aAAO,oBAAC,oBAAiB,aAA0B,SAAS,MAAM,SAAS,GAAsB,YAAY,aAA1B,UAAU,EAA2B;AAAA,IAC1H,CAAC,KAAK;AAAA,IACL;AAAA,KACH;AAEJ;","names":["hide"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/ReflectionViewer/ReflectionViewer.tsx","../../../src/CommentViewer.tsx","../../../src/ReflectionViewer/NameViewer.tsx","../../../src/JsonViewerButton.tsx","../../../src/trimFlagLabel.ts","../../../src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts","../../../src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx"],"sourcesContent":["import { FlexCol } from '@xylabs/react-flexbox'\nimport type { ReflectionFlags } from 'typedoc'\n\nimport { CommentViewer } from '../CommentViewer'\nimport { SomeReflection } from '../SomeReflection'\nimport { NameViewer } from './NameViewer'\nimport { FlagFilter, ReflectionViewerProps } from './ReflectionViewerProps'\n\nconst hide = (flags?: ReflectionFlags, hiddenFlags: FlagFilter[] = []) => {\n let hide = false\n hiddenFlags.map((hiddenFlag) => {\n if (flags?.[hiddenFlag]) {\n hide = true\n }\n })\n return hide\n}\n\nexport const ReflectionViewer: React.FC<ReflectionViewerProps> = ({ variant, nameViewer, children, reflection, hiddenFlags, ...props }) => {\n const someReflection = reflection as SomeReflection\n\n return hide(reflection?.flags, hiddenFlags) ? null : (\n <FlexCol title=\"ReflectionViewer\" alignItems=\"stretch\" {...props}>\n {nameViewer === undefined ? (\n <NameViewer marginY={0.25} variant={variant} reflection={someReflection} reflectionViewer={ReflectionViewer} />\n ) : (\n nameViewer\n )}\n {reflection.comment ? <CommentViewer comment={reflection.comment} /> : null}\n {/*sources && reflection.sources && children ? (\n <>\n {reflection.sources.map((source, index) => {\n return <SourceViewer key={index} source={source} />\n })}\n </>\n ) : null*/}\n {someReflection.parameters?.map((parameter) => {\n return <ReflectionViewer hiddenFlags={hiddenFlags} marginY={0.25} marginX={1} key={parameter.id} reflection={parameter} />\n }) ?? null}\n {children}\n </FlexCol>\n )\n}\n","import { Typography } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport type { Comment } from 'typedoc'\n\nexport interface CommentViewerProps extends FlexBoxProps {\n comment: Comment\n}\n\nexport const CommentViewer: React.FC<CommentViewerProps> = ({ comment, ...props }) => {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n <Typography variant=\"body2\">{comment.summary[0]?.text}</Typography>\n </FlexCol>\n )\n}\n","import { Chip, Stack, Typography, TypographyVariant } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nimport { JsonViewerButton } from '../JsonViewerButton'\nimport { SomeReflection } from '../SomeReflection'\nimport { trimFlagLabel } from '../trimFlagLabel'\nimport { ReflectionViewerProps } from './ReflectionViewerProps'\nimport { SomeTypeViewer } from './SomeTypeViewer'\n\nexport interface NameViewerProps extends FlexBoxProps {\n reflection: SomeReflection\n reflectionViewer: React.FC<ReflectionViewerProps>\n variant?: TypographyVariant\n}\n\nexport const NameViewer: React.FC<NameViewerProps> = ({ reflectionViewer, variant, reflection, ...props }) => {\n return (\n <FlexRow justifyContent=\"flex-start\" {...props}>\n <FlexRow marginRight={1}>\n <Typography variant={variant} noWrap>\n {reflection.name}\n {reflection.type ? <>: </> : null}\n </Typography>\n <SomeTypeViewer reflection={reflection} reflectionViewer={reflectionViewer} />\n </FlexRow>\n <Stack direction=\"row\" spacing={1}>\n <Chip size=\"small\" label={reflection.kind} />\n {reflection.flags\n ? Object.entries(reflection.flags).map(([flag, value]) => {\n return value ? <Chip size=\"small\" key={flag} label={trimFlagLabel(flag)} variant=\"outlined\" /> : null\n })\n : null}\n </Stack>\n {document && document?.location.hostname === 'localhost' && (\n <JsonViewerButton jsonViewProps={{ collapsed: 1 }} size=\"small\" variant=\"contained\" padding={0} marginX={1} src={reflection} />\n )}\n </FlexRow>\n )\n}\n","import { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { lazy, Suspense, useState } from 'react'\nimport { ReactJsonViewProps } from 'react-json-view'\n\nconst JsonView = lazy(() => import(/* webpackChunkName: \"jsonView\" */ 'react-json-view'))\n\nexport interface JsonViewerButtonProps extends ButtonExProps {\n jsonViewProps?: Partial<ReactJsonViewProps>\n src: object\n}\n\nexport const JsonViewerButton: React.FC<JsonViewerButtonProps> = ({ jsonViewProps, src, title, ...props }) => {\n const [open, setOpen] = useState(false)\n return (\n <>\n <ButtonEx onClick={() => setOpen(!open)} {...props}>\n JSON\n </ButtonEx>\n <Dialog open={open} onClose={() => setOpen(false)}>\n {title ? <DialogTitle>{title}</DialogTitle> : null}\n <DialogContent>\n <Suspense fallback={<div />}>\n <JsonView src={src} {...jsonViewProps} />\n </Suspense>\n </DialogContent>\n <DialogActions>\n <ButtonEx onClick={() => setOpen(false)}>Close</ButtonEx>\n </DialogActions>\n </Dialog>\n </>\n )\n}\n","export const trimFlagLabel = (label: string) => {\n if (label.startsWith('is')) {\n return label.substring(2)\n }\n return label\n}\n","import { Typography, TypographyProps } from '@mui/material'\n\nimport { SomeReflection } from '../../SomeReflection'\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildTypeString } from './buildTypeString'\n\nexport interface SomeTypeViewerProps extends TypographyProps {\n opacity?: number\n reflection: SomeReflection\n reflectionViewer: React.FC<ReflectionViewerProps>\n}\n\nexport const SomeTypeViewer: React.FC<SomeTypeViewerProps> = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {\n const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : ''\n if (typeof typeReactNode === 'string') {\n return (\n <Typography title=\"SomeTypeViewer\" style={{ opacity }} {...props}>\n {typeReactNode}\n </Typography>\n )\n }\n return <>{typeReactNode}</>\n}\n","import type { ArrayType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildArrayString = (typeObj: ArrayType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n const typeString = typeBuilder(typeObj.elementType, reflectionViewer)\n if (typeof typeString === 'string') {\n parts.push(typeString)\n }\n parts.push('[]')\n return parts\n}\n","import type { IntersectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildIntersectionString = (typeObj: IntersectionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' & '),\n )\n }\n return parts\n}\n","import type { ReferenceType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildReferenceString = (typeObj: ReferenceType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n parts.push(typeObj.name)\n if (typeObj.typeArguments) {\n parts.push('<')\n parts.push(\n typeObj.typeArguments\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(', '),\n )\n parts.push('>')\n }\n return parts\n}\n","import type { ReflectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\n\nexport const buildRelfectionString = (typeObj: ReflectionType, reflectionViewer: React.FC<ReflectionViewerProps>) => {\n if (typeObj.declaration) {\n return <>{reflectionViewer({ reflection: typeObj.declaration })}</>\n }\n}\n","import type { UnionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildUnionString = (typeObj: UnionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' | '),\n )\n }\n return parts\n}\n","import { ReactNode } from 'react'\nimport type { SomeType, Type } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildArrayString } from './buildArrayString'\nimport { buildIntersectionString } from './buildIntersectionString'\nimport { buildReferenceString } from './buildReferenceString'\nimport { buildRelfectionString } from './buildReflectionString'\nimport { buildUnionString } from './buildUnionString'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildTypeString: TypeBuilder = (type: SomeType | Type, reflectionViewer: React.FC<ReflectionViewerProps>): ReactNode => {\n const someType = type as SomeType\n const parts: string[] = []\n\n switch (someType.type) {\n case 'intrinsic':\n parts.push(someType.name)\n break\n case 'intersection': {\n parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'literal':\n parts.push(JSON.stringify(someType.value))\n break\n case 'array': {\n parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reference': {\n parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'union': {\n parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reflection': {\n return buildRelfectionString(someType, reflectionViewer)\n }\n default:\n parts.push('#')\n parts.push(someType.type)\n parts.push('#')\n break\n }\n return parts.join('')\n}\n"],"mappings":";AAAA,SAAS,WAAAA,gBAAe;;;ACAxB,SAAS,kBAAkB;AAC3B,SAAuB,eAAe;AAUhC;AAHC,IAAM,gBAA8C,CAAC,EAAE,SAAS,GAAG,MAAM,MAAM;AACpF,SACE,oBAAC,WAAQ,YAAW,WAAW,GAAG,OAChC,8BAAC,cAAW,SAAQ,SAAS,kBAAQ,QAAQ,CAAC,GAAG,MAAK,GACxD;AAEJ;;;ACdA,SAAS,MAAM,OAAO,cAAAC,mBAAqC;AAC3D,SAAuB,eAAe;;;ACDtC,SAAS,QAAQ,eAAe,eAAe,mBAAmB;AAClE,SAAS,gBAA+B;AACxC,SAAS,MAAM,UAAU,gBAAgB;AAarC,mBACE,OAAAC,MAGA,YAJF;AAVJ,IAAM,WAAW,KAAK,MAAM;AAAA;AAAA,EAA0C;AAAiB,CAAC;AAOjF,IAAM,mBAAoD,CAAC,EAAE,eAAe,KAAK,OAAO,GAAG,MAAM,MAAM;AAC5G,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,SACE,iCACE;AAAA,oBAAAA,KAAC,YAAS,SAAS,MAAM,QAAQ,CAAC,IAAI,GAAI,GAAG,OAAO,kBAEpD;AAAA,IACA,qBAAC,UAAO,MAAY,SAAS,MAAM,QAAQ,KAAK,GAC7C;AAAA,cAAQ,gBAAAA,KAAC,eAAa,iBAAM,IAAiB;AAAA,MAC9C,gBAAAA,KAAC,iBACC,0BAAAA,KAAC,YAAS,UAAU,gBAAAA,KAAC,SAAI,GACvB,0BAAAA,KAAC,YAAS,KAAW,GAAG,eAAe,GACzC,GACF;AAAA,MACA,gBAAAA,KAAC,iBACC,0BAAAA,KAAC,YAAS,SAAS,MAAM,QAAQ,KAAK,GAAG,mBAAK,GAChD;AAAA,OACF;AAAA,KACF;AAEJ;;;AChC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,IAAM,OAAO,CAAC,OAAyB,cAA4B,CAAC,MAAM;AACxE,MAAIC,QAAO;AACX,cAAY,IAAI,CAAC,eAAe;AAC9B,QAAI,QAAQ,UAAU,GAAG;AACvB,MAAAA,QAAO;AAAA,IACT;AAAA,EACF,CAAC;AACD,SAAOA;AACT;AAEO,IAAM,mBAAoD,CAAC,EAAE,SAAS,YAAY,UAAU,YAAY,aAAa,GAAG,MAAM,MAAM;AACzI,QAAM,iBAAiB;AAEvB,SAAO,KAAK,YAAY,OAAO,WAAW,IAAI,OAC5C,gBAAAD,MAACE,UAAA,EAAQ,OAAM,oBAAmB,YAAW,WAAW,GAAG,OACxD;AAAA,mBAAe,SACd,gBAAAH,KAAC,cAAW,SAAS,MAAM,SAAkB,YAAY,gBAAgB,kBAAkB,kBAAkB,IAE7G;AAAA,IAED,WAAW,UAAU,gBAAAA,KAAC,iBAAc,SAAS,WAAW,SAAS,IAAK;AAAA,IAQtE,eAAe,YAAY,IAAI,CAAC,cAAc;AAC7C,aAAO,gBAAAA,KAAC,oBAAiB,aAA0B,SAAS,MAAM,SAAS,GAAsB,YAAY,aAA1B,UAAU,EAA2B;AAAA,IAC1H,CAAC,KAAK;AAAA,IACL;AAAA,KACH;AAEJ;","names":["FlexCol","Typography","jsx","Typography","Fragment","jsx","Fragment","jsx","Typography","Fragment","jsx","jsxs","Typography","jsx","jsxs","hide","FlexCol"]}
|
|
@@ -1,12 +1,114 @@
|
|
|
1
|
-
|
|
1
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
2
2
|
import { Typography } from "@mui/material";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
// src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
|
|
5
|
+
var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
6
|
+
const parts = [];
|
|
7
|
+
const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
|
|
8
|
+
if (typeof typeString === "string") {
|
|
9
|
+
parts.push(typeString);
|
|
10
|
+
}
|
|
11
|
+
parts.push("[]");
|
|
12
|
+
return parts;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
|
|
16
|
+
var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
17
|
+
const parts = [];
|
|
18
|
+
if (typeObj.types) {
|
|
19
|
+
parts.push(
|
|
20
|
+
typeObj.types.map((arg) => {
|
|
21
|
+
return typeBuilder(arg, reflectionViewer);
|
|
22
|
+
}).join(" & ")
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return parts;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
|
|
29
|
+
var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
30
|
+
const parts = [];
|
|
31
|
+
parts.push(typeObj.name);
|
|
32
|
+
if (typeObj.typeArguments) {
|
|
33
|
+
parts.push("<");
|
|
34
|
+
parts.push(
|
|
35
|
+
typeObj.typeArguments.map((arg) => {
|
|
36
|
+
return typeBuilder(arg, reflectionViewer);
|
|
37
|
+
}).join(", ")
|
|
38
|
+
);
|
|
39
|
+
parts.push(">");
|
|
40
|
+
}
|
|
41
|
+
return parts;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
|
|
45
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
46
|
+
var buildRelfectionString = (typeObj, reflectionViewer) => {
|
|
47
|
+
if (typeObj.declaration) {
|
|
48
|
+
return /* @__PURE__ */ jsx(Fragment, { children: reflectionViewer({ reflection: typeObj.declaration }) });
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx
|
|
53
|
+
var buildUnionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
54
|
+
const parts = [];
|
|
55
|
+
if (typeObj.types) {
|
|
56
|
+
parts.push(
|
|
57
|
+
typeObj.types.map((arg) => {
|
|
58
|
+
return typeBuilder(arg, reflectionViewer);
|
|
59
|
+
}).join(" | ")
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return parts;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx
|
|
66
|
+
var buildTypeString = (type, reflectionViewer) => {
|
|
67
|
+
const someType = type;
|
|
68
|
+
const parts = [];
|
|
69
|
+
switch (someType.type) {
|
|
70
|
+
case "intrinsic":
|
|
71
|
+
parts.push(someType.name);
|
|
72
|
+
break;
|
|
73
|
+
case "intersection": {
|
|
74
|
+
parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString));
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case "literal":
|
|
78
|
+
parts.push(JSON.stringify(someType.value));
|
|
79
|
+
break;
|
|
80
|
+
case "array": {
|
|
81
|
+
parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString));
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case "reference": {
|
|
85
|
+
parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString));
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case "union": {
|
|
89
|
+
parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString));
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case "reflection": {
|
|
93
|
+
return buildRelfectionString(someType, reflectionViewer);
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
parts.push("#");
|
|
97
|
+
parts.push(someType.type);
|
|
98
|
+
parts.push("#");
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
return parts.join("");
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
105
|
+
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
106
|
+
var SomeTypeViewer = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {
|
|
5
107
|
const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : "";
|
|
6
108
|
if (typeof typeReactNode === "string") {
|
|
7
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ jsx2(Typography, { title: "SomeTypeViewer", style: { opacity }, ...props, children: typeReactNode });
|
|
8
110
|
}
|
|
9
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ jsx2(Fragment2, { children: typeReactNode });
|
|
10
112
|
};
|
|
11
113
|
export {
|
|
12
114
|
SomeTypeViewer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx"],"sourcesContent":["import { Typography, TypographyProps } from '@mui/material'\n\nimport { SomeReflection } from '../../SomeReflection'\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildTypeString } from './buildTypeString'\n\nexport interface SomeTypeViewerProps extends TypographyProps {\n opacity?: number\n reflection: SomeReflection\n reflectionViewer: React.FC<ReflectionViewerProps>\n}\n\nexport const SomeTypeViewer: React.FC<SomeTypeViewerProps> = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {\n const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : ''\n if (typeof typeReactNode === 'string') {\n return (\n <Typography title=\"SomeTypeViewer\" style={{ opacity }} {...props}>\n {typeReactNode}\n </Typography>\n )\n }\n return <>{typeReactNode}</>\n}\n"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts","../../../../src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx"],"sourcesContent":["import { Typography, TypographyProps } from '@mui/material'\n\nimport { SomeReflection } from '../../SomeReflection'\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildTypeString } from './buildTypeString'\n\nexport interface SomeTypeViewerProps extends TypographyProps {\n opacity?: number\n reflection: SomeReflection\n reflectionViewer: React.FC<ReflectionViewerProps>\n}\n\nexport const SomeTypeViewer: React.FC<SomeTypeViewerProps> = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {\n const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : ''\n if (typeof typeReactNode === 'string') {\n return (\n <Typography title=\"SomeTypeViewer\" style={{ opacity }} {...props}>\n {typeReactNode}\n </Typography>\n )\n }\n return <>{typeReactNode}</>\n}\n","import type { ArrayType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildArrayString = (typeObj: ArrayType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n const typeString = typeBuilder(typeObj.elementType, reflectionViewer)\n if (typeof typeString === 'string') {\n parts.push(typeString)\n }\n parts.push('[]')\n return parts\n}\n","import type { IntersectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildIntersectionString = (typeObj: IntersectionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' & '),\n )\n }\n return parts\n}\n","import type { ReferenceType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildReferenceString = (typeObj: ReferenceType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n parts.push(typeObj.name)\n if (typeObj.typeArguments) {\n parts.push('<')\n parts.push(\n typeObj.typeArguments\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(', '),\n )\n parts.push('>')\n }\n return parts\n}\n","import type { ReflectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\n\nexport const buildRelfectionString = (typeObj: ReflectionType, reflectionViewer: React.FC<ReflectionViewerProps>) => {\n if (typeObj.declaration) {\n return <>{reflectionViewer({ reflection: typeObj.declaration })}</>\n }\n}\n","import type { UnionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildUnionString = (typeObj: UnionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' | '),\n )\n }\n return parts\n}\n","import { ReactNode } from 'react'\nimport type { SomeType, Type } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildArrayString } from './buildArrayString'\nimport { buildIntersectionString } from './buildIntersectionString'\nimport { buildReferenceString } from './buildReferenceString'\nimport { buildRelfectionString } from './buildReflectionString'\nimport { buildUnionString } from './buildUnionString'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildTypeString: TypeBuilder = (type: SomeType | Type, reflectionViewer: React.FC<ReflectionViewerProps>): ReactNode => {\n const someType = type as SomeType\n const parts: string[] = []\n\n switch (someType.type) {\n case 'intrinsic':\n parts.push(someType.name)\n break\n case 'intersection': {\n parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'literal':\n parts.push(JSON.stringify(someType.value))\n break\n case 'array': {\n parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reference': {\n parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'union': {\n parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reflection': {\n return buildRelfectionString(someType, reflectionViewer)\n }\n default:\n parts.push('#')\n parts.push(someType.type)\n parts.push('#')\n break\n }\n return parts.join('')\n}\n"],"mappings":";AAAA,SAAS,kBAAmC;;;ACKrC,IAAM,mBAAmB,CAAC,SAAoB,kBAAmD,gBAA6B;AACnI,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAa,YAAY,QAAQ,aAAa,gBAAgB;AACpE,MAAI,OAAO,eAAe,UAAU;AAClC,UAAM,KAAK,UAAU;AAAA,EACvB;AACA,QAAM,KAAK,IAAI;AACf,SAAO;AACT;;;ACRO,IAAM,0BAA0B,CAAC,SAA2B,kBAAmD,gBAA6B;AACjJ,QAAM,QAAkB,CAAC;AACzB,MAAI,QAAQ,OAAO;AACjB,UAAM;AAAA,MACJ,QAAQ,MACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,CAAC,EACA,KAAK,KAAK;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;;;ACZO,IAAM,uBAAuB,CAAC,SAAwB,kBAAmD,gBAA6B;AAC3I,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,QAAQ,IAAI;AACvB,MAAI,QAAQ,eAAe;AACzB,UAAM,KAAK,GAAG;AACd,UAAM;AAAA,MACJ,QAAQ,cACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,CAAC,EACA,KAAK,IAAI;AAAA,IACd;AACA,UAAM,KAAK,GAAG;AAAA,EAChB;AACA,SAAO;AACT;;;ACdW;AAFJ,IAAM,wBAAwB,CAAC,SAAyB,qBAAsD;AACnH,MAAI,QAAQ,aAAa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A;AAJC,IAAM,iBAAgD,CAAC,EAAE,UAAU,KAAK,YAAY,kBAAkB,GAAG,MAAM,MAAM;AAC1H,QAAM,gBAAgB,WAAW,OAAO,gBAAgB,WAAW,MAAM,gBAAgB,IAAI;AAC7F,MAAI,OAAO,kBAAkB,UAAU;AACrC,WACE,gBAAAA,KAAC,cAAW,OAAM,kBAAiB,OAAO,EAAE,QAAQ,GAAI,GAAG,OACxD,yBACH;AAAA,EAEJ;AACA,SAAO,gBAAAA,KAAAD,WAAA,EAAG,yBAAc;AAC1B;","names":["Fragment","jsx"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
|
|
2
|
+
var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
2
3
|
const parts = [];
|
|
3
4
|
const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
|
|
4
5
|
if (typeof typeString === "string") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx"],"sourcesContent":["import type { ArrayType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildArrayString = (typeObj: ArrayType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n const typeString = typeBuilder(typeObj.elementType, reflectionViewer)\n if (typeof typeString === 'string') {\n parts.push(typeString)\n }\n parts.push('[]')\n return parts\n}\n"],"mappings":"AAKO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx"],"sourcesContent":["import type { ArrayType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildArrayString = (typeObj: ArrayType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n const typeString = typeBuilder(typeObj.elementType, reflectionViewer)\n if (typeof typeString === 'string') {\n parts.push(typeString)\n }\n parts.push('[]')\n return parts\n}\n"],"mappings":";AAKO,IAAM,mBAAmB,CAAC,SAAoB,kBAAmD,gBAA6B;AACnI,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAa,YAAY,QAAQ,aAAa,gBAAgB;AACpE,MAAI,OAAO,eAAe,UAAU;AAClC,UAAM,KAAK,UAAU;AAAA,EACvB;AACA,QAAM,KAAK,IAAI;AACf,SAAO;AACT;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
|
|
2
|
+
var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
2
3
|
const parts = [];
|
|
3
4
|
if (typeObj.types) {
|
|
4
5
|
parts.push(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx"],"sourcesContent":["import type { IntersectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildIntersectionString = (typeObj: IntersectionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' & '),\n )\n }\n return parts\n}\n"],"mappings":"AAKO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx"],"sourcesContent":["import type { IntersectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildIntersectionString = (typeObj: IntersectionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' & '),\n )\n }\n return parts\n}\n"],"mappings":";AAKO,IAAM,0BAA0B,CAAC,SAA2B,kBAAmD,gBAA6B;AACjJ,QAAM,QAAkB,CAAC;AACzB,MAAI,QAAQ,OAAO;AACjB,UAAM;AAAA,MACJ,QAAQ,MACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,CAAC,EACA,KAAK,KAAK;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
|
|
2
|
+
var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
2
3
|
const parts = [];
|
|
3
4
|
parts.push(typeObj.name);
|
|
4
5
|
if (typeObj.typeArguments) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts"],"sourcesContent":["import type { ReferenceType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildReferenceString = (typeObj: ReferenceType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n parts.push(typeObj.name)\n if (typeObj.typeArguments) {\n parts.push('<')\n parts.push(\n typeObj.typeArguments\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(', '),\n )\n parts.push('>')\n }\n return parts\n}\n"],"mappings":"AAKO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts"],"sourcesContent":["import type { ReferenceType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildReferenceString = (typeObj: ReferenceType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n parts.push(typeObj.name)\n if (typeObj.typeArguments) {\n parts.push('<')\n parts.push(\n typeObj.typeArguments\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(', '),\n )\n parts.push('>')\n }\n return parts\n}\n"],"mappings":";AAKO,IAAM,uBAAuB,CAAC,SAAwB,kBAAmD,gBAA6B;AAC3I,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,QAAQ,IAAI;AACvB,MAAI,QAAQ,eAAe;AACzB,UAAM,KAAK,GAAG;AACd,UAAM;AAAA,MACJ,QAAQ,cACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,CAAC,EACA,KAAK,IAAI;AAAA,IACd;AACA,UAAM,KAAK,GAAG;AAAA,EAChB;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
|
|
1
2
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
+
var buildRelfectionString = (typeObj, reflectionViewer) => {
|
|
3
4
|
if (typeObj.declaration) {
|
|
4
5
|
return /* @__PURE__ */ jsx(Fragment, { children: reflectionViewer({ reflection: typeObj.declaration }) });
|
|
5
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx"],"sourcesContent":["import type { ReflectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\n\nexport const buildRelfectionString = (typeObj: ReflectionType, reflectionViewer: React.FC<ReflectionViewerProps>) => {\n if (typeObj.declaration) {\n return <>{reflectionViewer({ reflection: typeObj.declaration })}</>\n }\n}\n"],"mappings":"AAMW;AAFJ,
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx"],"sourcesContent":["import type { ReflectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\n\nexport const buildRelfectionString = (typeObj: ReflectionType, reflectionViewer: React.FC<ReflectionViewerProps>) => {\n if (typeObj.declaration) {\n return <>{reflectionViewer({ reflection: typeObj.declaration })}</>\n }\n}\n"],"mappings":";AAMW;AAFJ,IAAM,wBAAwB,CAAC,SAAyB,qBAAsD;AACnH,MAAI,QAAQ,aAAa;AACvB,WAAO,gCAAG,2BAAiB,EAAE,YAAY,QAAQ,YAAY,CAAC,GAAE;AAAA,EAClE;AACF;","names":[]}
|
|
@@ -1,9 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
|
|
2
|
+
var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
3
|
+
const parts = [];
|
|
4
|
+
const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
|
|
5
|
+
if (typeof typeString === "string") {
|
|
6
|
+
parts.push(typeString);
|
|
7
|
+
}
|
|
8
|
+
parts.push("[]");
|
|
9
|
+
return parts;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
|
|
13
|
+
var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
14
|
+
const parts = [];
|
|
15
|
+
if (typeObj.types) {
|
|
16
|
+
parts.push(
|
|
17
|
+
typeObj.types.map((arg) => {
|
|
18
|
+
return typeBuilder(arg, reflectionViewer);
|
|
19
|
+
}).join(" & ")
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return parts;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
|
|
26
|
+
var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
27
|
+
const parts = [];
|
|
28
|
+
parts.push(typeObj.name);
|
|
29
|
+
if (typeObj.typeArguments) {
|
|
30
|
+
parts.push("<");
|
|
31
|
+
parts.push(
|
|
32
|
+
typeObj.typeArguments.map((arg) => {
|
|
33
|
+
return typeBuilder(arg, reflectionViewer);
|
|
34
|
+
}).join(", ")
|
|
35
|
+
);
|
|
36
|
+
parts.push(">");
|
|
37
|
+
}
|
|
38
|
+
return parts;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
|
|
42
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
43
|
+
var buildRelfectionString = (typeObj, reflectionViewer) => {
|
|
44
|
+
if (typeObj.declaration) {
|
|
45
|
+
return /* @__PURE__ */ jsx(Fragment, { children: reflectionViewer({ reflection: typeObj.declaration }) });
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx
|
|
50
|
+
var buildUnionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
51
|
+
const parts = [];
|
|
52
|
+
if (typeObj.types) {
|
|
53
|
+
parts.push(
|
|
54
|
+
typeObj.types.map((arg) => {
|
|
55
|
+
return typeBuilder(arg, reflectionViewer);
|
|
56
|
+
}).join(" | ")
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return parts;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx
|
|
63
|
+
var buildTypeString = (type, reflectionViewer) => {
|
|
7
64
|
const someType = type;
|
|
8
65
|
const parts = [];
|
|
9
66
|
switch (someType.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport type { SomeType, Type } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildArrayString } from './buildArrayString'\nimport { buildIntersectionString } from './buildIntersectionString'\nimport { buildReferenceString } from './buildReferenceString'\nimport { buildRelfectionString } from './buildReflectionString'\nimport { buildUnionString } from './buildUnionString'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildTypeString: TypeBuilder = (type: SomeType | Type, reflectionViewer: React.FC<ReflectionViewerProps>): ReactNode => {\n const someType = type as SomeType\n const parts: string[] = []\n\n switch (someType.type) {\n case 'intrinsic':\n parts.push(someType.name)\n break\n case 'intersection': {\n parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'literal':\n parts.push(JSON.stringify(someType.value))\n break\n case 'array': {\n parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reference': {\n parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'union': {\n parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reflection': {\n return buildRelfectionString(someType, reflectionViewer)\n }\n default:\n parts.push('#')\n parts.push(someType.type)\n parts.push('#')\n break\n }\n return parts.join('')\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts","../../../../src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx"],"sourcesContent":["import type { ArrayType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildArrayString = (typeObj: ArrayType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n const typeString = typeBuilder(typeObj.elementType, reflectionViewer)\n if (typeof typeString === 'string') {\n parts.push(typeString)\n }\n parts.push('[]')\n return parts\n}\n","import type { IntersectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildIntersectionString = (typeObj: IntersectionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' & '),\n )\n }\n return parts\n}\n","import type { ReferenceType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildReferenceString = (typeObj: ReferenceType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n parts.push(typeObj.name)\n if (typeObj.typeArguments) {\n parts.push('<')\n parts.push(\n typeObj.typeArguments\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(', '),\n )\n parts.push('>')\n }\n return parts\n}\n","import type { ReflectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\n\nexport const buildRelfectionString = (typeObj: ReflectionType, reflectionViewer: React.FC<ReflectionViewerProps>) => {\n if (typeObj.declaration) {\n return <>{reflectionViewer({ reflection: typeObj.declaration })}</>\n }\n}\n","import type { UnionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildUnionString = (typeObj: UnionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' | '),\n )\n }\n return parts\n}\n","import { ReactNode } from 'react'\nimport type { SomeType, Type } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildArrayString } from './buildArrayString'\nimport { buildIntersectionString } from './buildIntersectionString'\nimport { buildReferenceString } from './buildReferenceString'\nimport { buildRelfectionString } from './buildReflectionString'\nimport { buildUnionString } from './buildUnionString'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildTypeString: TypeBuilder = (type: SomeType | Type, reflectionViewer: React.FC<ReflectionViewerProps>): ReactNode => {\n const someType = type as SomeType\n const parts: string[] = []\n\n switch (someType.type) {\n case 'intrinsic':\n parts.push(someType.name)\n break\n case 'intersection': {\n parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'literal':\n parts.push(JSON.stringify(someType.value))\n break\n case 'array': {\n parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reference': {\n parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'union': {\n parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reflection': {\n return buildRelfectionString(someType, reflectionViewer)\n }\n default:\n parts.push('#')\n parts.push(someType.type)\n parts.push('#')\n break\n }\n return parts.join('')\n}\n"],"mappings":";AAKO,IAAM,mBAAmB,CAAC,SAAoB,kBAAmD,gBAA6B;AACnI,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAa,YAAY,QAAQ,aAAa,gBAAgB;AACpE,MAAI,OAAO,eAAe,UAAU;AAClC,UAAM,KAAK,UAAU;AAAA,EACvB;AACA,QAAM,KAAK,IAAI;AACf,SAAO;AACT;;;ACRO,IAAM,0BAA0B,CAAC,SAA2B,kBAAmD,gBAA6B;AACjJ,QAAM,QAAkB,CAAC;AACzB,MAAI,QAAQ,OAAO;AACjB,UAAM;AAAA,MACJ,QAAQ,MACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,C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B,eAAe,CAAC;AAC3E;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,YAAM,KAAK,GAAG,qBAAqB,UAAU,kBAAkB,eAAe,CAAC;AAC/E;AAAA,IACF;AAAA,IACA,KAAK,SAAS;AACZ,YAAM,KAAK,GAAG,iBAAiB,UAAU,kBAAkB,eAAe,CAAC;AAC3E;AAAA,IACF;AAAA,IACA,KAAK,cAAc;AACjB,aAAO,sBAAsB,UAAU,gBAAgB;AAAA,IACzD;AAAA,IACA;AACE,YAAM,KAAK,GAAG;AACd,YAAM,KAAK,SAAS,IAAI;AACxB,YAAM,KAAK,GAAG;AACd;AAAA,EACJ;AACA,SAAO,MAAM,KAAK,EAAE;AACtB;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx"],"sourcesContent":["import type { UnionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildUnionString = (typeObj: UnionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' | '),\n )\n }\n return parts\n}\n"],"mappings":"AAKO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx"],"sourcesContent":["import type { UnionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildUnionString = (typeObj: UnionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' | '),\n )\n }\n return parts\n}\n"],"mappings":";AAKO,IAAM,mBAAmB,CAAC,SAAoB,kBAAmD,gBAA6B;AACnI,QAAM,QAAkB,CAAC;AACzB,MAAI,QAAQ,OAAO;AACjB,UAAM;AAAA,MACJ,QAAQ,MACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,CAAC,EACA,KAAK,KAAK;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,2 +1,116 @@
|
|
|
1
|
-
|
|
1
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
2
|
+
import { Typography } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
// src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
|
|
5
|
+
var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
6
|
+
const parts = [];
|
|
7
|
+
const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
|
|
8
|
+
if (typeof typeString === "string") {
|
|
9
|
+
parts.push(typeString);
|
|
10
|
+
}
|
|
11
|
+
parts.push("[]");
|
|
12
|
+
return parts;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
|
|
16
|
+
var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
17
|
+
const parts = [];
|
|
18
|
+
if (typeObj.types) {
|
|
19
|
+
parts.push(
|
|
20
|
+
typeObj.types.map((arg) => {
|
|
21
|
+
return typeBuilder(arg, reflectionViewer);
|
|
22
|
+
}).join(" & ")
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return parts;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
|
|
29
|
+
var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
30
|
+
const parts = [];
|
|
31
|
+
parts.push(typeObj.name);
|
|
32
|
+
if (typeObj.typeArguments) {
|
|
33
|
+
parts.push("<");
|
|
34
|
+
parts.push(
|
|
35
|
+
typeObj.typeArguments.map((arg) => {
|
|
36
|
+
return typeBuilder(arg, reflectionViewer);
|
|
37
|
+
}).join(", ")
|
|
38
|
+
);
|
|
39
|
+
parts.push(">");
|
|
40
|
+
}
|
|
41
|
+
return parts;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
|
|
45
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
46
|
+
var buildRelfectionString = (typeObj, reflectionViewer) => {
|
|
47
|
+
if (typeObj.declaration) {
|
|
48
|
+
return /* @__PURE__ */ jsx(Fragment, { children: reflectionViewer({ reflection: typeObj.declaration }) });
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx
|
|
53
|
+
var buildUnionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
54
|
+
const parts = [];
|
|
55
|
+
if (typeObj.types) {
|
|
56
|
+
parts.push(
|
|
57
|
+
typeObj.types.map((arg) => {
|
|
58
|
+
return typeBuilder(arg, reflectionViewer);
|
|
59
|
+
}).join(" | ")
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return parts;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx
|
|
66
|
+
var buildTypeString = (type, reflectionViewer) => {
|
|
67
|
+
const someType = type;
|
|
68
|
+
const parts = [];
|
|
69
|
+
switch (someType.type) {
|
|
70
|
+
case "intrinsic":
|
|
71
|
+
parts.push(someType.name);
|
|
72
|
+
break;
|
|
73
|
+
case "intersection": {
|
|
74
|
+
parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString));
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case "literal":
|
|
78
|
+
parts.push(JSON.stringify(someType.value));
|
|
79
|
+
break;
|
|
80
|
+
case "array": {
|
|
81
|
+
parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString));
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case "reference": {
|
|
85
|
+
parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString));
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case "union": {
|
|
89
|
+
parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString));
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case "reflection": {
|
|
93
|
+
return buildRelfectionString(someType, reflectionViewer);
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
parts.push("#");
|
|
97
|
+
parts.push(someType.type);
|
|
98
|
+
parts.push("#");
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
return parts.join("");
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
105
|
+
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
106
|
+
var SomeTypeViewer = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {
|
|
107
|
+
const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : "";
|
|
108
|
+
if (typeof typeReactNode === "string") {
|
|
109
|
+
return /* @__PURE__ */ jsx2(Typography, { title: "SomeTypeViewer", style: { opacity }, ...props, children: typeReactNode });
|
|
110
|
+
}
|
|
111
|
+
return /* @__PURE__ */ jsx2(Fragment2, { children: typeReactNode });
|
|
112
|
+
};
|
|
113
|
+
export {
|
|
114
|
+
SomeTypeViewer
|
|
115
|
+
};
|
|
2
116
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/
|
|
1
|
+
{"version":3,"sources":["../../../../src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts","../../../../src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx","../../../../src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx"],"sourcesContent":["import { Typography, TypographyProps } from '@mui/material'\n\nimport { SomeReflection } from '../../SomeReflection'\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildTypeString } from './buildTypeString'\n\nexport interface SomeTypeViewerProps extends TypographyProps {\n opacity?: number\n reflection: SomeReflection\n reflectionViewer: React.FC<ReflectionViewerProps>\n}\n\nexport const SomeTypeViewer: React.FC<SomeTypeViewerProps> = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {\n const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : ''\n if (typeof typeReactNode === 'string') {\n return (\n <Typography title=\"SomeTypeViewer\" style={{ opacity }} {...props}>\n {typeReactNode}\n </Typography>\n )\n }\n return <>{typeReactNode}</>\n}\n","import type { ArrayType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildArrayString = (typeObj: ArrayType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n const typeString = typeBuilder(typeObj.elementType, reflectionViewer)\n if (typeof typeString === 'string') {\n parts.push(typeString)\n }\n parts.push('[]')\n return parts\n}\n","import type { IntersectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildIntersectionString = (typeObj: IntersectionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' & '),\n )\n }\n return parts\n}\n","import type { ReferenceType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildReferenceString = (typeObj: ReferenceType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n parts.push(typeObj.name)\n if (typeObj.typeArguments) {\n parts.push('<')\n parts.push(\n typeObj.typeArguments\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(', '),\n )\n parts.push('>')\n }\n return parts\n}\n","import type { ReflectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\n\nexport const buildRelfectionString = (typeObj: ReflectionType, reflectionViewer: React.FC<ReflectionViewerProps>) => {\n if (typeObj.declaration) {\n return <>{reflectionViewer({ reflection: typeObj.declaration })}</>\n }\n}\n","import type { UnionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildUnionString = (typeObj: UnionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' | '),\n )\n }\n return parts\n}\n","import { ReactNode } from 'react'\nimport type { SomeType, Type } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildArrayString } from './buildArrayString'\nimport { buildIntersectionString } from './buildIntersectionString'\nimport { buildReferenceString } from './buildReferenceString'\nimport { buildRelfectionString } from './buildReflectionString'\nimport { buildUnionString } from './buildUnionString'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildTypeString: TypeBuilder = (type: SomeType | Type, reflectionViewer: React.FC<ReflectionViewerProps>): ReactNode => {\n const someType = type as SomeType\n const parts: string[] = []\n\n switch (someType.type) {\n case 'intrinsic':\n parts.push(someType.name)\n break\n case 'intersection': {\n parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'literal':\n parts.push(JSON.stringify(someType.value))\n break\n case 'array': {\n parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reference': {\n parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'union': {\n parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reflection': {\n return buildRelfectionString(someType, reflectionViewer)\n }\n default:\n parts.push('#')\n parts.push(someType.type)\n parts.push('#')\n break\n }\n return parts.join('')\n}\n"],"mappings":";AAAA,SAAS,kBAAmC;;;ACKrC,IAAM,mBAAmB,CAAC,SAAoB,kBAAmD,gBAA6B;AACnI,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAa,YAAY,QAAQ,aAAa,gBAAgB;AACpE,MAAI,OAAO,eAAe,UAAU;AAClC,UAAM,KAAK,UAAU;AAAA,EACvB;AACA,QAAM,KAAK,IAAI;AACf,SAAO;AACT;;;ACRO,IAAM,0BAA0B,CAAC,SAA2B,kBAAmD,gBAA6B;AACjJ,QAAM,QAAkB,CAAC;AACzB,MAAI,QAAQ,OAAO;AACjB,UAAM;AAAA,MACJ,QAAQ,MACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,CAAC,EACA,KAAK,KAAK;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;;;ACZO,IAAM,uBAAuB,CAAC,SAAwB,kBAAmD,gBAA6B;AAC3I,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,QAAQ,IAAI;AACvB,MAAI,QAAQ,eAAe;AACzB,UAAM,KAAK,GAAG;AACd,UAAM;AAAA,MACJ,QAAQ,cACL,IAAI,CAAC,QAAQ;AACZ,eAAO,YAAY,KAAK,gBAAgB;AAAA,MAC1C,CAAC,EACA,KAAK,IAAI;AAAA,IACd;AACA,UAAM,KAAK,GA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