mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 22:40:50 +08:00
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:
8
angular/index.d.ts
vendored
8
angular/index.d.ts
vendored
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user