Skip to content

Commit

Permalink
chore(deps): use angular2 0.44 and ensure noImplicitAny:true builds
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Oct 21, 2015
1 parent 443c778 commit 61bbb9d
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 114 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ npm-debug.log
/dist

/demo/**/*.js
/demo/**/*.d.ts
/demo/**/*.js.map
/components/**/*.js
/components/**/*.d.ts
/components/**/*.js.map

ng2-file-upload.js
ng2-file-upload.d.ts
ng2-file-upload.js.map
/logs

!/demo/components/file-upload/file-catcher.js
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea
demo
build
gulp-tasks
logs

tsd.d.ts
typings

webpack.config.js
18 changes: 9 additions & 9 deletions components/file-upload/file-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class FileDrop {
getFilters() {
}

onDrop(event) {
onDrop(event:any) {
let transfer = this._getTransfer(event);
if (!transfer) {
return;
Expand All @@ -43,7 +43,7 @@ export class FileDrop {
this.fileOver.next(false);
}

onDragOver(event) {
onDragOver(event:any) {
let transfer = this._getTransfer(event);
if (!this._haveFiles(transfer.types)) {
return;
Expand All @@ -54,25 +54,25 @@ export class FileDrop {
this.fileOver.next(true);
}

onDragLeave(event) {
if (event.currentTarget === this.element[0]) {
onDragLeave(event:any):any {
if (event.currentTarget === (<any>this).element[0]) {
return;
}

this._preventAndStop(event);
this.fileOver.next(false);
}

_getTransfer(event) {
private _getTransfer(event:any):any {
return event.dataTransfer ? event.dataTransfer : event.originalEvent.dataTransfer; // jQuery fix;
}

_preventAndStop(event) {
private _preventAndStop(event:any):any {
event.preventDefault();
event.stopPropagation();
}

_haveFiles(types) {
private _haveFiles(types:any):any {
if (!types) {
return false;
}
Expand All @@ -86,11 +86,11 @@ export class FileDrop {
}
}

_addOverClass(item) {
_addOverClass(item:any):any {
item.addOverClass();
}

_removeOverClass(item) {
_removeOverClass(item:any):any {
item.removeOverClass();
}
}
26 changes: 10 additions & 16 deletions components/file-upload/file-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ export class FileItem {
public onBeforeUpload() {
}

public onProgress(progress) {
public onProgress(progress:number) {
}

public onSuccess(response, status, headers) {
public onSuccess(response:any, status:any, headers:any) {
}

public onError(response, status, headers) {
public onError(response:any, status:any, headers:any) {
}

public onCancel(response, status, headers) {
public onCancel(response:any, status:any, headers:any) {
}

public onComplete(response, status, headers) {
public onComplete(response:any, status:any, headers:any) {
}

private _onBeforeUpload() {
Expand All @@ -71,12 +71,12 @@ export class FileItem {
this.onBeforeUpload();
}

private _onProgress(progress) {
private _onProgress(progress:number) {
this.progress = progress;
this.onProgress(progress);
}

private _onSuccess(response, status, headers) {
private _onSuccess(response:any, status:any, headers:any) {
this.isReady = false;
this.isUploading = false;
this.isUploaded = true;
Expand All @@ -88,7 +88,7 @@ export class FileItem {
this.onSuccess(response, status, headers);
}

private _onError(response, status, headers) {
private _onError(response:any, status:any, headers:any) {
this.isReady = false;
this.isUploading = false;
this.isUploaded = true;
Expand All @@ -100,7 +100,7 @@ export class FileItem {
this.onError(response, status, headers);
}

private _onCancel(response, status, headers) {
private _onCancel(response:any, status:any, headers:any) {
this.isReady = false;
this.isUploading = false;
this.isUploaded = false;
Expand All @@ -112,22 +112,16 @@ export class FileItem {
this.onCancel(response, status, headers);
}

private _onComplete(response, status, headers) {
private _onComplete(response:any, status:any, headers:any) {
this.onComplete(response, status, headers);

if (this.uploader.removeAfterUpload) {
this.remove();
}
}

private _destroy() {
}

private _prepareToUploading() {
this.index = this.index || ++this.uploader._nextIndex;
this.isReady = true;
}

_replaceNode(input) {
}
}
8 changes: 4 additions & 4 deletions components/file-upload/file-like-object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function isElement(node) {
function isElement(node:any) {
return !!(node && (node.nodeName || node.prop && node.attr && node.find));
}

Expand All @@ -13,17 +13,17 @@ export class FileLikeObject {
let fakePathOrObject = isInput ? fileOrInput.value : fileOrInput;
let postfix = typeof fakePathOrObject === 'string' ? 'FakePath' : 'Object';
let method = '_createFrom' + postfix;
this[method](fakePathOrObject);
(<any>this)[method](fakePathOrObject);
}

public _createFromFakePath(path) {
public _createFromFakePath(path:string) {
this.lastModifiedDate = null;
this.size = null;
this.type = 'like/' + path.slice(path.lastIndexOf('.') + 1).toLowerCase();
this.name = path.slice(path.lastIndexOf('/') + path.lastIndexOf('\\') + 2);
}

public _createFromObject(object) {
public _createFromObject(object:{size: number, type: string, name: string}) {
// this.lastModifiedDate = copy(object.lastModifiedDate);
this.size = object.size;
this.type = object.type;
Expand Down
Loading

0 comments on commit 61bbb9d

Please sign in to comment.