From aea6e0dab3ed05d2ba1bfb33d67c838c8b6dd4a8 Mon Sep 17 00:00:00 2001 From: jraymakers Date: Tue, 7 Jan 2014 15:59:44 -0800 Subject: [PATCH 1/5] support optional scope on ITemplateLinkingFunction --- angularjs/angular.d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 875abc754..5bfde41e9 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -537,9 +537,15 @@ declare module ng { directive(directivesMap: any): ICompileProvider; } - interface ITemplateLinkingFunction { + interface ICloneAttachFunction { // Let's hint but not force cloneAttachFn's signature - (scope: IScope, cloneAttachFn?: (clonedElement?: JQuery, scope?: IScope) => any): JQuery; + (clonedElement?: JQuery, scope?: IScope): any + } + + interface ITemplateLinkingFunction { + (scope: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery; + // scope argument is optional + (cloneAttachFn?: ICloneAttachFunction): JQuery; } /////////////////////////////////////////////////////////////////////////// From 3a82c7c52c606043d05a2bb72a20fc4596dc72a3 Mon Sep 17 00:00:00 2001 From: jraymakers Date: Tue, 7 Jan 2014 18:24:52 -0800 Subject: [PATCH 2/5] add ? to scope in ITemplateLinkingFunction --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 5bfde41e9..79134e433 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -543,7 +543,7 @@ declare module ng { } interface ITemplateLinkingFunction { - (scope: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery; + (scope?: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery; // scope argument is optional (cloneAttachFn?: ICloneAttachFunction): JQuery; } From ad7b08921be13c5dd80cc73ded45f4b8441acb08 Mon Sep 17 00:00:00 2001 From: jraymakers Date: Tue, 7 Jan 2014 21:08:18 -0800 Subject: [PATCH 3/5] remove unnecessary comment in ITemplateLinkingFunction --- angularjs/angular.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 79134e433..ec5b48964 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -544,7 +544,6 @@ declare module ng { interface ITemplateLinkingFunction { (scope?: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery; - // scope argument is optional (cloneAttachFn?: ICloneAttachFunction): JQuery; } From 75357ab8101c32379e2a59f396161a66688c6d26 Mon Sep 17 00:00:00 2001 From: jraymakers Date: Tue, 7 Jan 2014 22:22:33 -0800 Subject: [PATCH 4/5] add missing semicolon in ICloneAttachFunction --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index ec5b48964..3af21d4a3 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -539,7 +539,7 @@ declare module ng { interface ICloneAttachFunction { // Let's hint but not force cloneAttachFn's signature - (clonedElement?: JQuery, scope?: IScope): any + (clonedElement?: JQuery, scope?: IScope): any; } interface ITemplateLinkingFunction { From 90cf96b45178b6708d61b159b6bb0b541394b0ce Mon Sep 17 00:00:00 2001 From: jraymakers Date: Thu, 9 Jan 2014 16:01:48 -0800 Subject: [PATCH 5/5] update optionality of arguments to ITemplateLinkingFunction --- angularjs/angular.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 1a3889e04..6b0fe4683 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -543,7 +543,9 @@ declare module ng { } interface ITemplateLinkingFunction { - (scope?: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery; + // If the scope is provided, then the cloneAttachFn must be as well. + (scope: IScope, cloneAttachFn: ICloneAttachFunction): JQuery; + // If one argument is provided, then it's assumed to be the cloneAttachFn. (cloneAttachFn?: ICloneAttachFunction): JQuery; }