2020-02-26 12:09:35 -05:00
|
|
|
export declare interface AbstractType<T> extends Function {
|
2019-05-15 23:24:29 -04:00
|
|
|
prototype: T;
|
|
|
|
}
|
2019-03-13 20:02:31 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface AfterContentChecked {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngAfterContentChecked(): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface AfterContentInit {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngAfterContentInit(): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface AfterViewChecked {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngAfterViewChecked(): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface AfterViewInit {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngAfterViewInit(): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2019-10-18 14:48:37 -04:00
|
|
|
/** @deprecated */
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const ANALYZE_FOR_ENTRY_COMPONENTS: InjectionToken<any>;
|
2016-07-07 13:05:55 -04:00
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare const APP_BOOTSTRAP_LISTENER: InjectionToken<((compRef: ComponentRef<any>) => void)[]>;
|
2016-08-02 10:54:14 -04:00
|
|
|
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const APP_ID: InjectionToken<string>;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const APP_INITIALIZER: InjectionToken<(() => void)[]>;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2016-08-02 10:54:14 -04:00
|
|
|
export declare class ApplicationInitStatus {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly done = false;
|
|
|
|
readonly donePromise: Promise<any>;
|
|
|
|
constructor(appInits: (() => any)[]);
|
2016-08-02 10:54:14 -04:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare class ApplicationModule {
|
|
|
|
constructor(appRef: ApplicationRef);
|
|
|
|
}
|
2016-07-18 06:50:31 -04:00
|
|
|
|
2017-09-12 14:45:02 -04:00
|
|
|
export declare class ApplicationRef {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly componentTypes: Type<any>[];
|
|
|
|
readonly components: ComponentRef<any>[];
|
|
|
|
readonly isStable: Observable<boolean>;
|
2019-11-09 13:36:22 -05:00
|
|
|
get viewCount(): number;
|
2019-05-15 23:24:29 -04:00
|
|
|
attachView(viewRef: ViewRef): void;
|
|
|
|
bootstrap<C>(componentOrFactory: ComponentFactory<C> | Type<C>, rootSelectorOrNode?: string | any): ComponentRef<C>;
|
|
|
|
detachView(viewRef: ViewRef): void;
|
|
|
|
tick(): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare function asNativeElements(debugEls: DebugElement[]): any;
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function assertPlatform(requiredToken: any): PlatformRef;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Attribute {
|
2020-07-18 09:05:28 -04:00
|
|
|
attributeName: string;
|
2019-05-15 23:24:29 -04:00
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Attribute: AttributeDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface AttributeDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(name: string): any;
|
|
|
|
new (name: string): Attribute;
|
2019-01-11 19:07:01 -05:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare enum ChangeDetectionStrategy {
|
|
|
|
OnPush = 0,
|
|
|
|
Default = 1
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
|
|
|
export declare abstract class ChangeDetectorRef {
|
2019-05-15 23:24:29 -04:00
|
|
|
abstract checkNoChanges(): void;
|
|
|
|
abstract detach(): void;
|
|
|
|
abstract detectChanges(): void;
|
|
|
|
abstract markForCheck(): void;
|
|
|
|
abstract reattach(): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ClassProvider extends ClassSansProvider {
|
2019-05-15 23:24:29 -04:00
|
|
|
multi?: boolean;
|
|
|
|
provide: any;
|
2016-08-15 22:37:42 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ClassSansProvider {
|
2019-06-10 13:04:11 -04:00
|
|
|
useClass: Type<any>;
|
|
|
|
}
|
|
|
|
|
2016-06-24 11:46:43 -04:00
|
|
|
export declare class Compiler {
|
2019-05-15 23:24:29 -04:00
|
|
|
compileModuleAndAllComponentsAsync: <T>(moduleType: Type<T>) => Promise<ModuleWithComponentFactories<T>>;
|
|
|
|
compileModuleAndAllComponentsSync: <T>(moduleType: Type<T>) => ModuleWithComponentFactories<T>;
|
|
|
|
compileModuleAsync: <T>(moduleType: Type<T>) => Promise<NgModuleFactory<T>>;
|
|
|
|
compileModuleSync: <T>(moduleType: Type<T>) => NgModuleFactory<T>;
|
|
|
|
clearCache(): void;
|
|
|
|
clearCacheFor(type: Type<any>): void;
|
|
|
|
getModuleId(moduleType: Type<any>): string | undefined;
|
2016-06-24 11:46:43 -04:00
|
|
|
}
|
|
|
|
|
2017-02-07 22:27:01 -05:00
|
|
|
export declare const COMPILER_OPTIONS: InjectionToken<CompilerOptions[]>;
|
2016-08-04 14:31:58 -04:00
|
|
|
|
refactor(core): clean up platform bootstrap and initTestEnvironment
- Introduces `CompilerFactory` which can be part of a `PlatformRef`.
- Introduces `WorkerAppModule`, `WorkerUiModule`, `ServerModule`
- Introduces `serverDynamicPlatform` for applications using runtime compilation
on the server.
- Changes browser bootstrap for runtime and offline compilation (see below for an example).
* introduces `bootstrapModule` and `bootstrapModuleFactory` in `@angular/core`
* introduces new `browserDynamicPlatform` in `@angular/platform-browser-dynamic
- Changes `initTestEnvironment` (which used to be `setBaseTestProviders`) to not take a compiler factory any more (see below for an example).
BREAKING CHANGE:
## Migration from `setBaseTestProviders` to `initTestEnvironment`:
- For the browser platform:
BEFORE:
```
import {setBaseTestProviders} from ‘@angular/core/testing’;
import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
```
AFTER:
```
import {initTestEnvironment} from ‘@angular/core/testing’;
import {browserDynamicTestPlatform,
BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
initTestEnvironment(
BrowserDynamicTestModule,
browserDynamicTestPlatform());
```
- For the server platform:
BEFORE:
```
import {setBaseTestProviders} from ‘@angular/core/testing’;
import {TEST_SERVER_PLATFORM_PROVIDERS,
TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
TEST_SERVER_APPLICATION_PROVIDERS);
```
AFTER:
```
import {initTestEnvironment} from ‘@angular/core/testing’;
import {serverTestPlatform,
ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
initTestEnvironment(
ServerTestModule,
serverTestPlatform());
```
## Bootstrap changes
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {browserPlatform} from ‘@angular/platform-browser’;
import {bootstrapModuleFactory} from ‘@angular/core’;
bootstrapModuleFactory(MyModuleNgFactory, browserPlatform());
// runtime compile long form
import {browserDynamicPlatform} from ‘@angular/platform-browser-dynamic’;
import {bootstrapModule} from ‘@angular/core’;
bootstrapModule(MyModule, browserDynamicPlatform());
```
Closes #9922
Part of #9726
2016-07-08 13:47:17 -04:00
|
|
|
export declare abstract class CompilerFactory {
|
2019-05-15 23:24:29 -04:00
|
|
|
abstract createCompiler(options?: CompilerOptions[]): Compiler;
|
refactor(core): clean up platform bootstrap and initTestEnvironment
- Introduces `CompilerFactory` which can be part of a `PlatformRef`.
- Introduces `WorkerAppModule`, `WorkerUiModule`, `ServerModule`
- Introduces `serverDynamicPlatform` for applications using runtime compilation
on the server.
- Changes browser bootstrap for runtime and offline compilation (see below for an example).
* introduces `bootstrapModule` and `bootstrapModuleFactory` in `@angular/core`
* introduces new `browserDynamicPlatform` in `@angular/platform-browser-dynamic
- Changes `initTestEnvironment` (which used to be `setBaseTestProviders`) to not take a compiler factory any more (see below for an example).
BREAKING CHANGE:
## Migration from `setBaseTestProviders` to `initTestEnvironment`:
- For the browser platform:
BEFORE:
```
import {setBaseTestProviders} from ‘@angular/core/testing’;
import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
```
AFTER:
```
import {initTestEnvironment} from ‘@angular/core/testing’;
import {browserDynamicTestPlatform,
BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
initTestEnvironment(
BrowserDynamicTestModule,
browserDynamicTestPlatform());
```
- For the server platform:
BEFORE:
```
import {setBaseTestProviders} from ‘@angular/core/testing’;
import {TEST_SERVER_PLATFORM_PROVIDERS,
TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
TEST_SERVER_APPLICATION_PROVIDERS);
```
AFTER:
```
import {initTestEnvironment} from ‘@angular/core/testing’;
import {serverTestPlatform,
ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
initTestEnvironment(
ServerTestModule,
serverTestPlatform());
```
## Bootstrap changes
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {browserPlatform} from ‘@angular/platform-browser’;
import {bootstrapModuleFactory} from ‘@angular/core’;
bootstrapModuleFactory(MyModuleNgFactory, browserPlatform());
// runtime compile long form
import {browserDynamicPlatform} from ‘@angular/platform-browser-dynamic’;
import {bootstrapModule} from ‘@angular/core’;
bootstrapModule(MyModule, browserDynamicPlatform());
```
Closes #9922
Part of #9726
2016-07-08 13:47:17 -04:00
|
|
|
}
|
|
|
|
|
2016-08-04 14:31:58 -04:00
|
|
|
export declare type CompilerOptions = {
|
2019-05-15 23:24:29 -04:00
|
|
|
useJit?: boolean;
|
|
|
|
defaultEncapsulation?: ViewEncapsulation;
|
|
|
|
providers?: StaticProvider[];
|
|
|
|
missingTranslation?: MissingTranslationStrategy;
|
|
|
|
preserveWhitespaces?: boolean;
|
2016-08-04 14:31:58 -04:00
|
|
|
};
|
refactor(core): clean up platform bootstrap and initTestEnvironment
- Introduces `CompilerFactory` which can be part of a `PlatformRef`.
- Introduces `WorkerAppModule`, `WorkerUiModule`, `ServerModule`
- Introduces `serverDynamicPlatform` for applications using runtime compilation
on the server.
- Changes browser bootstrap for runtime and offline compilation (see below for an example).
* introduces `bootstrapModule` and `bootstrapModuleFactory` in `@angular/core`
* introduces new `browserDynamicPlatform` in `@angular/platform-browser-dynamic
- Changes `initTestEnvironment` (which used to be `setBaseTestProviders`) to not take a compiler factory any more (see below for an example).
BREAKING CHANGE:
## Migration from `setBaseTestProviders` to `initTestEnvironment`:
- For the browser platform:
BEFORE:
```
import {setBaseTestProviders} from ‘@angular/core/testing’;
import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
```
AFTER:
```
import {initTestEnvironment} from ‘@angular/core/testing’;
import {browserDynamicTestPlatform,
BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
initTestEnvironment(
BrowserDynamicTestModule,
browserDynamicTestPlatform());
```
- For the server platform:
BEFORE:
```
import {setBaseTestProviders} from ‘@angular/core/testing’;
import {TEST_SERVER_PLATFORM_PROVIDERS,
TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
TEST_SERVER_APPLICATION_PROVIDERS);
```
AFTER:
```
import {initTestEnvironment} from ‘@angular/core/testing’;
import {serverTestPlatform,
ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
initTestEnvironment(
ServerTestModule,
serverTestPlatform());
```
## Bootstrap changes
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {browserPlatform} from ‘@angular/platform-browser’;
import {bootstrapModuleFactory} from ‘@angular/core’;
bootstrapModuleFactory(MyModuleNgFactory, browserPlatform());
// runtime compile long form
import {browserDynamicPlatform} from ‘@angular/platform-browser-dynamic’;
import {bootstrapModule} from ‘@angular/core’;
bootstrapModule(MyModule, browserDynamicPlatform());
```
Closes #9922
Part of #9726
2016-07-08 13:47:17 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Component extends Directive {
|
2019-05-15 23:24:29 -04:00
|
|
|
animations?: any[];
|
|
|
|
changeDetection?: ChangeDetectionStrategy;
|
|
|
|
encapsulation?: ViewEncapsulation;
|
2019-10-18 14:48:37 -04:00
|
|
|
/** @deprecated */ entryComponents?: Array<Type<any> | any[]>;
|
2019-05-15 23:24:29 -04:00
|
|
|
interpolation?: [string, string];
|
|
|
|
moduleId?: string;
|
|
|
|
preserveWhitespaces?: boolean;
|
|
|
|
styleUrls?: string[];
|
|
|
|
styles?: string[];
|
|
|
|
template?: string;
|
|
|
|
templateUrl?: string;
|
|
|
|
viewProviders?: Provider[];
|
2018-11-26 17:44:45 -05:00
|
|
|
}
|
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Component: ComponentDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ComponentDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(obj: Component): TypeDecorator;
|
|
|
|
new (obj: Component): Component;
|
2016-09-14 18:12:25 -04:00
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare abstract class ComponentFactoryResolver {
|
2019-05-15 23:24:29 -04:00
|
|
|
abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;
|
|
|
|
static NULL: ComponentFactoryResolver;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare abstract class ComponentRef<C> {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get changeDetectorRef(): ChangeDetectorRef;
|
|
|
|
abstract get componentType(): Type<any>;
|
|
|
|
abstract get hostView(): ViewRef;
|
|
|
|
abstract get injector(): Injector;
|
|
|
|
abstract get instance(): C;
|
|
|
|
abstract get location(): ElementRef;
|
2019-05-15 23:24:29 -04:00
|
|
|
abstract destroy(): void;
|
|
|
|
abstract onDestroy(callback: Function): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ConstructorProvider extends ConstructorSansProvider {
|
2019-07-02 16:57:02 -04:00
|
|
|
multi?: boolean;
|
|
|
|
provide: Type<any>;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ConstructorSansProvider {
|
2019-05-15 23:24:29 -04:00
|
|
|
deps?: any[];
|
|
|
|
}
|
2018-05-09 19:49:39 -04:00
|
|
|
|
2018-11-26 17:44:45 -05:00
|
|
|
export declare type ContentChild = Query;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ContentChildDecorator {
|
2020-06-10 04:07:22 -04:00
|
|
|
(selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2019-05-15 23:24:29 -04:00
|
|
|
read?: any;
|
2019-10-03 15:54:07 -04:00
|
|
|
static?: boolean;
|
2019-05-15 23:24:29 -04:00
|
|
|
}): any;
|
2020-06-10 04:07:22 -04:00
|
|
|
new (selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2019-05-15 23:24:29 -04:00
|
|
|
read?: any;
|
2019-10-03 15:54:07 -04:00
|
|
|
static?: boolean;
|
2019-05-15 23:24:29 -04:00
|
|
|
}): ContentChild;
|
2016-09-14 14:51:26 -04:00
|
|
|
}
|
|
|
|
|
2018-11-26 17:44:45 -05:00
|
|
|
export declare type ContentChildren = Query;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ContentChildrenDecorator {
|
2020-06-10 04:07:22 -04:00
|
|
|
(selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2019-05-15 23:24:29 -04:00
|
|
|
descendants?: boolean;
|
|
|
|
read?: any;
|
|
|
|
}): any;
|
2020-06-10 04:07:22 -04:00
|
|
|
new (selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2019-05-15 23:24:29 -04:00
|
|
|
descendants?: boolean;
|
|
|
|
read?: any;
|
|
|
|
}): Query;
|
2016-09-14 14:51:26 -04:00
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare function createPlatform(injector: Injector): PlatformRef;
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function createPlatformFactory(parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null, name: string, providers?: StaticProvider[]): (extraProviders?: StaticProvider[]) => PlatformRef;
|
|
|
|
|
|
|
|
export declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata;
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface DebugElement extends DebugNode {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly attributes: {
|
|
|
|
[key: string]: string | null;
|
|
|
|
};
|
|
|
|
readonly childNodes: DebugNode[];
|
|
|
|
readonly children: DebugElement[];
|
|
|
|
readonly classes: {
|
|
|
|
[key: string]: boolean;
|
|
|
|
};
|
|
|
|
readonly name: string;
|
|
|
|
readonly nativeElement: any;
|
|
|
|
readonly properties: {
|
|
|
|
[key: string]: any;
|
|
|
|
};
|
|
|
|
readonly styles: {
|
|
|
|
[key: string]: string | null;
|
|
|
|
};
|
|
|
|
query(predicate: Predicate<DebugElement>): DebugElement;
|
|
|
|
queryAll(predicate: Predicate<DebugElement>): DebugElement[];
|
|
|
|
queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[];
|
|
|
|
triggerEventHandler(eventName: string, eventObj: any): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare const DebugElement: {
|
|
|
|
new (...args: any[]): DebugElement;
|
|
|
|
};
|
2018-11-22 00:14:06 -05:00
|
|
|
|
2019-04-10 07:27:17 -04:00
|
|
|
export declare class DebugEventListener {
|
2019-05-15 23:24:29 -04:00
|
|
|
callback: Function;
|
|
|
|
name: string;
|
|
|
|
constructor(name: string, callback: Function);
|
2019-04-10 07:27:17 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface DebugNode {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly componentInstance: any;
|
|
|
|
readonly context: any;
|
|
|
|
readonly injector: Injector;
|
|
|
|
readonly listeners: DebugEventListener[];
|
|
|
|
readonly nativeNode: any;
|
|
|
|
readonly parent: DebugElement | null;
|
|
|
|
readonly providerTokens: any[];
|
|
|
|
readonly references: {
|
|
|
|
[key: string]: any;
|
|
|
|
};
|
2019-05-15 22:20:02 -04:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare const DebugNode: {
|
|
|
|
new (...args: any[]): DebugNode;
|
|
|
|
};
|
2018-11-22 00:14:06 -05:00
|
|
|
|
2019-12-14 05:39:41 -05:00
|
|
|
export declare const DEFAULT_CURRENCY_CODE: InjectionToken<string>;
|
|
|
|
|
2016-10-27 14:28:11 -04:00
|
|
|
/** @deprecated */
|
|
|
|
export declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly collection: V[] | Iterable<V> | null;
|
2019-11-09 13:36:22 -05:00
|
|
|
get isDirty(): boolean;
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly length: number;
|
|
|
|
constructor(trackByFn?: TrackByFunction<V>);
|
|
|
|
check(collection: NgIterable<V>): boolean;
|
2019-10-03 12:31:28 -04:00
|
|
|
diff(collection: NgIterable<V> | null | undefined): DefaultIterableDiffer<V> | null;
|
2019-05-15 23:24:29 -04:00
|
|
|
forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
|
|
|
|
forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void): void;
|
|
|
|
forEachItem(fn: (record: IterableChangeRecord_<V>) => void): void;
|
|
|
|
forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
|
|
|
|
forEachOperation(fn: (item: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
|
|
|
|
forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void): void;
|
|
|
|
forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
|
|
|
|
onDestroy(): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2019-04-04 14:41:52 -04:00
|
|
|
/** @deprecated */
|
2019-05-17 21:49:21 -04:00
|
|
|
export declare const defineInjectable: typeof ɵɵdefineInjectable;
|
2018-02-16 11:45:21 -05:00
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function destroyPlatform(): void;
|
2016-08-12 17:15:37 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Directive {
|
2019-05-15 23:24:29 -04:00
|
|
|
exportAs?: string;
|
|
|
|
host?: {
|
|
|
|
[key: string]: string;
|
|
|
|
};
|
|
|
|
inputs?: string[];
|
|
|
|
jit?: true;
|
|
|
|
outputs?: string[];
|
|
|
|
providers?: Provider[];
|
|
|
|
queries?: {
|
|
|
|
[key: string]: any;
|
|
|
|
};
|
|
|
|
selector?: string;
|
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Directive: DirectiveDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface DirectiveDecorator {
|
feat(compiler): allow selector-less directives as base classes (#31379)
In Angular today, the following pattern works:
```typescript
export class BaseDir {
constructor(@Inject(ViewContainerRef) protected vcr: ViewContainerRef) {}
}
@Directive({
selector: '[child]',
})
export class ChildDir extends BaseDir {
// constructor inherited from BaseDir
}
```
A decorated child class can inherit a constructor from an undecorated base
class, so long as the base class has metadata of its own (for JIT mode).
This pattern works regardless of metadata in AOT.
In Angular Ivy, this pattern does not work: without the @Directive
annotation identifying the base class as a directive, information about its
constructor parameters will not be captured by the Ivy compiler. This is a
result of Ivy's locality principle, which is the basis behind a number of
compilation optimizations.
As a solution, @Directive() without a selector will be interpreted as a
"directive base class" annotation. Such a directive cannot be declared in an
NgModule, but can be inherited from. To implement this, a few changes are
made to the ngc compiler:
* the error for a selector-less directive is now generated when an NgModule
declaring it is processed, not when the directive itself is processed.
* selector-less directives are not tracked along with other directives in
the compiler, preventing other errors (like their absence in an NgModule)
from being generated from them.
PR Close #31379
2019-07-01 19:04:58 -04:00
|
|
|
(obj?: Directive): TypeDecorator;
|
|
|
|
new (obj?: Directive): Directive;
|
2016-09-14 18:12:25 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface DoBootstrap {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngDoBootstrap(appRef: ApplicationRef): void;
|
|
|
|
}
|
2018-06-18 05:29:29 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface DoCheck {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngDoCheck(): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-05-12 03:19:59 -04:00
|
|
|
export declare class ElementRef<T = any> {
|
2019-05-15 23:24:29 -04:00
|
|
|
nativeElement: T;
|
|
|
|
constructor(nativeElement: T);
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get context(): C;
|
|
|
|
abstract get rootNodes(): any[];
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function enableProdMode(): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare class ErrorHandler {
|
|
|
|
handleError(error: any): void;
|
|
|
|
}
|
2016-08-25 03:50:16 -04:00
|
|
|
|
2020-05-13 04:45:46 -04:00
|
|
|
export declare interface EventEmitter<T> extends Subject<T> {
|
|
|
|
new (isAsync?: boolean): EventEmitter<T>;
|
2019-05-15 23:24:29 -04:00
|
|
|
emit(value?: T): void;
|
|
|
|
subscribe(generatorOrNext?: any, error?: any, complete?: any): Subscription;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-05-13 04:45:46 -04:00
|
|
|
export declare const EventEmitter: {
|
|
|
|
new (isAsync?: boolean): EventEmitter<any>;
|
|
|
|
new <T>(isAsync?: boolean): EventEmitter<T>;
|
|
|
|
readonly prototype: EventEmitter<any>;
|
|
|
|
};
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ExistingProvider extends ExistingSansProvider {
|
2019-05-15 23:24:29 -04:00
|
|
|
multi?: boolean;
|
|
|
|
provide: any;
|
2016-08-15 22:37:42 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ExistingSansProvider {
|
2019-07-02 16:57:02 -04:00
|
|
|
useExisting: any;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface FactoryProvider extends FactorySansProvider {
|
2019-05-15 23:24:29 -04:00
|
|
|
multi?: boolean;
|
|
|
|
provide: any;
|
2016-08-15 22:37:42 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface FactorySansProvider {
|
2019-07-02 16:57:02 -04:00
|
|
|
deps?: any[];
|
|
|
|
useFactory: Function;
|
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function forwardRef(forwardRefFn: ForwardRefFn): Type<any>;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ForwardRefFn {
|
2019-05-15 23:24:29 -04:00
|
|
|
(): any;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2018-11-22 00:14:06 -05:00
|
|
|
export declare const getDebugNode: (nativeNode: any) => DebugNode | null;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2018-12-11 13:43:02 -05:00
|
|
|
export declare const getModuleFactory: (id: string) => NgModuleFactory<any>;
|
2016-09-01 16:46:08 -04:00
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function getPlatform(): PlatformRef | null;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface GetTestability {
|
2019-05-15 23:24:29 -04:00
|
|
|
addToWindow(registry: TestabilityRegistry): void;
|
|
|
|
findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Host {
|
2019-05-15 23:24:29 -04:00
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Host: HostDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface HostBinding {
|
2019-05-15 23:24:29 -04:00
|
|
|
hostPropertyName?: string;
|
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const HostBinding: HostBindingDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface HostBindingDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(hostPropertyName?: string): any;
|
|
|
|
new (hostPropertyName?: string): any;
|
2019-02-19 14:52:21 -05:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface HostDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(): any;
|
|
|
|
new (): Host;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface HostListener {
|
2019-05-15 23:24:29 -04:00
|
|
|
args?: string[];
|
|
|
|
eventName?: string;
|
2018-11-26 17:44:45 -05:00
|
|
|
}
|
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const HostListener: HostListenerDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface HostListenerDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(eventName: string, args?: string[]): any;
|
|
|
|
new (eventName: string, args?: string[]): any;
|
2019-02-19 14:52:21 -05:00
|
|
|
}
|
|
|
|
|
2019-05-17 21:49:21 -04:00
|
|
|
export declare const inject: typeof ɵɵinject;
|
2018-02-23 12:04:55 -05:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Inject {
|
2019-05-15 23:24:29 -04:00
|
|
|
token: any;
|
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Inject: InjectDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Injectable {
|
2019-08-22 22:19:41 -04:00
|
|
|
providedIn?: Type<any> | 'root' | 'platform' | 'any' | null;
|
2019-05-15 23:24:29 -04:00
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Injectable: InjectableDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface InjectableDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(): TypeDecorator;
|
|
|
|
(options?: {
|
2019-08-22 22:19:41 -04:00
|
|
|
providedIn: Type<any> | 'root' | 'platform' | 'any' | null;
|
2019-05-15 23:24:29 -04:00
|
|
|
} & InjectableProvider): TypeDecorator;
|
|
|
|
new (): Injectable;
|
|
|
|
new (options?: {
|
2019-08-22 22:19:41 -04:00
|
|
|
providedIn: Type<any> | 'root' | 'platform' | 'any' | null;
|
2019-05-15 23:24:29 -04:00
|
|
|
} & InjectableProvider): Injectable;
|
feat: change @Injectable() to support tree-shakeable tokens (#22005)
This commit bundles 3 important changes, with the goal of enabling tree-shaking
of services which are never injected. Ordinarily, this tree-shaking is prevented
by the existence of a hard dependency on the service by the module in which it
is declared.
Firstly, @Injectable() is modified to accept a 'scope' parameter, which points
to an @NgModule(). This reverses the dependency edge, permitting the module to
not depend on the service which it "provides".
Secondly, the runtime is modified to understand the new relationship created
above. When a module receives a request to inject a token, and cannot find that
token in its list of providers, it will then look at the token for a special
ngInjectableDef field which indicates which module the token is scoped to. If
that module happens to be in the injector, it will behave as if the token
itself was in the injector to begin with.
Thirdly, the compiler is modified to read the @Injectable() metadata and to
generate the special ngInjectableDef field as part of TS compilation, using the
PartialModules system.
Additionally, this commit adds several unit and integration tests of various
flavors to test this change.
PR Close #22005
2018-02-02 13:33:48 -05:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare type InjectableProvider = ValueSansProvider | ExistingSansProvider | StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;
|
feat: change @Injectable() to support tree-shakeable tokens (#22005)
This commit bundles 3 important changes, with the goal of enabling tree-shaking
of services which are never injected. Ordinarily, this tree-shaking is prevented
by the existence of a hard dependency on the service by the module in which it
is declared.
Firstly, @Injectable() is modified to accept a 'scope' parameter, which points
to an @NgModule(). This reverses the dependency edge, permitting the module to
not depend on the service which it "provides".
Secondly, the runtime is modified to understand the new relationship created
above. When a module receives a request to inject a token, and cannot find that
token in its list of providers, it will then look at the token for a special
ngInjectableDef field which indicates which module the token is scoped to. If
that module happens to be in the injector, it will behave as if the token
itself was in the injector to begin with.
Thirdly, the compiler is modified to read the @Injectable() metadata and to
generate the special ngInjectableDef field as part of TS compilation, using the
PartialModules system.
Additionally, this commit adds several unit and integration tests of various
flavors to test this change.
PR Close #22005
2018-02-02 13:33:48 -05:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface InjectableType<T> extends Type<T> {
|
2019-10-15 15:41:30 -04:00
|
|
|
ɵprov: never;
|
2019-05-15 23:24:29 -04:00
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface InjectDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(token: any): any;
|
|
|
|
new (token: any): Inject;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare enum InjectFlags {
|
|
|
|
Default = 0,
|
|
|
|
Host = 1,
|
|
|
|
Self = 2,
|
|
|
|
SkipSelf = 4,
|
|
|
|
Optional = 8
|
|
|
|
}
|
feat: change @Injectable() to support tree-shakeable tokens (#22005)
This commit bundles 3 important changes, with the goal of enabling tree-shaking
of services which are never injected. Ordinarily, this tree-shaking is prevented
by the existence of a hard dependency on the service by the module in which it
is declared.
Firstly, @Injectable() is modified to accept a 'scope' parameter, which points
to an @NgModule(). This reverses the dependency edge, permitting the module to
not depend on the service which it "provides".
Secondly, the runtime is modified to understand the new relationship created
above. When a module receives a request to inject a token, and cannot find that
token in its list of providers, it will then look at the token for a special
ngInjectableDef field which indicates which module the token is scoped to. If
that module happens to be in the injector, it will behave as if the token
itself was in the injector to begin with.
Thirdly, the compiler is modified to read the @Injectable() metadata and to
generate the special ngInjectableDef field as part of TS compilation, using the
PartialModules system.
Additionally, this commit adds several unit and integration tests of various
flavors to test this change.
PR Close #22005
2018-02-02 13:33:48 -05:00
|
|
|
|
2017-08-31 04:56:26 -04:00
|
|
|
export declare class InjectionToken<T> {
|
2019-05-15 23:24:29 -04:00
|
|
|
protected _desc: string;
|
2019-10-15 15:41:30 -04:00
|
|
|
readonly ɵprov: never | undefined;
|
2019-05-15 23:24:29 -04:00
|
|
|
constructor(_desc: string, options?: {
|
2019-08-22 22:19:41 -04:00
|
|
|
providedIn?: Type<any> | 'root' | 'platform' | 'any' | null;
|
2019-05-15 23:24:29 -04:00
|
|
|
factory: () => T;
|
|
|
|
});
|
|
|
|
toString(): string;
|
2017-01-03 19:54:46 -05:00
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare abstract class Injector {
|
2019-08-19 18:05:29 -04:00
|
|
|
abstract get<T>(token: Type<T> | InjectionToken<T> | AbstractType<T>, notFoundValue?: T, flags?: InjectFlags): T;
|
2019-05-15 23:24:29 -04:00
|
|
|
/** @deprecated */ abstract get(token: any, notFoundValue?: any): any;
|
|
|
|
static NULL: Injector;
|
2019-10-16 20:46:50 -04:00
|
|
|
static THROW_IF_NOT_FOUND: {};
|
2019-10-15 15:41:30 -04:00
|
|
|
static ɵprov: never;
|
2019-05-15 23:24:29 -04:00
|
|
|
/** @deprecated */ static create(providers: StaticProvider[], parent?: Injector): Injector;
|
|
|
|
static create(options: {
|
|
|
|
providers: StaticProvider[];
|
|
|
|
parent?: Injector;
|
|
|
|
name?: string;
|
|
|
|
}): Injector;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2018-02-16 11:45:21 -05:00
|
|
|
export declare const INJECTOR: InjectionToken<Injector>;
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface InjectorType<T> extends Type<T> {
|
2019-10-14 18:28:01 -04:00
|
|
|
ɵinj: never;
|
2019-05-15 23:24:29 -04:00
|
|
|
}
|
2018-02-16 11:45:21 -05:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Input {
|
2019-05-15 23:24:29 -04:00
|
|
|
bindingPropertyName?: string;
|
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Input: InputDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface InputDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(bindingPropertyName?: string): any;
|
|
|
|
new (bindingPropertyName?: string): any;
|
2019-02-19 14:52:21 -05:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function isDevMode(): boolean;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface IterableChangeRecord<V> {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly currentIndex: number | null;
|
|
|
|
readonly item: V;
|
|
|
|
readonly previousIndex: number | null;
|
|
|
|
readonly trackById: any;
|
|
|
|
}
|
2016-10-27 14:28:11 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface IterableChanges<V> {
|
2019-05-15 23:24:29 -04:00
|
|
|
forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;
|
|
|
|
forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;
|
|
|
|
forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;
|
|
|
|
forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
|
|
|
|
forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
|
|
|
|
forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;
|
|
|
|
forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
|
2016-10-27 14:28:11 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface IterableDiffer<V> {
|
2019-10-03 12:31:28 -04:00
|
|
|
diff(object: NgIterable<V> | undefined | null): IterableChanges<V> | null;
|
2019-05-15 23:24:29 -04:00
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface IterableDifferFactory {
|
2019-05-15 23:24:29 -04:00
|
|
|
create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;
|
|
|
|
supports(objects: any): boolean;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare class IterableDiffers {
|
2019-05-15 23:24:29 -04:00
|
|
|
/** @deprecated */ factories: IterableDifferFactory[];
|
|
|
|
constructor(factories: IterableDifferFactory[]);
|
|
|
|
find(iterable: any): IterableDifferFactory;
|
2019-10-15 15:41:30 -04:00
|
|
|
static ɵprov: never;
|
2019-05-15 23:24:29 -04:00
|
|
|
static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
|
|
|
|
static extend(factories: IterableDifferFactory[]): StaticProvider;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface KeyValueChangeRecord<K, V> {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly currentValue: V | null;
|
|
|
|
readonly key: K;
|
|
|
|
readonly previousValue: V | null;
|
2016-10-27 14:28:11 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface KeyValueChanges<K, V> {
|
2019-05-15 23:24:29 -04:00
|
|
|
forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
|
|
|
|
forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
|
|
|
|
forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
|
|
|
|
forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
|
|
|
|
forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface KeyValueDiffer<K, V> {
|
2019-05-15 23:24:29 -04:00
|
|
|
diff(object: Map<K, V>): KeyValueChanges<K, V> | null;
|
|
|
|
diff(object: {
|
|
|
|
[key: string]: V;
|
|
|
|
}): KeyValueChanges<string, V> | null;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface KeyValueDifferFactory {
|
2019-05-15 23:24:29 -04:00
|
|
|
create<K, V>(): KeyValueDiffer<K, V>;
|
|
|
|
supports(objects: any): boolean;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare class KeyValueDiffers {
|
2019-05-15 23:24:29 -04:00
|
|
|
/** @deprecated */ factories: KeyValueDifferFactory[];
|
|
|
|
constructor(factories: KeyValueDifferFactory[]);
|
|
|
|
find(kv: any): KeyValueDifferFactory;
|
2019-10-15 15:41:30 -04:00
|
|
|
static ɵprov: never;
|
2019-05-15 23:24:29 -04:00
|
|
|
static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
|
|
|
|
static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const LOCALE_ID: InjectionToken<string>;
|
2016-08-12 17:45:36 -04:00
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare enum MissingTranslationStrategy {
|
|
|
|
Error = 0,
|
|
|
|
Warning = 1,
|
|
|
|
Ignore = 2
|
|
|
|
}
|
2017-01-10 08:14:41 -05:00
|
|
|
|
2016-07-29 07:19:02 -04:00
|
|
|
export declare class ModuleWithComponentFactories<T> {
|
2019-05-15 23:24:29 -04:00
|
|
|
componentFactories: ComponentFactory<any>[];
|
|
|
|
ngModuleFactory: NgModuleFactory<T>;
|
|
|
|
constructor(ngModuleFactory: NgModuleFactory<T>, componentFactories: ComponentFactory<any>[]);
|
2016-07-29 07:19:02 -04:00
|
|
|
}
|
|
|
|
|
2020-05-01 19:39:22 -04:00
|
|
|
export declare interface ModuleWithProviders<T> {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngModule: Type<T>;
|
|
|
|
providers?: Provider[];
|
2016-07-25 08:47:16 -04:00
|
|
|
}
|
|
|
|
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare type NgIterable<T> = Array<T> | Iterable<T>;
|
2017-01-25 16:45:06 -05:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface NgModule {
|
2019-05-15 23:24:29 -04:00
|
|
|
bootstrap?: Array<Type<any> | any[]>;
|
|
|
|
declarations?: Array<Type<any> | any[]>;
|
2019-10-18 14:48:37 -04:00
|
|
|
/** @deprecated */ entryComponents?: Array<Type<any> | any[]>;
|
2019-05-15 23:24:29 -04:00
|
|
|
exports?: Array<Type<any> | any[]>;
|
|
|
|
id?: string;
|
|
|
|
imports?: Array<Type<any> | ModuleWithProviders<{}> | any[]>;
|
|
|
|
jit?: true;
|
|
|
|
providers?: Provider[];
|
|
|
|
schemas?: Array<SchemaMetadata | any[]>;
|
2018-11-26 17:44:45 -05:00
|
|
|
}
|
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const NgModule: NgModuleDecorator;
|
2016-07-18 06:50:31 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface NgModuleDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(obj?: NgModule): TypeDecorator;
|
|
|
|
new (obj?: NgModule): NgModule;
|
2019-02-26 11:25:01 -05:00
|
|
|
}
|
|
|
|
|
2017-05-11 13:26:02 -04:00
|
|
|
export declare abstract class NgModuleFactory<T> {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get moduleType(): Type<T>;
|
2019-05-15 23:24:29 -04:00
|
|
|
abstract create(parentInjector: Injector | null): NgModuleRef<T>;
|
2016-07-18 06:50:31 -04:00
|
|
|
}
|
|
|
|
|
feat(router): deprecate loadChildren:string (#30073)
The proposed ES dynamic import() is now supported by the Angular CLI and the
larger toolchain. This renders the `loadChildren: string` API largely
redundant, as import() is far more natural, is less error-prone, and is
standards compliant. This commit deprecates the `string` form of
`loadChildren` in favor of dynamic import().
DEPRECATION:
When defining lazy-loaded route, Angular previously offered two options for
configuring the module to be loaded, both via the `loadChildren` parameter
of the route. Most Angular developers are familiar withthe `string` form of
this API. For example, the following route definition configures Angular to
load a `LazyModule` NgModule from `lazy-route/lazy.module.ts`:
```
[{
path: 'lazy',
loadChildren: 'lazy-route/lazy.module#LazyModule',
}]
```
This "magic string" configuration was previously necessary as there was
no dynamic module loading standard on the web. This has changed with the
pending standardization of dynamic `import()` expressions, which are now
supported in the Angular CLI and in web tooling in general. `import()`
offers a more natural and robust solution to dynamic module loading. The
above example can be rewritten to use dynamic `import()`:
```
[{
path: 'lazy',
loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),
}]
```
This form of lazy loading offers significant advantages in terms of:
* type checking via TypeScript
* simplicity of generated code
* future potential to run natively in supporting browsers
(see: [caniuse: dynamic import()](https://caniuse.com/#feat=es6-module-dynamic-import))
As a result, Angular is deprecating the `loadChildren: string` syntax in
favor of ES dynamic `import()`. An automatic migration will run during
`ng upgrade` to convert your existing Angular code to the new syntax.
PR Close #30073
2019-04-23 17:30:09 -04:00
|
|
|
/** @deprecated */
|
2016-07-18 06:50:31 -04:00
|
|
|
export declare abstract class NgModuleFactoryLoader {
|
2019-05-15 23:24:29 -04:00
|
|
|
abstract load(path: string): Promise<NgModuleFactory<any>>;
|
2016-07-18 06:50:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare abstract class NgModuleRef<T> {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get componentFactoryResolver(): ComponentFactoryResolver;
|
|
|
|
abstract get injector(): Injector;
|
|
|
|
abstract get instance(): T;
|
2019-05-15 23:24:29 -04:00
|
|
|
abstract destroy(): void;
|
|
|
|
abstract onDestroy(callback: () => void): void;
|
2016-07-18 06:50:31 -04:00
|
|
|
}
|
|
|
|
|
2016-11-09 17:58:40 -05:00
|
|
|
export declare class NgProbeToken {
|
2019-05-15 23:24:29 -04:00
|
|
|
name: string;
|
|
|
|
token: any;
|
|
|
|
constructor(name: string, token: any);
|
2016-11-09 17:58:40 -05:00
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class NgZone {
|
2019-05-15 23:24:29 -04:00
|
|
|
readonly hasPendingMacrotasks: boolean;
|
|
|
|
readonly hasPendingMicrotasks: boolean;
|
|
|
|
readonly isStable: boolean;
|
|
|
|
readonly onError: EventEmitter<any>;
|
|
|
|
readonly onMicrotaskEmpty: EventEmitter<any>;
|
|
|
|
readonly onStable: EventEmitter<any>;
|
|
|
|
readonly onUnstable: EventEmitter<any>;
|
2019-05-17 07:50:02 -04:00
|
|
|
constructor({ enableLongStackTrace, shouldCoalesceEventChangeDetection }: {
|
2019-05-15 23:24:29 -04:00
|
|
|
enableLongStackTrace?: boolean | undefined;
|
2019-05-17 07:50:02 -04:00
|
|
|
shouldCoalesceEventChangeDetection?: boolean | undefined;
|
2019-05-15 23:24:29 -04:00
|
|
|
});
|
|
|
|
run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T;
|
|
|
|
runGuarded<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T;
|
|
|
|
runOutsideAngular<T>(fn: (...args: any[]) => T): T;
|
|
|
|
runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T;
|
|
|
|
static assertInAngularZone(): void;
|
|
|
|
static assertNotInAngularZone(): void;
|
|
|
|
static isInAngularZone(): boolean;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2016-08-19 19:05:34 -04:00
|
|
|
export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface OnChanges {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngOnChanges(changes: SimpleChanges): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface OnDestroy {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngOnDestroy(): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface OnInit {
|
2019-05-15 23:24:29 -04:00
|
|
|
ngOnInit(): void;
|
|
|
|
}
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Optional {
|
2019-05-15 23:24:29 -04:00
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Optional: OptionalDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface OptionalDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(): any;
|
|
|
|
new (): Optional;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Output {
|
2019-05-15 23:24:29 -04:00
|
|
|
bindingPropertyName?: string;
|
|
|
|
}
|
2018-11-26 17:44:45 -05:00
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Output: OutputDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface OutputDecorator {
|
2019-05-15 23:24:29 -04:00
|
|
|
(bindingPropertyName?: string): any;
|
|
|
|
new (bindingPropertyName?: string): any;
|
2019-02-19 14:52:21 -05:00
|
|
|
}
|
|
|
|
|
2020-07-24 12:49:19 -04:00
|
|
|
/** @codeGenApi */
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function ɵɵdefineInjectable<T>(opts: {
|
2019-06-07 13:12:07 -04:00
|
|
|
token: unknown;
|
2019-08-22 22:19:41 -04:00
|
|
|
providedIn?: Type<any> | 'root' | 'platform' | 'any' | null;
|
2019-05-15 23:24:29 -04:00
|
|
|
factory: () => T;
|
|
|
|
}): never;
|
2019-05-17 21:49:21 -04:00
|
|
|
|
2020-07-24 12:49:19 -04:00
|
|
|
/** @codeGenApi */
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function ɵɵinject<T>(token: Type<T> | InjectionToken<T>): T;
|
|
|
|
export declare function ɵɵinject<T>(token: Type<T> | InjectionToken<T>, flags?: InjectFlags): T | null;
|
2019-05-17 21:49:21 -04:00
|
|
|
|
2020-07-24 12:49:19 -04:00
|
|
|
/** @codeGenApi */
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ɵɵInjectableDef<T> {
|
2019-06-04 16:50:48 -04:00
|
|
|
factory: (t?: Type<any>) => T;
|
2019-08-22 22:19:41 -04:00
|
|
|
providedIn: InjectorType<any> | 'root' | 'platform' | 'any' | null;
|
2019-06-07 13:12:07 -04:00
|
|
|
token: unknown;
|
2019-05-15 23:24:29 -04:00
|
|
|
value: T | undefined;
|
|
|
|
}
|
2019-05-17 21:49:21 -04:00
|
|
|
|
2020-07-24 12:49:19 -04:00
|
|
|
/** @codeGenApi */
|
2019-05-15 23:24:29 -04:00
|
|
|
export declare function ɵɵinjectAttribute(attrNameToInject: string): string | null;
|
2019-05-17 21:49:21 -04:00
|
|
|
|
2020-07-24 12:49:19 -04:00
|
|
|
/** @codeGenApi */
|
2019-07-12 14:15:12 -04:00
|
|
|
export declare function ɵɵinjectPipeChangeDetectorRef(flags?: InjectFlags): ChangeDetectorRef | null;
|
|
|
|
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const PACKAGE_ROOT_URL: InjectionToken<string>;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Pipe {
|
2018-11-26 17:44:45 -05:00
|
|
|
name: string;
|
|
|
|
pure?: boolean;
|
|
|
|
}
|
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Pipe: PipeDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface PipeDecorator {
|
2019-02-19 14:52:21 -05:00
|
|
|
(obj: Pipe): TypeDecorator;
|
|
|
|
new (obj: Pipe): Pipe;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface PipeTransform {
|
2016-06-22 17:56:10 -04:00
|
|
|
transform(value: any, ...args: any[]): any;
|
|
|
|
}
|
|
|
|
|
2017-02-22 19:49:46 -05:00
|
|
|
export declare const PLATFORM_ID: InjectionToken<Object>;
|
|
|
|
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const PLATFORM_INITIALIZER: InjectionToken<(() => void)[]>;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
perf: switch angular to use StaticInjector instead of ReflectiveInjector
This change allows ReflectiveInjector to be tree shaken resulting
in not needed Reflect polyfil and smaller bundles.
Code savings for HelloWorld using Closure:
Reflective: bundle.js: 105,864(34,190 gzip)
Static: bundle.js: 154,889(33,555 gzip)
645( 2%)
BREAKING CHANGE:
`platformXXXX()` no longer accepts providers which depend on reflection.
Specifically the method signature when from `Provider[]` to
`StaticProvider[]`.
Example:
Before:
```
[
MyClass,
{provide: ClassA, useClass: SubClassA}
]
```
After:
```
[
{provide: MyClass, deps: [Dep1,...]},
{provide: ClassA, useClass: SubClassA, deps: [Dep1,...]}
]
```
NOTE: This only applies to platform creation and providers for the JIT
compiler. It does not apply to `@Compotent` or `@NgModule` provides
declarations.
Benchpress note: Previously Benchpress also supported reflective
provides, which now require static providers.
DEPRECATION:
- `ReflectiveInjector` is now deprecated as it will be remove. Use
`Injector.create` as a replacement.
closes #18496
2017-08-03 15:33:29 -04:00
|
|
|
export declare const platformCore: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
|
2016-07-25 08:47:16 -04:00
|
|
|
|
2017-09-12 14:45:02 -04:00
|
|
|
export declare class PlatformRef {
|
2019-11-09 13:36:22 -05:00
|
|
|
get destroyed(): boolean;
|
|
|
|
get injector(): Injector;
|
2018-04-05 17:31:44 -04:00
|
|
|
bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: (CompilerOptions & BootstrapOptions) | Array<CompilerOptions & BootstrapOptions>): Promise<NgModuleRef<M>>;
|
2018-10-19 11:27:04 -04:00
|
|
|
bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>, options?: BootstrapOptions): Promise<NgModuleRef<M>>;
|
2017-09-12 14:45:02 -04:00
|
|
|
destroy(): void;
|
|
|
|
onDestroy(callback: () => void): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Predicate<T> {
|
2017-03-29 12:34:45 -04:00
|
|
|
(value: T): boolean;
|
2017-03-01 17:10:59 -05:00
|
|
|
}
|
|
|
|
|
2018-05-09 19:49:39 -04:00
|
|
|
export declare type Provider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | any[];
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Query {
|
2018-11-26 17:44:45 -05:00
|
|
|
descendants: boolean;
|
|
|
|
first: boolean;
|
|
|
|
isViewQuery: boolean;
|
|
|
|
read: any;
|
|
|
|
selector: any;
|
2019-10-03 15:54:07 -04:00
|
|
|
static?: boolean;
|
2018-11-26 17:44:45 -05:00
|
|
|
}
|
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare abstract class Query {
|
|
|
|
}
|
|
|
|
|
fix(core): make QueryList implement Iterable in the type system (#33536)
Originally, QueryList implemented Iterable and provided a Symbol.iterator
on its prototype. This caused issues with tree-shaking, so QueryList was
refactored and the Symbol.iterator added in its constructor instead. As
part of this change, QueryList no longer implemented Iterable directly.
Unfortunately, this meant that QueryList was no longer assignable to
Iterable or, consequently, NgIterable. NgIterable is used for NgFor's input,
so this meant that QueryList was not usable (in a type sense) for NgFor
iteration. View Engine's template type checking would not catch this, but
Ivy's did.
As a fix, this commit adds the declaration (but not the implementation) of
the Symbol.iterator function back to QueryList. This has no runtime effect,
so it doesn't affect tree-shaking of QueryList, but it ensures that
QueryList is assignable to NgIterable and thus usable with NgFor.
Fixes #29842
PR Close #33536
2019-11-01 15:31:56 -04:00
|
|
|
export declare class QueryList<T> implements Iterable<T> {
|
|
|
|
[Symbol.iterator]: () => Iterator<T>;
|
2017-02-07 22:27:01 -05:00
|
|
|
readonly changes: Observable<any>;
|
2018-09-27 19:47:19 -04:00
|
|
|
readonly dirty = true;
|
2017-02-07 22:27:01 -05:00
|
|
|
readonly first: T;
|
|
|
|
readonly last: T;
|
|
|
|
readonly length: number;
|
2019-05-21 01:50:30 -04:00
|
|
|
constructor();
|
2017-09-02 10:42:22 -04:00
|
|
|
destroy(): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
filter(fn: (item: T, index: number, array: T[]) => boolean): T[];
|
2017-03-29 12:34:45 -04:00
|
|
|
find(fn: (item: T, index: number, array: T[]) => boolean): T | undefined;
|
2016-06-22 17:56:10 -04:00
|
|
|
forEach(fn: (item: T, index: number, array: T[]) => void): void;
|
2016-06-23 21:19:32 -04:00
|
|
|
map<U>(fn: (item: T, index: number, array: T[]) => U): U[];
|
|
|
|
notifyOnChanges(): void;
|
|
|
|
reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U;
|
2019-03-15 16:18:34 -04:00
|
|
|
reset(resultsTree: Array<T | any[]>): void;
|
2016-06-23 21:19:32 -04:00
|
|
|
setDirty(): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
some(fn: (value: T, index: number, array: T[]) => boolean): boolean;
|
|
|
|
toArray(): T[];
|
|
|
|
toString(): string;
|
|
|
|
}
|
|
|
|
|
2017-08-09 03:18:05 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare abstract class ReflectiveInjector implements Injector {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get parent(): Injector | null;
|
2017-01-26 01:36:38 -05:00
|
|
|
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
|
2016-06-23 21:19:32 -04:00
|
|
|
abstract get(token: any, notFoundValue?: any): any;
|
2017-01-26 01:36:38 -05:00
|
|
|
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
|
|
|
|
abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;
|
|
|
|
abstract resolveAndInstantiate(provider: Provider): any;
|
2018-10-19 11:27:04 -04:00
|
|
|
static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector;
|
2016-08-15 22:37:42 -04:00
|
|
|
static resolve(providers: Provider[]): ResolvedReflectiveProvider[];
|
|
|
|
static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
perf: switch angular to use StaticInjector instead of ReflectiveInjector
This change allows ReflectiveInjector to be tree shaken resulting
in not needed Reflect polyfil and smaller bundles.
Code savings for HelloWorld using Closure:
Reflective: bundle.js: 105,864(34,190 gzip)
Static: bundle.js: 154,889(33,555 gzip)
645( 2%)
BREAKING CHANGE:
`platformXXXX()` no longer accepts providers which depend on reflection.
Specifically the method signature when from `Provider[]` to
`StaticProvider[]`.
Example:
Before:
```
[
MyClass,
{provide: ClassA, useClass: SubClassA}
]
```
After:
```
[
{provide: MyClass, deps: [Dep1,...]},
{provide: ClassA, useClass: SubClassA, deps: [Dep1,...]}
]
```
NOTE: This only applies to platform creation and providers for the JIT
compiler. It does not apply to `@Compotent` or `@NgModule` provides
declarations.
Benchpress note: Previously Benchpress also supported reflective
provides, which now require static providers.
DEPRECATION:
- `ReflectiveInjector` is now deprecated as it will be remove. Use
`Injector.create` as a replacement.
closes #18496
2017-08-03 15:33:29 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class ReflectiveKey {
|
2017-02-07 22:27:01 -05:00
|
|
|
readonly displayName: string;
|
2016-06-22 17:56:10 -04:00
|
|
|
id: number;
|
2016-06-23 21:19:32 -04:00
|
|
|
token: Object;
|
2016-06-22 17:56:10 -04:00
|
|
|
constructor(token: Object, id: number);
|
2019-11-09 13:36:22 -05:00
|
|
|
static get numberOfKeys(): number;
|
2016-06-23 21:19:32 -04:00
|
|
|
static get(token: Object): ReflectiveKey;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2017-03-07 19:36:12 -05:00
|
|
|
export declare abstract class Renderer2 {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get data(): {
|
2017-02-24 15:10:19 -05:00
|
|
|
[key: string]: any;
|
|
|
|
};
|
2017-03-29 12:34:45 -04:00
|
|
|
destroyNode: ((node: any) => void) | null;
|
2017-02-15 00:03:18 -05:00
|
|
|
abstract addClass(el: any, name: string): void;
|
|
|
|
abstract appendChild(parent: any, newChild: any): void;
|
2017-02-16 16:55:55 -05:00
|
|
|
abstract createComment(value: string): any;
|
2017-03-29 12:34:45 -04:00
|
|
|
abstract createElement(name: string, namespace?: string | null): any;
|
2017-02-16 16:55:55 -05:00
|
|
|
abstract createText(value: string): any;
|
|
|
|
abstract destroy(): void;
|
2017-02-15 00:03:18 -05:00
|
|
|
abstract insertBefore(parent: any, newChild: any, refChild: any): void;
|
2017-03-07 19:36:12 -05:00
|
|
|
abstract listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => boolean | void): () => void;
|
2017-02-15 00:03:18 -05:00
|
|
|
abstract nextSibling(node: any): any;
|
|
|
|
abstract parentNode(node: any): any;
|
2017-03-29 12:34:45 -04:00
|
|
|
abstract removeAttribute(el: any, name: string, namespace?: string | null): void;
|
2019-01-14 18:36:08 -05:00
|
|
|
abstract removeChild(parent: any, oldChild: any, isHostElement?: boolean): void;
|
2017-02-15 00:03:18 -05:00
|
|
|
abstract removeClass(el: any, name: string): void;
|
2017-03-13 12:45:04 -04:00
|
|
|
abstract removeStyle(el: any, style: string, flags?: RendererStyleFlags2): void;
|
2018-07-15 21:53:18 -04:00
|
|
|
abstract selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): any;
|
2017-03-29 12:34:45 -04:00
|
|
|
abstract setAttribute(el: any, name: string, value: string, namespace?: string | null): void;
|
2017-02-15 00:03:18 -05:00
|
|
|
abstract setProperty(el: any, name: string, value: any): void;
|
2017-03-13 12:45:04 -04:00
|
|
|
abstract setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2): void;
|
2017-02-16 16:55:55 -05:00
|
|
|
abstract setValue(node: any, value: string): void;
|
2017-02-15 00:03:18 -05:00
|
|
|
}
|
|
|
|
|
2017-03-07 19:36:12 -05:00
|
|
|
export declare abstract class RendererFactory2 {
|
2017-05-03 16:17:46 -04:00
|
|
|
abstract begin?(): void;
|
2017-03-29 12:34:45 -04:00
|
|
|
abstract createRenderer(hostElement: any, type: RendererType2 | null): Renderer2;
|
2017-05-03 16:17:46 -04:00
|
|
|
abstract end?(): void;
|
2017-05-12 17:32:51 -04:00
|
|
|
abstract whenRenderingDone?(): Promise<any>;
|
2017-03-07 19:36:12 -05:00
|
|
|
}
|
|
|
|
|
2017-03-13 12:45:04 -04:00
|
|
|
export declare enum RendererStyleFlags2 {
|
|
|
|
Important = 1,
|
2018-06-25 05:11:22 -04:00
|
|
|
DashCase = 2
|
2017-03-13 12:45:04 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface RendererType2 {
|
2017-03-07 19:36:12 -05:00
|
|
|
data: {
|
|
|
|
[kind: string]: any;
|
|
|
|
};
|
|
|
|
encapsulation: ViewEncapsulation;
|
|
|
|
id: string;
|
|
|
|
styles: (string | any[])[];
|
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class ResolvedReflectiveFactory {
|
2020-02-26 12:09:35 -05:00
|
|
|
dependencies: ɵangular_packages_core_core_e[];
|
2016-06-23 21:19:32 -04:00
|
|
|
factory: Function;
|
2016-06-22 17:56:10 -04:00
|
|
|
constructor(
|
2018-06-25 05:11:22 -04:00
|
|
|
factory: Function,
|
2020-02-26 12:09:35 -05:00
|
|
|
dependencies: ɵangular_packages_core_core_e[]);
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ResolvedReflectiveProvider {
|
2016-06-22 17:56:10 -04:00
|
|
|
key: ReflectiveKey;
|
|
|
|
multiProvider: boolean;
|
2016-06-23 21:19:32 -04:00
|
|
|
resolvedFactories: ResolvedReflectiveFactory[];
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2018-10-18 03:23:18 -04:00
|
|
|
export declare function resolveForwardRef<T>(type: T): T;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2016-08-25 18:41:19 -04:00
|
|
|
export declare abstract class Sanitizer {
|
2017-04-14 17:40:56 -04:00
|
|
|
abstract sanitize(context: SecurityContext, value: {} | string | null): string | null;
|
2019-10-15 15:41:30 -04:00
|
|
|
static ɵprov: never;
|
feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);
// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```
The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.
Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
public so that the offline compiler can resolve the token
BREAKING CHANGES:
- short form bootstrap does no longer allow
to inject compiler internals (i.e. everything
from `@angular/compiler). Inject `Compiler` instead.
To provide custom providers for the compiler,
create a custom compiler via `browserCompiler({providers: [...]})`
and pass that into the `bootstrap` method.
2016-06-30 16:07:17 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface SchemaMetadata {
|
2016-07-25 08:47:16 -04:00
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);
// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```
The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.
Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
public so that the offline compiler can resolve the token
BREAKING CHANGES:
- short form bootstrap does no longer allow
to inject compiler internals (i.e. everything
from `@angular/compiler). Inject `Compiler` instead.
To provide custom providers for the compiler,
create a custom compiler via `browserCompiler({providers: [...]})`
and pass that into the `bootstrap` method.
2016-06-30 16:07:17 -04:00
|
|
|
export declare enum SecurityContext {
|
|
|
|
NONE = 0,
|
|
|
|
HTML = 1,
|
|
|
|
STYLE = 2,
|
|
|
|
SCRIPT = 3,
|
|
|
|
URL = 4,
|
2018-06-25 05:11:22 -04:00
|
|
|
RESOURCE_URL = 5
|
feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:
```
@AppModule({
modules: [BrowserModule],
precompile: [MainComponent],
providers: […], // additional providers
directives: […], // additional platform directives
pipes: […] // additional platform pipes
})
class MyModule {
constructor(appRef: ApplicationRef) {
appRef.bootstrap(MainComponent);
}
}
// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);
// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```
The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.
Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
public so that the offline compiler can resolve the token
BREAKING CHANGES:
- short form bootstrap does no longer allow
to inject compiler internals (i.e. everything
from `@angular/compiler). Inject `Compiler` instead.
To provide custom providers for the compiler,
create a custom compiler via `browserCompiler({providers: [...]})`
and pass that into the `bootstrap` method.
2016-06-30 16:07:17 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface Self {
|
2018-11-26 17:44:45 -05:00
|
|
|
}
|
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const Self: SelfDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface SelfDecorator {
|
2018-04-05 17:31:44 -04:00
|
|
|
(): any;
|
2016-09-12 22:34:14 -04:00
|
|
|
new (): Self;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare function setTestabilityGetter(getter: GetTestability): void;
|
|
|
|
|
|
|
|
export declare class SimpleChange {
|
|
|
|
currentValue: any;
|
2017-01-03 14:58:49 -05:00
|
|
|
firstChange: boolean;
|
2016-06-23 21:19:32 -04:00
|
|
|
previousValue: any;
|
2017-01-03 14:58:49 -05:00
|
|
|
constructor(previousValue: any, currentValue: any, firstChange: boolean);
|
2016-06-22 17:56:10 -04:00
|
|
|
isFirstChange(): boolean;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface SimpleChanges {
|
2016-06-22 17:56:10 -04:00
|
|
|
[propName: string]: SimpleChange;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface SkipSelf {
|
2018-11-26 17:44:45 -05:00
|
|
|
}
|
|
|
|
|
2016-09-12 22:34:14 -04:00
|
|
|
export declare const SkipSelf: SkipSelfDecorator;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface SkipSelfDecorator {
|
2018-04-05 17:31:44 -04:00
|
|
|
(): any;
|
2016-09-12 22:34:14 -04:00
|
|
|
new (): SkipSelf;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface StaticClassProvider extends StaticClassSansProvider {
|
2019-07-02 16:57:02 -04:00
|
|
|
multi?: boolean;
|
|
|
|
provide: any;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface StaticClassSansProvider {
|
2019-07-02 16:57:02 -04:00
|
|
|
deps: any[];
|
|
|
|
useClass: Type<any>;
|
|
|
|
}
|
|
|
|
|
2017-07-27 16:49:33 -04:00
|
|
|
export declare type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[];
|
|
|
|
|
feat(router): deprecate loadChildren:string (#30073)
The proposed ES dynamic import() is now supported by the Angular CLI and the
larger toolchain. This renders the `loadChildren: string` API largely
redundant, as import() is far more natural, is less error-prone, and is
standards compliant. This commit deprecates the `string` form of
`loadChildren` in favor of dynamic import().
DEPRECATION:
When defining lazy-loaded route, Angular previously offered two options for
configuring the module to be loaded, both via the `loadChildren` parameter
of the route. Most Angular developers are familiar withthe `string` form of
this API. For example, the following route definition configures Angular to
load a `LazyModule` NgModule from `lazy-route/lazy.module.ts`:
```
[{
path: 'lazy',
loadChildren: 'lazy-route/lazy.module#LazyModule',
}]
```
This "magic string" configuration was previously necessary as there was
no dynamic module loading standard on the web. This has changed with the
pending standardization of dynamic `import()` expressions, which are now
supported in the Angular CLI and in web tooling in general. `import()`
offers a more natural and robust solution to dynamic module loading. The
above example can be rewritten to use dynamic `import()`:
```
[{
path: 'lazy',
loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),
}]
```
This form of lazy loading offers significant advantages in terms of:
* type checking via TypeScript
* simplicity of generated code
* future potential to run natively in supporting browsers
(see: [caniuse: dynamic import()](https://caniuse.com/#feat=es6-module-dynamic-import))
As a result, Angular is deprecating the `loadChildren: string` syntax in
favor of ES dynamic `import()`. An automatic migration will run during
`ng upgrade` to convert your existing Angular code to the new syntax.
PR Close #30073
2019-04-23 17:30:09 -04:00
|
|
|
/** @deprecated */
|
2016-07-18 06:50:31 -04:00
|
|
|
export declare class SystemJsNgModuleLoader implements NgModuleFactoryLoader {
|
2016-08-24 19:54:42 -04:00
|
|
|
constructor(_compiler: Compiler, config?: SystemJsNgModuleLoaderConfig);
|
2016-07-18 06:50:31 -04:00
|
|
|
load(path: string): Promise<NgModuleFactory<any>>;
|
|
|
|
}
|
|
|
|
|
feat(router): deprecate loadChildren:string (#30073)
The proposed ES dynamic import() is now supported by the Angular CLI and the
larger toolchain. This renders the `loadChildren: string` API largely
redundant, as import() is far more natural, is less error-prone, and is
standards compliant. This commit deprecates the `string` form of
`loadChildren` in favor of dynamic import().
DEPRECATION:
When defining lazy-loaded route, Angular previously offered two options for
configuring the module to be loaded, both via the `loadChildren` parameter
of the route. Most Angular developers are familiar withthe `string` form of
this API. For example, the following route definition configures Angular to
load a `LazyModule` NgModule from `lazy-route/lazy.module.ts`:
```
[{
path: 'lazy',
loadChildren: 'lazy-route/lazy.module#LazyModule',
}]
```
This "magic string" configuration was previously necessary as there was
no dynamic module loading standard on the web. This has changed with the
pending standardization of dynamic `import()` expressions, which are now
supported in the Angular CLI and in web tooling in general. `import()`
offers a more natural and robust solution to dynamic module loading. The
above example can be rewritten to use dynamic `import()`:
```
[{
path: 'lazy',
loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),
}]
```
This form of lazy loading offers significant advantages in terms of:
* type checking via TypeScript
* simplicity of generated code
* future potential to run natively in supporting browsers
(see: [caniuse: dynamic import()](https://caniuse.com/#feat=es6-module-dynamic-import))
As a result, Angular is deprecating the `loadChildren: string` syntax in
favor of ES dynamic `import()`. An automatic migration will run during
`ng upgrade` to convert your existing Angular code to the new syntax.
PR Close #30073
2019-04-23 17:30:09 -04:00
|
|
|
/** @deprecated */
|
2016-08-24 19:54:42 -04:00
|
|
|
export declare abstract class SystemJsNgModuleLoaderConfig {
|
|
|
|
factoryPathPrefix: string;
|
|
|
|
factoryPathSuffix: string;
|
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare abstract class TemplateRef<C> {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get elementRef(): ElementRef;
|
2016-06-22 17:56:10 -04:00
|
|
|
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
|
|
|
}
|
|
|
|
|
2016-08-29 16:08:28 -04:00
|
|
|
export declare class Testability implements PublicTestability {
|
2016-06-22 17:56:10 -04:00
|
|
|
constructor(_ngZone: NgZone);
|
2017-04-27 14:44:14 -04:00
|
|
|
/** @deprecated */ decreasePendingRequestCount(): number;
|
2016-06-22 17:56:10 -04:00
|
|
|
findProviders(using: any, provider: string, exactMatch: boolean): any[];
|
2017-04-27 14:44:14 -04:00
|
|
|
/** @deprecated */ getPendingRequestCount(): number;
|
|
|
|
/** @deprecated */ increasePendingRequestCount(): number;
|
2016-06-23 21:19:32 -04:00
|
|
|
isStable(): boolean;
|
2017-04-27 14:44:14 -04:00
|
|
|
whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare class TestabilityRegistry {
|
|
|
|
constructor();
|
2017-03-29 12:34:45 -04:00
|
|
|
findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null;
|
2016-06-23 21:19:32 -04:00
|
|
|
getAllRootElements(): any[];
|
|
|
|
getAllTestabilities(): Testability[];
|
2017-03-29 12:34:45 -04:00
|
|
|
getTestability(elem: any): Testability | null;
|
2016-06-23 21:19:32 -04:00
|
|
|
registerApplication(token: any, testability: Testability): void;
|
2017-09-08 14:50:13 -04:00
|
|
|
unregisterAllApplications(): void;
|
|
|
|
unregisterApplication(token: any): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface TrackByFunction<T> {
|
2017-01-25 16:45:06 -05:00
|
|
|
(index: number, item: T): any;
|
|
|
|
}
|
|
|
|
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const TRANSLATIONS: InjectionToken<string>;
|
2016-08-12 17:45:36 -04:00
|
|
|
|
2017-01-03 19:54:46 -05:00
|
|
|
export declare const TRANSLATIONS_FORMAT: InjectionToken<string>;
|
2016-08-12 17:45:36 -04:00
|
|
|
|
2016-09-20 17:14:57 -04:00
|
|
|
export declare const Type: FunctionConstructor;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface TypeDecorator {
|
2016-06-23 21:19:32 -04:00
|
|
|
(target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;
|
2016-08-10 21:21:28 -04:00
|
|
|
<T extends Type<any>>(type: T): T;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface TypeProvider extends Type<any> {
|
2016-08-15 22:37:42 -04:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ValueProvider extends ValueSansProvider {
|
2016-08-15 22:37:42 -04:00
|
|
|
multi?: boolean;
|
|
|
|
provide: any;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ValueSansProvider {
|
2019-06-10 13:04:11 -04:00
|
|
|
useValue: any;
|
|
|
|
}
|
|
|
|
|
2016-11-30 16:52:08 -05:00
|
|
|
export declare class Version {
|
|
|
|
full: string;
|
2017-02-07 22:27:01 -05:00
|
|
|
readonly major: string;
|
|
|
|
readonly minor: string;
|
|
|
|
readonly patch: string;
|
2016-11-30 16:52:08 -05:00
|
|
|
constructor(full: string);
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare const VERSION: Version;
|
|
|
|
|
2018-11-26 17:44:45 -05:00
|
|
|
export declare type ViewChild = Query;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ViewChildDecorator {
|
2020-06-10 04:07:22 -04:00
|
|
|
(selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2016-09-14 14:51:26 -04:00
|
|
|
read?: any;
|
2019-10-03 15:54:07 -04:00
|
|
|
static?: boolean;
|
2016-09-14 14:51:26 -04:00
|
|
|
}): any;
|
2020-06-10 04:07:22 -04:00
|
|
|
new (selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2016-09-14 14:51:26 -04:00
|
|
|
read?: any;
|
2019-10-03 15:54:07 -04:00
|
|
|
static?: boolean;
|
2016-09-14 14:51:26 -04:00
|
|
|
}): ViewChild;
|
|
|
|
}
|
|
|
|
|
2018-11-26 17:44:45 -05:00
|
|
|
export declare type ViewChildren = Query;
|
2016-06-22 17:56:10 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface ViewChildrenDecorator {
|
2020-06-10 04:07:22 -04:00
|
|
|
(selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2016-09-14 14:51:26 -04:00
|
|
|
read?: any;
|
|
|
|
}): any;
|
2020-06-10 04:07:22 -04:00
|
|
|
new (selector: Type<any> | InjectionToken<unknown> | Function | string, opts?: {
|
2016-09-14 14:51:26 -04:00
|
|
|
read?: any;
|
|
|
|
}): ViewChildren;
|
|
|
|
}
|
|
|
|
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare abstract class ViewContainerRef {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get element(): ElementRef;
|
|
|
|
abstract get injector(): Injector;
|
|
|
|
abstract get length(): number;
|
|
|
|
/** @deprecated */ abstract get parentInjector(): Injector;
|
2016-06-22 17:56:10 -04:00
|
|
|
abstract clear(): void;
|
2017-03-21 11:15:10 -04:00
|
|
|
abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
2016-06-23 21:19:32 -04:00
|
|
|
abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
|
2017-03-29 12:34:45 -04:00
|
|
|
abstract detach(index?: number): ViewRef | null;
|
|
|
|
abstract get(index: number): ViewRef | null;
|
2016-06-22 17:56:10 -04:00
|
|
|
abstract indexOf(viewRef: ViewRef): number;
|
2016-06-23 21:19:32 -04:00
|
|
|
abstract insert(viewRef: ViewRef, index?: number): ViewRef;
|
2016-08-01 14:09:52 -04:00
|
|
|
abstract move(viewRef: ViewRef, currentIndex: number): ViewRef;
|
2016-06-22 17:56:10 -04:00
|
|
|
abstract remove(index?: number): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare enum ViewEncapsulation {
|
|
|
|
Emulated = 0,
|
|
|
|
Native = 1,
|
|
|
|
None = 2,
|
2018-06-25 05:11:22 -04:00
|
|
|
ShadowDom = 3
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2016-11-04 17:40:37 -04:00
|
|
|
export declare abstract class ViewRef extends ChangeDetectorRef {
|
2019-11-09 13:36:22 -05:00
|
|
|
abstract get destroyed(): boolean;
|
2016-11-24 05:32:28 -05:00
|
|
|
abstract destroy(): void;
|
2018-06-25 05:11:22 -04:00
|
|
|
abstract onDestroy(callback: Function): any /** TODO #9100 */;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|
|
|
|
|
2020-04-27 13:58:51 -04:00
|
|
|
/** @deprecated */
|
2016-06-22 17:56:10 -04:00
|
|
|
export declare class WrappedValue {
|
2017-12-13 18:54:43 -05:00
|
|
|
/** @deprecated */ wrapped: any;
|
|
|
|
constructor(value: any);
|
|
|
|
static isWrapped(value: any): value is WrappedValue;
|
|
|
|
static unwrap(value: any): any;
|
2016-06-22 17:56:10 -04:00
|
|
|
static wrap(value: any): WrappedValue;
|
|
|
|
}
|