@@ -132,6 +132,7 @@ module.exports = function(grunt) {
132132 outModulesDir : tsconfig . compilerOptions . outDir ,
133133 outAppsDir : "./bin/dist/apps" ,
134134 outTsAppsDir : "./bin/dist/ts-apps" ,
135+ outApiRefDir : "./bin/dist/api-ref"
135136 } ;
136137
137138 var nodeTestEnv = JSON . parse ( JSON . stringify ( process . env ) ) ;
@@ -150,6 +151,16 @@ module.exports = function(grunt) {
150151 "!android17.d.ts" ,
151152 "!libjs.d.ts"
152153 ] ) ;
154+ localCfg . srcTsdFiles = [
155+ "**/*.d.ts" ,
156+ "!apps/**" ,
157+ "!node-tests/**" ,
158+ "!org.nativescript.widgets.d.ts" ,
159+ "!android17.d.ts" ,
160+ "!**/*.android.d.ts" ,
161+ "!ios.d.ts" ,
162+ "!**/*.ios.d.ts"
163+ ] . concat ( localCfg . defaultExcludes ) ;
153164
154165 var tsOptions = tsconfig . compilerOptions ;
155166 tsOptions . fast = 'never' ;
@@ -411,6 +422,26 @@ module.exports = function(grunt) {
411422 pathModule . join ( localCfg . outDir , "**/*.xml" )
412423 ]
413424 }
425+ } ,
426+ typedoc : {
427+ build : {
428+ options : {
429+ // 'flag:undefined' will set flags without options.
430+ "module" : 'commonjs' ,
431+ "target" : 'es5' ,
432+ "out" : localCfg . outApiRefDir ,
433+ //"json": './dist/doc.json',
434+ "name" : 'NativeScript' ,
435+ "includeDeclarations" : undefined ,
436+ //"excludeExternals": undefined,
437+ //"externalPattern": './declarations.d.ts',
438+ "mode" : "file" ,
439+ //"readme": "source/README.md",
440+ //"entryPoint": '"a-module"'
441+ // verbose: undefined
442+ } ,
443+ src : localCfg . srcTsdFiles
444+ }
414445 }
415446 } ) ;
416447
@@ -424,6 +455,7 @@ module.exports = function(grunt) {
424455 grunt . loadNpmTasks ( "grunt-env" ) ;
425456 grunt . loadNpmTasks ( "grunt-simple-mocha" ) ;
426457 grunt . loadNpmTasks ( 'grunt-bom-removal' ) ;
458+ grunt . loadNpmTasks ( 'grunt-typedoc' ) ;
427459
428460 var cloneTasks = function ( originalTasks , taskNameSuffix ) {
429461 var clonedTasks = [ ] ;
0 commit comments