aboutsummaryrefslogtreecommitdiff
path: root/node_modules/typedoc/dist/lib/converter/plugins/TypePlugin.js.map
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/typedoc/dist/lib/converter/plugins/TypePlugin.js.map')
-rw-r--r--node_modules/typedoc/dist/lib/converter/plugins/TypePlugin.js.map2
1 files changed, 1 insertions, 1 deletions
diff --git a/node_modules/typedoc/dist/lib/converter/plugins/TypePlugin.js.map b/node_modules/typedoc/dist/lib/converter/plugins/TypePlugin.js.map
index 8b47a462d..e7af6446a 100644
--- a/node_modules/typedoc/dist/lib/converter/plugins/TypePlugin.js.map
+++ b/node_modules/typedoc/dist/lib/converter/plugins/TypePlugin.js.map
@@ -1 +1 @@
-{"version":3,"file":"TypePlugin.js","sourceRoot":"","sources":["../../../../src/lib/converter/plugins/TypePlugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,wDAAkI;AAClI,kDAAgH;AAChH,4CAA4D;AAC5D,0CAAuC;AAOvC,IAAa,UAAU;IAAS,8BAAkB;IADlD;QAAA,qEAgKC;QA9JG,iBAAW,GAA4B,EAAE,CAAC;;IA8J9C,CAAC;IAzJG,+BAAU,GAAV;QACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK;YACpB,GAAC,qBAAS,CAAC,aAAa,IAAO,IAAI,CAAC,SAAS;YAC7C,GAAC,qBAAS,CAAC,iBAAiB,IAAG,IAAI,CAAC,YAAY;gBAClD,CAAC;;IACP,CAAC;IAQO,8BAAS,GAAjB,UAAkB,OAAgB,EAAE,UAAiC;QAArE,iBA0FC;QAzFG,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAEhC,WAAW,CAAC,UAAU,EAAkB,UAAU,CAAC,IAAI,CAAC,CAAC;QACzD,WAAW,CAAC,UAAU,EAAkB,UAAU,CAAC,aAAa,CAAC,CAAC;QAClE,WAAW,CAAC,UAAU,EAAkB,UAAU,CAAC,UAAU,CAAC,CAAC;QAC/D,YAAY,CAAC,U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IAAI,GAAG,KAAK,CAAC;oBACvB,SAAS,GAAG,KAAK,CAAC;gBACtB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;gBAC7B,CAAC;YACL,CAAC;YAED,EAAE,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;gBAC3B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YACnC,CAAC;YAED,IAAI,CAAC,CAAC,IAAI,qBAAa,CAAC,UAAU,CAAC,IAAI,EAAE,qBAAa,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;YACzF,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC;YAE1B,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC;YAED,UAAU,CAAC,aAAa,GAAG,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;IACL,iBAAC;AAAD,CAAC,AA/JD,CAAgC,+BAAkB,GA+JjD;AA/JY,UAAU;IADtB,sBAAS,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;GACb,UAAU,CA+JtB;AA/JY,gCAAU","sourcesContent":["import {Reflection, ReflectionKind, Decorator, DeclarationReflection, DeclarationHierarchy} from '../../models/reflections/index';\nimport {Type, ReferenceType, TupleType, UnionType, IntersectionType, ArrayType} from '../../models/types/index';\nimport {Component, ConverterComponent} from '../components';\nimport {Converter} from '../converter';\nimport {Context} from '../context';\n\n/**\n * A handler that converts all instances of [[LateResolvingType]] to their renderable equivalents.\n */\n@Component({name: 'type'})\nexport class TypePlugin extends ConverterComponent {\n reflections: DeclarationReflection[] = [];\n\n /**\n * Create a new TypeHandler instance.\n */\n initialize() {\n this.listenTo(this.owner, {\n [Converter.EVENT_RESOLVE]: this.onResolve,\n [Converter.EVENT_RESOLVE_END]: this.onResolveEnd\n });\n }\n\n /**\n * Triggered when the converter resolves a reflection.\n *\n * @param context The context object describing the current state the converter is in.\n * @param reflection The reflection that is currently resolved.\n */\n private onResolve(context: Context, reflection: DeclarationReflection) {\n const project = context.project;\n\n resolveType(reflection, <ReferenceType> reflection.type);\n resolveType(reflection, <ReferenceType> reflection.inheritedFrom);\n resolveType(reflection, <ReferenceType> reflection.overwrites);\n resolveTypes(reflection, reflection.extendedTypes);\n resolveTypes(reflection, reflection.extendedBy);\n resolveTypes(reflection, reflection.implementedTypes);\n\n if (reflection.decorators) {\n reflection.decorators.forEach((decorator: Decorator) => {\n if (decorator.type) {\n resolveType(reflection, decorator.type);\n }\n });\n }\n\n if (reflection.kindOf(ReflectionKind.ClassOrInterface)) {\n this.postpone(reflection);\n\n walk(reflection.implementedTypes, (target) => {\n this.postpone(target);\n if (!target.implementedBy) {\n target.implementedBy = [];\n }\n target.implementedBy.push(new ReferenceType(reflection.name, ReferenceType.SYMBOL_ID_RESOLVED, reflection));\n });\n\n walk(reflection.extendedTypes, (target) => {\n this.postpone(target);\n if (!target.extendedBy) {\n target.extendedBy = [];\n }\n target.extendedBy.push(new ReferenceType(reflection.name, ReferenceType.SYMBOL_ID_RESOLVED, reflection));\n });\n }\n\n function walk(types: Type[], callback: {(declaration: DeclarationReflection): void}) {\n if (!types) {\n return;\n }\n types.forEach((type: ReferenceType) => {\n if (!(type instanceof ReferenceType)) {\n return;\n }\n if (!type.reflection || !(type.reflection instanceof DeclarationReflection)) {\n return;\n }\n callback(<DeclarationReflection> type.reflection);\n });\n }\n\n function resolveTypes(reflection: Reflection, types: Type[]) {\n if (!types) {\n return;\n }\n for (let i = 0, c = types.length; i < c; i++) {\n resolveType(reflection, <ReferenceType> types[i]);\n }\n }\n\n function resolveType(reflection: Reflection, type: Type) {\n if (type instanceof ReferenceType) {\n const referenceType: ReferenceType = <ReferenceType> type;\n if (referenceType.symbolID === ReferenceType.SYMBOL_ID_RESOLVE_BY_NAME) {\n referenceType.reflection = reflection.findReflectionByName(referenceType.name);\n } else if (!referenceType.reflection && referenceType.symbolID !== ReferenceType.SYMBOL_ID_RESOLVED) {\n referenceType.reflection = project.reflections[project.symbolMapping[referenceType.symbolID]];\n }\n\n if (referenceType.typeArguments) {\n referenceType.typeArguments.forEach((typeArgument: Type) => {\n resolveType(reflection, typeArgument);\n });\n }\n } else if (type instanceof TupleType) {\n const tupleType: TupleType = <TupleType> type;\n for (let index = 0, count = tupleType.elements.length; index < count; index++) {\n resolveType(reflection, tupleType.elements[index]);\n }\n } else if (type instanceof UnionType || type instanceof IntersectionType) {\n const unionOrIntersectionType: UnionType | IntersectionType = <UnionType | IntersectionType> type;\n for (let index = 0, count = unionOrIntersectionType.types.length; index < count; index++) {\n resolveType(reflection, unionOrIntersectionType.types[index]);\n }\n } else if (type instanceof ArrayType) {\n resolveType(reflection, type.elementType);\n }\n }\n }\n\n private postpone(reflection: DeclarationReflection) {\n if (this.reflections.indexOf(reflection) === -1) {\n this.reflections.push(reflection);\n }\n }\n\n /**\n * Triggered when the converter has finished resolving a project.\n *\n * @param context The context object describing the current state the converter is in.\n */\n private onResolveEnd(context: Context) {\n this.reflections.forEach((reflection) => {\n if (reflection.implementedBy) {\n reflection.implementedBy.sort((a: Type, b: Type): number => {\n if (a['name'] === b['name']) {\n return 0;\n }\n return a['name'] > b['name'] ? 1 : -1;\n });\n }\n\n let root: DeclarationHierarchy;\n let hierarchy: DeclarationHierarchy;\n function push(types: Type[]) {\n const level: DeclarationHierarchy = {types: types};\n if (hierarchy) {\n hierarchy.next = level;\n hierarchy = level;\n } else {\n root = hierarchy = level;\n }\n }\n\n if (reflection.extendedTypes) {\n push(reflection.extendedTypes);\n }\n\n push([new ReferenceType(reflection.name, ReferenceType.SYMBOL_ID_RESOLVED, reflection)]);\n hierarchy.isTarget = true;\n\n if (reflection.extendedBy) {\n push(reflection.extendedBy);\n }\n\n reflection.typeHierarchy = root;\n });\n }\n}\n"]} \ No newline at end of file
+{"version":3,"file":"TypePl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AC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC;YAED,UAAU,CAAC,aAAa,GAAG,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;IA9JQ,UAAU;QADtB,sBAAS,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;OACb,UAAU,CA+JtB;IAAD,iBAAC;CAAA,AA/JD,CAAgC,+BAAkB,GA+JjD;AA/JY,gCAAU","sourcesContent":["import { Reflection, ReflectionKind, Decorator, DeclarationReflection, DeclarationHierarchy } from '../../models/reflections/index';\nimport { Type, ReferenceType, TupleType, UnionType, IntersectionType, ArrayType } from '../../models/types/index';\nimport { Component, ConverterComponent } from '../components';\nimport { Converter } from '../converter';\nimport { Context } from '../context';\n\n/**\n * A handler that converts all instances of [[LateResolvingType]] to their renderable equivalents.\n */\n@Component({name: 'type'})\nexport class TypePlugin extends ConverterComponent {\n reflections: DeclarationReflection[] = [];\n\n /**\n * Create a new TypeHandler instance.\n */\n initialize() {\n this.listenTo(this.owner, {\n [Converter.EVENT_RESOLVE]: this.onResolve,\n [Converter.EVENT_RESOLVE_END]: this.onResolveEnd\n });\n }\n\n /**\n * Triggered when the converter resolves a reflection.\n *\n * @param context The context object describing the current state the converter is in.\n * @param reflection The reflection that is currently resolved.\n */\n private onResolve(context: Context, reflection: DeclarationReflection) {\n const project = context.project;\n\n resolveType(reflection, <ReferenceType> reflection.type);\n resolveType(reflection, <ReferenceType> reflection.inheritedFrom);\n resolveType(reflection, <ReferenceType> reflection.overwrites);\n resolveTypes(reflection, reflection.extendedTypes);\n resolveTypes(reflection, reflection.extendedBy);\n resolveTypes(reflection, reflection.implementedTypes);\n\n if (reflection.decorators) {\n reflection.decorators.forEach((decorator: Decorator) => {\n if (decorator.type) {\n resolveType(reflection, decorator.type);\n }\n });\n }\n\n if (reflection.kindOf(ReflectionKind.ClassOrInterface)) {\n this.postpone(reflection);\n\n walk(reflection.implementedTypes, (target) => {\n this.postpone(target);\n if (!target.implementedBy) {\n target.implementedBy = [];\n }\n target.implementedBy.push(new ReferenceType(reflection.name, ReferenceType.SYMBOL_ID_RESOLVED, reflection));\n });\n\n walk(reflection.extendedTypes, (target) => {\n this.postpone(target);\n if (!target.extendedBy) {\n target.extendedBy = [];\n }\n target.extendedBy.push(new ReferenceType(reflection.name, ReferenceType.SYMBOL_ID_RESOLVED, reflection));\n });\n }\n\n function walk(types: Type[], callback: {(declaration: DeclarationReflection): void}) {\n if (!types) {\n return;\n }\n types.forEach((type: ReferenceType) => {\n if (!(type instanceof ReferenceType)) {\n return;\n }\n if (!type.reflection || !(type.reflection instanceof DeclarationReflection)) {\n return;\n }\n callback(<DeclarationReflection> type.reflection);\n });\n }\n\n function resolveTypes(reflection: Reflection, types: Type[]) {\n if (!types) {\n return;\n }\n for (let i = 0, c = types.length; i < c; i++) {\n resolveType(reflection, <ReferenceType> types[i]);\n }\n }\n\n function resolveType(reflection: Reflection, type: Type) {\n if (type instanceof ReferenceType) {\n const referenceType: ReferenceType = <ReferenceType> type;\n if (referenceType.symbolID === ReferenceType.SYMBOL_ID_RESOLVE_BY_NAME) {\n referenceType.reflection = reflection.findReflectionByName(referenceType.name);\n } else if (!referenceType.reflection && referenceType.symbolID !== ReferenceType.SYMBOL_ID_RESOLVED) {\n referenceType.reflection = project.reflections[project.symbolMapping[referenceType.symbolID]];\n }\n\n if (referenceType.typeArguments) {\n referenceType.typeArguments.forEach((typeArgument: Type) => {\n resolveType(reflection, typeArgument);\n });\n }\n } else if (type instanceof TupleType) {\n const tupleType: TupleType = <TupleType> type;\n for (let index = 0, count = tupleType.elements.length; index < count; index++) {\n resolveType(reflection, tupleType.elements[index]);\n }\n } else if (type instanceof UnionType || type instanceof IntersectionType) {\n const unionOrIntersectionType: UnionType | IntersectionType = <UnionType | IntersectionType> type;\n for (let index = 0, count = unionOrIntersectionType.types.length; index < count; index++) {\n resolveType(reflection, unionOrIntersectionType.types[index]);\n }\n } else if (type instanceof ArrayType) {\n resolveType(reflection, type.elementType);\n }\n }\n }\n\n private postpone(reflection: DeclarationReflection) {\n if (this.reflections.indexOf(reflection) === -1) {\n this.reflections.push(reflection);\n }\n }\n\n /**\n * Triggered when the converter has finished resolving a project.\n *\n * @param context The context object describing the current state the converter is in.\n */\n private onResolveEnd(context: Context) {\n this.reflections.forEach((reflection) => {\n if (reflection.implementedBy) {\n reflection.implementedBy.sort((a: Type, b: Type): number => {\n if (a['name'] === b['name']) {\n return 0;\n }\n return a['name'] > b['name'] ? 1 : -1;\n });\n }\n\n let root: DeclarationHierarchy;\n let hierarchy: DeclarationHierarchy;\n function push(types: Type[]) {\n const level: DeclarationHierarchy = {types: types};\n if (hierarchy) {\n hierarchy.next = level;\n hierarchy = level;\n } else {\n root = hierarchy = level;\n }\n }\n\n if (reflection.extendedTypes) {\n push(reflection.extendedTypes);\n }\n\n push([new ReferenceType(reflection.name, ReferenceType.SYMBOL_ID_RESOLVED, reflection)]);\n hierarchy.isTarget = true;\n\n if (reflection.extendedBy) {\n push(reflection.extendedBy);\n }\n\n reflection.typeHierarchy = root;\n });\n }\n}\n"]} \ No newline at end of file