MCPcopy Create free account
hub / github.com/2fd/graphdoc / NavigationEnums

Class NavigationEnums

plugins/navigation.enum.ts:4–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import { PluginInterface, NavigationItemInterface } from '../lib/interface';
3
4export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected