| 2 | import { PluginInterface, NavigationItemInterface } from '../lib/interface'; |
| 3 | |
| 4 | export default class NavigationEnums extends Plugin implements PluginInterface { |
| 5 | |
| 6 | getTypes(buildForType: string): NavigationItemInterface[] { |
| 7 | return this.document.types |
| 8 | .filter(type => type.kind === ENUM) |
| 9 | .map(type => new NavigationItem( |
| 10 | type.name, |
| 11 | this.url(type), |
| 12 | type.name === buildForType |
| 13 | )); |
| 14 | } |
| 15 | |
| 16 | getNavigations(buildForType: string) { |
| 17 | |
| 18 | const types: NavigationItemInterface[] = this.getTypes(buildForType); |
| 19 | |
| 20 | if (types.length === 0) |
| 21 | return []; |
| 22 | |
| 23 | return [ |
| 24 | new NavigationSection('Enums', types) |
| 25 | ]; |
| 26 | } |
| 27 | } |
nothing calls this directly
no outgoing calls
no test coverage detected