@d-fischer/documen.ts 0.16.9 → 0.17.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/index.html +36 -35
- package/lib/common/CustomError.js +1 -4
- package/lib/common/CustomError.js.map +1 -1
- package/lib/common/Paths.js +1 -2
- package/lib/common/components/Badge.js +7 -10
- package/lib/common/components/Badge.js.map +1 -1
- package/lib/common/components/BetaNotice.js +5 -10
- package/lib/common/components/BetaNotice.js.map +1 -1
- package/lib/common/components/Button.js +8 -12
- package/lib/common/components/Button.js.map +1 -1
- package/lib/common/components/CodeBlock.js +45 -61
- package/lib/common/components/CodeBlock.js.map +1 -1
- package/lib/common/components/CodeLink.js +12 -15
- package/lib/common/components/CodeLink.js.map +1 -1
- package/lib/common/components/DeprecationNotice.js +5 -10
- package/lib/common/components/DeprecationNotice.js.map +1 -1
- package/lib/common/components/FunctionParamDesc.js +7 -19
- package/lib/common/components/FunctionParamDesc.js.map +1 -1
- package/lib/common/components/FunctionParamDescEntry.js +26 -38
- package/lib/common/components/FunctionParamDescEntry.js.map +1 -1
- package/lib/common/components/FunctionReturnType.js +8 -17
- package/lib/common/components/FunctionReturnType.js.map +1 -1
- package/lib/common/components/FunctionSignature.js +7 -22
- package/lib/common/components/FunctionSignature.js.map +1 -1
- package/lib/common/components/InterfaceDetail.js +11 -18
- package/lib/common/components/InterfaceDetail.js.map +1 -1
- package/lib/common/components/InterfaceRepresentation.js +21 -40
- package/lib/common/components/InterfaceRepresentation.js.map +1 -1
- package/lib/common/components/MainMenu.js +20 -36
- package/lib/common/components/MainMenu.js.map +1 -1
- package/lib/common/components/NavMenu.js +6 -9
- package/lib/common/components/NavMenu.js.map +1 -1
- package/lib/common/components/NavMenuGroup.js +5 -10
- package/lib/common/components/NavMenuGroup.js.map +1 -1
- package/lib/common/components/NavMenuItem.js +8 -11
- package/lib/common/components/NavMenuItem.js.map +1 -1
- package/lib/common/components/PageArticle.js +7 -10
- package/lib/common/components/PageArticle.js.map +1 -1
- package/lib/common/components/SymbolHeader.js +6 -20
- package/lib/common/components/SymbolHeader.js.map +1 -1
- package/lib/common/components/TypeAliasHint.js +7 -22
- package/lib/common/components/TypeAliasHint.js.map +1 -1
- package/lib/common/components/TypeLink.js +12 -16
- package/lib/common/components/TypeLink.js.map +1 -1
- package/lib/common/components/VersionMenu.js +21 -28
- package/lib/common/components/VersionMenu.js.map +1 -1
- package/lib/common/components/cards/CardToolbar.js +11 -17
- package/lib/common/components/cards/CardToolbar.js.map +1 -1
- package/lib/common/components/cards/EventCard.js +21 -46
- package/lib/common/components/cards/EventCard.js.map +1 -1
- package/lib/common/components/cards/FunctionCardHeader.js +13 -25
- package/lib/common/components/cards/FunctionCardHeader.js.map +1 -1
- package/lib/common/components/cards/MethodCard.js +13 -23
- package/lib/common/components/cards/MethodCard.js.map +1 -1
- package/lib/common/components/cards/PropertyCard.js +15 -31
- package/lib/common/components/cards/PropertyCard.js.map +1 -1
- package/lib/common/components/codeBuilders/ReferenceTypeView.js +12 -25
- package/lib/common/components/codeBuilders/ReferenceTypeView.js.map +1 -1
- package/lib/common/components/codeBuilders/Type.js +30 -75
- package/lib/common/components/codeBuilders/Type.js.map +1 -1
- package/lib/common/components/overviewTable/OverviewTable.js +6 -21
- package/lib/common/components/overviewTable/OverviewTable.js.map +1 -1
- package/lib/common/components/overviewTable/OverviewTableEntry.js +13 -22
- package/lib/common/components/overviewTable/OverviewTableEntry.js.map +1 -1
- package/lib/common/config/Config.js +1 -2
- package/lib/common/config/Util.js +4 -8
- package/lib/common/config/Util.js.map +1 -1
- package/lib/common/config/index.js +5 -9
- package/lib/common/config/index.js.map +1 -1
- package/lib/common/containers/App.js +10 -18
- package/lib/common/containers/App.js.map +1 -1
- package/lib/common/containers/AppLayout.js +5 -10
- package/lib/common/containers/AppLayout.js.map +1 -1
- package/lib/common/containers/Card.js +6 -9
- package/lib/common/containers/Card.js.map +1 -1
- package/lib/common/containers/PageContent.js +5 -8
- package/lib/common/containers/PageContent.js.map +1 -1
- package/lib/common/containers/PageHeader.js +5 -8
- package/lib/common/containers/PageHeader.js.map +1 -1
- package/lib/common/containers/PageSwitch.js +10 -19
- package/lib/common/containers/PageSwitch.js.map +1 -1
- package/lib/common/containers/ReferencePackageContainer.js +37 -54
- package/lib/common/containers/ReferencePackageContainer.js.map +1 -1
- package/lib/common/htmlRenderer/HtmlRenderer.js +23 -37
- package/lib/common/htmlRenderer/HtmlRenderer.js.map +1 -1
- package/lib/common/htmlRenderer/RouterMode.js +1 -2
- package/lib/common/htmlRenderer/StaticRouterWithSuffix.js +20 -24
- package/lib/common/htmlRenderer/StaticRouterWithSuffix.js.map +1 -1
- package/lib/common/pages/ClassPage.js +39 -67
- package/lib/common/pages/ClassPage.js.map +1 -1
- package/lib/common/pages/DocPage.js +27 -39
- package/lib/common/pages/DocPage.js.map +1 -1
- package/lib/common/pages/EnumPage.js +20 -40
- package/lib/common/pages/EnumPage.js.map +1 -1
- package/lib/common/pages/FunctionPage.js +20 -39
- package/lib/common/pages/FunctionPage.js.map +1 -1
- package/lib/common/pages/InterfacePage.js +20 -32
- package/lib/common/pages/InterfacePage.js.map +1 -1
- package/lib/common/pages/TypeAliasPage.js +19 -34
- package/lib/common/pages/TypeAliasPage.js.map +1 -1
- package/lib/common/reference/index.js +1 -3
- package/lib/common/reference/index.js.map +1 -1
- package/lib/common/theme.js +1 -3
- package/lib/common/theme.js.map +1 -1
- package/lib/common/tools/ArrayTools.js +7 -18
- package/lib/common/tools/ArrayTools.js.map +1 -1
- package/lib/common/tools/CodeTools.js +12 -23
- package/lib/common/tools/CodeTools.js.map +1 -1
- package/lib/common/tools/ConfigTools.js +15 -20
- package/lib/common/tools/ConfigTools.js.map +1 -1
- package/lib/common/tools/FileTools.js +9 -16
- package/lib/common/tools/FileTools.js.map +1 -1
- package/lib/common/tools/FunctionTools.js +3 -7
- package/lib/common/tools/FunctionTools.js.map +1 -1
- package/lib/common/tools/NodeTools.js +22 -33
- package/lib/common/tools/NodeTools.js.map +1 -1
- package/lib/common/tools/Point.js +1 -2
- package/lib/common/tools/ReferenceTools.js +30 -43
- package/lib/common/tools/ReferenceTools.js.map +1 -1
- package/lib/common/tools/StringTools.js +3 -9
- package/lib/common/tools/StringTools.js.map +1 -1
- package/lib/common/tools/TypeTools.js +1 -2
- package/lib/common/tools/markdown/MarkdownParser.js +21 -28
- package/lib/common/tools/markdown/MarkdownParser.js.map +1 -1
- package/lib/common/tools/markdown/plugins/customDirectives.js +15 -17
- package/lib/common/tools/markdown/plugins/customDirectives.js.map +1 -1
- package/lib/common/tools/markdown/plugins/gfmTables.js +7 -12
- package/lib/common/tools/markdown/plugins/gfmTables.js.map +1 -1
- package/lib/common/tools/markdown/plugins/symbolLinks.js +9 -13
- package/lib/common/tools/markdown/plugins/symbolLinks.js.map +1 -1
- package/lib/generator/analyzer/AnalyzeContext.js +5 -6
- package/lib/generator/analyzer/AnalyzeContext.js.map +1 -1
- package/lib/generator/analyzer/DocComment.js +17 -23
- package/lib/generator/analyzer/DocComment.js.map +1 -1
- package/lib/generator/analyzer/DocCommentTag.js +4 -5
- package/lib/generator/analyzer/DocCommentTag.js.map +1 -1
- package/lib/generator/analyzer/Project.js +71 -84
- package/lib/generator/analyzer/Project.js.map +1 -1
- package/lib/generator/analyzer/createReflection.js +87 -101
- package/lib/generator/analyzer/createReflection.js.map +1 -1
- package/lib/generator/analyzer/createType.js +51 -62
- package/lib/generator/analyzer/createType.js.map +1 -1
- package/lib/generator/analyzer/reflections/AccessorReflection.js +36 -39
- package/lib/generator/analyzer/reflections/AccessorReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/ClassReflection.js +58 -51
- package/lib/generator/analyzer/reflections/ClassReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/ConstructorReflection.js +28 -36
- package/lib/generator/analyzer/reflections/ConstructorReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/EnumMemberReflection.js +15 -18
- package/lib/generator/analyzer/reflections/EnumMemberReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/EnumReflection.js +21 -23
- package/lib/generator/analyzer/reflections/EnumReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/FunctionReflection.js +14 -16
- package/lib/generator/analyzer/reflections/FunctionReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/Heritage.js +6 -11
- package/lib/generator/analyzer/reflections/Heritage.js.map +1 -1
- package/lib/generator/analyzer/reflections/InterfaceReflection.js +41 -41
- package/lib/generator/analyzer/reflections/InterfaceReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/MethodReflection.js +40 -45
- package/lib/generator/analyzer/reflections/MethodReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/ParameterReflection.js +68 -69
- package/lib/generator/analyzer/reflections/ParameterReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/PropertyReflection.js +43 -40
- package/lib/generator/analyzer/reflections/PropertyReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/ReferenceReflection.js +8 -7
- package/lib/generator/analyzer/reflections/ReferenceReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/Reflection.js +35 -38
- package/lib/generator/analyzer/reflections/Reflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/SignatureReflection.js +42 -46
- package/lib/generator/analyzer/reflections/SignatureReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/SymbolBasedReflection.js +6 -13
- package/lib/generator/analyzer/reflections/SymbolBasedReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/TypeAliasReflection.js +24 -26
- package/lib/generator/analyzer/reflections/TypeAliasReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/TypeLiteralReflection.js +22 -21
- package/lib/generator/analyzer/reflections/TypeLiteralReflection.js.map +1 -1
- package/lib/generator/analyzer/reflections/TypeParameterReflection.js +38 -39
- package/lib/generator/analyzer/reflections/TypeParameterReflection.js.map +1 -1
- package/lib/generator/analyzer/types/ArrayType.js +15 -23
- package/lib/generator/analyzer/types/ArrayType.js.map +1 -1
- package/lib/generator/analyzer/types/FunctionType.js +31 -38
- package/lib/generator/analyzer/types/FunctionType.js.map +1 -1
- package/lib/generator/analyzer/types/IntersectionType.js +12 -20
- package/lib/generator/analyzer/types/IntersectionType.js.map +1 -1
- package/lib/generator/analyzer/types/IntrinsicType.js +33 -41
- package/lib/generator/analyzer/types/IntrinsicType.js.map +1 -1
- package/lib/generator/analyzer/types/LiteralType.js +60 -68
- package/lib/generator/analyzer/types/LiteralType.js.map +1 -1
- package/lib/generator/analyzer/types/NamedTupleElementType.js +11 -15
- package/lib/generator/analyzer/types/NamedTupleElementType.js.map +1 -1
- package/lib/generator/analyzer/types/ObjectLiteralType.js +21 -30
- package/lib/generator/analyzer/types/ObjectLiteralType.js.map +1 -1
- package/lib/generator/analyzer/types/OptionalType.js +11 -17
- package/lib/generator/analyzer/types/OptionalType.js.map +1 -1
- package/lib/generator/analyzer/types/ReferenceType.js +118 -133
- package/lib/generator/analyzer/types/ReferenceType.js.map +1 -1
- package/lib/generator/analyzer/types/ReflectionType.js +4 -7
- package/lib/generator/analyzer/types/ReflectionType.js.map +1 -1
- package/lib/generator/analyzer/types/TupleType.js +27 -31
- package/lib/generator/analyzer/types/TupleType.js.map +1 -1
- package/lib/generator/analyzer/types/Type.js +1 -5
- package/lib/generator/analyzer/types/Type.js.map +1 -1
- package/lib/generator/analyzer/types/TypeOperatorType.js +38 -40
- package/lib/generator/analyzer/types/TypeOperatorType.js.map +1 -1
- package/lib/generator/analyzer/types/UnionType.js +22 -30
- package/lib/generator/analyzer/types/UnionType.js.map +1 -1
- package/lib/generator/analyzer/types/UnknownType.js +5 -6
- package/lib/generator/analyzer/types/UnknownType.js.map +1 -1
- package/lib/generator/analyzer/util/expressions.js +8 -13
- package/lib/generator/analyzer/util/expressions.js.map +1 -1
- package/lib/generator/analyzer/util/functions.js +15 -19
- package/lib/generator/analyzer/util/functions.js.map +1 -1
- package/lib/generator/analyzer/util/inheritance.js +26 -32
- package/lib/generator/analyzer/util/inheritance.js.map +1 -1
- package/lib/generator/analyzer/util/promises.js +2 -9
- package/lib/generator/analyzer/util/promises.js.map +1 -1
- package/lib/generator/analyzer/util/sourceMaps.js +12 -20
- package/lib/generator/analyzer/util/sourceMaps.js.map +1 -1
- package/lib/generator/analyzer/util/symbols.js +3 -9
- package/lib/generator/analyzer/util/symbols.js.map +1 -1
- package/lib/generator/analyzer/util/types.js +6 -10
- package/lib/generator/analyzer/util/types.js.map +1 -1
- package/lib/generator/cli.js +5 -8
- package/lib/generator/cli.js.map +1 -1
- package/lib/generator/commands/default.js +260 -259
- package/lib/generator/commands/default.js.map +1 -1
- package/lib/generator/index.js +1 -1
- package/lib/generator/modes/Generator.js +20 -31
- package/lib/generator/modes/Generator.js.map +1 -1
- package/lib/generator/modes/HtmlGenerator.js +214 -228
- package/lib/generator/modes/HtmlGenerator.js.map +1 -1
- package/lib/generator/modes/MonorepoGenerator.js +143 -159
- package/lib/generator/modes/MonorepoGenerator.js.map +1 -1
- package/lib/generator/modes/OutputGenerator.js +2 -7
- package/lib/generator/modes/OutputGenerator.js.map +1 -1
- package/lib/progressiveEnhancement/fsMap.js +2 -5
- package/lib/progressiveEnhancement/fsMap.js.map +1 -1
- package/package.json +16 -16
- package/src/common/components/CodeBlock.tsx +2 -2
- package/src/common/components/CodeLink.tsx +2 -2
- package/src/common/components/DeprecationNotice.tsx +2 -2
- package/src/common/components/FunctionParamDesc.tsx +3 -3
- package/src/common/components/FunctionParamDescEntry.tsx +6 -6
- package/src/common/components/FunctionReturnType.tsx +3 -3
- package/src/common/components/FunctionSignature.tsx +2 -2
- package/src/common/components/InterfaceDetail.tsx +15 -7
- package/src/common/components/InterfaceRepresentation.tsx +9 -9
- package/src/common/components/MainMenu.tsx +4 -4
- package/src/common/components/NavMenuItem.tsx +1 -1
- package/src/common/components/PageArticle.tsx +2 -2
- package/src/common/components/SymbolHeader.tsx +7 -9
- package/src/common/components/TypeAliasHint.tsx +3 -5
- package/src/common/components/TypeLink.tsx +6 -7
- package/src/common/components/VersionMenu.tsx +3 -3
- package/src/common/components/cards/CardToolbar.tsx +10 -6
- package/src/common/components/cards/EventCard.tsx +19 -23
- package/src/common/components/cards/FunctionCardHeader.tsx +8 -8
- package/src/common/components/cards/MethodCard.tsx +8 -8
- package/src/common/components/cards/PropertyCard.tsx +11 -11
- package/src/common/components/codeBuilders/ReferenceTypeView.tsx +4 -4
- package/src/common/components/codeBuilders/Type.tsx +4 -4
- package/src/common/components/overviewTable/OverviewTable.tsx +2 -2
- package/src/common/components/overviewTable/OverviewTableEntry.tsx +7 -7
- package/src/common/config/Config.ts +1 -1
- package/src/common/config/Util.ts +11 -3
- package/src/common/config/index.tsx +2 -2
- package/src/common/containers/App.tsx +12 -9
- package/src/common/containers/AppLayout.tsx +2 -2
- package/src/common/containers/PageHeader.tsx +2 -2
- package/src/common/containers/PageSwitch.tsx +7 -7
- package/src/common/containers/ReferencePackageContainer.tsx +13 -13
- package/src/common/htmlRenderer/HtmlRenderer.tsx +8 -9
- package/src/common/htmlRenderer/StaticRouterWithSuffix.tsx +18 -21
- package/src/common/pages/ClassPage.tsx +17 -17
- package/src/common/pages/DocPage.tsx +10 -10
- package/src/common/pages/EnumPage.tsx +14 -14
- package/src/common/pages/FunctionPage.tsx +15 -15
- package/src/common/pages/InterfacePage.tsx +13 -13
- package/src/common/pages/TypeAliasPage.tsx +12 -12
- package/src/common/reference/index.ts +0 -1
- package/src/common/tools/ArrayTools.ts +27 -11
- package/src/common/tools/CodeTools.tsx +1 -1
- package/src/common/tools/ConfigTools.ts +1 -1
- package/src/common/tools/FunctionTools.ts +2 -3
- package/src/common/tools/NodeTools.ts +3 -2
- package/src/common/tools/ReferenceTools.ts +10 -11
- package/src/common/tools/StringTools.ts +1 -1
- package/src/common/tools/markdown/MarkdownParser.tsx +13 -15
- package/src/common/tools/markdown/plugins/customDirectives.ts +1 -1
- package/src/common/tools/markdown/plugins/symbolLinks.ts +3 -3
- package/src/dev/index.tsx +9 -9
- package/src/dev/registerServiceWorker.ts +8 -16
- package/src/progressiveEnhancement/fsMap.ts +0 -1
- package/src/progressiveEnhancement/index.tsx +9 -11
- package/tsconfig-dev.json +1 -6
- package/tsconfig-enhance.json +1 -5
- package/tsconfig-html.json +1 -5
- package/tsconfig.json +7 -21
- package/types/globals.d.ts +0 -1
- package/types/react-router-hash-link.d.ts +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@mui/styles';
|
|
2
|
-
import
|
|
2
|
+
import { type PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
const useStyles = makeStyles(
|
|
5
5
|
theme => ({
|
|
@@ -24,7 +24,7 @@ const useStyles = makeStyles(
|
|
|
24
24
|
{ name: 'PageHeader' }
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
const PageHeader
|
|
27
|
+
const PageHeader = ({ children }: PropsWithChildren) => {
|
|
28
28
|
const classes = useStyles();
|
|
29
29
|
return <div className={classes.root}>{children}</div>;
|
|
30
30
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Route, Routes } from 'react-router
|
|
3
|
-
import ClassPage from '../pages/ClassPage';
|
|
4
|
-
import DocPage from '../pages/DocPage';
|
|
5
|
-
import EnumPage from '../pages/EnumPage';
|
|
6
|
-
import FunctionPage from '../pages/FunctionPage';
|
|
7
|
-
import InterfacePage from '../pages/InterfacePage';
|
|
8
|
-
import TypeAliasPage from '../pages/TypeAliasPage';
|
|
2
|
+
import { Route, Routes } from 'react-router';
|
|
3
|
+
import ClassPage from '../pages/ClassPage.js';
|
|
4
|
+
import DocPage from '../pages/DocPage.js';
|
|
5
|
+
import EnumPage from '../pages/EnumPage.js';
|
|
6
|
+
import FunctionPage from '../pages/FunctionPage.js';
|
|
7
|
+
import InterfacePage from '../pages/InterfacePage.js';
|
|
8
|
+
import TypeAliasPage from '../pages/TypeAliasPage.js';
|
|
9
9
|
|
|
10
10
|
const PageSwitch: React.FunctionComponent = () => (
|
|
11
11
|
<Routes>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { groupBy } from '@d-fischer/shared-utils';
|
|
2
2
|
import { makeStyles } from '@mui/styles';
|
|
3
3
|
import React, { useContext, useMemo } from 'react';
|
|
4
|
-
import { useParams } from 'react-router
|
|
4
|
+
import { useParams } from 'react-router';
|
|
5
5
|
|
|
6
|
-
import NavMenu from '../components/NavMenu';
|
|
7
|
-
import NavMenuGroup from '../components/NavMenuGroup';
|
|
8
|
-
import NavMenuItem from '../components/NavMenuItem';
|
|
9
|
-
import { ConfigContext } from '../config';
|
|
6
|
+
import NavMenu from '../components/NavMenu.js';
|
|
7
|
+
import NavMenuGroup from '../components/NavMenuGroup.js';
|
|
8
|
+
import NavMenuItem from '../components/NavMenuItem.js';
|
|
9
|
+
import { ConfigContext } from '../config/index.js';
|
|
10
10
|
import type {
|
|
11
11
|
ClassReferenceNode,
|
|
12
12
|
EnumReferenceNode,
|
|
@@ -14,13 +14,13 @@ import type {
|
|
|
14
14
|
InterfaceReferenceNode,
|
|
15
15
|
ReferenceNode,
|
|
16
16
|
TypeAliasReferenceNode
|
|
17
|
-
} from '../reference';
|
|
18
|
-
import { partition } from '../tools/ArrayTools';
|
|
19
|
-
import { getPageType } from '../tools/CodeTools';
|
|
20
|
-
import { checkVisibility, defaultNodeSort, getNodeMeta } from '../tools/NodeTools';
|
|
21
|
-
import { getPackageRoot } from '../tools/ReferenceTools';
|
|
22
|
-
import { getPackagePath } from '../tools/StringTools';
|
|
23
|
-
import PageSwitch from './PageSwitch';
|
|
17
|
+
} from '../reference/index.js';
|
|
18
|
+
import { partition } from '../tools/ArrayTools.js';
|
|
19
|
+
import { getPageType } from '../tools/CodeTools.js';
|
|
20
|
+
import { checkVisibility, defaultNodeSort, getNodeMeta } from '../tools/NodeTools.js';
|
|
21
|
+
import { getPackageRoot } from '../tools/ReferenceTools.js';
|
|
22
|
+
import { getPackagePath } from '../tools/StringTools.js';
|
|
23
|
+
import PageSwitch from './PageSwitch.js';
|
|
24
24
|
|
|
25
25
|
const useStyles = makeStyles(
|
|
26
26
|
{
|
|
@@ -111,7 +111,7 @@ export const ReferencePackageContainer: React.FC = () => {
|
|
|
111
111
|
<NavMenu className={classes.nav}>
|
|
112
112
|
{filledReferenceCategories?.map(cat => (
|
|
113
113
|
<NavMenuGroup key={cat.name} title={cat.title}>
|
|
114
|
-
{nodesByCategory[cat.name]
|
|
114
|
+
{nodesByCategory[cat.name].map(node => (
|
|
115
115
|
<NavMenuItem
|
|
116
116
|
key={node.id}
|
|
117
117
|
path={`/reference${pkgPath}/${getPageType(node)}/${node.name}`}
|
|
@@ -3,15 +3,14 @@ import { ServerStyleSheets, ThemeProvider } from '@mui/styles';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { renderToString } from 'react-dom/server';
|
|
6
|
-
import { StaticRouter } from 'react-router
|
|
7
|
-
import type
|
|
8
|
-
import {
|
|
9
|
-
import { ConfigContext } from '../config';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import StaticRouterWithSuffix from './StaticRouterWithSuffix';
|
|
6
|
+
import { StaticRouter } from 'react-router';
|
|
7
|
+
import { type ArticleContent, PageArticleContext } from '../components/PageArticle.js';
|
|
8
|
+
import type { Config } from '../config/Config.js';
|
|
9
|
+
import { ConfigContext } from '../config/index.js';
|
|
10
|
+
import App from '../containers/App.js';
|
|
11
|
+
import theme from '../theme.js';
|
|
12
|
+
import type RouterMode from './RouterMode.js';
|
|
13
|
+
import StaticRouterWithSuffix from './StaticRouterWithSuffix.js';
|
|
15
14
|
|
|
16
15
|
const insertIntoSkeleton = (html: string, css: string, baseUrl: string, config: Config) =>
|
|
17
16
|
`<!doctype html>
|
|
@@ -22,7 +22,7 @@ const stripSuffix = (suffix: string, location: Location): Location => {
|
|
|
22
22
|
|
|
23
23
|
const createUrl = (location: To, suffix?: string): string => {
|
|
24
24
|
if (typeof location === 'string') {
|
|
25
|
-
return
|
|
25
|
+
return location.endsWith('/') || !suffix ? location : `${location}${suffix}`;
|
|
26
26
|
}
|
|
27
27
|
if (!location.pathname) {
|
|
28
28
|
return '/';
|
|
@@ -34,7 +34,12 @@ const createUrl = (location: To, suffix?: string): string => {
|
|
|
34
34
|
return createPath(location);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const StaticRouterWithSuffix: React.FunctionComponent<React.PropsWithChildren<StaticRouterWithSuffixProps>> = ({
|
|
37
|
+
const StaticRouterWithSuffix: React.FunctionComponent<React.PropsWithChildren<StaticRouterWithSuffixProps>> = ({
|
|
38
|
+
children,
|
|
39
|
+
location: loc,
|
|
40
|
+
suffix,
|
|
41
|
+
basename
|
|
42
|
+
}) => {
|
|
38
43
|
if (typeof loc === 'string') {
|
|
39
44
|
loc = parsePath(loc);
|
|
40
45
|
}
|
|
@@ -58,52 +63,44 @@ const StaticRouterWithSuffix: React.FunctionComponent<React.PropsWithChildren<St
|
|
|
58
63
|
push(to: To) {
|
|
59
64
|
throw new Error(
|
|
60
65
|
'You cannot use navigator.push() on the server because it is a stateless ' +
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
'environment. This error was probably triggered when you did a ' +
|
|
67
|
+
`\`navigate(${JSON.stringify(to)})\` somewhere in your app.`
|
|
63
68
|
);
|
|
64
69
|
},
|
|
65
70
|
replace(to: To) {
|
|
66
71
|
throw new Error(
|
|
67
72
|
'You cannot use navigator.replace() on the server because it is a stateless ' +
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
'environment. This error was probably triggered when you did a ' +
|
|
74
|
+
`\`navigate(${JSON.stringify(to)}, { replace: true })\` somewhere ` +
|
|
75
|
+
'in your app.'
|
|
71
76
|
);
|
|
72
77
|
},
|
|
73
78
|
go(delta: number) {
|
|
74
79
|
throw new Error(
|
|
75
80
|
'You cannot use navigator.go() on the server because it is a stateless ' +
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
'environment. This error was probably triggered when you did a ' +
|
|
82
|
+
`\`navigate(${delta})\` somewhere in your app.`
|
|
78
83
|
);
|
|
79
84
|
},
|
|
80
85
|
back() {
|
|
81
86
|
throw new Error(
|
|
82
|
-
'You cannot use navigator.back() on the server because it is a stateless ' +
|
|
83
|
-
'environment.'
|
|
87
|
+
'You cannot use navigator.back() on the server because it is a stateless ' + 'environment.'
|
|
84
88
|
);
|
|
85
89
|
},
|
|
86
90
|
forward() {
|
|
87
91
|
throw new Error(
|
|
88
|
-
'You cannot use navigator.forward() on the server because it is a stateless ' +
|
|
89
|
-
'environment.'
|
|
92
|
+
'You cannot use navigator.forward() on the server because it is a stateless ' + 'environment.'
|
|
90
93
|
);
|
|
91
94
|
},
|
|
92
95
|
block() {
|
|
93
96
|
throw new Error(
|
|
94
|
-
'You cannot use navigator.block() on the server because it is a stateless ' +
|
|
95
|
-
'environment.'
|
|
97
|
+
'You cannot use navigator.block() on the server because it is a stateless ' + 'environment.'
|
|
96
98
|
);
|
|
97
99
|
}
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
return (
|
|
101
|
-
<Router
|
|
102
|
-
basename={basename}
|
|
103
|
-
location={location}
|
|
104
|
-
navigator={staticNavigator}
|
|
105
|
-
static={true}
|
|
106
|
-
>
|
|
103
|
+
<Router basename={basename} location={location} navigator={staticNavigator} static={true}>
|
|
107
104
|
{children}
|
|
108
105
|
</Router>
|
|
109
106
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Navigate, useParams } from 'react-router
|
|
3
|
-
import BetaNotice from '../components/BetaNotice';
|
|
4
|
-
import EventCard from '../components/cards/EventCard';
|
|
5
|
-
import MethodCard from '../components/cards/MethodCard';
|
|
6
|
-
import PropertyCard from '../components/cards/PropertyCard';
|
|
7
|
-
import DeprecationNotice from '../components/DeprecationNotice';
|
|
8
|
-
import OverviewTable from '../components/overviewTable/OverviewTable';
|
|
9
|
-
import SymbolHeader from '../components/SymbolHeader';
|
|
10
|
-
import PageContent from '../containers/PageContent';
|
|
11
|
-
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer';
|
|
2
|
+
import { Navigate, useParams } from 'react-router';
|
|
3
|
+
import BetaNotice from '../components/BetaNotice.js';
|
|
4
|
+
import EventCard from '../components/cards/EventCard.js';
|
|
5
|
+
import MethodCard from '../components/cards/MethodCard.js';
|
|
6
|
+
import PropertyCard from '../components/cards/PropertyCard.js';
|
|
7
|
+
import DeprecationNotice from '../components/DeprecationNotice.js';
|
|
8
|
+
import OverviewTable from '../components/overviewTable/OverviewTable.js';
|
|
9
|
+
import SymbolHeader from '../components/SymbolHeader.js';
|
|
10
|
+
import PageContent from '../containers/PageContent.js';
|
|
11
|
+
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer.js';
|
|
12
12
|
import type {
|
|
13
13
|
AccessorReferenceNode,
|
|
14
14
|
CallSignatureReferenceNode,
|
|
@@ -16,13 +16,13 @@ import type {
|
|
|
16
16
|
ConstructorReferenceNode,
|
|
17
17
|
MethodReferenceNode,
|
|
18
18
|
PropertyReferenceNode
|
|
19
|
-
} from '../reference';
|
|
20
|
-
import { partition } from '../tools/ArrayTools';
|
|
21
|
-
import { getPageType, getTag, hasTag } from '../tools/CodeTools';
|
|
22
|
-
import MarkdownParser from '../tools/markdown/MarkdownParser';
|
|
23
|
-
import { checkVisibility, defaultNodeSort } from '../tools/NodeTools';
|
|
24
|
-
import { filterChildrenByMember, findSymbolByMember } from '../tools/ReferenceTools';
|
|
25
|
-
import { getPackagePath } from '../tools/StringTools';
|
|
19
|
+
} from '../reference/index.js';
|
|
20
|
+
import { partition } from '../tools/ArrayTools.js';
|
|
21
|
+
import { getPageType, getTag, hasTag } from '../tools/CodeTools.js';
|
|
22
|
+
import MarkdownParser from '../tools/markdown/MarkdownParser.js';
|
|
23
|
+
import { checkVisibility, defaultNodeSort } from '../tools/NodeTools.js';
|
|
24
|
+
import { filterChildrenByMember, findSymbolByMember } from '../tools/ReferenceTools.js';
|
|
25
|
+
import { getPackagePath } from '../tools/StringTools.js';
|
|
26
26
|
|
|
27
27
|
interface ClassPageRouteParams extends PackageContainerRouteParams {
|
|
28
28
|
name: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { makeStyles } from '@mui/styles';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
-
import { useParams } from 'react-router
|
|
4
|
-
import NavMenu from '../components/NavMenu';
|
|
5
|
-
import NavMenuGroup from '../components/NavMenuGroup';
|
|
6
|
-
import NavMenuItem from '../components/NavMenuItem';
|
|
7
|
-
import PageArticle, { PageArticleContext } from '../components/PageArticle';
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import PageContent from '../containers/PageContent';
|
|
3
|
+
import { useParams } from 'react-router';
|
|
4
|
+
import NavMenu from '../components/NavMenu.js';
|
|
5
|
+
import NavMenuGroup from '../components/NavMenuGroup.js';
|
|
6
|
+
import NavMenuItem from '../components/NavMenuItem.js';
|
|
7
|
+
import PageArticle, { PageArticleContext } from '../components/PageArticle.js';
|
|
8
|
+
import type { ConfigArticleCategory, ConfigInternalArticle } from '../config/Config.js';
|
|
9
|
+
import { ConfigContext, mockFs } from '../config/index.js';
|
|
10
|
+
import PageContent from '../containers/PageContent.js';
|
|
11
11
|
|
|
12
|
-
import PageHeader from '../containers/PageHeader';
|
|
12
|
+
import PageHeader from '../containers/PageHeader.js';
|
|
13
13
|
|
|
14
14
|
interface DocPageRouteParams {
|
|
15
15
|
category?: string;
|
|
@@ -97,7 +97,7 @@ const DocPage: React.FC = () => {
|
|
|
97
97
|
) : (
|
|
98
98
|
<NavMenuItem
|
|
99
99
|
key={art.name}
|
|
100
|
-
path={`/docs/${confCategory
|
|
100
|
+
path={`/docs/${confCategory.name}/${grp.name}/${art.name}`}
|
|
101
101
|
title={art.title}
|
|
102
102
|
>
|
|
103
103
|
{art.title}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Navigate, useParams } from 'react-router
|
|
3
|
-
import BetaNotice from '../components/BetaNotice';
|
|
4
|
-
import DeprecationNotice from '../components/DeprecationNotice';
|
|
5
|
-
import OverviewTable from '../components/overviewTable/OverviewTable';
|
|
6
|
-
import SymbolHeader from '../components/SymbolHeader';
|
|
7
|
-
import Card from '../containers/Card';
|
|
8
|
-
import PageContent from '../containers/PageContent';
|
|
9
|
-
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer';
|
|
10
|
-
import type { EnumMemberReferenceNode, EnumReferenceNode } from '../reference';
|
|
11
|
-
import { getPageType, getTag, hasTag } from '../tools/CodeTools';
|
|
12
|
-
import MarkdownParser from '../tools/markdown/MarkdownParser';
|
|
13
|
-
import { defaultNodeSort } from '../tools/NodeTools';
|
|
14
|
-
import { filterChildrenByMember, findSymbolByMember } from '../tools/ReferenceTools';
|
|
15
|
-
import { getPackagePath } from '../tools/StringTools';
|
|
2
|
+
import { Navigate, useParams } from 'react-router';
|
|
3
|
+
import BetaNotice from '../components/BetaNotice.js';
|
|
4
|
+
import DeprecationNotice from '../components/DeprecationNotice.js';
|
|
5
|
+
import OverviewTable from '../components/overviewTable/OverviewTable.js';
|
|
6
|
+
import SymbolHeader from '../components/SymbolHeader.js';
|
|
7
|
+
import Card from '../containers/Card.js';
|
|
8
|
+
import PageContent from '../containers/PageContent.js';
|
|
9
|
+
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer.js';
|
|
10
|
+
import type { EnumMemberReferenceNode, EnumReferenceNode } from '../reference/index.js';
|
|
11
|
+
import { getPageType, getTag, hasTag } from '../tools/CodeTools.js';
|
|
12
|
+
import MarkdownParser from '../tools/markdown/MarkdownParser.js';
|
|
13
|
+
import { defaultNodeSort } from '../tools/NodeTools.js';
|
|
14
|
+
import { filterChildrenByMember, findSymbolByMember } from '../tools/ReferenceTools.js';
|
|
15
|
+
import { getPackagePath } from '../tools/StringTools.js';
|
|
16
16
|
|
|
17
17
|
interface EnumPageRouteParams extends PackageContainerRouteParams {
|
|
18
18
|
name: string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Navigate, useParams } from 'react-router
|
|
3
|
-
import BetaNotice from '../components/BetaNotice';
|
|
4
|
-
import { FunctionCardHeader } from '../components/cards/FunctionCardHeader';
|
|
5
|
-
import DeprecationNotice from '../components/DeprecationNotice';
|
|
6
|
-
import FunctionParamDesc from '../components/FunctionParamDesc';
|
|
7
|
-
import { FunctionReturnType } from '../components/FunctionReturnType';
|
|
8
|
-
import SymbolHeader from '../components/SymbolHeader';
|
|
9
|
-
import Card from '../containers/Card';
|
|
10
|
-
import PageContent from '../containers/PageContent';
|
|
11
|
-
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer';
|
|
12
|
-
import type { FunctionReferenceNode } from '../reference';
|
|
13
|
-
import { getPageType, getTag, hasTag } from '../tools/CodeTools';
|
|
14
|
-
import MarkdownParser from '../tools/markdown/MarkdownParser';
|
|
15
|
-
import { findSymbolByMember } from '../tools/ReferenceTools';
|
|
16
|
-
import { getPackagePath } from '../tools/StringTools';
|
|
2
|
+
import { Navigate, useParams } from 'react-router';
|
|
3
|
+
import BetaNotice from '../components/BetaNotice.js';
|
|
4
|
+
import { FunctionCardHeader } from '../components/cards/FunctionCardHeader.js';
|
|
5
|
+
import DeprecationNotice from '../components/DeprecationNotice.js';
|
|
6
|
+
import FunctionParamDesc from '../components/FunctionParamDesc.js';
|
|
7
|
+
import { FunctionReturnType } from '../components/FunctionReturnType.js';
|
|
8
|
+
import SymbolHeader from '../components/SymbolHeader.js';
|
|
9
|
+
import Card from '../containers/Card.js';
|
|
10
|
+
import PageContent from '../containers/PageContent.js';
|
|
11
|
+
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer.js';
|
|
12
|
+
import type { FunctionReferenceNode } from '../reference/index.js';
|
|
13
|
+
import { getPageType, getTag, hasTag } from '../tools/CodeTools.js';
|
|
14
|
+
import MarkdownParser from '../tools/markdown/MarkdownParser.js';
|
|
15
|
+
import { findSymbolByMember } from '../tools/ReferenceTools.js';
|
|
16
|
+
import { getPackagePath } from '../tools/StringTools.js';
|
|
17
17
|
|
|
18
18
|
interface FunctionPageRouteParams extends PackageContainerRouteParams {
|
|
19
19
|
name: string;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { makeStyles } from '@mui/styles';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Navigate, useParams } from 'react-router
|
|
4
|
-
import BetaNotice from '../components/BetaNotice';
|
|
5
|
-
import DeprecationNotice from '../components/DeprecationNotice';
|
|
6
|
-
import InterfaceDetail from '../components/InterfaceDetail';
|
|
7
|
-
import InterfaceRepresentation from '../components/InterfaceRepresentation';
|
|
8
|
-
import SymbolHeader from '../components/SymbolHeader';
|
|
9
|
-
import PageContent from '../containers/PageContent';
|
|
10
|
-
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer';
|
|
11
|
-
import type { InterfaceReferenceNode } from '../reference';
|
|
12
|
-
import { getPageType, getTag, hasTag } from '../tools/CodeTools';
|
|
13
|
-
import MarkdownParser from '../tools/markdown/MarkdownParser';
|
|
14
|
-
import { findSymbolByMember } from '../tools/ReferenceTools';
|
|
15
|
-
import { getPackagePath } from '../tools/StringTools';
|
|
3
|
+
import { Navigate, useParams } from 'react-router';
|
|
4
|
+
import BetaNotice from '../components/BetaNotice.js';
|
|
5
|
+
import DeprecationNotice from '../components/DeprecationNotice.js';
|
|
6
|
+
import InterfaceDetail from '../components/InterfaceDetail.js';
|
|
7
|
+
import InterfaceRepresentation from '../components/InterfaceRepresentation.js';
|
|
8
|
+
import SymbolHeader from '../components/SymbolHeader.js';
|
|
9
|
+
import PageContent from '../containers/PageContent.js';
|
|
10
|
+
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer.js';
|
|
11
|
+
import type { InterfaceReferenceNode } from '../reference/index.js';
|
|
12
|
+
import { getPageType, getTag, hasTag } from '../tools/CodeTools.js';
|
|
13
|
+
import MarkdownParser from '../tools/markdown/MarkdownParser.js';
|
|
14
|
+
import { findSymbolByMember } from '../tools/ReferenceTools.js';
|
|
15
|
+
import { getPackagePath } from '../tools/StringTools.js';
|
|
16
16
|
|
|
17
17
|
const useStyles = makeStyles(
|
|
18
18
|
{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { makeStyles } from '@mui/styles';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Navigate, useParams } from 'react-router
|
|
4
|
-
import BetaNotice from '../components/BetaNotice';
|
|
5
|
-
import Type from '../components/codeBuilders/Type';
|
|
6
|
-
import DeprecationNotice from '../components/DeprecationNotice';
|
|
7
|
-
import SymbolHeader from '../components/SymbolHeader';
|
|
8
|
-
import PageContent from '../containers/PageContent';
|
|
9
|
-
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer';
|
|
10
|
-
import type { TypeAliasReferenceNode } from '../reference';
|
|
11
|
-
import { getPageType, getTag, hasTag } from '../tools/CodeTools';
|
|
12
|
-
import MarkdownParser from '../tools/markdown/MarkdownParser';
|
|
13
|
-
import { findSymbolByMember } from '../tools/ReferenceTools';
|
|
14
|
-
import { getPackagePath } from '../tools/StringTools';
|
|
3
|
+
import { Navigate, useParams } from 'react-router';
|
|
4
|
+
import BetaNotice from '../components/BetaNotice.js';
|
|
5
|
+
import Type from '../components/codeBuilders/Type.js';
|
|
6
|
+
import DeprecationNotice from '../components/DeprecationNotice.js';
|
|
7
|
+
import SymbolHeader from '../components/SymbolHeader.js';
|
|
8
|
+
import PageContent from '../containers/PageContent.js';
|
|
9
|
+
import type { PackageContainerRouteParams } from '../containers/ReferencePackageContainer.js';
|
|
10
|
+
import type { TypeAliasReferenceNode } from '../reference/index.js';
|
|
11
|
+
import { getPageType, getTag, hasTag } from '../tools/CodeTools.js';
|
|
12
|
+
import MarkdownParser from '../tools/markdown/MarkdownParser.js';
|
|
13
|
+
import { findSymbolByMember } from '../tools/ReferenceTools.js';
|
|
14
|
+
import { getPackagePath } from '../tools/StringTools.js';
|
|
15
15
|
|
|
16
16
|
interface TypeAliasPageRouteParams extends PackageContainerRouteParams {
|
|
17
17
|
name: string;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
export function partition<EntryType>(
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function partition<EntryType>(
|
|
2
|
+
arr: Iterable<EntryType>,
|
|
3
|
+
predicate: (val: EntryType) => boolean
|
|
4
|
+
): [EntryType[], EntryType[]];
|
|
5
|
+
export function partition<EntryType, TrueEntryType extends EntryType = EntryType>(
|
|
6
|
+
arr: Iterable<EntryType>,
|
|
7
|
+
predicate: (val: EntryType) => val is TrueEntryType
|
|
8
|
+
): [EntryType[], TrueEntryType[]];
|
|
9
|
+
export function partition<EntryType, TrueEntryType extends EntryType = EntryType>(
|
|
10
|
+
arr: Iterable<EntryType>,
|
|
11
|
+
predicate: (val: EntryType) => boolean
|
|
12
|
+
): [EntryType[], TrueEntryType[]] {
|
|
4
13
|
const falseResult: EntryType[] = [];
|
|
5
14
|
const trueResult: TrueEntryType[] = [];
|
|
6
15
|
for (const entry of arr) {
|
|
@@ -9,7 +18,11 @@ export function partition<EntryType, TrueEntryType extends EntryType = EntryType
|
|
|
9
18
|
return [falseResult, trueResult];
|
|
10
19
|
}
|
|
11
20
|
|
|
12
|
-
export function partitionedFlatMap<T, R>(
|
|
21
|
+
export function partitionedFlatMap<T, R>(
|
|
22
|
+
arr: T[],
|
|
23
|
+
keyMapper: (val: T) => string,
|
|
24
|
+
valueMapper: (val: T) => R | R[]
|
|
25
|
+
): Record<string, R[]> {
|
|
13
26
|
const result: Record<string, R[]> = {};
|
|
14
27
|
for (const entry of arr) {
|
|
15
28
|
const key = keyMapper(entry);
|
|
@@ -28,24 +41,27 @@ export function partitionedFlatMap<T, R>(arr: T[], keyMapper: (val: T) => string
|
|
|
28
41
|
return result;
|
|
29
42
|
}
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
export function findByMember<T extends object, K extends keyof T, R extends T>(
|
|
45
|
+
arr: T[],
|
|
46
|
+
key: K,
|
|
47
|
+
value: T[K]
|
|
48
|
+
): R | undefined {
|
|
33
49
|
return arr.find(obj => obj[key] === value) as R | undefined;
|
|
34
50
|
}
|
|
35
51
|
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
37
52
|
export function filterByMember<T extends object, K extends keyof T, R extends T>(arr: T[], key: K, value: T[K]): R[] {
|
|
38
53
|
return arr.filter(obj => obj[key] === value) as R[];
|
|
39
54
|
}
|
|
40
55
|
|
|
41
56
|
export type ExtractIterable<T> = T extends Iterable<infer I> ? I : T;
|
|
42
57
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
export function* zip<T extends Array<Iterable<unknown>>>(
|
|
59
|
+
...args: T
|
|
60
|
+
): Iterable<{ [K in keyof T]: ExtractIterable<T[K]> }> {
|
|
61
|
+
const iterators = args.map(x => x[Symbol.iterator]());
|
|
46
62
|
|
|
47
63
|
while (true) {
|
|
48
|
-
const next = iterators.map(
|
|
64
|
+
const next = iterators.map(i => i.next());
|
|
49
65
|
if (next.some(nx => nx.done)) {
|
|
50
66
|
break;
|
|
51
67
|
}
|
|
@@ -59,7 +59,7 @@ function createConfigParsingHost() {
|
|
|
59
59
|
// from here https://github.com/Microsoft/TypeScript/blob/6fb0f6818ad48bf4f685e86c03405ddc84b530ed/src/compiler/program.ts#L2812
|
|
60
60
|
const configParsingHost: ts.ParseConfigFileHost = {
|
|
61
61
|
fileExists: f => tempCompilerHost.fileExists(f),
|
|
62
|
-
readDirectory: (root, extensions, includes, depth
|
|
62
|
+
readDirectory: (root, extensions, includes, depth) =>
|
|
63
63
|
tempCompilerHost.readDirectory ? tempCompilerHost.readDirectory(root, extensions, includes, depth) : [],
|
|
64
64
|
readFile: f => tempCompilerHost.readFile(f),
|
|
65
65
|
useCaseSensitiveFileNames: tempCompilerHost.useCaseSensitiveFileNames(),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { useEffect } from 'react';
|
|
1
|
+
import { type DependencyList, useEffect } from 'react';
|
|
3
2
|
|
|
4
|
-
export function useAsyncEffect(fn: () => Promise<void>, deps:
|
|
3
|
+
export function useAsyncEffect(fn: () => Promise<void>, deps: DependencyList) {
|
|
5
4
|
useEffect(() => {
|
|
6
5
|
// drop promise to prevent React warning
|
|
7
6
|
void fn();
|
|
@@ -5,10 +5,11 @@ import type {
|
|
|
5
5
|
ReferenceNode,
|
|
6
6
|
ReferenceReferenceType,
|
|
7
7
|
ReferenceType
|
|
8
|
-
} from '../reference';
|
|
9
|
-
import { hasTag } from './CodeTools';
|
|
8
|
+
} from '../reference/index.js';
|
|
9
|
+
import { hasTag } from './CodeTools.js';
|
|
10
10
|
|
|
11
11
|
export function checkVisibility(node: ReferenceNode, parent?: ReferenceNode) {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
12
13
|
if (node.flags?.isPrivate || node.flags?.isInternal) {
|
|
13
14
|
return false;
|
|
14
15
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
ClassReferenceNode,
|
|
3
|
-
EnumReferenceNode,
|
|
4
|
-
InterfaceReferenceNode,
|
|
5
|
-
ReferenceNode,
|
|
6
|
-
TypeLiteralReferenceNode
|
|
7
|
-
} from '../reference';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import { checkVisibility } from './NodeTools';
|
|
1
|
+
import reference, {
|
|
2
|
+
type ClassReferenceNode,
|
|
3
|
+
type EnumReferenceNode,
|
|
4
|
+
type InterfaceReferenceNode,
|
|
5
|
+
type ReferenceNode,
|
|
6
|
+
type TypeLiteralReferenceNode
|
|
7
|
+
} from '../reference/index.js';
|
|
8
|
+
import { filterByMember, findByMember } from './ArrayTools.js';
|
|
9
|
+
import { checkVisibility } from './NodeTools.js';
|
|
11
10
|
|
|
12
11
|
interface SymbolDefinition<T extends ReferenceNode> {
|
|
13
12
|
symbol: T;
|
|
@@ -51,7 +50,7 @@ export function findSymbolByMember<T extends ReferenceNode, K extends keyof T, R
|
|
|
51
50
|
return undefined;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
const parent = reference.packages
|
|
53
|
+
const [parent] = reference.packages;
|
|
55
54
|
|
|
56
55
|
const foundInParent = findByMember(parent.symbols as T[], key, value);
|
|
57
56
|
|
|
@@ -7,5 +7,5 @@ export function getPackagePath(packageName?: string) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function getRandomString(length: number, permitted = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') {
|
|
10
|
-
return Array.from({ length }, () => permitted[Math.floor(Math.random() * permitted.length)]).join('')
|
|
10
|
+
return Array.from({ length }, () => permitted[Math.floor(Math.random() * permitted.length)]).join('');
|
|
11
11
|
}
|
|
@@ -2,11 +2,11 @@ import { makeStyles } from '@mui/styles';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import ReactMarkdown from 'react-markdown';
|
|
5
|
-
import {
|
|
6
|
-
import { CodeBlock } from '../../components/CodeBlock';
|
|
7
|
-
import { customDirectives } from './plugins/customDirectives';
|
|
8
|
-
import { gfmTables } from './plugins/gfmTables';
|
|
9
|
-
import { symbolLinks } from './plugins/symbolLinks';
|
|
5
|
+
import { Link } from 'react-router';
|
|
6
|
+
import { CodeBlock } from '../../components/CodeBlock.js';
|
|
7
|
+
import { customDirectives } from './plugins/customDirectives.js';
|
|
8
|
+
import { gfmTables } from './plugins/gfmTables.js';
|
|
9
|
+
import { symbolLinks } from './plugins/symbolLinks.js';
|
|
10
10
|
|
|
11
11
|
interface MarkdownParserProps {
|
|
12
12
|
source: string;
|
|
@@ -80,7 +80,6 @@ const MarkdownParser: React.FC<MarkdownParserProps> = ({ source }) => {
|
|
|
80
80
|
const components = useMemo(
|
|
81
81
|
() => ({
|
|
82
82
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call */
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/naming-convention
|
|
84
83
|
a: function MdLink(mdProps: any) {
|
|
85
84
|
const props = {
|
|
86
85
|
key: mdProps.nodeKey,
|
|
@@ -89,20 +88,19 @@ const MarkdownParser: React.FC<MarkdownParserProps> = ({ source }) => {
|
|
|
89
88
|
|
|
90
89
|
if (mdProps.href.startsWith('/')) {
|
|
91
90
|
return (
|
|
92
|
-
<
|
|
91
|
+
<Link {...props} className={classNames(props.className, classes.link)} to={mdProps.href}>
|
|
93
92
|
{mdProps.children}
|
|
94
|
-
</
|
|
95
|
-
);
|
|
96
|
-
} else {
|
|
97
|
-
return (
|
|
98
|
-
<a className={classes.link} href={mdProps.href}>
|
|
99
|
-
{mdProps.children}
|
|
100
|
-
</a>
|
|
93
|
+
</Link>
|
|
101
94
|
);
|
|
102
95
|
}
|
|
96
|
+
return (
|
|
97
|
+
<a className={classes.link} href={mdProps.href}>
|
|
98
|
+
{mdProps.children}
|
|
99
|
+
</a>
|
|
100
|
+
);
|
|
103
101
|
},
|
|
104
102
|
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
106
104
|
code: function MdCodeBlock({ node, inline, className, children, ...props }: any) {
|
|
107
105
|
if (!inline) {
|
|
108
106
|
const match = /language-(\w+)/.exec(className || '');
|