typedoc 0.28.19 → 0.28.20
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/bin/typedoc +1 -1
- package/dist/browser-utils.js +29 -2
- package/dist/cli.js +111 -0
- package/dist/index.js +17888 -44
- package/dist/models.js +3736 -0
- package/dist/node-utils.js +7018 -0
- package/dist/serialization.js +430 -0
- package/dist/{lib → types}/application-events.d.ts +2 -0
- package/dist/{lib → types}/application.d.ts +51 -8
- package/dist/{lib → types}/converter/comments/declarationReferenceResolver.d.ts +1 -1
- package/dist/{lib → types}/converter/comments/discovery.d.ts +3 -3
- package/dist/{lib → types}/converter/comments/index.d.ts +4 -4
- package/dist/{lib → types}/converter/comments/lexer.d.ts +1 -1
- package/dist/{lib → types}/converter/comments/linkResolver.d.ts +1 -1
- package/dist/{lib → types}/converter/comments/parser.d.ts +3 -4
- package/dist/{lib → types}/converter/comments/textParser.d.ts +8 -2
- package/dist/{lib → types}/converter/components.d.ts +1 -1
- package/dist/{lib → types}/converter/context.d.ts +2 -2
- package/dist/{lib → types}/converter/converter.d.ts +6 -8
- package/dist/{lib → types}/converter/factories/signature.d.ts +1 -1
- package/dist/{lib → types}/converter/index.d.ts +1 -0
- package/dist/{lib → types}/converter/plugins/CategoryPlugin.d.ts +2 -2
- package/dist/{lib → types}/converter/plugins/GroupPlugin.d.ts +2 -3
- package/dist/{lib → types}/converter/plugins/IncludePlugin.d.ts +1 -1
- package/dist/{lib → types}/converter/plugins/InheritDocPlugin.d.ts +1 -1
- package/dist/{lib → types}/converter/plugins/LinkResolverPlugin.d.ts +3 -3
- package/dist/{lib → types}/converter/plugins/SourcePlugin.d.ts +1 -2
- package/dist/{lib → types}/converter/plugins/TypePlugin.d.ts +1 -1
- package/dist/{lib → types}/converter/types.d.ts +1 -1
- package/dist/{lib/converter/utils → types/converter/utilities}/reflections.d.ts +1 -1
- package/dist/{lib/converter/utils → types/converter/utilities}/repository.d.ts +14 -13
- package/dist/{index.d.ts → types/index.d.ts} +15 -16
- package/dist/{lib → types}/internationalization/internationalization.d.ts +0 -8
- package/dist/types/internationalization/locale-utils.d.ts +3 -0
- package/dist/types/internationalization/locales/de.d.ts +368 -0
- package/dist/{lib/internationalization/locales/en.d.cts → types/internationalization/locales/en.d.ts} +2 -1
- package/dist/types/internationalization/locales/fr.d.ts +346 -0
- package/dist/types/internationalization/locales/ja.d.ts +307 -0
- package/dist/types/internationalization/locales/ko.d.ts +221 -0
- package/dist/types/internationalization/locales/zh.d.ts +452 -0
- package/dist/{lib → types}/internationalization/translatable.d.ts +1 -1
- package/dist/{lib → types}/models/FileRegistry.d.ts +5 -0
- package/dist/{lib → types}/models/ReflectionSymbolId.d.ts +9 -3
- package/dist/{lib → types}/models/SourceReference.d.ts +5 -3
- package/dist/types/models.d.ts +1 -0
- package/dist/types/node-utils.d.ts +1 -0
- package/dist/{lib → types}/output/components.d.ts +3 -3
- package/dist/{lib → types}/output/events.d.ts +1 -2
- package/dist/{lib → types}/output/formatter.d.ts +1 -2
- package/dist/{lib → types}/output/output.d.ts +2 -2
- package/dist/{lib → types}/output/renderer.d.ts +4 -5
- package/dist/{lib → types}/output/router.d.ts +2 -2
- package/dist/{lib → types}/output/themes/MarkedPlugin.d.ts +3 -3
- package/dist/{lib → types}/output/themes/default/DefaultTheme.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/DefaultThemeRenderContext.d.ts +25 -25
- package/dist/{lib → types}/output/themes/default/layouts/default.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/anchor-icon.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/breadcrumb.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/comment.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/header.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/hierarchy.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/icon.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/index.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/member.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/member.getterSetter.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/member.signature.body.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/member.signature.title.d.ts +2 -2
- package/dist/{lib → types}/output/themes/default/partials/member.signatures.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/member.sources.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/members.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/moduleReflection.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/navigation.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/reflectionPreview.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/toolbar.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/partials/type.d.ts +2 -2
- package/dist/{lib → types}/output/themes/default/partials/typeDetails.d.ts +2 -2
- package/dist/{lib → types}/output/themes/default/partials/typeParameters.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/templates/document.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/templates/hierarchy.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/templates/index.d.ts +1 -1
- package/dist/{lib → types}/output/themes/default/templates/reflection.d.ts +1 -1
- package/dist/{lib → types}/output/themes/lib.d.ts +1 -1
- package/dist/types/serialization.d.ts +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dist/{lib → types}/utils/ValidatingFileRegistry.d.ts +1 -1
- package/dist/{lib → types}/utils/entry-point.d.ts +2 -2
- package/dist/{lib → types}/utils/general.d.ts +3 -0
- package/dist/types/utils/index.d.ts +22 -0
- package/dist/{lib → types}/utils/options/declaration.d.ts +1 -1
- package/dist/{lib → types}/utils/options/defaults.d.ts +1 -1
- package/dist/{lib → types}/utils/options/index.d.ts +2 -1
- package/dist/{lib → types}/utils/options/options.d.ts +1 -1
- package/dist/{lib → types}/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/{lib → types}/utils/reflections.d.ts +1 -1
- package/dist/{lib → types}/utils/sort.d.ts +1 -2
- package/dist/{lib → types}/utils-common/general.d.ts +4 -4
- package/dist/types/utils-common.d.ts +1 -0
- package/dist/{lib → types}/validation/documentation.d.ts +1 -1
- package/dist/{lib → types}/validation/exports.d.ts +1 -1
- package/dist/types/validation/filePaths.d.ts +3 -0
- package/dist/{lib → types}/validation/links.d.ts +1 -1
- package/dist/{lib → types}/validation/unusedMergeModuleWith.d.ts +1 -1
- package/dist/utils-common.js +1311 -0
- package/package.json +45 -36
- package/static/main.js +1 -1
- package/static/style.css +18 -3
- package/tsdoc.json +4 -0
- package/typedoc-config.schema.json +1 -0
- package/dist/lib/application-events.js +0 -5
- package/dist/lib/application.js +0 -716
- package/dist/lib/cli.js +0 -111
- package/dist/lib/converter/comments/blockLexer.js +0 -391
- package/dist/lib/converter/comments/declarationReferenceResolver.js +0 -218
- package/dist/lib/converter/comments/discovery.js +0 -567
- package/dist/lib/converter/comments/index.js +0 -241
- package/dist/lib/converter/comments/lexer.js +0 -10
- package/dist/lib/converter/comments/lineLexer.js +0 -279
- package/dist/lib/converter/comments/linkResolver.js +0 -186
- package/dist/lib/converter/comments/parser.js +0 -538
- package/dist/lib/converter/comments/rawLexer.js +0 -218
- package/dist/lib/converter/comments/tagName.js +0 -58
- package/dist/lib/converter/comments/textParser.js +0 -372
- package/dist/lib/converter/components.js +0 -3
- package/dist/lib/converter/context.js +0 -311
- package/dist/lib/converter/convert-expression.js +0 -58
- package/dist/lib/converter/converter-events.js +0 -13
- package/dist/lib/converter/converter.js +0 -705
- package/dist/lib/converter/factories/index-signature.js +0 -50
- package/dist/lib/converter/factories/signature.js +0 -353
- package/dist/lib/converter/factories/symbol-id.js +0 -50
- package/dist/lib/converter/index.js +0 -3
- package/dist/lib/converter/jsdoc.js +0 -135
- package/dist/lib/converter/plugins/CategoryPlugin.js +0 -278
- package/dist/lib/converter/plugins/CommentPlugin.js +0 -770
- package/dist/lib/converter/plugins/GroupPlugin.js +0 -281
- package/dist/lib/converter/plugins/ImplementsPlugin.js +0 -438
- package/dist/lib/converter/plugins/IncludePlugin.js +0 -254
- package/dist/lib/converter/plugins/InheritDocPlugin.js +0 -220
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +0 -88
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +0 -50
- package/dist/lib/converter/plugins/PackagePlugin.js +0 -188
- package/dist/lib/converter/plugins/SourcePlugin.js +0 -215
- package/dist/lib/converter/plugins/TypePlugin.js +0 -108
- package/dist/lib/converter/plugins/index.js +0 -10
- package/dist/lib/converter/symbols.js +0 -861
- package/dist/lib/converter/types.js +0 -833
- package/dist/lib/converter/utils/nodes.js +0 -26
- package/dist/lib/converter/utils/reflections.js +0 -17
- package/dist/lib/converter/utils/repository.js +0 -295
- package/dist/lib/converter/utils/symbols.js +0 -12
- package/dist/lib/debug/index.js +0 -2
- package/dist/lib/debug/reflectionLifetimes.js +0 -27
- package/dist/lib/debug/rendererUrls.js +0 -68
- package/dist/lib/internationalization/index.js +0 -7
- package/dist/lib/internationalization/internationalization.js +0 -64
- package/dist/lib/internationalization/locale-utils.cjs +0 -8
- package/dist/lib/internationalization/locale-utils.d.cts +0 -8
- package/dist/lib/internationalization/locales/de.cjs +0 -401
- package/dist/lib/internationalization/locales/de.d.cts +0 -368
- package/dist/lib/internationalization/locales/en.cjs +0 -411
- package/dist/lib/internationalization/locales/fr.cjs +0 -347
- package/dist/lib/internationalization/locales/fr.d.cts +0 -346
- package/dist/lib/internationalization/locales/ja.cjs +0 -320
- package/dist/lib/internationalization/locales/ja.d.cts +0 -307
- package/dist/lib/internationalization/locales/ko.cjs +0 -233
- package/dist/lib/internationalization/locales/ko.d.cts +0 -221
- package/dist/lib/internationalization/locales/zh.cjs +0 -488
- package/dist/lib/internationalization/locales/zh.d.cts +0 -452
- package/dist/lib/internationalization/translatable.js +0 -8
- package/dist/lib/models/Comment.js +0 -534
- package/dist/lib/models/ContainerReflection.js +0 -159
- package/dist/lib/models/DeclarationReflection.js +0 -287
- package/dist/lib/models/DocumentReflection.js +0 -66
- package/dist/lib/models/FileRegistry.js +0 -133
- package/dist/lib/models/ParameterReflection.js +0 -39
- package/dist/lib/models/ProjectReflection.js +0 -417
- package/dist/lib/models/ReferenceReflection.js +0 -85
- package/dist/lib/models/Reflection.js +0 -495
- package/dist/lib/models/ReflectionCategory.js +0 -56
- package/dist/lib/models/ReflectionGroup.js +0 -72
- package/dist/lib/models/ReflectionSymbolId.js +0 -85
- package/dist/lib/models/SignatureReflection.js +0 -96
- package/dist/lib/models/SourceReference.js +0 -50
- package/dist/lib/models/TypeParameterReflection.js +0 -45
- package/dist/lib/models/index.js +0 -19
- package/dist/lib/models/kind.js +0 -231
- package/dist/lib/models/types.js +0 -1296
- package/dist/lib/models/utils.js +0 -26
- package/dist/lib/models/variant.js +0 -1
- package/dist/lib/output/components.js +0 -133
- package/dist/lib/output/events.js +0 -195
- package/dist/lib/output/formatter.js +0 -660
- package/dist/lib/output/index.js +0 -7
- package/dist/lib/output/output.js +0 -92
- package/dist/lib/output/plugins/AssetsPlugin.js +0 -160
- package/dist/lib/output/plugins/HierarchyPlugin.js +0 -65
- package/dist/lib/output/plugins/IconsPlugin.js +0 -58
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +0 -222
- package/dist/lib/output/plugins/NavigationPlugin.js +0 -23
- package/dist/lib/output/plugins/SitemapPlugin.js +0 -82
- package/dist/lib/output/plugins/index.js +0 -7
- package/dist/lib/output/renderer.js +0 -387
- package/dist/lib/output/router.js +0 -522
- package/dist/lib/output/theme.js +0 -17
- package/dist/lib/output/themes/MarkedPlugin.js +0 -461
- package/dist/lib/output/themes/default/DefaultTheme.js +0 -367
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +0 -151
- package/dist/lib/output/themes/default/Slugger.js +0 -60
- package/dist/lib/output/themes/default/layouts/default.js +0 -89
- package/dist/lib/output/themes/default/partials/anchor-icon.js +0 -9
- package/dist/lib/output/themes/default/partials/breadcrumb.js +0 -11
- package/dist/lib/output/themes/default/partials/comment.js +0 -80
- package/dist/lib/output/themes/default/partials/footer.js +0 -37
- package/dist/lib/output/themes/default/partials/header.js +0 -39
- package/dist/lib/output/themes/default/partials/hierarchy.js +0 -32
- package/dist/lib/output/themes/default/partials/icon.js +0 -101
- package/dist/lib/output/themes/default/partials/index.js +0 -24
- package/dist/lib/output/themes/default/partials/member.declaration.js +0 -35
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +0 -12
- package/dist/lib/output/themes/default/partials/member.js +0 -36
- package/dist/lib/output/themes/default/partials/member.signature.body.js +0 -33
- package/dist/lib/output/themes/default/partials/member.signature.title.js +0 -9
- package/dist/lib/output/themes/default/partials/member.signatures.js +0 -9
- package/dist/lib/output/themes/default/partials/member.sources.js +0 -55
- package/dist/lib/output/themes/default/partials/members.js +0 -17
- package/dist/lib/output/themes/default/partials/moduleReflection.js +0 -68
- package/dist/lib/output/themes/default/partials/navigation.js +0 -144
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +0 -26
- package/dist/lib/output/themes/default/partials/toolbar.js +0 -13
- package/dist/lib/output/themes/default/partials/type.js +0 -9
- package/dist/lib/output/themes/default/partials/typeAndParent.js +0 -28
- package/dist/lib/output/themes/default/partials/typeDetails.js +0 -284
- package/dist/lib/output/themes/default/partials/typeParameters.js +0 -26
- package/dist/lib/output/themes/default/templates/document.js +0 -3
- package/dist/lib/output/themes/default/templates/hierarchy.js +0 -31
- package/dist/lib/output/themes/default/templates/index.js +0 -3
- package/dist/lib/output/themes/default/templates/reflection.js +0 -53
- package/dist/lib/output/themes/lib.js +0 -218
- package/dist/lib/serialization/components.js +0 -1
- package/dist/lib/serialization/deserializer.js +0 -235
- package/dist/lib/serialization/events.js +0 -18
- package/dist/lib/serialization/index.js +0 -4
- package/dist/lib/serialization/schema.js +0 -32
- package/dist/lib/serialization/serializer.js +0 -65
- package/dist/lib/utils/ValidatingFileRegistry.js +0 -52
- package/dist/lib/utils/component.js +0 -41
- package/dist/lib/utils/compress.js +0 -13
- package/dist/lib/utils/declaration-maps.js +0 -51
- package/dist/lib/utils/entry-point.js +0 -330
- package/dist/lib/utils/fs.js +0 -372
- package/dist/lib/utils/general.js +0 -25
- package/dist/lib/utils/highlighter.js +0 -150
- package/dist/lib/utils/html-entities.js +0 -2329
- package/dist/lib/utils/html.js +0 -635
- package/dist/lib/utils/index.d.ts +0 -17
- package/dist/lib/utils/index.js +0 -15
- package/dist/lib/utils/loggers.js +0 -71
- package/dist/lib/utils/options/declaration.js +0 -444
- package/dist/lib/utils/options/defaults.js +0 -104
- package/dist/lib/utils/options/help.js +0 -63
- package/dist/lib/utils/options/index.js +0 -4
- package/dist/lib/utils/options/options.js +0 -273
- package/dist/lib/utils/options/readers/arguments.js +0 -109
- package/dist/lib/utils/options/readers/index.js +0 -4
- package/dist/lib/utils/options/readers/package-json.js +0 -40
- package/dist/lib/utils/options/readers/tsconfig.js +0 -172
- package/dist/lib/utils/options/readers/typedoc.js +0 -136
- package/dist/lib/utils/options/sources/index.js +0 -1
- package/dist/lib/utils/options/sources/typedoc.js +0 -876
- package/dist/lib/utils/options/tsdoc-defaults.js +0 -94
- package/dist/lib/utils/package-manifest.js +0 -84
- package/dist/lib/utils/paths.js +0 -127
- package/dist/lib/utils/perf.js +0 -86
- package/dist/lib/utils/plugins.js +0 -61
- package/dist/lib/utils/reflections.js +0 -64
- package/dist/lib/utils/sort.js +0 -153
- package/dist/lib/utils/tsconfig.js +0 -60
- package/dist/lib/utils/tsutils.js +0 -23
- package/dist/lib/utils-common/array.js +0 -152
- package/dist/lib/utils-common/declarationReference.js +0 -341
- package/dist/lib/utils-common/enum.js +0 -27
- package/dist/lib/utils-common/events.js +0 -49
- package/dist/lib/utils-common/general.js +0 -22
- package/dist/lib/utils-common/hooks.js +0 -90
- package/dist/lib/utils-common/i18n.js +0 -39
- package/dist/lib/utils-common/index.js +0 -17
- package/dist/lib/utils-common/jsx.elements.js +0 -3
- package/dist/lib/utils-common/jsx.js +0 -187
- package/dist/lib/utils-common/logger.js +0 -129
- package/dist/lib/utils-common/map.js +0 -63
- package/dist/lib/utils-common/minimalSourceFile.js +0 -43
- package/dist/lib/utils-common/path.js +0 -130
- package/dist/lib/utils-common/set.js +0 -23
- package/dist/lib/utils-common/string.js +0 -84
- package/dist/lib/utils-common/validation.js +0 -50
- package/dist/lib/validation/documentation.js +0 -91
- package/dist/lib/validation/exports.js +0 -65
- package/dist/lib/validation/links.js +0 -78
- package/dist/lib/validation/unusedMergeModuleWith.js +0 -12
- /package/dist/{browser-utils.d.ts → types/browser-utils.d.ts} +0 -0
- /package/dist/{lib → types}/cli.d.ts +0 -0
- /package/dist/{lib → types}/converter/comments/blockLexer.d.ts +0 -0
- /package/dist/{lib → types}/converter/comments/lineLexer.d.ts +0 -0
- /package/dist/{lib → types}/converter/comments/rawLexer.d.ts +0 -0
- /package/dist/{lib → types}/converter/comments/tagName.d.ts +0 -0
- /package/dist/{lib → types}/converter/convert-expression.d.ts +0 -0
- /package/dist/{lib → types}/converter/converter-events.d.ts +0 -0
- /package/dist/{lib → types}/converter/factories/index-signature.d.ts +0 -0
- /package/dist/{lib → types}/converter/factories/symbol-id.d.ts +0 -0
- /package/dist/{lib → types}/converter/jsdoc.d.ts +0 -0
- /package/dist/{lib → types}/converter/plugins/CommentPlugin.d.ts +0 -0
- /package/dist/{lib → types}/converter/plugins/ImplementsPlugin.d.ts +0 -0
- /package/dist/{lib → types}/converter/plugins/MergeModuleWithPlugin.d.ts +0 -0
- /package/dist/{lib → types}/converter/plugins/PackagePlugin.d.ts +0 -0
- /package/dist/{lib → types}/converter/plugins/index.d.ts +0 -0
- /package/dist/{lib → types}/converter/symbols.d.ts +0 -0
- /package/dist/{lib/converter/utils → types/converter/utilities}/nodes.d.ts +0 -0
- /package/dist/{lib/converter/utils → types/converter/utilities}/symbols.d.ts +0 -0
- /package/dist/{lib → types}/debug/index.d.ts +0 -0
- /package/dist/{lib → types}/debug/reflectionLifetimes.d.ts +0 -0
- /package/dist/{lib → types}/debug/rendererUrls.d.ts +0 -0
- /package/dist/{lib → types}/internationalization/index.d.ts +0 -0
- /package/dist/{lib → types}/models/Comment.d.ts +0 -0
- /package/dist/{lib → types}/models/ContainerReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/DeclarationReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/DocumentReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/ParameterReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/ProjectReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/ReferenceReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/Reflection.d.ts +0 -0
- /package/dist/{lib → types}/models/ReflectionCategory.d.ts +0 -0
- /package/dist/{lib → types}/models/ReflectionGroup.d.ts +0 -0
- /package/dist/{lib → types}/models/SignatureReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/TypeParameterReflection.d.ts +0 -0
- /package/dist/{lib → types}/models/index.d.ts +0 -0
- /package/dist/{lib → types}/models/kind.d.ts +0 -0
- /package/dist/{lib → types}/models/types.d.ts +0 -0
- /package/dist/{lib → types}/models/utils.d.ts +0 -0
- /package/dist/{lib → types}/models/variant.d.ts +0 -0
- /package/dist/{lib → types}/output/index.d.ts +0 -0
- /package/dist/{lib → types}/output/plugins/AssetsPlugin.d.ts +0 -0
- /package/dist/{lib → types}/output/plugins/HierarchyPlugin.d.ts +0 -0
- /package/dist/{lib → types}/output/plugins/IconsPlugin.d.ts +0 -0
- /package/dist/{lib → types}/output/plugins/JavascriptIndexPlugin.d.ts +0 -0
- /package/dist/{lib → types}/output/plugins/NavigationPlugin.d.ts +0 -0
- /package/dist/{lib → types}/output/plugins/SitemapPlugin.d.ts +0 -0
- /package/dist/{lib → types}/output/plugins/index.d.ts +0 -0
- /package/dist/{lib → types}/output/theme.d.ts +0 -0
- /package/dist/{lib → types}/output/themes/default/Slugger.d.ts +0 -0
- /package/dist/{lib → types}/output/themes/default/partials/footer.d.ts +0 -0
- /package/dist/{lib → types}/output/themes/default/partials/member.declaration.d.ts +0 -0
- /package/dist/{lib → types}/output/themes/default/partials/typeAndParent.d.ts +0 -0
- /package/dist/{lib → types}/serialization/components.d.ts +0 -0
- /package/dist/{lib → types}/serialization/deserializer.d.ts +0 -0
- /package/dist/{lib → types}/serialization/events.d.ts +0 -0
- /package/dist/{lib → types}/serialization/index.d.ts +0 -0
- /package/dist/{lib → types}/serialization/schema.d.ts +0 -0
- /package/dist/{lib → types}/serialization/serializer.d.ts +0 -0
- /package/dist/{lib → types}/utils/component.d.ts +0 -0
- /package/dist/{lib → types}/utils/compress.d.ts +0 -0
- /package/dist/{lib → types}/utils/declaration-maps.d.ts +0 -0
- /package/dist/{lib → types}/utils/fs.d.ts +0 -0
- /package/dist/{lib → types}/utils/highlighter.d.ts +0 -0
- /package/dist/{lib → types}/utils/html-entities.d.ts +0 -0
- /package/dist/{lib → types}/utils/html.d.ts +0 -0
- /package/dist/{lib → types}/utils/loggers.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/help.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/readers/arguments.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/readers/index.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/readers/package-json.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/readers/tsconfig.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/readers/typedoc.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/sources/index.d.ts +0 -0
- /package/dist/{lib → types}/utils/options/sources/typedoc.d.ts +0 -0
- /package/dist/{lib → types}/utils/package-manifest.d.ts +0 -0
- /package/dist/{lib → types}/utils/paths.d.ts +0 -0
- /package/dist/{lib → types}/utils/perf.d.ts +0 -0
- /package/dist/{lib → types}/utils/plugins.d.ts +0 -0
- /package/dist/{lib → types}/utils/tsconfig.d.ts +0 -0
- /package/dist/{lib → types}/utils/tsutils.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/array.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/declarationReference.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/enum.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/events.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/hooks.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/i18n.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/index.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/jsx.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/jsx.elements.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/logger.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/map.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/minimalSourceFile.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/path.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/set.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/string.d.ts +0 -0
- /package/dist/{lib → types}/utils-common/validation.d.ts +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { isDir, isFile, readFile } from "./fs.js";
|
|
3
|
-
import { createRequire } from "module";
|
|
4
|
-
import { diagnostic, diagnostics } from "./loggers.js";
|
|
5
|
-
export function findTsConfigFile(path, usedFile) {
|
|
6
|
-
let fileToRead = path;
|
|
7
|
-
if (isDir(fileToRead)) {
|
|
8
|
-
fileToRead = ts.findConfigFile(path, (file) => (usedFile?.(file), isFile(file)));
|
|
9
|
-
}
|
|
10
|
-
if (!fileToRead || !isFile(fileToRead)) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
return fileToRead;
|
|
14
|
-
}
|
|
15
|
-
// We don't need recursive read checks because that would cause a diagnostic
|
|
16
|
-
// when reading the tsconfig for compiler options, which happens first, and we bail before
|
|
17
|
-
// doing this in that case.
|
|
18
|
-
export function getTypeDocOptionsFromTsConfig(file) {
|
|
19
|
-
const readResult = ts.readConfigFile(file, readFile);
|
|
20
|
-
const result = {};
|
|
21
|
-
if (readResult.error) {
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
if ("extends" in readResult.config) {
|
|
25
|
-
const resolver = createRequire(file);
|
|
26
|
-
const extended = Array.isArray(readResult.config.extends)
|
|
27
|
-
? readResult.config.extends.map(String)
|
|
28
|
-
: [String(readResult.config.extends)];
|
|
29
|
-
for (const extendedFile of extended) {
|
|
30
|
-
let resolvedParent;
|
|
31
|
-
try {
|
|
32
|
-
resolvedParent = resolver.resolve(extendedFile);
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
Object.assign(result, getTypeDocOptionsFromTsConfig(resolvedParent));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if ("typedocOptions" in readResult.config) {
|
|
41
|
-
Object.assign(result, readResult.config.typedocOptions);
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
const tsConfigCache = {};
|
|
46
|
-
export function readTsConfig(path, logger) {
|
|
47
|
-
if (tsConfigCache[path]) {
|
|
48
|
-
return tsConfigCache[path];
|
|
49
|
-
}
|
|
50
|
-
const parsed = ts.getParsedCommandLineOfConfigFile(path, {}, {
|
|
51
|
-
...ts.sys,
|
|
52
|
-
onUnRecoverableConfigFileDiagnostic: diagnostic.bind(null, logger),
|
|
53
|
-
});
|
|
54
|
-
if (!parsed) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
diagnostics(logger, parsed.errors);
|
|
58
|
-
tsConfigCache[path] = parsed;
|
|
59
|
-
return parsed;
|
|
60
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
export function getQualifiedName(symbol, defaultName) {
|
|
3
|
-
// Two implementation options for this one:
|
|
4
|
-
// 1. Use the internal symbol.parent, to walk up until we hit a source file symbol (if in a module)
|
|
5
|
-
// or undefined (if in a global file)
|
|
6
|
-
// 2. Use checker.getFullyQualifiedName and parse out the name from the returned string.
|
|
7
|
-
// The symbol.parent method is easier to check for now.
|
|
8
|
-
let sym = symbol;
|
|
9
|
-
const parts = [];
|
|
10
|
-
while (sym && !sym.declarations?.some(ts.isSourceFile)) {
|
|
11
|
-
parts.unshift(getHumanName(sym.name));
|
|
12
|
-
sym = sym.parent;
|
|
13
|
-
}
|
|
14
|
-
return parts.join(".") || defaultName;
|
|
15
|
-
}
|
|
16
|
-
export function getHumanName(name) {
|
|
17
|
-
// Unique symbols get a name that will change between runs of the compiler.
|
|
18
|
-
const match = /^__@(.*)@\d+$/.exec(name);
|
|
19
|
-
if (match) {
|
|
20
|
-
return `[${match[1]}]`;
|
|
21
|
-
}
|
|
22
|
-
return name;
|
|
23
|
-
}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
export const emptyArray = [];
|
|
2
|
-
/**
|
|
3
|
-
* Inserts an item into an array sorted by priority. If two items have the same priority,
|
|
4
|
-
* the item will be inserted later will be placed later in the array.
|
|
5
|
-
* Higher priority is placed earlier in the array.
|
|
6
|
-
* @param arr modified by inserting item.
|
|
7
|
-
* @param item
|
|
8
|
-
*/
|
|
9
|
-
export function insertPrioritySorted(arr, item) {
|
|
10
|
-
const index = binaryFindPartition(arr, (v) => v.priority < item.priority);
|
|
11
|
-
arr.splice(index === -1 ? arr.length : index, 0, item);
|
|
12
|
-
return arr;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Inserts an item into an array sorted by order. If two items have the same order,
|
|
16
|
-
* the item inserted later will be placed later in the array.
|
|
17
|
-
* The array will be sorted with lower order being placed sooner.
|
|
18
|
-
* @param arr modified by inserting item.
|
|
19
|
-
* @param item
|
|
20
|
-
*/
|
|
21
|
-
export function insertOrderSorted(arr, item) {
|
|
22
|
-
const index = binaryFindPartition(arr, (v) => v.order > item.order);
|
|
23
|
-
arr.splice(index === -1 ? arr.length : index, 0, item);
|
|
24
|
-
return arr;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Performs a binary search of a given array, returning the index of the first item
|
|
28
|
-
* for which `partition` returns true. Returns the -1 if there are no items in `arr`
|
|
29
|
-
* such that `partition(item)` is true.
|
|
30
|
-
* @param arr
|
|
31
|
-
* @param partition should return true while less than the partition point.
|
|
32
|
-
*/
|
|
33
|
-
export function binaryFindPartition(arr, partition) {
|
|
34
|
-
if (arr.length === 0) {
|
|
35
|
-
return -1;
|
|
36
|
-
}
|
|
37
|
-
let low = 0, high = arr.length - 1;
|
|
38
|
-
while (high > low) {
|
|
39
|
-
const mid = low + Math.floor((high - low) / 2);
|
|
40
|
-
if (partition(arr[mid])) {
|
|
41
|
-
high = mid;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
low = mid + 1;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return partition(arr[low]) ? low : -1;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Removes an item from the array if the array exists and the item is included
|
|
51
|
-
* within it.
|
|
52
|
-
* @param arr
|
|
53
|
-
* @param item
|
|
54
|
-
*/
|
|
55
|
-
export function removeIfPresent(arr, item) {
|
|
56
|
-
if (!arr) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const index = arr.indexOf(item);
|
|
60
|
-
if (index !== -1) {
|
|
61
|
-
arr.splice(index, 1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Remove items in an array which match a predicate.
|
|
66
|
-
* @param arr
|
|
67
|
-
* @param predicate
|
|
68
|
-
*/
|
|
69
|
-
export function removeIf(arr, predicate) {
|
|
70
|
-
for (let i = 0; i < arr.length; i++) {
|
|
71
|
-
if (predicate(arr[i])) {
|
|
72
|
-
arr.splice(i, 1);
|
|
73
|
-
i--;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Filters out duplicate values from the given iterable.
|
|
79
|
-
* @param arr
|
|
80
|
-
*/
|
|
81
|
-
export function unique(arr) {
|
|
82
|
-
return Array.from(new Set(arr));
|
|
83
|
-
}
|
|
84
|
-
export function partition(iter, predicate) {
|
|
85
|
-
const left = [];
|
|
86
|
-
const right = [];
|
|
87
|
-
for (const item of iter) {
|
|
88
|
-
if (predicate(item)) {
|
|
89
|
-
left.push(item);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
right.push(item);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return [left, right];
|
|
96
|
-
}
|
|
97
|
-
export function* zip(...args) {
|
|
98
|
-
const iterators = args.map((x) => x[Symbol.iterator]());
|
|
99
|
-
for (;;) {
|
|
100
|
-
const next = iterators.map((i) => i.next());
|
|
101
|
-
if (next.some((v) => v.done)) {
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
yield next.map((v) => v.value);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
export function filterMap(iter, fn) {
|
|
108
|
-
const result = [];
|
|
109
|
-
for (const item of iter || []) {
|
|
110
|
-
const newItem = fn(item);
|
|
111
|
-
if (newItem !== void 0) {
|
|
112
|
-
result.push(newItem);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return result;
|
|
116
|
-
}
|
|
117
|
-
export function firstDefined(array, callback) {
|
|
118
|
-
for (let i = 0; i < array.length; i++) {
|
|
119
|
-
const result = callback(array[i], i);
|
|
120
|
-
if (result !== undefined) {
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return undefined;
|
|
125
|
-
}
|
|
126
|
-
export function filter(array, predicate) {
|
|
127
|
-
return array ? array.filter(predicate) : emptyArray;
|
|
128
|
-
}
|
|
129
|
-
export function aggregate(arr, fn) {
|
|
130
|
-
return arr.reduce((sum, it) => sum + fn(it), 0);
|
|
131
|
-
}
|
|
132
|
-
export function joinArray(arr, joiner, mapper) {
|
|
133
|
-
if (arr?.length) {
|
|
134
|
-
return arr.map(mapper).join(joiner);
|
|
135
|
-
}
|
|
136
|
-
return "";
|
|
137
|
-
}
|
|
138
|
-
export function maxElementByScore(arr, score) {
|
|
139
|
-
if (arr.length === 0) {
|
|
140
|
-
return undefined;
|
|
141
|
-
}
|
|
142
|
-
let largest = arr[0];
|
|
143
|
-
let largestScore = score(arr[0]);
|
|
144
|
-
for (let i = 1; i < arr.length; ++i) {
|
|
145
|
-
const itemScore = score(arr[i]);
|
|
146
|
-
if (itemScore > largestScore) {
|
|
147
|
-
largest = arr[i];
|
|
148
|
-
largestScore = itemScore;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return largest;
|
|
152
|
-
}
|
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parser for declaration references, see the [TSDoc grammar](https://github.com/microsoft/tsdoc/blob/main/tsdoc/src/beta/DeclarationReference.grammarkdown)
|
|
3
|
-
* for reference. TypeDoc **does not** support the full grammar today. This is intentional, since the TSDoc
|
|
4
|
-
* specified grammar allows the user to construct nonsensical declaration references such as `abc![def!ghi]`
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
export const MeaningKeywords = [
|
|
9
|
-
"class", // SymbolFlags.Class
|
|
10
|
-
"interface", // SymbolFlags.Interface
|
|
11
|
-
"type", // SymbolFlags.TypeAlias
|
|
12
|
-
"enum", // SymbolFlags.Enum
|
|
13
|
-
"namespace", // SymbolFlags.Module
|
|
14
|
-
"function", // SymbolFlags.Function
|
|
15
|
-
"var", // SymbolFlags.Variable
|
|
16
|
-
"constructor", // SymbolFlags.Constructor
|
|
17
|
-
"member", // SymbolFlags.ClassMember | SymbolFlags.EnumMember
|
|
18
|
-
"event", //
|
|
19
|
-
"call", // SymbolFlags.Signature (for __call)
|
|
20
|
-
"new", // SymbolFlags.Signature (for __new)
|
|
21
|
-
"index", // SymbolFlags.Signature (for __index)
|
|
22
|
-
"complex", // Any complex type
|
|
23
|
-
// TypeDoc specific
|
|
24
|
-
"getter",
|
|
25
|
-
"setter",
|
|
26
|
-
];
|
|
27
|
-
export function meaningToString(meaning) {
|
|
28
|
-
let result = "";
|
|
29
|
-
if (meaning.keyword) {
|
|
30
|
-
result += meaning.keyword;
|
|
31
|
-
}
|
|
32
|
-
else if (meaning.label) {
|
|
33
|
-
result += meaning.label;
|
|
34
|
-
}
|
|
35
|
-
if (typeof meaning.index === "number") {
|
|
36
|
-
result += `(${meaning.index})`;
|
|
37
|
-
}
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
// <TAB> <VT> <FF> <SP> <NBSP> <ZWNBSP> <USP>
|
|
41
|
-
const WhiteSpace = /[\t\u2B7F\u240C \u00A0\uFEFF\p{White_Space}]/u;
|
|
42
|
-
const LineTerminator = "\r\n\u2028\u2029";
|
|
43
|
-
const Punctuators = "{}()[]!.#~:,";
|
|
44
|
-
const FutureReservedPunctuator = "{}@";
|
|
45
|
-
const NavigationPunctuator = ".#~";
|
|
46
|
-
const DecimalDigit = "0123456789";
|
|
47
|
-
const HexDigit = DecimalDigit + "abcdefABCDEF";
|
|
48
|
-
const SingleEscapeCharacter = `'"\\bfnrtv`;
|
|
49
|
-
const EscapeCharacter = SingleEscapeCharacter + DecimalDigit + "xu";
|
|
50
|
-
const UserLabelStart = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
|
|
51
|
-
const UserLabelCharacter = UserLabelStart + DecimalDigit;
|
|
52
|
-
const SingleEscapeChars = {
|
|
53
|
-
"'": "'",
|
|
54
|
-
'"': '"',
|
|
55
|
-
"\\": "\\",
|
|
56
|
-
b: "\b",
|
|
57
|
-
f: "\f",
|
|
58
|
-
n: "\n",
|
|
59
|
-
r: "\r",
|
|
60
|
-
t: "\t",
|
|
61
|
-
v: "\v",
|
|
62
|
-
};
|
|
63
|
-
// EscapeSequence::
|
|
64
|
-
// SingleEscapeCharacter
|
|
65
|
-
// NonEscapeCharacter
|
|
66
|
-
// `0` [lookahead != DecimalDigit]
|
|
67
|
-
// HexEscapeSequence
|
|
68
|
-
// UnicodeEscapeSequence
|
|
69
|
-
function parseEscapeSequence(source, pos, end) {
|
|
70
|
-
// SingleEscapeCharacter
|
|
71
|
-
if (SingleEscapeCharacter.includes(source[pos])) {
|
|
72
|
-
return [SingleEscapeChars[source[pos]], pos + 1];
|
|
73
|
-
}
|
|
74
|
-
// NonEscapeCharacter:: SourceCharacter but not one of EscapeCharacter or LineTerminator
|
|
75
|
-
if (!(EscapeCharacter + LineTerminator).includes(source[pos])) {
|
|
76
|
-
return [source[pos], pos + 1];
|
|
77
|
-
}
|
|
78
|
-
// `0` [lookahead != DecimalDigit]
|
|
79
|
-
if (source[pos] === "0" &&
|
|
80
|
-
pos + 1 < end &&
|
|
81
|
-
!DecimalDigit.includes(source[pos + 1])) {
|
|
82
|
-
return ["\x00", pos + 1];
|
|
83
|
-
}
|
|
84
|
-
// HexEscapeSequence:: x HexDigit HexDigit
|
|
85
|
-
if (source[pos] === "x" &&
|
|
86
|
-
pos + 2 < end &&
|
|
87
|
-
HexDigit.includes(source[pos + 1]) &&
|
|
88
|
-
HexDigit.includes(source[pos + 2])) {
|
|
89
|
-
return [
|
|
90
|
-
String.fromCharCode(parseInt(source.substring(pos + 1, pos + 3), 16)),
|
|
91
|
-
pos + 3,
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
return parseUnicodeEscapeSequence(source, pos, end);
|
|
95
|
-
}
|
|
96
|
-
// UnicodeEscapeSequence::
|
|
97
|
-
// `u` HexDigit HexDigit HexDigit HexDigit
|
|
98
|
-
// `u` `{` CodePoint `}`
|
|
99
|
-
// CodePoint:: > |HexDigits| but only if MV of |HexDigits| ≤ 0x10FFFF
|
|
100
|
-
function parseUnicodeEscapeSequence(source, pos, end) {
|
|
101
|
-
if (source[pos] !== "u" || pos + 1 >= end) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (HexDigit.includes(source[pos + 1])) {
|
|
105
|
-
if (pos + 4 >= end ||
|
|
106
|
-
!HexDigit.includes(source[pos + 2]) ||
|
|
107
|
-
!HexDigit.includes(source[pos + 3]) ||
|
|
108
|
-
!HexDigit.includes(source[pos + 4])) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
return [
|
|
112
|
-
String.fromCharCode(parseInt(source.substring(pos + 1, pos + 5), 16)),
|
|
113
|
-
pos + 5,
|
|
114
|
-
];
|
|
115
|
-
}
|
|
116
|
-
if (source[pos + 1] === "{" &&
|
|
117
|
-
pos + 2 < end &&
|
|
118
|
-
HexDigit.includes(source[pos + 2])) {
|
|
119
|
-
let lookahead = pos + 3;
|
|
120
|
-
while (lookahead < end && HexDigit.includes(source[lookahead])) {
|
|
121
|
-
lookahead++;
|
|
122
|
-
}
|
|
123
|
-
if (lookahead >= end || source[lookahead] !== "}")
|
|
124
|
-
return;
|
|
125
|
-
const codePoint = parseInt(source.substring(pos + 2, lookahead), 16);
|
|
126
|
-
if (codePoint <= 0x10ffff) {
|
|
127
|
-
return [String.fromCodePoint(codePoint), lookahead + 1];
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
// String:: `"` StringCharacters? `"`
|
|
132
|
-
// StringCharacters:: StringCharacter StringCharacters?
|
|
133
|
-
// StringCharacter::
|
|
134
|
-
// SourceCharacter but not one of `"` or `\` or LineTerminator
|
|
135
|
-
// `\` EscapeSequence
|
|
136
|
-
export function parseString(source, pos, end) {
|
|
137
|
-
let result = "";
|
|
138
|
-
if (source[pos++] !== '"')
|
|
139
|
-
return;
|
|
140
|
-
while (pos < end) {
|
|
141
|
-
if (source[pos] === '"') {
|
|
142
|
-
return [result, pos + 1];
|
|
143
|
-
}
|
|
144
|
-
if (LineTerminator.includes(source[pos]))
|
|
145
|
-
return;
|
|
146
|
-
if (source[pos] === "\\") {
|
|
147
|
-
const esc = parseEscapeSequence(source, pos + 1, end);
|
|
148
|
-
if (!esc)
|
|
149
|
-
return;
|
|
150
|
-
result += esc[0];
|
|
151
|
-
pos = esc[1];
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
result += source[pos++];
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
// ModuleSource:: String | ModuleSourceCharacters
|
|
158
|
-
export function parseModuleSource(source, pos, end) {
|
|
159
|
-
if (pos >= end)
|
|
160
|
-
return;
|
|
161
|
-
if (source[pos] === '"') {
|
|
162
|
-
return parseString(source, pos, end);
|
|
163
|
-
}
|
|
164
|
-
let lookahead = pos;
|
|
165
|
-
while (lookahead < end &&
|
|
166
|
-
!('"!' + LineTerminator).includes(source[lookahead])) {
|
|
167
|
-
lookahead++;
|
|
168
|
-
}
|
|
169
|
-
if (lookahead === pos)
|
|
170
|
-
return;
|
|
171
|
-
return [source.substring(pos, lookahead), lookahead];
|
|
172
|
-
}
|
|
173
|
-
// SymbolReference:
|
|
174
|
-
// ComponentPath Meaning?
|
|
175
|
-
// Meaning
|
|
176
|
-
export function parseSymbolReference(source, pos, end) {
|
|
177
|
-
const path = parseComponentPath(source, pos, end);
|
|
178
|
-
pos = path?.[1] ?? pos;
|
|
179
|
-
const meaning = parseMeaning(source, pos, end);
|
|
180
|
-
pos = meaning?.[1] ?? pos;
|
|
181
|
-
if (path || meaning) {
|
|
182
|
-
return [{ path: path?.[0], meaning: meaning?.[0] }, pos];
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
// Component::
|
|
186
|
-
// String
|
|
187
|
-
// ComponentCharacters
|
|
188
|
-
// `[` DeclarationReference `]` <--- THIS ONE IS NOT IMPLEMENTED.
|
|
189
|
-
export function parseComponent(source, pos, end) {
|
|
190
|
-
if (pos < end && source[pos] === '"') {
|
|
191
|
-
return parseString(source, pos, end);
|
|
192
|
-
}
|
|
193
|
-
let lookahead = pos;
|
|
194
|
-
while (lookahead < end &&
|
|
195
|
-
!('"' +
|
|
196
|
-
Punctuators +
|
|
197
|
-
FutureReservedPunctuator +
|
|
198
|
-
LineTerminator).includes(source[lookahead]) &&
|
|
199
|
-
!WhiteSpace.test(source[lookahead])) {
|
|
200
|
-
lookahead++;
|
|
201
|
-
}
|
|
202
|
-
if (lookahead === pos)
|
|
203
|
-
return;
|
|
204
|
-
return [source.substring(pos, lookahead), lookahead];
|
|
205
|
-
}
|
|
206
|
-
// ComponentPath:
|
|
207
|
-
// Component
|
|
208
|
-
// ComponentPath `.` Component // Navigate via 'exports' of |ComponentPath|
|
|
209
|
-
// ComponentPath `#` Component // Navigate via 'members' of |ComponentPath|
|
|
210
|
-
// ComponentPath `~` Component // Navigate via 'locals' of |ComponentPath|
|
|
211
|
-
export function parseComponentPath(source, pos, end) {
|
|
212
|
-
const components = [];
|
|
213
|
-
let component = parseComponent(source, pos, end);
|
|
214
|
-
if (!component)
|
|
215
|
-
return;
|
|
216
|
-
pos = component[1];
|
|
217
|
-
components.push({ navigation: ".", path: component[0] });
|
|
218
|
-
while (pos < end && NavigationPunctuator.includes(source[pos])) {
|
|
219
|
-
const navigation = source[pos];
|
|
220
|
-
pos++;
|
|
221
|
-
component = parseComponent(source, pos, end);
|
|
222
|
-
if (!component) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
pos = component[1];
|
|
226
|
-
components.push({ navigation, path: component[0] });
|
|
227
|
-
}
|
|
228
|
-
return [components, pos];
|
|
229
|
-
}
|
|
230
|
-
// The TSDoc specification permits the first four branches of Meaning. TypeDoc adds the UserLabel
|
|
231
|
-
// branch so that the @label tag can be used with this form of declaration references.
|
|
232
|
-
// Meaning:
|
|
233
|
-
// `:` MeaningKeyword // Indicates the meaning of a symbol (i.e. ':class')
|
|
234
|
-
// `:` MeaningKeyword `(` DecimalDigits `)` // Indicates an overloaded meaning (i.e. ':function(1)')
|
|
235
|
-
// `:` `(` DecimalDigits `)` // Shorthand for an overloaded meaning (i.e. `:(1)`)
|
|
236
|
-
// `:` DecimalDigits // Shorthand for an overloaded meaning (i.e. ':1')
|
|
237
|
-
// `:` UserLabel // Indicates a user defined label via {@label CUSTOM_LABEL}
|
|
238
|
-
//
|
|
239
|
-
// UserLabel:
|
|
240
|
-
// UserLabelStart UserLabelCharacter*
|
|
241
|
-
export function parseMeaning(source, pos, end) {
|
|
242
|
-
if (source[pos++] !== ":")
|
|
243
|
-
return;
|
|
244
|
-
const keyword = MeaningKeywords.find((kw) => pos + kw.length <= end && source.startsWith(kw, pos));
|
|
245
|
-
if (keyword) {
|
|
246
|
-
pos += keyword.length;
|
|
247
|
-
}
|
|
248
|
-
if (!keyword && UserLabelStart.includes(source[pos])) {
|
|
249
|
-
let lookahead = pos + 1;
|
|
250
|
-
while (lookahead < end &&
|
|
251
|
-
UserLabelCharacter.includes(source[lookahead])) {
|
|
252
|
-
lookahead++;
|
|
253
|
-
}
|
|
254
|
-
return [{ label: source.substring(pos, lookahead) }, lookahead];
|
|
255
|
-
}
|
|
256
|
-
if (pos + 1 < end &&
|
|
257
|
-
source[pos] === "(" &&
|
|
258
|
-
DecimalDigit.includes(source[pos + 1])) {
|
|
259
|
-
let lookahead = pos + 1;
|
|
260
|
-
while (lookahead < end && DecimalDigit.includes(source[lookahead])) {
|
|
261
|
-
lookahead++;
|
|
262
|
-
}
|
|
263
|
-
if (lookahead < end && source[lookahead] === ")") {
|
|
264
|
-
return [
|
|
265
|
-
{
|
|
266
|
-
keyword,
|
|
267
|
-
index: parseInt(source.substring(pos + 1, lookahead)),
|
|
268
|
-
},
|
|
269
|
-
lookahead + 1,
|
|
270
|
-
];
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
if (!keyword && pos < end && DecimalDigit.includes(source[pos])) {
|
|
274
|
-
let lookahead = pos;
|
|
275
|
-
while (lookahead < end && DecimalDigit.includes(source[lookahead])) {
|
|
276
|
-
lookahead++;
|
|
277
|
-
}
|
|
278
|
-
return [
|
|
279
|
-
{
|
|
280
|
-
index: parseInt(source.substring(pos, lookahead)),
|
|
281
|
-
},
|
|
282
|
-
lookahead,
|
|
283
|
-
];
|
|
284
|
-
}
|
|
285
|
-
if (keyword) {
|
|
286
|
-
return [{ keyword }, pos];
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
// // NOTE: The following grammar is incorrect as |SymbolReference| and |ModuleSource| have an
|
|
290
|
-
// // ambiguous parse. The correct solution is to use a cover grammar to parse
|
|
291
|
-
// // |SymbolReference| until we hit a `!` and then reinterpret the grammar.
|
|
292
|
-
// DeclarationReference:
|
|
293
|
-
// [empty]
|
|
294
|
-
// SymbolReference // Shorthand reference to symbol
|
|
295
|
-
// ModuleSource `!` // Reference to a module
|
|
296
|
-
// ModuleSource `!` SymbolReference // Reference to an export of a module
|
|
297
|
-
// ModuleSource `!` `~` SymbolReference // Reference to a local of a module
|
|
298
|
-
// `!` SymbolReference // Reference to global symbol
|
|
299
|
-
export function parseDeclarationReference(source, pos, end) {
|
|
300
|
-
let moduleSource;
|
|
301
|
-
let symbolReference;
|
|
302
|
-
let resolutionStart = "local";
|
|
303
|
-
let topLevelLocalReference = false;
|
|
304
|
-
const moduleSourceOrSymbolRef = parseModuleSource(source, pos, end);
|
|
305
|
-
if (moduleSourceOrSymbolRef) {
|
|
306
|
-
if (moduleSourceOrSymbolRef[1] < end &&
|
|
307
|
-
source[moduleSourceOrSymbolRef[1]] === "!") {
|
|
308
|
-
// We had a module source!
|
|
309
|
-
pos = moduleSourceOrSymbolRef[1] + 1;
|
|
310
|
-
resolutionStart = "global";
|
|
311
|
-
moduleSource = moduleSourceOrSymbolRef[0];
|
|
312
|
-
// We might be referencing a local of a module
|
|
313
|
-
if (source[pos] === "~") {
|
|
314
|
-
topLevelLocalReference = true;
|
|
315
|
-
pos++;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
else if (source[pos] === "!") {
|
|
320
|
-
pos++;
|
|
321
|
-
resolutionStart = "global";
|
|
322
|
-
}
|
|
323
|
-
const ref = parseSymbolReference(source, pos, end);
|
|
324
|
-
if (ref) {
|
|
325
|
-
symbolReference = ref[0];
|
|
326
|
-
if (topLevelLocalReference && symbolReference.path?.length) {
|
|
327
|
-
symbolReference.path[0].navigation = "~";
|
|
328
|
-
}
|
|
329
|
-
pos = ref[1];
|
|
330
|
-
}
|
|
331
|
-
if (!moduleSource && !symbolReference)
|
|
332
|
-
return;
|
|
333
|
-
return [
|
|
334
|
-
{
|
|
335
|
-
moduleSource,
|
|
336
|
-
resolutionStart,
|
|
337
|
-
symbolReference,
|
|
338
|
-
},
|
|
339
|
-
pos,
|
|
340
|
-
];
|
|
341
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export function getEnumFlags(flags) {
|
|
2
|
-
const result = [];
|
|
3
|
-
for (let i = 1; i <= flags; i <<= 1) {
|
|
4
|
-
if (flags & i) {
|
|
5
|
-
result.push(i);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return result;
|
|
9
|
-
}
|
|
10
|
-
// T & {} reduces inference priority
|
|
11
|
-
export function removeFlag(flag, remove) {
|
|
12
|
-
return (flag & ~remove);
|
|
13
|
-
}
|
|
14
|
-
export function hasAllFlags(flags, check) {
|
|
15
|
-
return (flags & check) === check;
|
|
16
|
-
}
|
|
17
|
-
export function hasAnyFlag(flags, check) {
|
|
18
|
-
return (flags & check) !== 0;
|
|
19
|
-
}
|
|
20
|
-
export function debugFlags(Enum, flags) {
|
|
21
|
-
return getEnumKeys(Enum).filter((key) => (Enum[key] & flags) === Enum[key]);
|
|
22
|
-
}
|
|
23
|
-
// Note: String enums are not handled.
|
|
24
|
-
export function getEnumKeys(Enum) {
|
|
25
|
-
const E = Enum;
|
|
26
|
-
return Object.keys(E).filter((k) => E[E[k]] === k);
|
|
27
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { insertPrioritySorted } from "./array.js";
|
|
2
|
-
/**
|
|
3
|
-
* Intentionally very simple event emitter.
|
|
4
|
-
*
|
|
5
|
-
* @privateRemarks
|
|
6
|
-
* This is essentially a stripped down copy of EventHooks in hooks.ts.
|
|
7
|
-
*/
|
|
8
|
-
export class EventDispatcher {
|
|
9
|
-
// Function is *usually* not a good type to use, but here it lets us specify stricter
|
|
10
|
-
// contracts in the methods while not casting everywhere this is used.
|
|
11
|
-
_listeners = new Map();
|
|
12
|
-
/**
|
|
13
|
-
* Starts listening to an event.
|
|
14
|
-
* @param event the event to listen to.
|
|
15
|
-
* @param listener function to be called when an this event is emitted.
|
|
16
|
-
* @param priority optional priority to insert this hook with.
|
|
17
|
-
* Higher priority is placed earlier in the listener array.
|
|
18
|
-
*/
|
|
19
|
-
on(event, listener, priority = 0) {
|
|
20
|
-
const list = (this._listeners.get(event) || []).slice();
|
|
21
|
-
insertPrioritySorted(list, { listener, priority });
|
|
22
|
-
this._listeners.set(event, list);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Stops listening to an event.
|
|
26
|
-
* @param event the event to stop listening to.
|
|
27
|
-
* @param listener the function to remove from the listener array.
|
|
28
|
-
*/
|
|
29
|
-
off(event, listener) {
|
|
30
|
-
const listeners = this._listeners.get(event);
|
|
31
|
-
if (listeners) {
|
|
32
|
-
const index = listeners.findIndex((lo) => lo.listener === listener);
|
|
33
|
-
if (index > -1) {
|
|
34
|
-
listeners.splice(index, 1);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Emits an event to all currently subscribed listeners.
|
|
40
|
-
* @param event the event to emit.
|
|
41
|
-
* @param args any arguments required for the event.
|
|
42
|
-
*/
|
|
43
|
-
trigger(event, ...args) {
|
|
44
|
-
const listeners = this._listeners.get(event)?.slice() || [];
|
|
45
|
-
for (const { listener } of listeners) {
|
|
46
|
-
listener(...args);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility to help type checking ensure that there is no uncovered case.
|
|
3
|
-
*/
|
|
4
|
-
export function assertNever(x) {
|
|
5
|
-
throw new Error(`Expected handling to cover all possible cases, but it didn't cover: ${JSON.stringify(x)}`);
|
|
6
|
-
}
|
|
7
|
-
export function assert(x, message = "Assertion failed") {
|
|
8
|
-
if (!x) {
|
|
9
|
-
// eslint-disable-next-line no-debugger
|
|
10
|
-
debugger;
|
|
11
|
-
throw new Error(message);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export function NonEnumerable(_cls, context) {
|
|
15
|
-
context.addInitializer(function () {
|
|
16
|
-
Object.defineProperty(this, context.name, {
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
}
|