2016-05-17 10 views
3

Hat jemand Ratschläge, sollte ich meinen TypeScript-Code für eine Angular2-Anwendung dokumentieren? Ich suche nach einem Werkzeug, das Dokumentationsseiten aus dokumentiertem Code generieren kann.Dokumentieren von Angular2 TypeScript-Code

Ich habe versucht, es mit TypeDoc, aber es scheint nicht so weit zu arbeiten und gibt mir viele Fehler.

Wenn jemand Erfahrung damit hat, wäre jeder Rat hilfreich.

Update:

Ich habe versucht, Dokumentation mit TypeDoc zu erzeugen. Dies ist der Befehl bei mir läuft:

typedoc --experimentalDecorators --out 'doc/' 'app/' --excludeExternals --target 'es5' -module 'commonjs' 

Hier ist, was ich bekommen:

Using TypeScript 1.8.10 from /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/typescript/lib 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(17) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(20) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(21) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(22) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(88) 
Cannot find name 'IGridstackOptions'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(107) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(109) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(115) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/goalwidget.component.ts(3) 
Module '"/Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/models/goal"' has no exported member 'Unit'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(2) 
Cannot find namespace 'moment'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(54) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(55) 
Cannot find name 'Chart'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(72) 
Cannot find name 'moment'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/gridstack/gridstack.component.ts(36) 
Cannot find name 'IGridstackOptions'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/gridstack/gridstack.component.ts(56) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/gridstack/gridstack.component.ts(58) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/navigation/sidebarmenu.component.ts(80) 
Property 'startsWith' does not exist on type 'string'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/user/role-selector.component.ts(34) 
Cannot find name 'jQuery'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/pipes/display-notation.pipe.ts(2) 
Module '"/Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/models/goal"' has no exported member 'Unit'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/pipes/moment.pipe.ts(5) 
Cannot find name 'moment'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/services/implementations/mock/mock-score-service.ts(2) 
Cannot find namespace 'moment'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/services/implementations/mock/mock-score-service.ts(14) 
Cannot find name 'moment'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/util/mobileDetector.ts(3) 
Cannot find name 'MobileDetect'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/util/mobileDetector.ts(6) 
Cannot find name 'MobileDetect'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/platform/browser.d.ts(77) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/application_ref.d.ts(38) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/application_ref.d.ts(92) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/application_ref.d.ts(151) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.d.ts(22) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.d.ts(24) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/di/reflective_provider.d.ts(102) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/di/reflective_provider.d.ts(102) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/component_resolver.d.ts(7) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/component_resolver.d.ts(11) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(58) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(99) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(104) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(105) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/async.d.ts(26) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/async.d.ts(27) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(0) 
Cannot find name 'MapConstructor'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(1) 
Cannot find name 'SetConstructor'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(3) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(3) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(6) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(7) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(10) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(11) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(13) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(14) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(99) 
Cannot find name 'Set'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(100) 
Cannot find name 'Set'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(101) 
Cannot find name 'Set'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/lang.d.ts(3) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/lang.d.ts(4) 
Cannot find name 'Set'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/lang.d.ts(70) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(1) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(7) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(8) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(9) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(9) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(10) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(10) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(11) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(11) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(12) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/platform/browser/browser_adapter.d.ts(74) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/platform/dom/dom_adapter.d.ts(84) 
Cannot find name 'Map'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(26) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(32) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(37) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(46) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(57) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(123) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(147) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(163) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(166) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(20) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(38) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(56) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(79) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(101) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/lifecycle/lifecycle_annotations.d.ts(28) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_config/route_config_impl.d.ts(100) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_definition.d.ts(19) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_definition.d.ts(34) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_registry.d.ts(51) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(55) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(67) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(85) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(98) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(106) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(111) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(119) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(127) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(131) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(137) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(145) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(34) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(49) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(88) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(93) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(93) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(45) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(46) 
Cannot find name 'Iterator'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(102) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(102) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(142) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(157) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(200) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(205) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(205) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/ForkJoinObservable.d.ts(5) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/ForkJoinObservable.d.ts(6) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/FromObservable.d.ts(6) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/FromObservable.d.ts(6) 
Cannot find name 'Iterator'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/PromiseObservable.d.ts(8) 
Cannot find name 'Promise'. 
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/PromiseObservable.d.ts(9) 
Cannot find name 'Promise'.  
+0

