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

Class NavigationDirectives

plugins/navigation.directive.ts:4–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import { PluginInterface, NavigationItemInterface } from '../lib/interface';
3
4export default class NavigationDirectives extends Plugin implements PluginInterface {
5
6 getTypes(buildForType: string): NavigationItemInterface[] {
7 return this.document.directives
8 .map(directive => new NavigationItem(
9 directive.name,
10 this.url(directive),
11 directive.name === buildForType
12 ));
13 }
14
15 getNavigations(buildForType: string) {
16
17 const types: NavigationItemInterface[] = this.getTypes(buildForType);
18
19 if (types.length === 0)
20 return [];
21
22 return [
23 new NavigationSection('Directives', types)
24 ];
25 }
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected