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
|
@@ -0,0 +1,1311 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/lib/utils-common/array.ts
|
|
8
|
+
var emptyArray = [];
|
|
9
|
+
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
|
+
function insertOrderSorted(arr, item) {
|
|
15
|
+
const index = binaryFindPartition(arr, (v) => v.order > item.order);
|
|
16
|
+
arr.splice(index === -1 ? arr.length : index, 0, item);
|
|
17
|
+
return arr;
|
|
18
|
+
}
|
|
19
|
+
function binaryFindPartition(arr, partition2) {
|
|
20
|
+
if (arr.length === 0) {
|
|
21
|
+
return -1;
|
|
22
|
+
}
|
|
23
|
+
let low = 0, high = arr.length - 1;
|
|
24
|
+
while (high > low) {
|
|
25
|
+
const mid = low + Math.floor((high - low) / 2);
|
|
26
|
+
if (partition2(arr[mid])) {
|
|
27
|
+
high = mid;
|
|
28
|
+
} else {
|
|
29
|
+
low = mid + 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return partition2(arr[low]) ? low : -1;
|
|
33
|
+
}
|
|
34
|
+
function removeIfPresent(arr, item) {
|
|
35
|
+
if (!arr) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const index = arr.indexOf(item);
|
|
39
|
+
if (index !== -1) {
|
|
40
|
+
arr.splice(index, 1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function removeIf(arr, predicate) {
|
|
44
|
+
for (let i = 0; i < arr.length; i++) {
|
|
45
|
+
if (predicate(arr[i])) {
|
|
46
|
+
arr.splice(i, 1);
|
|
47
|
+
i--;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function unique(arr) {
|
|
52
|
+
return Array.from(new Set(arr));
|
|
53
|
+
}
|
|
54
|
+
function partition(iter, predicate) {
|
|
55
|
+
const left = [];
|
|
56
|
+
const right = [];
|
|
57
|
+
for (const item of iter) {
|
|
58
|
+
if (predicate(item)) {
|
|
59
|
+
left.push(item);
|
|
60
|
+
} else {
|
|
61
|
+
right.push(item);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return [left, right];
|
|
65
|
+
}
|
|
66
|
+
function* zip(...args) {
|
|
67
|
+
const iterators = args.map((x) => x[Symbol.iterator]());
|
|
68
|
+
for (; ; ) {
|
|
69
|
+
const next = iterators.map((i) => i.next());
|
|
70
|
+
if (next.some((v) => v.done)) {
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
yield next.map((v) => v.value);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function filterMap(iter, fn) {
|
|
77
|
+
const result = [];
|
|
78
|
+
for (const item of iter || []) {
|
|
79
|
+
const newItem = fn(item);
|
|
80
|
+
if (newItem !== void 0) {
|
|
81
|
+
result.push(newItem);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
function firstDefined(array, callback) {
|
|
87
|
+
for (let i = 0; i < array.length; i++) {
|
|
88
|
+
const result = callback(array[i], i);
|
|
89
|
+
if (result !== void 0) {
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return void 0;
|
|
94
|
+
}
|
|
95
|
+
function filter(array, predicate) {
|
|
96
|
+
return array ? array.filter(predicate) : emptyArray;
|
|
97
|
+
}
|
|
98
|
+
function aggregate(arr, fn) {
|
|
99
|
+
return arr.reduce((sum, it) => sum + fn(it), 0);
|
|
100
|
+
}
|
|
101
|
+
function joinArray(arr, joiner, mapper) {
|
|
102
|
+
if (arr?.length) {
|
|
103
|
+
return arr.map(mapper).join(joiner);
|
|
104
|
+
}
|
|
105
|
+
return "";
|
|
106
|
+
}
|
|
107
|
+
function maxElementByScore(arr, score) {
|
|
108
|
+
if (arr.length === 0) {
|
|
109
|
+
return void 0;
|
|
110
|
+
}
|
|
111
|
+
let largest = arr[0];
|
|
112
|
+
let largestScore = score(arr[0]);
|
|
113
|
+
for (let i = 1; i < arr.length; ++i) {
|
|
114
|
+
const itemScore = score(arr[i]);
|
|
115
|
+
if (itemScore > largestScore) {
|
|
116
|
+
largest = arr[i];
|
|
117
|
+
largestScore = itemScore;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return largest;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// src/lib/utils-common/declarationReference.ts
|
|
124
|
+
var MeaningKeywords = [
|
|
125
|
+
"class",
|
|
126
|
+
// SymbolFlags.Class
|
|
127
|
+
"interface",
|
|
128
|
+
// SymbolFlags.Interface
|
|
129
|
+
"type",
|
|
130
|
+
// SymbolFlags.TypeAlias
|
|
131
|
+
"enum",
|
|
132
|
+
// SymbolFlags.Enum
|
|
133
|
+
"namespace",
|
|
134
|
+
// SymbolFlags.Module
|
|
135
|
+
"function",
|
|
136
|
+
// SymbolFlags.Function
|
|
137
|
+
"var",
|
|
138
|
+
// SymbolFlags.Variable
|
|
139
|
+
"constructor",
|
|
140
|
+
// SymbolFlags.Constructor
|
|
141
|
+
"member",
|
|
142
|
+
// SymbolFlags.ClassMember | SymbolFlags.EnumMember
|
|
143
|
+
"event",
|
|
144
|
+
//
|
|
145
|
+
"call",
|
|
146
|
+
// SymbolFlags.Signature (for __call)
|
|
147
|
+
"new",
|
|
148
|
+
// SymbolFlags.Signature (for __new)
|
|
149
|
+
"index",
|
|
150
|
+
// SymbolFlags.Signature (for __index)
|
|
151
|
+
"complex",
|
|
152
|
+
// Any complex type
|
|
153
|
+
// TypeDoc specific
|
|
154
|
+
"getter",
|
|
155
|
+
"setter"
|
|
156
|
+
];
|
|
157
|
+
function meaningToString(meaning) {
|
|
158
|
+
let result = "";
|
|
159
|
+
if (meaning.keyword) {
|
|
160
|
+
result += meaning.keyword;
|
|
161
|
+
} else if (meaning.label) {
|
|
162
|
+
result += meaning.label;
|
|
163
|
+
}
|
|
164
|
+
if (typeof meaning.index === "number") {
|
|
165
|
+
result += `(${meaning.index})`;
|
|
166
|
+
}
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
var WhiteSpace = /[\t\u2B7F\u240C \u00A0\uFEFF\p{White_Space}]/u;
|
|
170
|
+
var LineTerminator = "\r\n\u2028\u2029";
|
|
171
|
+
var Punctuators = "{}()[]!.#~:,";
|
|
172
|
+
var FutureReservedPunctuator = "{}@";
|
|
173
|
+
var NavigationPunctuator = ".#~";
|
|
174
|
+
var DecimalDigit = "0123456789";
|
|
175
|
+
var HexDigit = DecimalDigit + "abcdefABCDEF";
|
|
176
|
+
var SingleEscapeCharacter = `'"\\bfnrtv`;
|
|
177
|
+
var EscapeCharacter = SingleEscapeCharacter + DecimalDigit + "xu";
|
|
178
|
+
var UserLabelStart = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
|
|
179
|
+
var UserLabelCharacter = UserLabelStart + DecimalDigit;
|
|
180
|
+
var SingleEscapeChars = {
|
|
181
|
+
"'": "'",
|
|
182
|
+
'"': '"',
|
|
183
|
+
"\\": "\\",
|
|
184
|
+
b: "\b",
|
|
185
|
+
f: "\f",
|
|
186
|
+
n: "\n",
|
|
187
|
+
r: "\r",
|
|
188
|
+
t: " ",
|
|
189
|
+
v: "\v"
|
|
190
|
+
};
|
|
191
|
+
function parseEscapeSequence(source, pos, end) {
|
|
192
|
+
if (SingleEscapeCharacter.includes(source[pos])) {
|
|
193
|
+
return [SingleEscapeChars[source[pos]], pos + 1];
|
|
194
|
+
}
|
|
195
|
+
if (!(EscapeCharacter + LineTerminator).includes(source[pos])) {
|
|
196
|
+
return [source[pos], pos + 1];
|
|
197
|
+
}
|
|
198
|
+
if (source[pos] === "0" && pos + 1 < end && !DecimalDigit.includes(source[pos + 1])) {
|
|
199
|
+
return ["\0", pos + 1];
|
|
200
|
+
}
|
|
201
|
+
if (source[pos] === "x" && pos + 2 < end && HexDigit.includes(source[pos + 1]) && HexDigit.includes(source[pos + 2])) {
|
|
202
|
+
return [
|
|
203
|
+
String.fromCharCode(
|
|
204
|
+
parseInt(source.substring(pos + 1, pos + 3), 16)
|
|
205
|
+
),
|
|
206
|
+
pos + 3
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
return parseUnicodeEscapeSequence(source, pos, end);
|
|
210
|
+
}
|
|
211
|
+
function parseUnicodeEscapeSequence(source, pos, end) {
|
|
212
|
+
if (source[pos] !== "u" || pos + 1 >= end) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (HexDigit.includes(source[pos + 1])) {
|
|
216
|
+
if (pos + 4 >= end || !HexDigit.includes(source[pos + 2]) || !HexDigit.includes(source[pos + 3]) || !HexDigit.includes(source[pos + 4])) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
return [
|
|
220
|
+
String.fromCharCode(
|
|
221
|
+
parseInt(source.substring(pos + 1, pos + 5), 16)
|
|
222
|
+
),
|
|
223
|
+
pos + 5
|
|
224
|
+
];
|
|
225
|
+
}
|
|
226
|
+
if (source[pos + 1] === "{" && pos + 2 < end && HexDigit.includes(source[pos + 2])) {
|
|
227
|
+
let lookahead = pos + 3;
|
|
228
|
+
while (lookahead < end && HexDigit.includes(source[lookahead])) {
|
|
229
|
+
lookahead++;
|
|
230
|
+
}
|
|
231
|
+
if (lookahead >= end || source[lookahead] !== "}") return;
|
|
232
|
+
const codePoint = parseInt(source.substring(pos + 2, lookahead), 16);
|
|
233
|
+
if (codePoint <= 1114111) {
|
|
234
|
+
return [String.fromCodePoint(codePoint), lookahead + 1];
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function parseString(source, pos, end) {
|
|
239
|
+
let result = "";
|
|
240
|
+
if (source[pos++] !== '"') return;
|
|
241
|
+
while (pos < end) {
|
|
242
|
+
if (source[pos] === '"') {
|
|
243
|
+
return [result, pos + 1];
|
|
244
|
+
}
|
|
245
|
+
if (LineTerminator.includes(source[pos])) return;
|
|
246
|
+
if (source[pos] === "\\") {
|
|
247
|
+
const esc = parseEscapeSequence(source, pos + 1, end);
|
|
248
|
+
if (!esc) return;
|
|
249
|
+
result += esc[0];
|
|
250
|
+
pos = esc[1];
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
result += source[pos++];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function parseModuleSource(source, pos, end) {
|
|
257
|
+
if (pos >= end) return;
|
|
258
|
+
if (source[pos] === '"') {
|
|
259
|
+
return parseString(source, pos, end);
|
|
260
|
+
}
|
|
261
|
+
let lookahead = pos;
|
|
262
|
+
while (lookahead < end && !('"!' + LineTerminator).includes(source[lookahead])) {
|
|
263
|
+
lookahead++;
|
|
264
|
+
}
|
|
265
|
+
if (lookahead === pos) return;
|
|
266
|
+
return [source.substring(pos, lookahead), lookahead];
|
|
267
|
+
}
|
|
268
|
+
function parseSymbolReference(source, pos, end) {
|
|
269
|
+
const path = parseComponentPath(source, pos, end);
|
|
270
|
+
pos = path?.[1] ?? pos;
|
|
271
|
+
const meaning = parseMeaning(source, pos, end);
|
|
272
|
+
pos = meaning?.[1] ?? pos;
|
|
273
|
+
if (path || meaning) {
|
|
274
|
+
return [{ path: path?.[0], meaning: meaning?.[0] }, pos];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function parseComponent(source, pos, end) {
|
|
278
|
+
if (pos < end && source[pos] === '"') {
|
|
279
|
+
return parseString(source, pos, end);
|
|
280
|
+
}
|
|
281
|
+
let lookahead = pos;
|
|
282
|
+
while (lookahead < end && !('"' + Punctuators + FutureReservedPunctuator + LineTerminator).includes(source[lookahead]) && !WhiteSpace.test(source[lookahead])) {
|
|
283
|
+
lookahead++;
|
|
284
|
+
}
|
|
285
|
+
if (lookahead === pos) return;
|
|
286
|
+
return [source.substring(pos, lookahead), lookahead];
|
|
287
|
+
}
|
|
288
|
+
function parseComponentPath(source, pos, end) {
|
|
289
|
+
const components = [];
|
|
290
|
+
let component = parseComponent(source, pos, end);
|
|
291
|
+
if (!component) return;
|
|
292
|
+
pos = component[1];
|
|
293
|
+
components.push({ navigation: ".", path: component[0] });
|
|
294
|
+
while (pos < end && NavigationPunctuator.includes(source[pos])) {
|
|
295
|
+
const navigation = source[pos];
|
|
296
|
+
pos++;
|
|
297
|
+
component = parseComponent(source, pos, end);
|
|
298
|
+
if (!component) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
pos = component[1];
|
|
302
|
+
components.push({ navigation, path: component[0] });
|
|
303
|
+
}
|
|
304
|
+
return [components, pos];
|
|
305
|
+
}
|
|
306
|
+
function parseMeaning(source, pos, end) {
|
|
307
|
+
if (source[pos++] !== ":") return;
|
|
308
|
+
const keyword = MeaningKeywords.find(
|
|
309
|
+
(kw) => pos + kw.length <= end && source.startsWith(kw, pos)
|
|
310
|
+
);
|
|
311
|
+
if (keyword) {
|
|
312
|
+
pos += keyword.length;
|
|
313
|
+
}
|
|
314
|
+
if (!keyword && UserLabelStart.includes(source[pos])) {
|
|
315
|
+
let lookahead = pos + 1;
|
|
316
|
+
while (lookahead < end && UserLabelCharacter.includes(source[lookahead])) {
|
|
317
|
+
lookahead++;
|
|
318
|
+
}
|
|
319
|
+
return [{ label: source.substring(pos, lookahead) }, lookahead];
|
|
320
|
+
}
|
|
321
|
+
if (pos + 1 < end && source[pos] === "(" && DecimalDigit.includes(source[pos + 1])) {
|
|
322
|
+
let lookahead = pos + 1;
|
|
323
|
+
while (lookahead < end && DecimalDigit.includes(source[lookahead])) {
|
|
324
|
+
lookahead++;
|
|
325
|
+
}
|
|
326
|
+
if (lookahead < end && source[lookahead] === ")") {
|
|
327
|
+
return [
|
|
328
|
+
{
|
|
329
|
+
keyword,
|
|
330
|
+
index: parseInt(source.substring(pos + 1, lookahead))
|
|
331
|
+
},
|
|
332
|
+
lookahead + 1
|
|
333
|
+
];
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (!keyword && pos < end && DecimalDigit.includes(source[pos])) {
|
|
337
|
+
let lookahead = pos;
|
|
338
|
+
while (lookahead < end && DecimalDigit.includes(source[lookahead])) {
|
|
339
|
+
lookahead++;
|
|
340
|
+
}
|
|
341
|
+
return [
|
|
342
|
+
{
|
|
343
|
+
index: parseInt(source.substring(pos, lookahead))
|
|
344
|
+
},
|
|
345
|
+
lookahead
|
|
346
|
+
];
|
|
347
|
+
}
|
|
348
|
+
if (keyword) {
|
|
349
|
+
return [{ keyword }, pos];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function parseDeclarationReference(source, pos, end) {
|
|
353
|
+
let moduleSource;
|
|
354
|
+
let symbolReference;
|
|
355
|
+
let resolutionStart = "local";
|
|
356
|
+
let topLevelLocalReference = false;
|
|
357
|
+
const moduleSourceOrSymbolRef = parseModuleSource(source, pos, end);
|
|
358
|
+
if (moduleSourceOrSymbolRef) {
|
|
359
|
+
if (moduleSourceOrSymbolRef[1] < end && source[moduleSourceOrSymbolRef[1]] === "!") {
|
|
360
|
+
pos = moduleSourceOrSymbolRef[1] + 1;
|
|
361
|
+
resolutionStart = "global";
|
|
362
|
+
moduleSource = moduleSourceOrSymbolRef[0];
|
|
363
|
+
if (source[pos] === "~") {
|
|
364
|
+
topLevelLocalReference = true;
|
|
365
|
+
pos++;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
} else if (source[pos] === "!") {
|
|
369
|
+
pos++;
|
|
370
|
+
resolutionStart = "global";
|
|
371
|
+
}
|
|
372
|
+
const ref = parseSymbolReference(source, pos, end);
|
|
373
|
+
if (ref) {
|
|
374
|
+
symbolReference = ref[0];
|
|
375
|
+
if (topLevelLocalReference && symbolReference.path?.length) {
|
|
376
|
+
symbolReference.path[0].navigation = "~";
|
|
377
|
+
}
|
|
378
|
+
pos = ref[1];
|
|
379
|
+
}
|
|
380
|
+
if (!moduleSource && !symbolReference) return;
|
|
381
|
+
return [
|
|
382
|
+
{
|
|
383
|
+
moduleSource,
|
|
384
|
+
resolutionStart,
|
|
385
|
+
symbolReference
|
|
386
|
+
},
|
|
387
|
+
pos
|
|
388
|
+
];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// src/lib/utils-common/enum.ts
|
|
392
|
+
function getEnumFlags(flags) {
|
|
393
|
+
const result = [];
|
|
394
|
+
for (let i = 1; i <= flags; i <<= 1) {
|
|
395
|
+
if (flags & i) {
|
|
396
|
+
result.push(i);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return result;
|
|
400
|
+
}
|
|
401
|
+
function removeFlag(flag, remove) {
|
|
402
|
+
return flag & ~remove;
|
|
403
|
+
}
|
|
404
|
+
function hasAllFlags(flags, check) {
|
|
405
|
+
return (flags & check) === check;
|
|
406
|
+
}
|
|
407
|
+
function hasAnyFlag(flags, check) {
|
|
408
|
+
return (flags & check) !== 0;
|
|
409
|
+
}
|
|
410
|
+
function debugFlags(Enum, flags) {
|
|
411
|
+
return getEnumKeys(Enum).filter(
|
|
412
|
+
(key) => (Enum[key] & flags) === Enum[key]
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
function getEnumKeys(Enum) {
|
|
416
|
+
const E = Enum;
|
|
417
|
+
return Object.keys(E).filter((k) => E[E[k]] === k);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// src/lib/utils-common/events.ts
|
|
421
|
+
var EventDispatcher = class {
|
|
422
|
+
// Function is *usually* not a good type to use, but here it lets us specify stricter
|
|
423
|
+
// contracts in the methods while not casting everywhere this is used.
|
|
424
|
+
_listeners = /* @__PURE__ */ new Map();
|
|
425
|
+
/**
|
|
426
|
+
* Starts listening to an event.
|
|
427
|
+
* @param event the event to listen to.
|
|
428
|
+
* @param listener function to be called when an this event is emitted.
|
|
429
|
+
* @param priority optional priority to insert this hook with.
|
|
430
|
+
* Higher priority is placed earlier in the listener array.
|
|
431
|
+
*/
|
|
432
|
+
on(event, listener, priority = 0) {
|
|
433
|
+
const list = (this._listeners.get(event) || []).slice();
|
|
434
|
+
insertPrioritySorted(list, { listener, priority });
|
|
435
|
+
this._listeners.set(event, list);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Stops listening to an event.
|
|
439
|
+
* @param event the event to stop listening to.
|
|
440
|
+
* @param listener the function to remove from the listener array.
|
|
441
|
+
*/
|
|
442
|
+
off(event, listener) {
|
|
443
|
+
const listeners = this._listeners.get(event);
|
|
444
|
+
if (listeners) {
|
|
445
|
+
const index = listeners.findIndex((lo) => lo.listener === listener);
|
|
446
|
+
if (index > -1) {
|
|
447
|
+
listeners.splice(index, 1);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Emits an event to all currently subscribed listeners.
|
|
453
|
+
* @param event the event to emit.
|
|
454
|
+
* @param args any arguments required for the event.
|
|
455
|
+
*/
|
|
456
|
+
trigger(event, ...args) {
|
|
457
|
+
const listeners = this._listeners.get(event)?.slice() || [];
|
|
458
|
+
for (const { listener } of listeners) {
|
|
459
|
+
listener(...args);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
// src/lib/utils-common/general.ts
|
|
465
|
+
function assertNever(x) {
|
|
466
|
+
throw new Error(
|
|
467
|
+
`Expected handling to cover all possible cases, but it didn't cover: ${JSON.stringify(x)}`
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
function assert(x, message = "Assertion failed") {
|
|
471
|
+
if (!x) {
|
|
472
|
+
debugger;
|
|
473
|
+
throw new Error(message);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
function NonEnumerable(_cls, context) {
|
|
477
|
+
context.addInitializer(function() {
|
|
478
|
+
Object.defineProperty(this, context.name, {
|
|
479
|
+
enumerable: false,
|
|
480
|
+
configurable: true,
|
|
481
|
+
writable: true
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// src/lib/utils-common/hooks.ts
|
|
487
|
+
var momentos = /* @__PURE__ */ new WeakMap();
|
|
488
|
+
var EventHooks = class {
|
|
489
|
+
// Function is *usually* not a good type to use, but here it lets us specify stricter
|
|
490
|
+
// contracts in the methods while not casting everywhere this is used.
|
|
491
|
+
_listeners = /* @__PURE__ */ new Map();
|
|
492
|
+
/**
|
|
493
|
+
* Starts listening to an event.
|
|
494
|
+
* @param event the event to listen to.
|
|
495
|
+
* @param listener function to be called when an this event is emitted.
|
|
496
|
+
* @param order optional order to insert this hook with.
|
|
497
|
+
*/
|
|
498
|
+
on(event, listener, order = 0) {
|
|
499
|
+
const list = (this._listeners.get(event) || []).slice();
|
|
500
|
+
insertOrderSorted(list, { listener, order });
|
|
501
|
+
this._listeners.set(event, list);
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Listens to a single occurrence of an event.
|
|
505
|
+
* @param event the event to listen to.
|
|
506
|
+
* @param listener function to be called when an this event is emitted.
|
|
507
|
+
* @param order optional order to insert this hook with.
|
|
508
|
+
*/
|
|
509
|
+
once(event, listener, order = 0) {
|
|
510
|
+
const list = (this._listeners.get(event) || []).slice();
|
|
511
|
+
insertOrderSorted(list, { listener, once: true, order });
|
|
512
|
+
this._listeners.set(event, list);
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Stops listening to an event.
|
|
516
|
+
* @param event the event to stop listening to.
|
|
517
|
+
* @param listener the function to remove from the listener array.
|
|
518
|
+
*/
|
|
519
|
+
off(event, listener) {
|
|
520
|
+
const listeners = this._listeners.get(event);
|
|
521
|
+
if (listeners) {
|
|
522
|
+
const index = listeners.findIndex((lo) => lo.listener === listener);
|
|
523
|
+
if (index > -1) {
|
|
524
|
+
listeners.splice(index, 1);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Emits an event to all currently subscribed listeners.
|
|
530
|
+
* @param event the event to emit.
|
|
531
|
+
* @param args any arguments required for the event.
|
|
532
|
+
*/
|
|
533
|
+
emit(event, ...args) {
|
|
534
|
+
const listeners = this._listeners.get(event)?.slice() || [];
|
|
535
|
+
this._listeners.set(
|
|
536
|
+
event,
|
|
537
|
+
listeners.filter(({ once }) => !once)
|
|
538
|
+
);
|
|
539
|
+
return listeners.map(({ listener }) => listener(...args));
|
|
540
|
+
}
|
|
541
|
+
saveMomento() {
|
|
542
|
+
const momento = {};
|
|
543
|
+
const save = /* @__PURE__ */ new Map();
|
|
544
|
+
for (const [key, val] of this._listeners) {
|
|
545
|
+
save.set(key, [...val]);
|
|
546
|
+
}
|
|
547
|
+
momentos.set(momento, save);
|
|
548
|
+
return momento;
|
|
549
|
+
}
|
|
550
|
+
restoreMomento(momento) {
|
|
551
|
+
const saved = momentos.get(momento);
|
|
552
|
+
if (saved) {
|
|
553
|
+
this._listeners.clear();
|
|
554
|
+
for (const [key, val] of saved) {
|
|
555
|
+
this._listeners.set(key, [...val]);
|
|
556
|
+
}
|
|
557
|
+
} else {
|
|
558
|
+
throw new Error("Momento not found.");
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
// src/lib/utils-common/i18n.ts
|
|
564
|
+
var translations = {};
|
|
565
|
+
function setTranslations(t) {
|
|
566
|
+
translations = { ...t };
|
|
567
|
+
}
|
|
568
|
+
function addTranslations(t) {
|
|
569
|
+
Object.assign(translations, t);
|
|
570
|
+
}
|
|
571
|
+
var i18n = new Proxy({}, {
|
|
572
|
+
get(_, key) {
|
|
573
|
+
return (...args) => {
|
|
574
|
+
const template = String(translations[key] || key);
|
|
575
|
+
return template.replace(/\{(\d+)\}/g, (_2, index) => {
|
|
576
|
+
return args[+index] ?? "(no placeholder)";
|
|
577
|
+
});
|
|
578
|
+
};
|
|
579
|
+
},
|
|
580
|
+
has(_, key) {
|
|
581
|
+
return Object.prototype.hasOwnProperty.call(translations, key);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
function translateTagName(tag) {
|
|
585
|
+
const tagName = tag.substring(1);
|
|
586
|
+
if (Object.prototype.hasOwnProperty.call(translations, `tag_${tagName}`)) {
|
|
587
|
+
return translations[`tag_${tagName}`];
|
|
588
|
+
}
|
|
589
|
+
return tagName.substring(0, 1).toUpperCase() + tagName.substring(1).replace(
|
|
590
|
+
/[a-z][A-Z]/g,
|
|
591
|
+
(x) => `${x[0]} ${x[1]}`
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// src/lib/utils-common/jsx.ts
|
|
596
|
+
var jsx_exports = {};
|
|
597
|
+
__export(jsx_exports, {
|
|
598
|
+
Fragment: () => JsxFragment,
|
|
599
|
+
Raw: () => Raw,
|
|
600
|
+
createElement: () => createElement,
|
|
601
|
+
renderElement: () => renderElement,
|
|
602
|
+
renderElementToText: () => renderElementToText,
|
|
603
|
+
setRenderSettings: () => setRenderSettings
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
// src/lib/utils-common/jsx.elements.ts
|
|
607
|
+
function JsxFragment() {
|
|
608
|
+
throw new Error("Should never be called");
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// src/lib/utils-common/map.ts
|
|
612
|
+
var DefaultMap = class extends Map {
|
|
613
|
+
constructor(creator) {
|
|
614
|
+
super();
|
|
615
|
+
this.creator = creator;
|
|
616
|
+
}
|
|
617
|
+
creator;
|
|
618
|
+
get(key) {
|
|
619
|
+
const saved = super.get(key);
|
|
620
|
+
if (saved != null) {
|
|
621
|
+
return saved;
|
|
622
|
+
}
|
|
623
|
+
const created = this.creator(key);
|
|
624
|
+
this.set(key, created);
|
|
625
|
+
return created;
|
|
626
|
+
}
|
|
627
|
+
getNoInsert(key) {
|
|
628
|
+
return super.get(key);
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
var StableKeyMap = class {
|
|
632
|
+
[Symbol.toStringTag] = "StableKeyMap";
|
|
633
|
+
impl = /* @__PURE__ */ new Map();
|
|
634
|
+
get size() {
|
|
635
|
+
return this.impl.size;
|
|
636
|
+
}
|
|
637
|
+
set(key, value) {
|
|
638
|
+
this.impl.set(key.getStableKey(), [key, value]);
|
|
639
|
+
return this;
|
|
640
|
+
}
|
|
641
|
+
get(key) {
|
|
642
|
+
return this.impl.get(key.getStableKey())?.[1];
|
|
643
|
+
}
|
|
644
|
+
has(key) {
|
|
645
|
+
return this.get(key) != null;
|
|
646
|
+
}
|
|
647
|
+
clear() {
|
|
648
|
+
this.impl.clear();
|
|
649
|
+
}
|
|
650
|
+
delete(key) {
|
|
651
|
+
return this.impl.delete(key.getStableKey());
|
|
652
|
+
}
|
|
653
|
+
forEach(callbackfn, thisArg) {
|
|
654
|
+
for (const [k, v] of this.entries()) {
|
|
655
|
+
callbackfn.apply(thisArg, [v, k, this]);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
entries() {
|
|
659
|
+
return this.impl.values();
|
|
660
|
+
}
|
|
661
|
+
*keys() {
|
|
662
|
+
for (const [k] of this.entries()) {
|
|
663
|
+
yield k;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
*values() {
|
|
667
|
+
for (const [, v] of this.entries()) {
|
|
668
|
+
yield v;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
[Symbol.iterator]() {
|
|
672
|
+
return this.entries();
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
// src/lib/utils-common/string.ts
|
|
677
|
+
function countMatches(text, search) {
|
|
678
|
+
let count = 0;
|
|
679
|
+
let last = 0;
|
|
680
|
+
for (; ; ) {
|
|
681
|
+
const index = text.indexOf(search, last);
|
|
682
|
+
if (index === -1) {
|
|
683
|
+
break;
|
|
684
|
+
} else {
|
|
685
|
+
last = index + 1;
|
|
686
|
+
++count;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return count;
|
|
690
|
+
}
|
|
691
|
+
function dedent(text) {
|
|
692
|
+
const lines = text.split(/\r?\n/);
|
|
693
|
+
while (lines.length && lines[0].search(/\S/) === -1) {
|
|
694
|
+
lines.shift();
|
|
695
|
+
}
|
|
696
|
+
while (lines.length && lines[lines.length - 1].search(/\S/) === -1) {
|
|
697
|
+
lines.pop();
|
|
698
|
+
}
|
|
699
|
+
const minIndent = lines.reduce(
|
|
700
|
+
(indent, line) => line.length ? Math.min(indent, line.search(/\S/)) : indent,
|
|
701
|
+
Infinity
|
|
702
|
+
);
|
|
703
|
+
return lines.map((line) => line.substring(minIndent)).join("\n");
|
|
704
|
+
}
|
|
705
|
+
function editDistance(s, t) {
|
|
706
|
+
if (s.length < t.length) return editDistance(t, s);
|
|
707
|
+
let v0 = Array.from({ length: t.length + 1 }, (_, i) => i);
|
|
708
|
+
let v1 = Array.from({ length: t.length + 1 }, () => 0);
|
|
709
|
+
for (let i = 0; i < s.length; i++) {
|
|
710
|
+
v1[0] = i + 1;
|
|
711
|
+
for (let j = 0; j < s.length; j++) {
|
|
712
|
+
const deletionCost = v0[j + 1] + 1;
|
|
713
|
+
const insertionCost = v1[j] + 1;
|
|
714
|
+
let substitutionCost;
|
|
715
|
+
if (s[i] === t[j]) {
|
|
716
|
+
substitutionCost = v0[j];
|
|
717
|
+
} else if (s[i]?.toUpperCase() === t[j]?.toUpperCase()) {
|
|
718
|
+
substitutionCost = v0[j] + 1;
|
|
719
|
+
} else {
|
|
720
|
+
substitutionCost = v0[j] + 3;
|
|
721
|
+
}
|
|
722
|
+
v1[j + 1] = Math.min(deletionCost, insertionCost, substitutionCost);
|
|
723
|
+
}
|
|
724
|
+
[v0, v1] = [v1, v0];
|
|
725
|
+
}
|
|
726
|
+
return v0[t.length];
|
|
727
|
+
}
|
|
728
|
+
function getSimilarValues(values, compareTo) {
|
|
729
|
+
const results = new DefaultMap(() => []);
|
|
730
|
+
let lowest = Infinity;
|
|
731
|
+
for (const name of values) {
|
|
732
|
+
const distance = editDistance(compareTo, name);
|
|
733
|
+
lowest = Math.min(lowest, distance);
|
|
734
|
+
results.get(distance).push(name);
|
|
735
|
+
}
|
|
736
|
+
return results.get(lowest).concat(results.get(lowest + 1), results.get(lowest + 2));
|
|
737
|
+
}
|
|
738
|
+
function escapeRegExp(s) {
|
|
739
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
740
|
+
}
|
|
741
|
+
var htmlEscapes = {
|
|
742
|
+
"&": "&",
|
|
743
|
+
"<": "<",
|
|
744
|
+
">": ">",
|
|
745
|
+
'"': """,
|
|
746
|
+
"'": "'"
|
|
747
|
+
};
|
|
748
|
+
function escapeHtml(html) {
|
|
749
|
+
return html.replace(/[&<>'"]/g, (c) => htmlEscapes[c]);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// src/lib/utils-common/jsx.ts
|
|
753
|
+
function Raw(_props) {
|
|
754
|
+
return null;
|
|
755
|
+
}
|
|
756
|
+
var voidElements = /* @__PURE__ */ new Set([
|
|
757
|
+
"area",
|
|
758
|
+
"base",
|
|
759
|
+
"br",
|
|
760
|
+
"col",
|
|
761
|
+
"embed",
|
|
762
|
+
"hr",
|
|
763
|
+
"img",
|
|
764
|
+
"input",
|
|
765
|
+
"link",
|
|
766
|
+
"meta",
|
|
767
|
+
"param",
|
|
768
|
+
"source",
|
|
769
|
+
"track",
|
|
770
|
+
"wbr"
|
|
771
|
+
]);
|
|
772
|
+
var blockElements = /* @__PURE__ */ new Set([
|
|
773
|
+
"h1",
|
|
774
|
+
"h2",
|
|
775
|
+
"h3",
|
|
776
|
+
"h4",
|
|
777
|
+
"h5",
|
|
778
|
+
"h6",
|
|
779
|
+
"div",
|
|
780
|
+
"section",
|
|
781
|
+
"nav",
|
|
782
|
+
"details",
|
|
783
|
+
"p",
|
|
784
|
+
"ul",
|
|
785
|
+
"ol",
|
|
786
|
+
"li"
|
|
787
|
+
]);
|
|
788
|
+
function createElement(tag, props, ...children) {
|
|
789
|
+
return { tag, props, children };
|
|
790
|
+
}
|
|
791
|
+
var renderPretty = true;
|
|
792
|
+
function setRenderSettings(options) {
|
|
793
|
+
renderPretty = options.pretty;
|
|
794
|
+
}
|
|
795
|
+
function renderElement(element) {
|
|
796
|
+
if (!element) {
|
|
797
|
+
return "";
|
|
798
|
+
}
|
|
799
|
+
const buf = [];
|
|
800
|
+
renderInto(buf, element);
|
|
801
|
+
return buf.join("");
|
|
802
|
+
}
|
|
803
|
+
function renderInto(buf, element) {
|
|
804
|
+
if (!element) {
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
const { tag, props, children } = element;
|
|
808
|
+
if (typeof tag === "function") {
|
|
809
|
+
if (tag === Raw) {
|
|
810
|
+
buf.push(String(props.html));
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
if (tag === JsxFragment) {
|
|
814
|
+
renderChildrenInto(buf, children);
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
renderInto(buf, tag(Object.assign({ children }, props)));
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
if (blockElements.has(tag) && renderPretty && buf.length) {
|
|
821
|
+
buf.push("\n");
|
|
822
|
+
}
|
|
823
|
+
buf.push("<", tag);
|
|
824
|
+
for (const [key, val] of Object.entries(props ?? {})) {
|
|
825
|
+
if (val == null) continue;
|
|
826
|
+
if (typeof val === "boolean") {
|
|
827
|
+
if (val) {
|
|
828
|
+
buf.push(" ", key);
|
|
829
|
+
}
|
|
830
|
+
} else {
|
|
831
|
+
const stringified = typeof val === "string" ? val : JSON.stringify(val);
|
|
832
|
+
buf.push(" ", key, '="', stringified.replaceAll('"', """), '"');
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
if (children.length) {
|
|
836
|
+
buf.push(">");
|
|
837
|
+
renderChildrenInto(buf, children);
|
|
838
|
+
buf.push("</", tag, ">");
|
|
839
|
+
} else if (voidElements.has(tag)) {
|
|
840
|
+
buf.push("/>");
|
|
841
|
+
} else {
|
|
842
|
+
buf.push("></", tag, ">");
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
function renderChildrenInto(buf, children) {
|
|
846
|
+
for (const child of children) {
|
|
847
|
+
if (typeof child === "boolean") continue;
|
|
848
|
+
if (Array.isArray(child)) {
|
|
849
|
+
renderChildrenInto(buf, child);
|
|
850
|
+
} else if (typeof child === "string" || typeof child === "number" || typeof child === "bigint") {
|
|
851
|
+
buf.push(escapeHtml(child.toString()));
|
|
852
|
+
} else {
|
|
853
|
+
renderInto(buf, child);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
function renderElementToText(element) {
|
|
858
|
+
if (!element) {
|
|
859
|
+
return "";
|
|
860
|
+
}
|
|
861
|
+
const buf = [];
|
|
862
|
+
renderTextInto(buf, element);
|
|
863
|
+
return buf.join("");
|
|
864
|
+
}
|
|
865
|
+
function renderTextInto(buf, element) {
|
|
866
|
+
if (!element) {
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
const { tag, props, children } = element;
|
|
870
|
+
if (typeof tag === "function") {
|
|
871
|
+
if (tag === Raw) {
|
|
872
|
+
buf.push(String(props.html));
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
if (tag === JsxFragment) {
|
|
876
|
+
renderTextChildrenInto(buf, children);
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
renderTextInto(buf, tag(Object.assign({ children }, props)));
|
|
880
|
+
return;
|
|
881
|
+
} else if (tag === "br") {
|
|
882
|
+
buf.push("\n");
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
renderTextChildrenInto(buf, children);
|
|
886
|
+
}
|
|
887
|
+
function renderTextChildrenInto(buf, children) {
|
|
888
|
+
for (const child of children) {
|
|
889
|
+
if (typeof child === "boolean") continue;
|
|
890
|
+
if (Array.isArray(child)) {
|
|
891
|
+
renderTextChildrenInto(buf, child);
|
|
892
|
+
} else if (typeof child === "string" || typeof child === "number" || typeof child === "bigint") {
|
|
893
|
+
buf.push(child.toString().replaceAll("\xA0", " "));
|
|
894
|
+
} else {
|
|
895
|
+
renderTextInto(buf, child);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// src/lib/utils-common/logger.ts
|
|
901
|
+
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
902
|
+
LogLevel2[LogLevel2["Verbose"] = 0] = "Verbose";
|
|
903
|
+
LogLevel2[LogLevel2["Info"] = 1] = "Info";
|
|
904
|
+
LogLevel2[LogLevel2["Warn"] = 2] = "Warn";
|
|
905
|
+
LogLevel2[LogLevel2["Error"] = 3] = "Error";
|
|
906
|
+
LogLevel2[LogLevel2["None"] = 4] = "None";
|
|
907
|
+
return LogLevel2;
|
|
908
|
+
})(LogLevel || {});
|
|
909
|
+
var messagePrefixes = {
|
|
910
|
+
[3 /* Error */]: "[error]",
|
|
911
|
+
[2 /* Warn */]: "[warning]",
|
|
912
|
+
[1 /* Info */]: "[info]",
|
|
913
|
+
[0 /* Verbose */]: "[debug]"
|
|
914
|
+
};
|
|
915
|
+
var Logger = class {
|
|
916
|
+
/**
|
|
917
|
+
* How many error messages have been logged?
|
|
918
|
+
*/
|
|
919
|
+
errorCount = 0;
|
|
920
|
+
/**
|
|
921
|
+
* How many warning messages have been logged?
|
|
922
|
+
*/
|
|
923
|
+
warningCount = 0;
|
|
924
|
+
/**
|
|
925
|
+
* How many validation warning messages have been logged?
|
|
926
|
+
*/
|
|
927
|
+
validationWarningCount = 0;
|
|
928
|
+
/**
|
|
929
|
+
* The minimum logging level to print.
|
|
930
|
+
*/
|
|
931
|
+
level = 1 /* Info */;
|
|
932
|
+
/**
|
|
933
|
+
* Has an error been raised through the log method?
|
|
934
|
+
*/
|
|
935
|
+
hasErrors() {
|
|
936
|
+
return this.errorCount > 0;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Has a warning been raised through the log method?
|
|
940
|
+
*/
|
|
941
|
+
hasWarnings() {
|
|
942
|
+
return this.warningCount > 0;
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Reset the error counter.
|
|
946
|
+
*/
|
|
947
|
+
resetErrors() {
|
|
948
|
+
this.errorCount = 0;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Reset the warning counter.
|
|
952
|
+
*/
|
|
953
|
+
resetWarnings() {
|
|
954
|
+
this.warningCount = 0;
|
|
955
|
+
this.validationWarningCount = 0;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Log the given verbose message.
|
|
959
|
+
*
|
|
960
|
+
* @param text The message that should be logged.
|
|
961
|
+
*/
|
|
962
|
+
verbose(text) {
|
|
963
|
+
this.log(this.addContext(text, 0 /* Verbose */), 0 /* Verbose */);
|
|
964
|
+
}
|
|
965
|
+
/** Log the given info message. */
|
|
966
|
+
info(text) {
|
|
967
|
+
this.log(this.addContext(text, 1 /* Info */), 1 /* Info */);
|
|
968
|
+
}
|
|
969
|
+
warn(text, ...args) {
|
|
970
|
+
const text2 = this.addContext(text, 2 /* Warn */, ...args);
|
|
971
|
+
this.log(text2, 2 /* Warn */);
|
|
972
|
+
}
|
|
973
|
+
validationWarning(...args) {
|
|
974
|
+
this.validationWarningCount += 1;
|
|
975
|
+
this.warn(...args);
|
|
976
|
+
}
|
|
977
|
+
error(text, ...args) {
|
|
978
|
+
const text2 = this.addContext(text, 3 /* Error */, ...args);
|
|
979
|
+
this.log(text2, 3 /* Error */);
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Print a log message.
|
|
983
|
+
*
|
|
984
|
+
* @param _message The message itself.
|
|
985
|
+
* @param level The urgency of the log message.
|
|
986
|
+
*/
|
|
987
|
+
log(_message, level) {
|
|
988
|
+
if (level === 3 /* Error */) {
|
|
989
|
+
this.errorCount += 1;
|
|
990
|
+
}
|
|
991
|
+
if (level === 2 /* Warn */) {
|
|
992
|
+
this.warningCount += 1;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
addContext(message, _level, ..._args) {
|
|
996
|
+
return message;
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
var ConsoleLogger = class extends Logger {
|
|
1000
|
+
log(message, level) {
|
|
1001
|
+
super.log(message, level);
|
|
1002
|
+
if (level < this.level) {
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
const method = {
|
|
1006
|
+
[3 /* Error */]: "error",
|
|
1007
|
+
[2 /* Warn */]: "warn",
|
|
1008
|
+
[1 /* Info */]: "info",
|
|
1009
|
+
[0 /* Verbose */]: "log"
|
|
1010
|
+
}[level];
|
|
1011
|
+
console[method](message);
|
|
1012
|
+
}
|
|
1013
|
+
addContext(message, level, ..._args) {
|
|
1014
|
+
return `${messagePrefixes[level]} ${message}`;
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
// src/lib/utils-common/minimalSourceFile.ts
|
|
1019
|
+
var lineStarts = /* @__PURE__ */ new WeakMap();
|
|
1020
|
+
var MinimalSourceFile = class {
|
|
1021
|
+
text;
|
|
1022
|
+
// This type is just string to ensure assignability from SourceFile
|
|
1023
|
+
fileName;
|
|
1024
|
+
constructor(text, fileName) {
|
|
1025
|
+
this.text = text.replaceAll("\r\n", "\n");
|
|
1026
|
+
lineStarts.set(this, [0]);
|
|
1027
|
+
this.fileName = fileName;
|
|
1028
|
+
}
|
|
1029
|
+
getLineAndCharacterOfPosition(pos) {
|
|
1030
|
+
if (pos < 0 || pos >= this.text.length) {
|
|
1031
|
+
throw new Error("pos must be within the range of the file.");
|
|
1032
|
+
}
|
|
1033
|
+
const starts = lineStarts.get(this);
|
|
1034
|
+
while (pos >= starts[starts.length - 1]) {
|
|
1035
|
+
const nextStart = this.text.indexOf(
|
|
1036
|
+
"\n",
|
|
1037
|
+
starts[starts.length - 1]
|
|
1038
|
+
);
|
|
1039
|
+
if (nextStart === -1) {
|
|
1040
|
+
starts.push(Infinity);
|
|
1041
|
+
} else {
|
|
1042
|
+
starts.push(nextStart + 1);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
const line = binaryFindPartition(starts, (x) => x > pos) - 1;
|
|
1046
|
+
return {
|
|
1047
|
+
character: pos - starts[line],
|
|
1048
|
+
line
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
// src/lib/utils-common/path.ts
|
|
1054
|
+
var NormalizedPathUtils;
|
|
1055
|
+
((NormalizedPathUtils2) => {
|
|
1056
|
+
function dirname(path) {
|
|
1057
|
+
let end = path.length - 2;
|
|
1058
|
+
for (; end > 0; --end) {
|
|
1059
|
+
if (path[end] === "/") break;
|
|
1060
|
+
}
|
|
1061
|
+
switch (end) {
|
|
1062
|
+
case -2:
|
|
1063
|
+
case -1:
|
|
1064
|
+
return path[0] === "/" ? "/" : ".";
|
|
1065
|
+
case 0:
|
|
1066
|
+
return path.substring(0, path.indexOf("/") + 1);
|
|
1067
|
+
default:
|
|
1068
|
+
return path.slice(0, end);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
NormalizedPathUtils2.dirname = dirname;
|
|
1072
|
+
function basename(path) {
|
|
1073
|
+
let end = path.length - 2;
|
|
1074
|
+
for (; end >= 0; --end) {
|
|
1075
|
+
if (path[end] === "/") break;
|
|
1076
|
+
}
|
|
1077
|
+
switch (end) {
|
|
1078
|
+
case -2:
|
|
1079
|
+
case -1:
|
|
1080
|
+
return path;
|
|
1081
|
+
default:
|
|
1082
|
+
if (path.endsWith("/")) {
|
|
1083
|
+
return path.slice(end + 1, -1);
|
|
1084
|
+
}
|
|
1085
|
+
return path.slice(end + 1);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
NormalizedPathUtils2.basename = basename;
|
|
1089
|
+
function relative(from, to) {
|
|
1090
|
+
if (from == to) {
|
|
1091
|
+
return "";
|
|
1092
|
+
}
|
|
1093
|
+
assert(
|
|
1094
|
+
isAbsolute(from) && isAbsolute(to),
|
|
1095
|
+
"resolving relative paths without absolute inputs requires a filesystem"
|
|
1096
|
+
);
|
|
1097
|
+
if (!from.endsWith("/")) {
|
|
1098
|
+
from += "/";
|
|
1099
|
+
}
|
|
1100
|
+
const end = to.length;
|
|
1101
|
+
if (!to.endsWith("/")) {
|
|
1102
|
+
to += "/";
|
|
1103
|
+
}
|
|
1104
|
+
const minLen = Math.min(from.length, to.length);
|
|
1105
|
+
let lastCommonSlash = 0;
|
|
1106
|
+
let i = 0;
|
|
1107
|
+
for (; i < minLen; ++i) {
|
|
1108
|
+
if (from[i] === to[i]) {
|
|
1109
|
+
if (from[i] === "/") {
|
|
1110
|
+
lastCommonSlash = i;
|
|
1111
|
+
}
|
|
1112
|
+
} else {
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
if (lastCommonSlash === from.length - 1) {
|
|
1117
|
+
return to.substring(from.length, end);
|
|
1118
|
+
}
|
|
1119
|
+
let prefix = "";
|
|
1120
|
+
for (let i2 = lastCommonSlash + 1; i2 < from.length; ++i2) {
|
|
1121
|
+
if (from[i2] === "/" || i2 + 1 === from.length) {
|
|
1122
|
+
prefix += prefix ? "/.." : "..";
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
return prefix + to.substring(lastCommonSlash, end);
|
|
1126
|
+
}
|
|
1127
|
+
NormalizedPathUtils2.relative = relative;
|
|
1128
|
+
function normalize(path) {
|
|
1129
|
+
const parts = path.split("/");
|
|
1130
|
+
let canRemoveDotDot = false;
|
|
1131
|
+
for (let i = 0; i < parts.length; ) {
|
|
1132
|
+
if (parts[i] == "." && i + 1 != parts.length) {
|
|
1133
|
+
parts.splice(i, 1);
|
|
1134
|
+
} else if (parts[i] == "..") {
|
|
1135
|
+
if (canRemoveDotDot) {
|
|
1136
|
+
if (i - 1 === 0 && /\w:/i.test(parts[0])) {
|
|
1137
|
+
parts.splice(i, 1);
|
|
1138
|
+
} else {
|
|
1139
|
+
parts.splice(i - 1, 2);
|
|
1140
|
+
i = i - 1;
|
|
1141
|
+
}
|
|
1142
|
+
} else {
|
|
1143
|
+
++i;
|
|
1144
|
+
}
|
|
1145
|
+
} else {
|
|
1146
|
+
canRemoveDotDot = true;
|
|
1147
|
+
++i;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return parts.join("/");
|
|
1151
|
+
}
|
|
1152
|
+
NormalizedPathUtils2.normalize = normalize;
|
|
1153
|
+
function resolve(from, to) {
|
|
1154
|
+
assert(isAbsolute(from), "resolving without an absolute path requires a filesystem");
|
|
1155
|
+
if (isAbsolute(to)) {
|
|
1156
|
+
return to;
|
|
1157
|
+
}
|
|
1158
|
+
return normalize(`${from}/${to}`);
|
|
1159
|
+
}
|
|
1160
|
+
NormalizedPathUtils2.resolve = resolve;
|
|
1161
|
+
function isAbsolute(from) {
|
|
1162
|
+
return /^\/|^\w:\//.test(from);
|
|
1163
|
+
}
|
|
1164
|
+
NormalizedPathUtils2.isAbsolute = isAbsolute;
|
|
1165
|
+
function splitFilename(name) {
|
|
1166
|
+
const lastDot = name.lastIndexOf(".");
|
|
1167
|
+
if (lastDot < 1) {
|
|
1168
|
+
return { name, ext: "" };
|
|
1169
|
+
}
|
|
1170
|
+
return { name: name.substring(0, lastDot), ext: name.substring(lastDot) };
|
|
1171
|
+
}
|
|
1172
|
+
NormalizedPathUtils2.splitFilename = splitFilename;
|
|
1173
|
+
function isDeclarationFilePath(path) {
|
|
1174
|
+
return /\.d\.(ts|mts|cts)$/.test(path);
|
|
1175
|
+
}
|
|
1176
|
+
NormalizedPathUtils2.isDeclarationFilePath = isDeclarationFilePath;
|
|
1177
|
+
})(NormalizedPathUtils || (NormalizedPathUtils = {}));
|
|
1178
|
+
|
|
1179
|
+
// src/lib/utils-common/set.ts
|
|
1180
|
+
function setIntersection(a, b) {
|
|
1181
|
+
const result = /* @__PURE__ */ new Set();
|
|
1182
|
+
for (const elem of a) {
|
|
1183
|
+
if (b.has(elem)) {
|
|
1184
|
+
result.add(elem);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
return result;
|
|
1188
|
+
}
|
|
1189
|
+
function setDifference(a, b) {
|
|
1190
|
+
const result = new Set(a);
|
|
1191
|
+
for (const elem of b) {
|
|
1192
|
+
result.delete(elem);
|
|
1193
|
+
}
|
|
1194
|
+
return result;
|
|
1195
|
+
}
|
|
1196
|
+
function setUnion(a, b) {
|
|
1197
|
+
const result = new Set(a);
|
|
1198
|
+
for (const elem of b) {
|
|
1199
|
+
result.add(elem);
|
|
1200
|
+
}
|
|
1201
|
+
return result;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
// src/lib/utils-common/validation.ts
|
|
1205
|
+
var validation_exports = {};
|
|
1206
|
+
__export(validation_exports, {
|
|
1207
|
+
additionalProperties: () => additionalProperties,
|
|
1208
|
+
isTagString: () => isTagString,
|
|
1209
|
+
optional: () => optional,
|
|
1210
|
+
validate: () => validate
|
|
1211
|
+
});
|
|
1212
|
+
var opt = /* @__PURE__ */ Symbol();
|
|
1213
|
+
var additionalProperties = /* @__PURE__ */ Symbol();
|
|
1214
|
+
function validate(schema, obj) {
|
|
1215
|
+
let type = schema;
|
|
1216
|
+
if (opt in schema) {
|
|
1217
|
+
if (obj == null) {
|
|
1218
|
+
return true;
|
|
1219
|
+
}
|
|
1220
|
+
type = schema[opt];
|
|
1221
|
+
}
|
|
1222
|
+
if (type === String) {
|
|
1223
|
+
return typeof obj === "string";
|
|
1224
|
+
}
|
|
1225
|
+
if (type === Number) {
|
|
1226
|
+
return typeof obj === "number";
|
|
1227
|
+
}
|
|
1228
|
+
if (type === Boolean) {
|
|
1229
|
+
return typeof obj === "boolean";
|
|
1230
|
+
}
|
|
1231
|
+
if (typeof type === "function") {
|
|
1232
|
+
return type(obj);
|
|
1233
|
+
}
|
|
1234
|
+
if (Array.isArray(type)) {
|
|
1235
|
+
if (type[0] === Array) {
|
|
1236
|
+
return Array.isArray(obj) && obj.every((item) => validate(type[1], item));
|
|
1237
|
+
}
|
|
1238
|
+
return type.includes(obj);
|
|
1239
|
+
}
|
|
1240
|
+
if (additionalProperties in schema && !schema[additionalProperties]) {
|
|
1241
|
+
if (Object.keys(obj).some((key) => !(key in schema))) {
|
|
1242
|
+
return false;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
return !!obj && typeof obj === "object" && !Array.isArray(obj) && Object.entries(type).every(([key, prop]) => validate(prop, obj[key]));
|
|
1246
|
+
}
|
|
1247
|
+
function optional(x) {
|
|
1248
|
+
return { [opt]: x };
|
|
1249
|
+
}
|
|
1250
|
+
function isTagString(x) {
|
|
1251
|
+
return typeof x === "string" && /^@[a-z][a-z0-9-]*$/i.test(x);
|
|
1252
|
+
}
|
|
1253
|
+
export {
|
|
1254
|
+
ConsoleLogger,
|
|
1255
|
+
DefaultMap,
|
|
1256
|
+
EventDispatcher,
|
|
1257
|
+
EventHooks,
|
|
1258
|
+
jsx_exports as JSX,
|
|
1259
|
+
LogLevel,
|
|
1260
|
+
Logger,
|
|
1261
|
+
MeaningKeywords,
|
|
1262
|
+
MinimalSourceFile,
|
|
1263
|
+
NonEnumerable,
|
|
1264
|
+
NormalizedPathUtils,
|
|
1265
|
+
StableKeyMap,
|
|
1266
|
+
validation_exports as Validation,
|
|
1267
|
+
addTranslations,
|
|
1268
|
+
aggregate,
|
|
1269
|
+
assert,
|
|
1270
|
+
assertNever,
|
|
1271
|
+
binaryFindPartition,
|
|
1272
|
+
countMatches,
|
|
1273
|
+
debugFlags,
|
|
1274
|
+
dedent,
|
|
1275
|
+
editDistance,
|
|
1276
|
+
emptyArray,
|
|
1277
|
+
escapeHtml,
|
|
1278
|
+
escapeRegExp,
|
|
1279
|
+
filter,
|
|
1280
|
+
filterMap,
|
|
1281
|
+
firstDefined,
|
|
1282
|
+
getEnumFlags,
|
|
1283
|
+
getEnumKeys,
|
|
1284
|
+
getSimilarValues,
|
|
1285
|
+
hasAllFlags,
|
|
1286
|
+
hasAnyFlag,
|
|
1287
|
+
i18n,
|
|
1288
|
+
insertOrderSorted,
|
|
1289
|
+
insertPrioritySorted,
|
|
1290
|
+
joinArray,
|
|
1291
|
+
maxElementByScore,
|
|
1292
|
+
meaningToString,
|
|
1293
|
+
parseComponent,
|
|
1294
|
+
parseComponentPath,
|
|
1295
|
+
parseDeclarationReference,
|
|
1296
|
+
parseMeaning,
|
|
1297
|
+
parseModuleSource,
|
|
1298
|
+
parseString,
|
|
1299
|
+
parseSymbolReference,
|
|
1300
|
+
partition,
|
|
1301
|
+
removeFlag,
|
|
1302
|
+
removeIf,
|
|
1303
|
+
removeIfPresent,
|
|
1304
|
+
setDifference,
|
|
1305
|
+
setIntersection,
|
|
1306
|
+
setTranslations,
|
|
1307
|
+
setUnion,
|
|
1308
|
+
translateTagName,
|
|
1309
|
+
unique,
|
|
1310
|
+
zip
|
|
1311
|
+
};
|