Add ReadonlyArray<string> as an alterative type for $inject.

It may be prudent to make injected dependencies immutable, but we can't Object.freeze() or use the Readonly interfae for our dependency array if $inject only accepts a mutable array of strings.
This commit is contained in:
Jough Dempsey
2016-12-13 17:13:06 -06:00
parent 1a5a11e8f1
commit 462a3e448e

8
angular/index.d.ts vendored
View File

@@ -10,7 +10,7 @@ declare var angular: angular.IAngularStatic;
// Support for painless dependency injection
declare global {
interface Function {
$inject?: string[];
$inject?: string[] | ReadonlyArray<string>;
}
}
@@ -1205,7 +1205,7 @@ declare namespace angular {
debugInfoEnabled(): boolean;
debugInfoEnabled(enabled: boolean): ICompileProvider;
/**
* Sets the number of times $onChanges hooks can trigger new changes before giving up and assuming that the model is unstable.
* Increasing the TTL could have performance implications, so you should not change it without proper justification.
@@ -1214,7 +1214,7 @@ declare namespace angular {
*/
onChangesTtl(): number;
onChangesTtl(limit: number): ICompileProvider;
/**
* It indicates to the compiler whether or not directives on comments should be compiled.
* It results in a compilation performance gain since the compiler doesn't have to check comments when looking for directives.
@@ -1223,7 +1223,7 @@ declare namespace angular {
*/
commentDirectivesEnabled(): boolean;
commentDirectivesEnabled(enabled: boolean): ICompileProvider;
/**
* It indicates to the compiler whether or not directives on element classes should be compiled.
* It results in a compilation performance gain since the compiler doesn't have to check element classes when looking for directives.