fix(upgrade): make typings compatible with older AngularJS typings (#26880)
Make `angular1` typings compatible with older versions of AngularJS typings from `@types/angular`. Closes #26420 PR Close #26880
This commit is contained in:
parent
c016066d9b
commit
64647af1a6
@ -10,7 +10,12 @@ export type Ng1Token = string;
|
|||||||
|
|
||||||
export type Ng1Expression = string | Function;
|
export type Ng1Expression = string | Function;
|
||||||
|
|
||||||
export interface IAnnotatedFunction extends Function { $inject?: ReadonlyArray<Ng1Token>; }
|
export interface IAnnotatedFunction extends Function {
|
||||||
|
// Older versions of `@types/angular` typings extend the global `Function` interface with
|
||||||
|
// `$inject?: string[]`, which is not compatible with `$inject?: ReadonlyArray<string>` (used in
|
||||||
|
// latest versions).
|
||||||
|
$inject?: Function extends{$inject?: string[]}? Ng1Token[]: ReadonlyArray<Ng1Token>;
|
||||||
|
}
|
||||||
|
|
||||||
export type IInjectable = (Ng1Token | Function)[] | IAnnotatedFunction;
|
export type IInjectable = (Ng1Token | Function)[] | IAnnotatedFunction;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user