UNPKG

2.9 kBJavaScriptView Raw
1/* @flow */
2/* eslint no-use-before-define: 0 */
3type DocumentationConfig = {
4 inferPrivate?: string,
5 noPackage?: boolean,
6 toc?: Array<Object>,
7 paths?: { [key: string]: number },
8 access?: Array<string>,
9 defaultGlobals?: boolean,
10 defaultGlobalsEnvs?: Array<string>,
11 external?: Array<string>,
12 theme: string,
13 requireExtension?: Array<string>,
14 parseExtension: Array<string>,
15 noReferenceLinks?: boolean,
16 markdownToc?: boolean,
17 markdownTocMaxDepth?: number,
18 documentExported?: boolean,
19 resolve?: string,
20 hljs?: Object
21};
22
23type CommentError = {
24 message: string,
25 commentLineNumber?: number
26};
27
28type DoctrineType = {
29 elements?: Array<DoctrineType>,
30 expression?: DoctrineType,
31 applications?: Array<DoctrineType>,
32 type: string,
33 name?: string
34};
35
36type CommentLoc = {
37 start: {
38 line: number
39 },
40 end: {
41 line: number
42 }
43};
44
45type SourceFile = {
46 source?: string,
47 file: string
48};
49
50type CommentContext = {
51 sortKey: string,
52 file: string,
53 ast?: Object,
54 loc: CommentLoc,
55 code: string,
56 github?: CommentContextGitHub
57};
58
59type CommentContextGitHub = {
60 path: string,
61 url: string
62};
63
64type CommentTag = {
65 name?: string,
66 title: string,
67 description?: Object,
68 default?: any,
69 lineNumber?: number,
70 type?: DoctrineType,
71 properties?: Array<CommentTag>,
72 readonly?: boolean
73};
74
75type Comment = {
76 errors: Array<CommentError>,
77 tags: Array<CommentTag>,
78
79 augments: Array<CommentTag>,
80 examples: Array<CommentExample>,
81 implements: Array<CommentTag>,
82 params: Array<CommentTag>,
83 properties: Array<CommentTag>,
84 returns: Array<CommentTag>,
85 sees: Array<Remark>,
86 throws: Array<CommentTag>,
87 todos: Array<CommentTag>,
88
89 description?: Remark,
90 summary?: Remark,
91 deprecated?: Remark,
92 classdesc?: Remark,
93
94 members: CommentMembers,
95 constructorComment?: Comment,
96
97 name?: string,
98 kind?: Kind,
99
100 memberof?: string,
101 scope?: Scope,
102 access?: Access,
103 readonly?: boolean,
104 abstract?: boolean,
105 generator?: boolean,
106 alias?: string,
107
108 copyright?: string,
109 author?: string,
110 license?: string,
111 version?: string,
112 since?: string,
113 lends?: string,
114 override?: boolean,
115 hideconstructor?: true,
116
117 type?: DoctrineType,
118
119 context: CommentContext,
120 loc: CommentLoc,
121
122 path?: Array<{
123 name: string,
124 scope: Scope
125 }>,
126
127 ignore?: boolean
128};
129
130type CommentMembers = {
131 static: Array<Comment>,
132 instance: Array<Comment>,
133 events: Array<Comment>,
134 global: Array<Comment>,
135 inner: Array<Comment>
136};
137
138type CommentExample = {
139 caption?: string,
140 description?: Object
141};
142
143type Remark = {
144 type: string,
145 children: Array<Object>
146};
147
148type Access = 'private' | 'public' | 'protected';
149type Scope = 'instance' | 'static' | 'inner' | 'global';
150type Kind =
151 | 'class'
152 | 'constant'
153 | 'event'
154 | 'external'
155 | 'file'
156 | 'function'
157 | 'member'
158 | 'mixin'
159 | 'module'
160 | 'namespace'
161 | 'typedef'
162 | 'interface';