From a0cda86791b9c6562caee534bdb1c5abd3c08340 Mon Sep 17 00:00:00 2001 From: Christopher Cortes Date: Wed, 21 Sep 2016 16:08:45 +0200 Subject: [PATCH 1/3] Add interfaces for Directive scope and Component bindings Interfaces for scope property in Directive and bindings property in Component to avoid using simple Object (not descriptive enough) and the explicit type {[binding: string]: string} which is too verbose. --- angularjs/angular.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index c9e95bcc98..812512bf3b 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1725,7 +1725,7 @@ declare namespace angular { * Define DOM attribute binding to component properties. Component properties are always bound to the component * controller and not to the scope. */ - bindings?: {[binding: string]: string}; + bindings?: IComponentBindings; /** * Whether transclusion is enabled. Enabled by default. */ @@ -1738,6 +1738,10 @@ declare namespace angular { */ require?: {[controller: string]: string}; } + + interface IComponentBindings { + [binding: string]: string; + } interface IComponentTemplateFn { ( $element?: JQuery, $attrs?: IAttributes ): string; @@ -1826,6 +1830,10 @@ declare namespace angular { transclude: ITranscludeFunction ): void | IDirectivePrePost; } + + interface IDirectiveScope { + [property: string]: string; + } interface IDirective { compile?: IDirectiveCompileFn; @@ -1848,7 +1856,7 @@ declare namespace angular { replace?: boolean; require?: string | string[] | {[controller: string]: string}; restrict?: string; - scope?: boolean | Object; + scope?: boolean | IDirectiveScope; template?: string | Function; templateNamespace?: string; templateUrl?: string | Function; From f63a1b638fb9537eb87670f319eda101523274a1 Mon Sep 17 00:00:00 2001 From: Christopher Cortes Date: Wed, 21 Sep 2016 16:18:46 +0200 Subject: [PATCH 2/3] Fix wrong whitespacing in IComponentBindings Removed wrong whitespaces. --- angularjs/angular.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 812512bf3b..c80db8626e 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1738,10 +1738,10 @@ declare namespace angular { */ require?: {[controller: string]: string}; } - + interface IComponentBindings { [binding: string]: string; - } + } interface IComponentTemplateFn { ( $element?: JQuery, $attrs?: IAttributes ): string; From f4f57de0b5cc07d2950bfb4b13adb3c48328febb Mon Sep 17 00:00:00 2001 From: Christopher Cortes Date: Wed, 21 Sep 2016 16:38:30 +0200 Subject: [PATCH 3/3] Replace tabs by whitespaces Fix issues with tabs in IComponentBindings and IDirectiveScope --- angularjs/angular.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index c80db8626e..d78f39bec9 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1740,7 +1740,7 @@ declare namespace angular { } interface IComponentBindings { - [binding: string]: string; + [binding: string]: string; } interface IComponentTemplateFn { @@ -1830,10 +1830,10 @@ declare namespace angular { transclude: ITranscludeFunction ): void | IDirectivePrePost; } - + interface IDirectiveScope { - [property: string]: string; - } + [property: string]: string; + } interface IDirective { compile?: IDirectiveCompileFn;