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