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AQ,CAAC,QAAQ,EAAE,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;SACrC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAnHD,0CAmHC","sourcesContent":["import { Reflection, ReflectionKind } from './reflections/abstract';\nimport { ReflectionCategory } from './ReflectionCategory';\n\n/**\n * A group of reflections. All reflections in a group are of the same kind.\n *\n * Reflection groups are created by the ´GroupHandler´ in the resolving phase\n * of the dispatcher. The main purpose of groups is to be able to more easily\n * render human readable children lists in templates.\n */\nexport class ReflectionGroup {\n /**\n * The title, a string representation of the typescript kind, of this group.\n */\n title: string;\n\n /**\n * The original typescript kind of the children of this group.\n */\n kind: ReflectionKind;\n\n /**\n * All reflections of this group.\n */\n children: Reflection[] = [];\n\n /**\n * A list of generated css classes that should be applied to representations of this\n * group in the generated markup.\n */\n cssClasses?: string;\n\n /**\n * Do all children of this group have a separate document?\n *\n * A bound representation of the ´ReflectionGroup.getAllChildrenHaveOwnDocument´\n * that can be used within templates.\n */\n allChildrenHaveOwnDocument: Function;\n\n /**\n * Are all children inherited members?\n */\n allChildrenAreInherited?: boolean;\n\n /**\n * Are all children private members?\n */\n allChildrenArePrivate?: boolean;\n\n /**\n * Are all children private or protected members?\n */\n allChildrenAreProtectedOrPrivate?: boolean;\n\n /**\n * Are all children external members?\n */\n allChildrenAreExternal?: boolean;\n\n /**\n * Are any children exported declarations?\n */\n someChildrenAreExported?: boolean;\n\n /**\n * Categories contained within this group.\n */\n categories?: ReflectionCategory[];\n\n /**\n * Create a new ReflectionGroup instance.\n *\n * @param title The title of this group.\n * @param kind The original typescript kind of the children of this group.\n */\n constructor(title: string, kind: ReflectionKind) {\n this.title = title;\n this.kind = kind;\n\n this.allChildrenHaveOwnDocument = (() => this.getAllChildrenHaveOwnDocument());\n }\n\n /**\n * Do all children of this group have a separate document?\n */\n private getAllChildrenHaveOwnDocument(): boolean {\n let onlyOwnDocuments = true;\n this.children.forEach((child) => {\n onlyOwnDocuments = onlyOwnDocuments && !!child.hasOwnDocument;\n });\n\n return onlyOwnDocuments;\n }\n\n /**\n * Return a raw object representation of this reflection group.\n * @deprecated Use serializers instead\n */\n toObject(): any {\n const result = {\n title: this.title,\n kind: this.kind\n };\n\n if (this.children) {\n const children: any[] = [];\n this.children.forEach((child) => {\n children.push(child.id);\n });\n\n result['children'] = children;\n }\n\n if (this.categories) {\n const categories: any[] = [];\n this.categories.forEach((category) => {\n categories.push(category.toObject());\n });\n\n result['categories'] = categories;\n }\n\n return result;\n }\n}\n"]}
\No newline at end of file