ich die Post mit weiteren Details aktualisiert haben. Vielen Dank! –

+0

können Sie zuerst mit includeDeclarations versuchen und wenn es nicht funktioniert, überprüfen Sie, ob ignoreCompilerErrors funktioniert, zumindest mit einigen Ausgaben. –

+0

ignoreCompilerErrors ändert etwas, jetzt werden Dokumente erstellt, die jedoch leer sind, mit Ausnahme eines leeren Unterabschnitts namens Globals. includeDeclarations scheint keine Auswirkungen zu haben. –

Antwort

3

die Gulp Aufgabe für die Erstellung von typedoc Hinzufügen.

var gulp = require("gulp"), 
    typedoc = require("gulp-typedoc"); 

gulp.task("typedoc", function() { 
var srcTSFiles= [<All src Typescript files>]; 

return gulp 
    .src(srcTSFiles) 
    .pipe(typedoc({ 
     // TypeScript options (see typescript docs) 
     module: "commonjs", 
     target: "ES5", 
     includeDeclarations: true, 
     emitDecoratorMetadata: true, 
     experimentalDecorators: true, 

     // Output options (see typedoc docs) 
     out: "dist/doc", 
     json: "dist/to/file.json", 

     // TypeDoc options (see typedoc docs) 
     name: "project-name", 
     version: true, 
     noLib: true 
    })); 
    }); 

Hoffe das hilft !!

+1

Ich glaube nicht, dass die 'noLib' Option länger unterstützt wird. 'TypeError: Kann Eigenschaft 'flags' von undefined nicht lesen – david

0

Der Grund für den Fehler ist, Eingabedefinition für "Moment", "jQuery" und andere Bibliotheken sind nicht verfügbar. Sie können die Typdefinition für diese vom Typdefinitionsmanager ("https://www.npmjs.com/package/typings") installieren und versuchen.

Type Definition Manager hat hat nicht Definition alle Javascript-Bibliotheken geben, in diesem Fall, dass Sie Fehler von typedoc kompilieren, indem die "--ignoreCompilerErrors" in Ihrem Befehl, wie unten

typedoc ignorieren können - -experimentalDecorators --out 'doc /' 'app /' --excludeExternals --target 'ES5' -Modul '--ignoreCompilerErrors' Commonjs

Es ist preferrable alle Dokumentenerstellung Konfiguration in typedoc.json zu bewegen und Verwenden Sie die gleiche Datei zum Generieren des Dokuments, können Sie --json verwenden Flag für die Konfiguration aus der Datei auszuwählen, unten ist die Probe Kommentar für die Konfiguration aus der Datei zu lesen (typedoc.json ist die Konfigurationsdatei typedoc)

„typedoc --options ./typedoc.json --ignoreCompilerErrors ./src/lib /“

Probe meiner tsconfig.json Datei

{ 
    "mode": "modules", 
    "out": "./dist/lib", 
    "json": "./dist/lib/api.json", 
    "theme": "default", 
    "experimentalDecorators": "true", 
    "emitDecoratorMetadata": "true", 
    "excludePrivate": "true", 
    "excludeExternals": "true", 
    "externalPattern":"./**.*!./src/**.*", 
    "includeDeclarations": "true", 
    "target": "es6", 
    "exclude": "**/+(*.spec.ts|*.scss|*.html|demo/**|node_modules/**/*.*|e2e/*.*|src/demo/**/*.*)", 
    "name": "ui-common-shared", 
    "moduleResolution": "node", 
    "preserveConstEnums": "true", 
    "stripInternal": "true", 
    "suppressExcessPropertyErrors": "true", 
    "suppressImplicitAnyIndexErrors": "true", 
    "module": "commonjs" 
} 

Für weitere Informationen siehe: https://github.com/angular/material2/blob/master/GENERATING_API_DOCS.md