refactor(upgrade): improve internal AngularJS typings (#24937)

PR Close #24937
This commit is contained in:
George Kalpakas 2018-07-22 17:18:59 +03:00 committed by Kara Erickson
parent 07ab98bbb0
commit 066fc6a0ca
1 changed files with 7 additions and 12 deletions

View File

@ -222,7 +222,7 @@ let angular: {
bootstrap: (e: Element, modules: (string | IInjectable)[], config?: IAngularBootstrapConfig) =>
IInjectorService,
module: (prefix: string, dependencies?: string[]) => IModule,
element: (e: Element | string) => IAugmentedJQuery,
element: (e: string | Element | Document | IAugmentedJQuery) => IAugmentedJQuery,
version: {major: number},
resumeBootstrap: () => void,
getTestability: (e: Element) => ITestabilityService
@ -261,8 +261,6 @@ export function getAngularLib(): any {
* Resets the AngularJS global.
*
* Used when AngularJS is loaded lazily, and not available on `window`.
*
*
*/
export function setAngularJSGlobal(ng: any): void {
angular = ng;
@ -271,24 +269,21 @@ export function setAngularJSGlobal(ng: any): void {
/**
* Returns the current AngularJS global.
*
*
*/
export function getAngularJSGlobal(): any {
return angular;
}
export const bootstrap =
(e: Element, modules: (string | IInjectable)[], config?: IAngularBootstrapConfig) =>
angular.bootstrap(e, modules, config);
export const bootstrap: typeof angular.bootstrap = (e, modules, config?) =>
angular.bootstrap(e, modules, config);
export const module = (prefix: string, dependencies?: string[]) =>
export const module: typeof angular.module = (prefix, dependencies?) =>
angular.module(prefix, dependencies);
export const element = (e: Element | string) => angular.element(e);
export const element: typeof angular.element = e => angular.element(e);
export const resumeBootstrap = () => angular.resumeBootstrap();
export const resumeBootstrap: typeof angular.resumeBootstrap = () => angular.resumeBootstrap();
export const getTestability = (e: Element) => angular.getTestability(e);
export const getTestability: typeof angular.getTestability = e => angular.getTestability(e);
export let version = angular.version;