Skip to content

Commit 0f40e97

Browse files
committed
docs: add gulpfile
1 parent 5871821 commit 0f40e97

File tree

4 files changed

+43
-4
lines changed

4 files changed

+43
-4
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
**/*.js.map
33
**/*.d.ts
44

5+
/docs
6+
57
/aot
68
*.metadata.json
79
**/*.ngFactory.ts
810

911
/npm-debug.log
1012

1113
/node_modules
12-
/typings
14+
/typings
15+
16+
!gulpfile.js

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ For demos please see [demos page](http://ng2-uploader.com).
1010
npm install ng2-uploader --save
1111
```
1212

13+
### API Docs
14+
15+
[http://docs.ng2-uploader.com](http://docs.ng2-uploader.com)
16+
1317
### Available parameters
1418

1519
|Parameter | Example Value
@@ -54,6 +58,7 @@ import { Ng2UploaderModule } from 'ng2-uploader';
5458
})
5559
// app.component.ts
5660
import { Component } from '@angular/core';
61+
import { Ng2UploaderOptions } from 'ng2-uploader';
5762

5863
@Component({
5964
selector: 'demo-app',
@@ -62,7 +67,7 @@ import { Component } from '@angular/core';
6267
export class DemoApp {
6368
uploadFile: any;
6469
hasBaseDropZoneOver: boolean = false;
65-
options: Object = {
70+
options: Ng2UploaderOptions = {
6671
url: 'http://localhost:10050/upload'
6772
};
6873
sizeLimit = 2000000;
@@ -118,14 +123,15 @@ This example show how to use available options and progress.
118123

119124
```ts
120125
import { Component, OnInit, NgZone } from '@angular/core';
126+
import { Ng2UploaderOptions } from 'ng2-uploader';
121127

122128
@Component({
123129
selector: 'app-component',
124130
templateUrl: 'app.component.html'
125131
})
126132
export class AppDemoComponent implements OnInit {
127133
private zone: NgZone;
128-
private options: Object;
134+
private options: Ng2UploaderOptions;
129135
private progress: number = 0;
130136
private response: any = {};
131137

gulpfile.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const gulp = require('gulp');
2+
const typedoc = require('gulp-typedoc');
3+
4+
gulp.task('docs', () => {
5+
return gulp.src([
6+
'index.ts',
7+
'!node_modules/**/*'])
8+
.pipe(typedoc({
9+
name: 'ng2-uploader docs',
10+
mode: 'file',
11+
out: 'docs',
12+
ignoreCompilerErrors: true,
13+
experimentalDecorators: true,
14+
emitDecoratorMetadata: true,
15+
target: 'ES5',
16+
moduleResolution: 'node',
17+
preserveConstEnums: true,
18+
stripInternal: true,
19+
suppressExcessPropertyErrors: true,
20+
suppressImplicitAnyIndexErrors: true,
21+
module: 'commonjs',
22+
ignoreCompilerErrors: true,
23+
noLib: true
24+
}));
25+
});

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"clean": "./scripts/clean.sh",
1111
"dev": "tsc --watch",
1212
"build": "./node_modules/.bin/ngc -p tsconfig.json",
13-
"prepublish": "npm run build"
13+
"prepublish": "npm run build",
14+
"docs": "gulp docs"
1415
},
1516
"repository": {
1617
"type": "git",
@@ -34,8 +35,11 @@
3435
"@angular/platform-server": "^2.4.1",
3536
"@types/core-js": "^0.9.35",
3637
"@types/node": "^6.0.52",
38+
"gulp": "^3.9.1",
39+
"gulp-typedoc": "^2.0.1",
3740
"reflect-metadata": "^0.1.9",
3841
"rxjs": "5.0.1",
42+
"typedoc": "^0.5.1",
3943
"typescript": "2.0.10",
4044
"zone.js": "^0.7.4"
4145
}

0 commit comments

Comments
 (0)