2
2
3
3
var fs = require ( 'fs' ) ,
4
4
_ = require ( 'lodash' ) ,
5
- sort = require ( './lib/ sort' ) ,
6
- nest = require ( './lib/ nest' ) ,
7
- filterAccess = require ( './lib/ filter_access' ) ,
8
- dependency = require ( './lib/ input/dependency' ) ,
9
- shallow = require ( './lib/ input/shallow' ) ,
10
- parseJavaScript = require ( './lib/ parsers/javascript' ) ,
11
- polyglot = require ( './lib/ parsers/polyglot' ) ,
12
- github = require ( './lib/ github' ) ,
13
- hierarchy = require ( './lib/ hierarchy' ) ,
14
- inferName = require ( './lib/ infer/name' ) ,
15
- inferKind = require ( './lib/ infer/kind' ) ,
16
- inferAugments = require ( './lib/ infer/augments' ) ,
17
- inferParams = require ( './lib/ infer/params' ) ,
18
- inferProperties = require ( './lib/ infer/properties' ) ,
19
- inferMembership = require ( './lib/ infer/membership' ) ,
20
- inferReturn = require ( './lib/ infer/return' ) ,
21
- inferAccess = require ( './lib/ infer/access' ) ,
22
- inferType = require ( './lib/ infer/type' ) ,
23
- formatLint = require ( './lib/ lint' ) . formatLint ,
24
- garbageCollect = require ( './lib/ garbage_collect' ) ,
25
- lintComments = require ( './lib/ lint' ) . lintComments ,
26
- markdownAST = require ( './lib/ output/markdown_ast' ) ,
27
- mergeConfig = require ( './lib/ merge_config' ) ;
5
+ sort = require ( './sort' ) ,
6
+ nest = require ( './nest' ) ,
7
+ filterAccess = require ( './filter_access' ) ,
8
+ dependency = require ( './input/dependency' ) ,
9
+ shallow = require ( './input/shallow' ) ,
10
+ parseJavaScript = require ( './parsers/javascript' ) ,
11
+ polyglot = require ( './parsers/polyglot' ) ,
12
+ github = require ( './github' ) ,
13
+ hierarchy = require ( './hierarchy' ) ,
14
+ inferName = require ( './infer/name' ) ,
15
+ inferKind = require ( './infer/kind' ) ,
16
+ inferAugments = require ( './infer/augments' ) ,
17
+ inferParams = require ( './infer/params' ) ,
18
+ inferProperties = require ( './infer/properties' ) ,
19
+ inferMembership = require ( './infer/membership' ) ,
20
+ inferReturn = require ( './infer/return' ) ,
21
+ inferAccess = require ( './infer/access' ) ,
22
+ inferType = require ( './infer/type' ) ,
23
+ formatLint = require ( './lint' ) . formatLint ,
24
+ garbageCollect = require ( './garbage_collect' ) ,
25
+ lintComments = require ( './lint' ) . lintComments ,
26
+ markdownAST = require ( './output/markdown_ast' ) ,
27
+ mergeConfig = require ( './merge_config' ) ;
28
28
29
29
/**
30
30
* Build a pipeline of comment handlers.
@@ -45,7 +45,10 @@ function pipeline() {
45
45
} ;
46
46
}
47
47
48
- function configure ( indexes , args ) /*: Promise<InputsConfig> */ {
48
+ function configure (
49
+ indexes /*: Array<string> */ ,
50
+ args /*: Object */
51
+ ) /*: Promise<InputsConfig> */ {
49
52
let mergedConfig = mergeConfig ( args ) ;
50
53
51
54
return mergedConfig . then ( config => {
@@ -185,7 +188,8 @@ function lintInternal(inputsAndConfig) {
185
188
* }
186
189
* });
187
190
*/
188
- let lint = ( indexes , args ) => configure ( indexes , args ) . then ( lintInternal ) ;
191
+ let lint = ( indexes /*: Array<string|Object> */ , args ) =>
192
+ configure ( indexes , args ) . then ( lintInternal ) ;
189
193
190
194
/**
191
195
* Generate JavaScript documentation as a list of parsed JSDoc
@@ -228,7 +232,8 @@ let lint = (indexes, args) => configure(indexes, args).then(lintInternal);
228
232
* // any other kind of code data.
229
233
* });
230
234
*/
231
- let build = ( indexes , args ) => configure ( indexes , args ) . then ( buildInternal ) ;
235
+ let build = ( indexes /*: Array<string|Object> */ , args /*: Object */ ) =>
236
+ configure ( indexes , args ) . then ( buildInternal ) ;
232
237
233
238
/**
234
239
* Documentation's formats are modular methods that take comments
@@ -238,11 +243,11 @@ let build = (indexes, args) => configure(indexes, args).then(buildInternal);
238
243
* @public
239
244
*/
240
245
var formats = {
241
- html : require ( './lib/ output/html' ) ,
242
- md : require ( './lib/ output/markdown' ) ,
246
+ html : require ( './output/html' ) ,
247
+ md : require ( './output/markdown' ) ,
243
248
remark : ( comments /*: Array<Comment> */ , config /*: DocumentationConfig */ ) =>
244
249
markdownAST ( comments , config ) . then ( res => JSON . stringify ( res , null , 2 ) ) ,
245
- json : require ( './lib/ output/json' )
250
+ json : require ( './output/json' )
246
251
} ;
247
252
248
253
module . exports . lint = lint ;
@@ -251,6 +256,6 @@ module.exports.build = build;
251
256
module . exports . formats = formats ;
252
257
253
258
module . exports . util = {
254
- createFormatters : require ( './lib/ output/util/formatters' ) ,
255
- LinkerStack : require ( './lib/ output/util/linker_stack' )
259
+ createFormatters : require ( './output/util/formatters' ) ,
260
+ LinkerStack : require ( './output/util/linker_stack' )
256
261
} ;
0 commit comments