chore(public_api): remove Angular 1 types from upgrade/static API

This commit is contained in:
Peter Bacon Darwin 2016-11-09 14:37:20 +00:00 committed by Victor Berchet
parent 009d545787
commit 1f96a93f59
3 changed files with 19 additions and 9 deletions

View File

@ -6,11 +6,10 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ComponentFactory, ComponentFactoryResolver, Injector} from '@angular/core'; import {ComponentFactory, ComponentFactoryResolver, Injector, Type} from '@angular/core';
import * as angular from '../angular_js'; import * as angular from '../angular_js';
import {ComponentInfo} from './component_info';
import {$INJECTOR, $PARSE, INJECTOR_KEY} from './constants'; import {$INJECTOR, $PARSE, INJECTOR_KEY} from './constants';
import {DowngradeComponentAdapter} from './downgrade_component_adapter'; import {DowngradeComponentAdapter} from './downgrade_component_adapter';
@ -19,7 +18,11 @@ let downgradeCount = 0;
/** /**
* @experimental * @experimental
*/ */
export function downgradeComponent(info: ComponentInfo): angular.IInjectable { export function downgradeComponent(info: /* ComponentInfo */ {
component: Type<any>;
inputs?: string[];
outputs?: string[];
}): any /* angular.IInjectable */ {
const idPrefix = `NG2_UPGRADE_${downgradeCount++}_`; const idPrefix = `NG2_UPGRADE_${downgradeCount++}_`;
let idCount = 0; let idCount = 0;

View File

@ -23,7 +23,7 @@ import {$$TESTABILITY, $DELEGATE, $INJECTOR, $PROVIDE, $ROOT_SCOPE, INJECTOR_KEY
*/ */
@NgModule({providers: angular1Providers}) @NgModule({providers: angular1Providers})
export class UpgradeModule { export class UpgradeModule {
public $injector: angular.IInjectorService; public $injector: any /*angular.IInjectorService*/;
constructor(public injector: Injector, public ngZone: NgZone) {} constructor(public injector: Injector, public ngZone: NgZone) {}
@ -33,7 +33,8 @@ export class UpgradeModule {
* @param [modules] the Angular 1 modules to bootstrap for this application * @param [modules] the Angular 1 modules to bootstrap for this application
* @param [config] optional extra Angular 1 bootstrap configuration * @param [config] optional extra Angular 1 bootstrap configuration
*/ */
bootstrap(element: Element, modules: string[] = [], config?: angular.IAngularBootstrapConfig) { bootstrap(
element: Element, modules: string[] = [], config?: any /*angular.IAngularBootstrapConfig*/) {
// Create an ng1 module to bootstrap // Create an ng1 module to bootstrap
const upgradeModule = const upgradeModule =
angular angular

View File

@ -1,5 +1,9 @@
/** @experimental */ /** @experimental */
export declare function downgradeComponent(info: ComponentInfo): angular.IInjectable; export declare function downgradeComponent(info: {
component: Type<any>;
inputs?: string[];
outputs?: string[];
}): any;
/** @experimental */ /** @experimental */
export declare function downgradeInjectable(token: any): (string | ((i: Injector) => any))[]; export declare function downgradeInjectable(token: any): (string | ((i: Injector) => any))[];
@ -15,9 +19,11 @@ export declare class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnD
/** @experimental */ /** @experimental */
export declare class UpgradeModule { export declare class UpgradeModule {
$injector: angular.IInjectorService; $injector: any;
injector: Injector; injector: Injector;
ngZone: NgZone; ngZone: NgZone;
constructor(injector: Injector, ngZone: NgZone); constructor(
bootstrap(element: Element, modules?: string[], config?: angular.IAngularBootstrapConfig): void; injector: Injector,
ngZone: NgZone);
bootstrap(element: Element, modules?: string[], config?: any): void;
} }