(items: ChildTypes[] | DeclarationReflection[], prop?: DeclarationReflection)
| 109 | } |
| 110 | |
| 111 | public parse(items: ChildTypes[] | DeclarationReflection[], prop?: DeclarationReflection) { |
| 112 | if (this.config.typescript) { |
| 113 | const it = items as DeclarationReflection[]; |
| 114 | |
| 115 | for (const member of it) { |
| 116 | let item: DocumentedConstructor | DocumentedEvent | DocumentedMember | DocumentedMethod | null = null; |
| 117 | |
| 118 | switch (member.kindString) { |
| 119 | case 'Constructor': { |
| 120 | item = new DocumentedConstructor(member, this.config); |
| 121 | break; |
| 122 | } |
| 123 | |
| 124 | case 'Method': { |
| 125 | const event = prop?.groups?.find((group) => group.title === 'Events'); |
| 126 | if ((event?.children as unknown as number[])?.includes(member.id)) { |
| 127 | item = new DocumentedEvent(member, this.config); |
| 128 | break; |
| 129 | } |
| 130 | |
| 131 | item = new DocumentedMethod(member, this.config); |
| 132 | break; |
| 133 | } |
| 134 | |
| 135 | case 'Property': { |
| 136 | item = new DocumentedMember(member, this.config); |
| 137 | break; |
| 138 | } |
| 139 | |
| 140 | default: { |
| 141 | console.warn(`- Unknown documentation kind "${member.kindString}" - \n${JSON.stringify(member)}\n`); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | const parent = this.classes.get(prop!.name) ?? this.interfaces.get(prop!.name); |
| 146 | if (parent) { |
| 147 | if (item) { |
| 148 | parent.add(item); |
| 149 | } else { |
| 150 | console.warn( |
| 151 | `- Documentation item could not be constructed for "${member.name}" - \n${JSON.stringify(member)}\n`, |
| 152 | ); |
| 153 | } |
| 154 | |
| 155 | continue; |
| 156 | } |
| 157 | |
| 158 | const info = []; |
| 159 | const name = (member.name || item?.data.name) ?? 'UNKNOWN'; |
| 160 | const meta = |
| 161 | member.kindString === 'constructor' |
| 162 | ? null |
| 163 | : { |
| 164 | file: member.sources?.[0]?.fileName, |
| 165 | line: member.sources?.[0]?.line, |
| 166 | path: dirname(member.sources?.[0]?.fileName ?? ''), |
| 167 | }; |
| 168 |
no test coverage detected