-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathapi-index.gjs
52 lines (48 loc) · 1.17 KB
/
api-index.gjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import Component from '@glimmer/component';
/**
* @typedef ItemData
* @property {Array<{ name: string }>} methods
* @property {Array<{ name: string }>} properties
* @property {Array<{ name: string }>} events
*/
/**
* @typedef Args
* @property {ItemData} itemData
*/
/**
* @typedef Blocks
* @property {[{ sections: ApiIndex['sections'] }]} default
*/
/**
* @extends Component<{ Args: Args, Blocks: Blocks }>
*/
import { hash } from "@ember/helper";
export default class ApiIndex extends Component {<template><div>
{{yield (hash sections=this.sections)}}
</div></template>
get sections() {
return [
{
title: 'Methods',
tab: 'methods',
items: this.args.itemData.methods,
class: 'spec-method-list',
routeSuffix: '.methods.method',
},
{
title: 'Properties',
tab: 'properties',
items: this.args.itemData.properties,
class: 'spec-property-list',
routeSuffix: '.properties.property',
},
{
title: 'Events',
tab: 'events',
items: this.args.itemData.events,
class: 'spec-event-list',
routeSuffix: '.events.event',
},
];
}
}