fix: public api surface fixes + stability markers

- ts-api-guardian will now error if a new public symbol is added with a stability marker (`@stable`, `@experimental`, `@deprecated`)
- DomEventsPlugin and KeyEventsPlugin were removed from public api surface - these classes is an implementation detail
- deprecated BROWSER_PROVIDERS was removed completely
- `@angular/compiler` was removed from the ts-api-guardian check since this package shouldn't contain anything that users need to directly import
- the rest of the api surface was conservatively marked as stable or experimental

BREAKING CHANGES: DomEventsPlugin and KeyEventsPlugin previously exported from core are no longer public - these classes are implementation detail.

Previously deprecated BROWSER_PROVIDERS was completely removed from platform-browser.

Closes #9236
Closes #9235
Ref #9234
This commit is contained in:
Igor Minar 2016-06-27 12:27:23 -07:00
parent fcfddbf79c
commit 24eb8389d2
102 changed files with 685 additions and 103 deletions

View File

@ -32,8 +32,10 @@ const entrypoints = [
'dist/packages-dist/core/testing.d.ts',
'dist/packages-dist/common/index.d.ts',
'dist/packages-dist/common/testing.d.ts',
'dist/packages-dist/compiler/index.d.ts',
'dist/packages-dist/compiler/testing.d.ts',
// The API surface of the compiler is currently unstable - all of the important APIs are exposed
// via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead.
//'dist/packages-dist/compiler/index.d.ts',
//'dist/packages-dist/compiler/testing.d.ts',
'dist/packages-dist/upgrade/index.d.ts',
'dist/packages-dist/platform-browser/index.d.ts',
'dist/packages-dist/platform-browser/testing.d.ts',
@ -54,7 +56,7 @@ const publicApiArgs = [
'--allowModuleIdentifiers', 'jasmine',
'--allowModuleIdentifiers', 'protractor',
'--allowModuleIdentifiers', 'angular',
'--onStabilityMissing', 'warn'
'--onStabilityMissing', 'error'
].concat(entrypoints);
// Note that these two commands work on built d.ts files instead of the source

View File

@ -30,6 +30,8 @@ import {NG_VALIDATORS, Validators} from '../validators';
* }
* }
* ```
*
* @experimental
*/
export interface Validator { validate(c: AbstractControl): {[key: string]: any}; }

View File

@ -53,8 +53,11 @@ export abstract class PlatformLocation {
/**
* A serializable version of the event from onPopState or onHashChange
*
* @stable
* @experimental
*/
export interface UrlChangeEvent { type: string; }
/**
* @experimental
*/
export interface UrlChangeListener { (e: UrlChangeEvent): any; }

View File

@ -15,6 +15,8 @@ import {LocationStrategy} from '../src/location/location_strategy';
/**
* A spy for {@link Location} that allows tests to fire simulated location events.
*
* @experimental
*/
@Injectable()
export class SpyLocation implements Location {

View File

@ -9,7 +9,7 @@
/**
* @module
* @description
* Starting point to import all public core APIs.
* Entry point from which you should import all public core APIs.
*/
export * from './src/metadata';
export * from './src/util';

View File

@ -75,10 +75,10 @@ export declare namespace __core_private_types__ {
export var ValueUnwrapper: typeof change_detection_util.ValueUnwrapper;
export type RenderDebugInfo = api.RenderDebugInfo;
export var RenderDebugInfo: typeof api.RenderDebugInfo;
export var SecurityContext: typeof security.SecurityContext;
export type SecurityContext = security.SecurityContext;
export var SanitizationService: typeof security.SanitizationService;
export var SecurityContext: typeof security.SecurityContext;
export type SanitizationService = security.SanitizationService;
export var SanitizationService: typeof security.SanitizationService;
export type TemplateRef_<C> = template_ref.TemplateRef_<C>;
export var TemplateRef_: typeof template_ref.TemplateRef_;
export var wtfInit: typeof wtf_init.wtfInit;

View File

@ -9,6 +9,10 @@
import {BaseException} from '../facade/exceptions';
import {scheduleMicroTask} from '../facade/lang';
/**
* @experimental Animation support is experimental.
*/
export abstract class AnimationPlayer {
abstract onDone(fn: Function): void;
abstract play(): void;

View File

@ -7,25 +7,35 @@
*/
import {BaseException} from '../facade/exceptions';
import {NumberWrapper, isArray, isPresent, isString, isStringMap} from '../facade/lang';
import {NumberWrapper, isArray, isPresent, isString} from '../facade/lang';
/**
* @experimental Animation support is experimental.
*/
export const AUTO_STYLE = '*';
/**
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the {@link trigger trigger
* animation function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationEntryMetadata {
constructor(public name: string, public definitions: AnimationStateMetadata[]) {}
}
/**
* @experimental Animation support is experimental.
*/
export abstract class AnimationStateMetadata {}
/**
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the {@link state state animation
* function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationStateDeclarationMetadata extends AnimationStateMetadata {
constructor(public stateNameExpr: string, public styles: AnimationStyleMetadata) { super(); }
@ -35,17 +45,24 @@ export class AnimationStateDeclarationMetadata extends AnimationStateMetadata {
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the
* {@link transition transition animation function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationStateTransitionMetadata extends AnimationStateMetadata {
constructor(public stateChangeExpr: string, public steps: AnimationMetadata) { super(); }
}
/**
* @experimental Animation support is experimental.
*/
export abstract class AnimationMetadata {}
/**
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the {@link keyframes keyframes
* animation function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationKeyframesSequenceMetadata extends AnimationMetadata {
constructor(public steps: AnimationStyleMetadata[]) { super(); }
@ -55,6 +72,8 @@ export class AnimationKeyframesSequenceMetadata extends AnimationMetadata {
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the {@link style style animation
* function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationStyleMetadata extends AnimationMetadata {
constructor(
@ -67,6 +86,8 @@ export class AnimationStyleMetadata extends AnimationMetadata {
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the {@link animate animate
* animation function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationAnimateMetadata extends AnimationMetadata {
constructor(
@ -76,6 +97,9 @@ export class AnimationAnimateMetadata extends AnimationMetadata {
}
}
/**
* @experimental Animation support is experimental.
*/
export abstract class AnimationWithStepsMetadata extends AnimationMetadata {
constructor() { super(); }
get steps(): AnimationMetadata[] { throw new BaseException('NOT IMPLEMENTED: Base Class'); }
@ -85,6 +109,8 @@ export abstract class AnimationWithStepsMetadata extends AnimationMetadata {
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the {@link sequence sequence
* animation function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationSequenceMetadata extends AnimationWithStepsMetadata {
constructor(private _steps: AnimationMetadata[]) { super(); }
@ -95,6 +121,8 @@ export class AnimationSequenceMetadata extends AnimationWithStepsMetadata {
* Metadata representing the entry of animations.
* Instances of this class are provided via the animation DSL when the {@link group group animation
* function} is called.
*
* @experimental Animation support is experimental.
*/
export class AnimationGroupMetadata extends AnimationWithStepsMetadata {
constructor(private _steps: AnimationMetadata[]) { super(); }
@ -150,6 +178,8 @@ export class AnimationGroupMetadata extends AnimationWithStepsMetadata {
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function animate(
timing: string | number, styles: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata =
@ -197,6 +227,8 @@ export function animate(
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function group(steps: AnimationMetadata[]): AnimationGroupMetadata {
return new AnimationGroupMetadata(steps);
@ -238,6 +270,8 @@ export function group(steps: AnimationMetadata[]): AnimationGroupMetadata {
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function sequence(steps: AnimationMetadata[]): AnimationSequenceMetadata {
return new AnimationSequenceMetadata(steps);
@ -287,6 +321,8 @@ export function sequence(steps: AnimationMetadata[]): AnimationSequenceMetadata
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function style(
tokens: string | {[key: string]: string | number} |
@ -362,6 +398,8 @@ export function style(
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function state(
stateNameExpr: string, styles: AnimationStyleMetadata): AnimationStateDeclarationMetadata {
@ -414,6 +452,8 @@ export function state(
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSequenceMetadata {
return new AnimationKeyframesSequenceMetadata(steps);
@ -504,6 +544,8 @@ export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSe
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function transition(stateChangeExpr: string, steps: AnimationMetadata | AnimationMetadata[]):
AnimationStateTransitionMetadata {
@ -565,6 +607,8 @@ export function transition(stateChangeExpr: string, steps: AnimationMetadata | A
* ### Example ([live demo](http://plnkr.co/edit/Kez8XGWBxWue7qP7nNvF?p=preview))
*
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
*
* @experimental Animation support is experimental.
*/
export function trigger(name: string, animation: AnimationMetadata[]): AnimationEntryMetadata {
return new AnimationEntryMetadata(name, animation);

View File

@ -41,7 +41,8 @@ var _inPlatformCreate: boolean = false;
* One important assertion this disables verifies that a change detection pass
* does not result in additional changes to any bindings (also known as
* unidirectional data flow).
* @stable
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function enableProdMode(): void {
if (_runModeLocked) {
@ -56,6 +57,8 @@ export function enableProdMode(): void {
* This can only be read after `lockRunMode` has been called.
*
* By default, this is true, unless a user calls `enableProdMode`.
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function isDevMode(): boolean {
if (!_runModeLocked) {
@ -68,6 +71,8 @@ export function isDevMode(): boolean {
* Locks the run mode of Angular. After this has been called,
* it can't be changed any more. I.e. `isDevMode()` will always
* return the same value.
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function lockRunMode(): void {
_runModeLocked = true;
@ -76,7 +81,8 @@ export function lockRunMode(): void {
/**
* Creates a platform.
* Platforms have to be eagerly created via this function.
* @experimental
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function createPlatform(injector: Injector): PlatformRef {
if (_inPlatformCreate) {
@ -99,7 +105,8 @@ export function createPlatform(injector: Injector): PlatformRef {
/**
* Checks that there currently is a platform
* which contains the given token as a provider.
* @experimental
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function assertPlatform(requiredToken: any): PlatformRef {
var platform = getPlatform();
@ -115,7 +122,8 @@ export function assertPlatform(requiredToken: any): PlatformRef {
/**
* Dispose the existing platform.
* @experimental
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function disposePlatform(): void {
if (isPresent(_platform) && !_platform.disposed) {
@ -125,7 +133,8 @@ export function disposePlatform(): void {
/**
* Returns the current platform.
* @experimental
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function getPlatform(): PlatformRef {
return isPresent(_platform) && !_platform.disposed ? _platform : null;
@ -134,7 +143,8 @@ export function getPlatform(): PlatformRef {
/**
* Shortcut for ApplicationRef.bootstrap.
* Requires a platform to be created first.
* @experimental
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function coreBootstrap<C>(
componentFactory: ComponentFactory<C>, injector: Injector): ComponentRef<C> {
@ -146,7 +156,8 @@ export function coreBootstrap<C>(
* Resolves the componentFactory for the given component,
* waits for asynchronous initializers and bootstraps the component.
* Requires a platform to be created first.
* @experimental
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export function coreLoadAndBootstrap(
componentType: Type, injector: Injector): Promise<ComponentRef<any>> {
@ -166,7 +177,8 @@ export function coreLoadAndBootstrap(
*
* A page's platform is initialized implicitly when {@link bootstrap}() is called, or
* explicitly by calling {@link createPlatform}().
* @stable
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export abstract class PlatformRef {
/**
@ -228,7 +240,8 @@ export class PlatformRef_ extends PlatformRef {
* A reference to an Angular application running on a page.
*
* For more about Angular applications, see the documentation for {@link bootstrap}.
* @stable
*
* @experimental APIs related to application bootstrap are currently under review.
*/
export abstract class ApplicationRef {
/**

View File

@ -25,14 +25,18 @@ export interface IterableDiffer {
}
/**
* An optional function passed into {@link NgFor} that defines how to track
* items in an iterable (e.g. by index or id)
* An optional function passed into {@link NgFor} that defines how to track
* items in an iterable (e.g. by index or id)
*
* @stable
*/
export interface TrackByFn { (index: number, item: any): any; }
/**
* Provides a factory for {@link IterableDiffer}.
*
* @stable
*/
export interface IterableDifferFactory {
supports(objects: any): boolean;

View File

@ -15,6 +15,8 @@ import {ChangeDetectorRef} from '../change_detector_ref';
/**
* A differ that tracks changes made to an object over time.
*
* @stable
*/
export interface KeyValueDiffer {
diff(object: any): any /** TODO #9100 */;
@ -23,6 +25,8 @@ export interface KeyValueDiffer {
/**
* Provides a factory for {@link KeyValueDiffer}.
*
* @stable
*/
export interface KeyValueDifferFactory {
supports(objects: any): boolean;

View File

@ -33,5 +33,6 @@
*
* Invoking `{{ 'ok' | repeat:3 }}` in a template produces `okokok`.
*
* @stable
*/
export interface PipeTransform { transform(value: any, ...args: any[]): any; }

View File

@ -14,7 +14,7 @@ import {RenderDebugInfo} from '../render/api';
export class EventListener { constructor(public name: string, public callback: Function){}; }
/**
* @experimental
* @experimental All debugging apis are currently experimental.
*/
export class DebugNode {
nativeNode: any;
@ -58,7 +58,7 @@ export class DebugNode {
}
/**
* @experimental
* @experimental All debugging apis are currently experimental.
*/
export class DebugElement extends DebugNode {
name: string;

View File

@ -15,6 +15,7 @@ import {Type, isFunction, stringify} from '../facade/lang';
* ### Example
*
* {@example core/di/ts/forward_ref/forward_ref.ts region='forward_ref_fn'}
* @experimental
*/
export interface ForwardRefFn { (): any; }

View File

@ -355,6 +355,8 @@ export class ReflectiveInjectorDynamicStrategy implements ReflectiveInjectorStra
*
* Notice, we don't use the `new` operator because we explicitly want to have the `Injector`
* resolve all of the object's dependencies automatically.
*
* @stable
*/
export abstract class ReflectiveInjector implements Injector {
/**

View File

@ -47,6 +47,8 @@ const _EMPTY_LIST: any[] /** TODO #9100 */ = /*@ts2dart_const*/[];
*
* expect(injector.get('message')).toEqual('Hello');
* ```
*
* @experimental
*/
export interface ResolvedReflectiveProvider {
/**

View File

@ -86,6 +86,10 @@ export class ComponentRef_<C> extends ComponentRef<C> {
* @ts2dart_const
*/
const EMPTY_CONTEXT = /*@ts2dart_const*/ new Object();
/**
* @stable
*/
export class ComponentFactory<C> {
constructor(
public selector: string, private _viewFactory: Function, private _componentType: Type) {}

View File

@ -12,6 +12,10 @@ import {ClassWithConstructor, stringify} from '../facade/lang';
import {ComponentFactory} from './component_factory';
/**
* @stable
*/
export class NoComponentFactoryError extends BaseException {
constructor(public component: Function) {
super(`No component factory found for ${stringify(component)}`);
@ -24,6 +28,9 @@ class _NullComponentFactoryResolver implements ComponentFactoryResolver {
}
}
/**
* @stable
*/
export abstract class ComponentFactoryResolver {
static NULL: ComponentFactoryResolver = new _NullComponentFactoryResolver();
abstract resolveComponentFactory<T>(component: ClassWithConstructor<T>): ComponentFactory<T>;

View File

@ -11,6 +11,8 @@
*
* An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
* element.
*
* @stable
*/
// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
// i.e. users have to ask for what they need. With that, we can build better analysis tools

View File

@ -30,6 +30,8 @@ import {Type} from '../src/facade/lang';
* Interface for the {@link DirectiveMetadata} decorator function.
*
* See {@link DirectiveFactory}.
*
* @stable
*/
export interface DirectiveDecorator extends TypeDecorator {}
@ -37,6 +39,8 @@ export interface DirectiveDecorator extends TypeDecorator {}
* Interface for the {@link ComponentMetadata} decorator function.
*
* See {@link ComponentFactory}.
*
* @stable
*/
export interface ComponentDecorator extends TypeDecorator {
/**
@ -59,6 +63,8 @@ export interface ComponentDecorator extends TypeDecorator {
* Interface for the {@link ViewMetadata} decorator function.
*
* See {@link ViewFactory}.
*
* @experimental
*/
export interface ViewDecorator extends TypeDecorator {
/**
@ -107,6 +113,8 @@ export interface ViewDecorator extends TypeDecorator {
* new ng.Directive({...})
* ]
* ```
*
* @stable
*/
export interface DirectiveMetadataFactory {
(obj: {
@ -163,6 +171,8 @@ export interface DirectiveMetadataFactory {
* new ng.Component({...})
* ]
* ```
*
* @stable
*/
export interface ComponentMetadataFactory {
(obj: {
@ -256,6 +266,8 @@ export interface ComponentMetadataFactory {
* new ng.View({...})
* ]
* ```
*
* @experimental You should most likely use ComponentMetadataFactory instead
*/
export interface ViewMetadataFactory {
(obj: {
@ -315,6 +327,8 @@ export interface ViewMetadataFactory {
* [new ng.Attribute('title')]
* ]
* ```
*
* @stable
*/
export interface AttributeMetadataFactory {
(name: string): TypeDecorator;

View File

@ -72,6 +72,8 @@ export var VIEW_ENCAPSULATION_VALUES =
* }
* ```
* @ts2dart_const
*
* @experimental You should most likely be using ComponentMetadata instead.
*/
export class ViewMetadata {
/**

View File

@ -10,6 +10,8 @@ import {global} from '../facade/lang';
/**
* A scope function for the Web Tracing Framework (WTF).
*
* @experimental
*/
export interface WtfScopeFn { (arg0?: any, arg1?: any): any; }

View File

@ -12,6 +12,8 @@
* handled.
*
* See DomSanitizationService for more details on security in Angular applications.
*
* @stable
*/
export enum SecurityContext {
NONE,
@ -25,6 +27,8 @@ export enum SecurityContext {
/**
* SanitizationService is used by the views to sanitize potentially dangerous values. This is a
* private API, use code should only refer to DomSanitizationService.
*
* @stable
*/
export abstract class SanitizationService {
abstract sanitize(context: SecurityContext, value: string): string;

View File

@ -138,6 +138,9 @@ export class TestabilityRegistry {
/**
* Adapter interface for retrieving the `Testability` service associated for a
* particular context.
*
* @experimental Testability apis are primarily intended to be used by e2e test tool vendors like
* the Protractor team.
*/
export interface GetTestability {
addToWindow(registry: TestabilityRegistry): void;

View File

@ -12,6 +12,8 @@ var _nextClassId = 0;
/**
* Declares the interface to be used with {@link Class}.
*
* @stable
*/
export interface ClassDefinition {
/**
@ -58,6 +60,7 @@ export interface ClassDefinition {
* @ng.View({...})
* class MyClass {...}
* ```
* @stable
*/
export interface TypeDecorator {
/**

View File

@ -15,8 +15,8 @@ import {CompilerConfig} from '@angular/compiler';
import {Component, ViewMetadata} from '@angular/core/src/metadata';
import {IS_DART} from '../../src/facade/lang';
import {el} from '@angular/platform-browser/testing/browser_util';
import {DomSanitizationService} from '@angular/platform-browser/src/security/dom_sanitization_service';
import {DomSanitizationService} from '@angular/platform-browser';
const ANCHOR_ELEMENT = /*@ts2dart_const*/ new OpaqueToken('AnchorElement');

View File

@ -24,6 +24,8 @@ var _global = <any>(typeof window === 'undefined' ? global : window);
* })
* });
* ```
*
* @stable
*/
export function async(fn: Function): (done: any) => any {
// If we're running using the Jasmine test framework, adapt to call the 'done'

View File

@ -16,6 +16,8 @@ import {tick} from './fake_async';
/**
* Fixture for debugging and testing a component.
*
* @stable
*/
export class ComponentFixture<T> {
/**

View File

@ -25,6 +25,8 @@ let _FakeAsyncTestZoneSpecType = (Zone as any /** TODO #9100 */)['FakeAsyncTestZ
*
* @param fn
* @returns {Function} The function wrapped to be executed in the fakeAsync zone
*
* @experimental
*/
export function fakeAsync(fn: Function): (...args: any[]) => any {
if (Zone.current.get('FakeAsyncTestZoneSpec') != null) {
@ -73,6 +75,7 @@ function _getFakeAsyncZoneSpec(): any {
*
* {@example testing/ts/fake_async.ts region='basic'}
*
* @experimental
*/
export function tick(millis: number = 0): void {
_getFakeAsyncZoneSpec().tick(millis);
@ -80,6 +83,8 @@ export function tick(millis: number = 0): void {
/**
* Discard all remaining periodic tasks.
*
* @experimental
*/
export function discardPeriodicTasks(): void {
let zoneSpec = _getFakeAsyncZoneSpec();
@ -89,6 +94,8 @@ export function discardPeriodicTasks(): void {
/**
* Flush any pending microtasks.
*
* @experimental
*/
export function flushMicrotasks(): void {
_getFakeAsyncZoneSpec().flushMicrotasks();

View File

@ -16,18 +16,28 @@ import {tick} from './fake_async';
/**
* An abstract class for inserting the root test component element in a platform independent way.
*
* @experimental
*/
export class TestComponentRenderer {
insertRootElement(rootElementId: string) {}
}
/**
* @experimental
*/
export var ComponentFixtureAutoDetect = new OpaqueToken('ComponentFixtureAutoDetect');
/**
* @experimental
*/
export var ComponentFixtureNoNgZone = new OpaqueToken('ComponentFixtureNoNgZone');
var _nextRootElementId = 0;
/**
* Builds a ComponentFixture for use in component level tests.
* @stable
*/
@Injectable()
export class TestComponentBuilder {

View File

@ -13,6 +13,9 @@ import {BaseException} from '../src/facade/exceptions';
import {FunctionWrapper, isPresent} from '../src/facade/lang';
import {AsyncTestCompleter} from './async_test_completer';
/**
* @experimental
*/
export class TestInjector {
private _instantiated: boolean = false;
@ -64,6 +67,9 @@ export class TestInjector {
var _testInjector: TestInjector = null;
/**
* @experimental
*/
export function getTestInjector() {
if (_testInjector == null) {
_testInjector = new TestInjector();
@ -81,6 +87,8 @@ export function getTestInjector() {
*
* Test Providers for individual platforms are available from
* 'angular2/platform/testing/<platform_name>'.
*
* @experimental
*/
export function setBaseTestProviders(
platformProviders: Array<Type|Provider|any[]>,
@ -101,6 +109,8 @@ export function setBaseTestProviders(
/**
* Reset the providers for the test injector.
*
* @experimental
*/
export function resetBaseTestProviders() {
var testInjector = getTestInjector();
@ -131,6 +141,7 @@ export function resetBaseTestProviders() {
* eventually
* becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });`
*
* @stable
*/
export function inject(tokens: any[], fn: Function): () => any {
let testInjector = getTestInjector();
@ -148,6 +159,9 @@ export function inject(tokens: any[], fn: Function): () => any {
}
}
/**
* @experimental
*/
export class InjectSetupWrapper {
constructor(private _providers: () => any) {}
@ -166,6 +180,9 @@ export class InjectSetupWrapper {
}
}
/**
* @experimental
*/
export function withProviders(providers: () => any) {
return new InjectSetupWrapper(providers);
}

View File

@ -117,6 +117,8 @@ if (_global.beforeEach) {
/**
* Allows overriding default providers of the test injector,
* which are defined in test_injector.js
*
* @stable
*/
export function addProviders(providers: Array<any>): void {
if (!providers) return;

View File

@ -7,7 +7,6 @@
*/
import {Component} from '@angular/core';
import {ELEMENT_PROBE_PROVIDERS} from '@angular/platform-browser';
import {bootstrap} from '@angular/platform-browser-dynamic';
@Component({selector: 'my-component'})
@ -15,5 +14,5 @@ class MyAppComponent {
}
// #docregion providers
bootstrap(MyAppComponent, [ELEMENT_PROBE_PROVIDERS]);
bootstrap(MyAppComponent);
// #enddocregion

View File

@ -59,6 +59,9 @@ var _global: BrowserNodeGlobal = globalScope;
export {_global as global};
/**
* @stable
*/
export var Type = Function;
/**
@ -66,6 +69,8 @@ export var Type = Function;
*
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
* the `MyCustomComponent` constructor function.
*
* @stable
*/
export interface Type extends Function {}

View File

@ -73,7 +73,10 @@ export const FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/[
RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator
];
/**
* @experimental
*/
export const REACTIVE_FORM_DIRECTIVES: Type[] =
/*@ts2dart_const*/[
FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName
];
];

View File

@ -30,6 +30,8 @@ import {NG_VALIDATORS, Validators} from '../validators';
* }
* }
* ```
*
* @experimental
*/
export interface Validator { validate(c: AbstractControl): {[key: string]: any}; }
@ -60,7 +62,14 @@ export const REQUIRED_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/
export class RequiredValidator {
}
/**
* @experimental
*/
export interface ValidatorFn { (c: AbstractControl): {[key: string]: any}; }
/**
* @experimental
*/
export interface AsyncValidatorFn {
(c: AbstractControl): any /*Promise<{[key: string]: any}>|Observable<{[key: string]: any}>*/;
}

View File

@ -18,7 +18,7 @@ import {FormBuilder as NewFormBuilder} from './form_builder';
/*
/**
* Shorthand set of providers used for building Angular forms.
*
* ### Example
@ -43,6 +43,10 @@ function flatten(platformDirectives: any[]): any[] {
return flattenedDirectives;
}
/**
* @experimental
*/
export function disableDeprecatedForms(): any[] {
return [{
provide: CompilerConfig,
@ -55,6 +59,9 @@ export function disableDeprecatedForms(): any[] {
}];
}
/**
* @experimental
*/
export function provideForms(): any[] {
return [
{provide: PLATFORM_DIRECTIVES, useValue: NEW_FORM_DIRECTIVES, multi: true}, FORM_PROVIDERS

View File

@ -179,6 +179,8 @@ export {URLSearchParams} from './src/url_search_params';
* useValue: new CookieXSRFStrategy('MY-XSRF-COOKIE-NAME', 'X-MY-XSRF-HEADER-NAME')}])
* .catch(err => console.error(err));
* ```
*
* @experimental
*/
export const HTTP_PROVIDERS: any[] = [
// TODO(pascal): use factory type annotations once supported in DI
@ -191,6 +193,10 @@ export const HTTP_PROVIDERS: any[] = [
{provide: XSRFStrategy, useValue: new CookieXSRFStrategy()},
];
/**
* @experimental
*/
export function httpFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions): Http {
return new Http(xhrBackend, requestOptions);
}
@ -308,6 +314,8 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
* }
* });
* ```
*
* @experimental
*/
export const JSONP_PROVIDERS: any[] = [
// TODO(pascal): use factory type annotations once supported in DI

View File

@ -12,6 +12,8 @@ import {Injectable} from '@angular/core';
* A backend for http that uses the `XMLHttpRequest` browser API.
*
* Take care not to evaluate this in non-browser contexts.
*
* @experimental
*/
@Injectable()
export class BrowserXhr {

View File

@ -25,6 +25,8 @@ const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.';
/**
* Abstract base class for an in-flight JSONP request.
*
* @experimental
*/
export abstract class JSONPConnection implements Connection {
/**
@ -143,6 +145,8 @@ export class JSONPConnection_ extends JSONPConnection {
/**
* A {@link ConnectionBackend} that uses the JSONP strategy of making requests.
*
* @experimental
*/
export abstract class JSONPBackend extends ConnectionBackend {}

View File

@ -31,6 +31,8 @@ const XSSI_PREFIX = /^\)\]\}',?\n/;
*
* This class would typically not be created or interacted with directly inside applications, though
* the {@link MockConnection} may be interacted with in tests.
*
* @experimental
*/
export class XHRConnection implements Connection {
request: Request;
@ -156,6 +158,8 @@ export class XHRConnection implements Connection {
* Applications can configure custom cookie and header names by binding an instance of this class
* with different `cookieName` and `headerName` values. See the main HTTP documentation for more
* details.
*
* @experimental
*/
export class CookieXSRFStrategy implements XSRFStrategy {
constructor(
@ -193,7 +197,8 @@ export class CookieXSRFStrategy implements XSRFStrategy {
* }
* }
* ```
**/
* @experimental
*/
@Injectable()
export class XHRBackend implements ConnectionBackend {
constructor(

View File

@ -40,6 +40,8 @@ import {URLSearchParams} from './url_search_params';
* console.log('req.method:', RequestMethod[req.method]); // Post
* console.log('options.url:', options.url); // https://google.com
* ```
*
* @experimental
*/
export class RequestOptions {
/**
@ -164,6 +166,8 @@ export class RequestOptions {
* console.log('options.url:', options.url); // null
* console.log('req.url:', req.url); // https://google.com
* ```
*
* @experimental
*/
@Injectable()
export class BaseRequestOptions extends RequestOptions {

View File

@ -40,6 +40,8 @@ import {ResponseOptionsArgs} from './interfaces';
*
* console.log('res.json():', res.json()); // Object {name: "Jeff"}
* ```
*
* @experimental
*/
export class ResponseOptions {
// TODO: ArrayBuffer | FormData | Blob
@ -155,6 +157,8 @@ export class ResponseOptions {
* console.log('res.headers.get("framework"):', res.headers.get('framework')); // angular
* console.log('res.text():', res.text()); // Angular;
* ```
*
* @experimental
*/
@Injectable()
export class BaseResponseOptions extends ResponseOptions {

View File

@ -8,6 +8,7 @@
/**
* Supported http methods.
* @experimental
*/
export enum RequestMethod {
Get,
@ -23,6 +24,7 @@ export enum RequestMethod {
* All possible states in which a connection can be, based on
* [States](http://www.w3.org/TR/XMLHttpRequest/#states) from the `XMLHttpRequest` spec, but with an
* additional "CANCELLED" state.
* @experimental
*/
export enum ReadyState {
Unsent,
@ -36,6 +38,7 @@ export enum ReadyState {
/**
* Acceptable response types to be associated with a {@link Response}, based on
* [ResponseType](https://fetch.spec.whatwg.org/#responsetype) from the Fetch spec.
* @experimental
*/
export enum ResponseType {
Basic,
@ -47,6 +50,7 @@ export enum ResponseType {
/**
* Supported content type to be automatically associated with a {@link Request}.
* @experimental
*/
export enum ContentType {
NONE,

View File

@ -36,6 +36,8 @@ import {isListLikeIterable, iterateListLike, Map, MapWrapper, StringMapWrapper,
* var thirdHeaders = new Headers(secondHeaders);
* console.log(thirdHeaders.get('X-My-Custom-Header')); //'Angular'
* ```
*
* @experimental
*/
export class Headers {
/** @internal */

View File

@ -103,7 +103,8 @@ function mergeOptions(
* http.get('request-from-mock-backend.json').subscribe((res:Response) => doSomething(res));
* ```
*
**/
* @experimental
*/
@Injectable()
export class Http {
constructor(protected _backend: ConnectionBackend, protected _defaultOptions: RequestOptions) {}
@ -186,6 +187,10 @@ export class Http {
}
}
/**
* @experimental
*/
@Injectable()
export class Jsonp extends Http {
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions) {

View File

@ -16,11 +16,15 @@ import {URLSearchParams} from './url_search_params';
*
* The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given
* {@link Request}.
*
* @experimental
*/
export abstract class ConnectionBackend { abstract createConnection(request: any): Connection; }
/**
* Abstract class from which real connections are derived.
*
* @experimental
*/
export abstract class Connection {
readyState: ReadyState;
@ -28,12 +32,18 @@ export abstract class Connection {
response: any; // TODO: generic of <Response>;
}
/** An XSRFStrategy configures XSRF protection (e.g. via headers) on an HTTP request. */
/**
* An XSRFStrategy configures XSRF protection (e.g. via headers) on an HTTP request.
*
* @experimental
*/
export abstract class XSRFStrategy { abstract configureRequest(req: Request): void; }
/**
* Interface for options to construct a RequestOptions, based on
* [RequestInit](https://fetch.spec.whatwg.org/#requestinit) from the Fetch spec.
*
* @experimental
*/
export interface RequestOptionsArgs {
url?: string;
@ -52,6 +62,8 @@ export interface RequestArgs extends RequestOptionsArgs { url: string; }
/**
* Interface for options to construct a Response, based on
* [ResponseInit](https://fetch.spec.whatwg.org/#responseinit) from the Fetch spec.
*
* @experimental
*/
export type ResponseOptionsArgs = {
// TODO: Support Blob, ArrayBuffer, JSON

View File

@ -52,6 +52,8 @@ import {URLSearchParams} from './url_search_params';
* console.log('people', res.json());
* });
* ```
*
* @experimental
*/
export class Request {
/**

View File

@ -32,6 +32,8 @@ import {isJsObject} from './http_utils';
* Spec](https://fetch.spec.whatwg.org/#response-class), but is considered a static value whose body
* can be accessed many times. There are other differences in the implementation, but this is the
* most significant.
*
* @experimental
*/
export class Response {
/**

View File

@ -32,6 +32,8 @@ function paramParser(rawParams: string = ''): Map<string, string[]> {
* - setAll()
* - appendAll()
* - replaceAll()
*
* @experimental
*/
export class URLSearchParams {
paramsMap: Map<string, string[]>;

View File

@ -23,7 +23,8 @@ import {Response} from '../src/static_response';
*
* Mock Connection to represent a {@link Connection} for tests.
*
**/
* @experimental
*/
export class MockConnection implements Connection {
// TODO Name `readyState` should change to be more generic, and states could be made to be more
// descriptive than XHR states.
@ -141,7 +142,9 @@ export class MockConnection implements Connection {
* ```
*
* This method only exists in the mock implementation, not in real Backends.
**/
*
* @experimental
*/
@Injectable()
export class MockBackend implements ConnectionBackend {
/**

View File

@ -18,6 +18,9 @@ import {CachedXHR} from './src/xhr/xhr_cache';
import {XHRImpl} from './src/xhr/xhr_impl';
/**
* @experimental
*/
export const BROWSER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
COMPILER_PROVIDERS, {
provide: CompilerConfig,
@ -32,6 +35,9 @@ export const BROWSER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]
];
/**
* @experimental
*/
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
[{provide: XHR, useClass: CachedXHR}];
@ -104,6 +110,9 @@ export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
* app injector to override default injection behavior.
*
* Returns a `Promise` of {@link ComponentRef}.
*
* @experimental This api cannot be used with the offline compiler and thus is still subject to
* change.
*/
export function bootstrap(
appComponentType: Type,

View File

@ -18,12 +18,16 @@ export * from './private_export_testing'
/**
* Default platform providers for testing.
*
* @stable
*/
export const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
[TEST_BROWSER_PLATFORM_PROVIDERS];
/**
* Default application providers for testing.
*
* @stable
*/
export const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
TEST_BROWSER_APPLICATION_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,

View File

@ -16,6 +16,10 @@ export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES =
r.VIEW_ENCAPSULATION_VALUES;
export type DebugDomRootRenderer = t.DebugDomRootRenderer;
export var DebugDomRootRenderer: typeof t.DebugDomRootRenderer = r.DebugDomRootRenderer;
/**
* @experimental bogus marker to pass the ts-api-guardian's check - this api should be public so
* this line will go away when that happens
*/
export var SecurityContext: typeof t.SecurityContext = r.SecurityContext;
export type SecurityContext = t.SecurityContext;
export var SanitizationService: typeof t.SanitizationService = r.SanitizationService;

View File

@ -10,12 +10,9 @@ export {BrowserPlatformLocation} from './src/browser/location/browser_platform_l
export {Title} from './src/browser/title';
export {disableDebugTools, enableDebugTools} from './src/browser/tools/tools';
export {By} from './src/dom/debug/by';
export {ELEMENT_PROBE_PROVIDERS} from './src/dom/debug/ng_probe';
export {DOCUMENT} from './src/dom/dom_tokens';
export {DomEventsPlugin} from './src/dom/events/dom_events';
export {EVENT_MANAGER_PLUGINS, EventManager} from './src/dom/events/event_manager';
export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './src/dom/events/hammer_gestures';
export {KeyEventsPlugin} from './src/dom/events/key_events';
export {DomSanitizationService, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl, SecurityContext} from './src/security/dom_sanitization_service';
export * from './src/browser';
@ -32,8 +29,3 @@ export * from './src/worker_render';
export * from './src/worker_app';
export * from './private_export';
import {BROWSER_PLATFORM_PROVIDERS} from './src/browser';
/* @deprecated use BROWSER_PLATFORM_PROVIDERS */
export const BROWSER_PROVIDERS: any[] = BROWSER_PLATFORM_PROVIDERS;

View File

@ -6,8 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
import * as ng_proble from './src/dom/debug/ng_probe';
import * as dom_adapter from './src/dom/dom_adapter';
import * as dom_renderer from './src/dom/dom_renderer';
import * as dom_events from './src/dom/events/dom_events';
import * as shared_styles_host from './src/dom/shared_styles_host';
export declare namespace __platform_browser_private_types__ {
@ -23,6 +25,9 @@ export declare namespace __platform_browser_private_types__ {
export var DomSharedStylesHost: typeof shared_styles_host.DomSharedStylesHost;
export type SharedStylesHost = shared_styles_host.SharedStylesHost;
export var SharedStylesHost: typeof shared_styles_host.SharedStylesHost;
export var ELEMENT_PROBE_PROVIDERS: typeof ng_proble.ELEMENT_PROBE_PROVIDERS;
export type DomEventsPlugin = dom_events.DomEventsPlugin;
export var DomEventsPlugin: typeof dom_events.DomEventsPlugin;
}
export var __platform_browser_private__ = {
@ -32,5 +37,7 @@ export var __platform_browser_private__ = {
DomRootRenderer: dom_renderer.DomRootRenderer,
DomRootRenderer_: dom_renderer.DomRootRenderer_,
DomSharedStylesHost: shared_styles_host.DomSharedStylesHost,
SharedStylesHost: shared_styles_host.SharedStylesHost
SharedStylesHost: shared_styles_host.SharedStylesHost,
ELEMENT_PROBE_PROVIDERS: ng_proble.ELEMENT_PROBE_PROVIDERS,
DomEventsPlugin: dom_events.DomEventsPlugin
};

View File

@ -34,6 +34,8 @@ const BROWSER_PLATFORM_MARKER = new OpaqueToken('BrowserPlatformMarker');
* A set of providers to initialize the Angular platform in a web browser.
*
* Used automatically by `bootstrap`, or can be passed to {@link platform}.
*
* @experimental API related to bootstrapping are still under review.
*/
export const BROWSER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
{provide: BROWSER_PLATFORM_MARKER, useValue: true}, PLATFORM_COMMON_PROVIDERS,
@ -41,6 +43,9 @@ export const BROWSER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/>
{provide: PlatformLocation, useClass: BrowserPlatformLocation}
];
/**
* @experimental
*/
export const BROWSER_SANITIZATION_PROVIDERS: Array<any> = [
{provide: SanitizationService, useExisting: DomSanitizationService},
{provide: DomSanitizationService, useClass: DomSanitizationServiceImpl},
@ -50,6 +55,8 @@ export const BROWSER_SANITIZATION_PROVIDERS: Array<any> = [
* A set of providers to initialize an Angular application in a web browser.
*
* Used automatically by `bootstrap`, or can be passed to {@link PlatformRef.application}.
*
* @experimental API related to bootstrapping are still under review.
*/
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
APPLICATION_COMMON_PROVIDERS, FORM_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS,
@ -66,6 +73,9 @@ export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
Testability, EventManager, ELEMENT_PROBE_PROVIDERS
];
/**
* @experimental API related to bootstrapping are still under review.
*/
export function browserPlatform(): PlatformRef {
if (isBlank(getPlatform())) {
createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PLATFORM_PROVIDERS));

View File

@ -20,6 +20,8 @@ import {supportsState} from './history';
* `PlatformLocation` encapsulates all of the direct calls to platform APIs.
* This class should not be used directly by an application developer. Instead, use
* {@link Location}.
*
* @stable
*/
@Injectable()
export class BrowserPlatformLocation extends PlatformLocation {

View File

@ -15,6 +15,8 @@ import 'common_tools.dart' show AngularTools;
* 1. Type `ng.` (usually the console will show auto-complete suggestion)
* 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
* then hit Enter.
*
* @experimental All debugging apis are currently experimental.
*/
void enableDebugTools(ComponentRef<dynamic> ref) {
final tools = new AngularTools(ref);
@ -29,6 +31,8 @@ void enableDebugTools(ComponentRef<dynamic> ref) {
/**
* Disables Angular 2 tools.
*
* @experimental All debugging apis are currently experimental.
*/
void disableDebugTools() {
context.deleteProperty('ng');

View File

@ -23,6 +23,8 @@ var context = <any>global;
* 1. Type `ng.` (usually the console will show auto-complete suggestion)
* 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
* then hit Enter.
*
* @experimental All debugging apis are currently experimental.
*/
export function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T> {
context.ng = new AngularTools(ref);
@ -31,6 +33,8 @@ export function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T> {
/**
* Disables Angular 2 tools.
*
* @experimental All debugging apis are currently experimental.
*/
export function disableDebugTools(): void {
delete context.ng;

View File

@ -16,6 +16,8 @@ import {Type, isPresent} from '../../facade/lang';
/**
* Predicates for use with {@link DebugElement}'s query functions.
*
* @experimental All debugging apis are currently experimental.
*/
export class By {
/**

View File

@ -13,5 +13,7 @@ import {OpaqueToken} from '@angular/core';
*
* Note: Document might not be available in the Application Context when Application and Rendering
* Contexts are not the same (e.g. when running the application into a Web Worker).
*
* @stable
*/
export const DOCUMENT: OpaqueToken = new OpaqueToken('DocumentToken');

View File

@ -12,8 +12,14 @@ import {ListWrapper} from '../../facade/collection';
import {BaseException} from '../../facade/exceptions';
/**
* @stable
*/
export const EVENT_MANAGER_PLUGINS: OpaqueToken = new OpaqueToken('EventManagerPlugins');
/**
* @stable
*/
@Injectable()
export class EventManager {
private _plugins: EventManagerPlugin[];

View File

@ -13,6 +13,12 @@ import {isPresent} from '../../facade/lang';
import {HammerGesturesPluginCommon} from './hammer_common';
/**
* A DI token that you can use to provide{@link HammerGestureConfig} to Angular. Use it to configure
* Hammer gestures.
*
* @experimental
*/
export const HAMMER_GESTURE_CONFIG: OpaqueToken = new OpaqueToken('HammerGestureConfig');
export interface HammerInstance {
@ -20,6 +26,9 @@ export interface HammerInstance {
off(eventName: string, callback: Function): void;
}
/**
* @experimental
*/
@Injectable()
export class HammerGestureConfig {
events: string[] = [];

View File

@ -23,6 +23,10 @@ var modifierKeyGetters: {[key: string]: (event: KeyboardEvent) => boolean} = {
'shift': (event: KeyboardEvent) => event.shiftKey
};
/**
* @experimental
*/
@Injectable()
export class KeyEventsPlugin extends EventManagerPlugin {
constructor() { super(); }

View File

@ -19,17 +19,44 @@ export {SecurityContext};
/**
* Marker interface for a value that's safe to use in a particular context.
*
* @stable
*/
export interface SafeValue {}
/** Marker interface for a value that's safe to use as HTML. */
/**
* Marker interface for a value that's safe to use as HTML.
*
* @stable
*/
export interface SafeHtml extends SafeValue {}
/** Marker interface for a value that's safe to use as style (CSS). */
/**
* Marker interface for a value that's safe to use as style (CSS).
*
* @stable
*/
export interface SafeStyle extends SafeValue {}
/** Marker interface for a value that's safe to use as JavaScript. */
/**
* Marker interface for a value that's safe to use as JavaScript.
*
* @stable
*/
export interface SafeScript extends SafeValue {}
/** Marker interface for a value that's safe to use as a URL linking to a document. */
/**
* Marker interface for a value that's safe to use as a URL linking to a document.
*
* @stable
*/
export interface SafeUrl extends SafeValue {}
/** Marker interface for a value that's safe to use as a URL to load executable code from. */
/**
* Marker interface for a value that's safe to use as a URL to load executable code from.
*
* @stable
*/
export interface SafeResourceUrl extends SafeValue {}
/**
@ -55,6 +82,8 @@ export interface SafeResourceUrl extends SafeValue {}
* It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
* does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
* code. The sanitizer leaves safe values intact.
*
* @stable
*/
export abstract class DomSanitizationService implements SanitizationService {
/**

View File

@ -16,7 +16,7 @@ import {MessageBus} from './message_bus';
import {Serializer} from './serializer';
/**
* @experimental
* @experimental WebWorker support in Angular is experimental.
*/
export abstract class ClientMessageBrokerFactory {
/**
@ -44,7 +44,7 @@ export class ClientMessageBrokerFactory_ extends ClientMessageBrokerFactory {
}
/**
* @experimental
* @experimental WebWorker support in Angular is experimental.
*/
export abstract class ClientMessageBroker {
abstract runOnService(args: UiArguments, returnType: Type): Promise<any>;
@ -163,14 +163,14 @@ class MessageData {
}
/**
* @experimental
* @experimental WebWorker support in Angular is experimental.
*/
export class FnArg {
constructor(public value: any /** TODO #9100 */, public type: Type) {}
}
/**
* @experimental
* @experimental WebWorker support in Angular is experimental.
*/
export class UiArguments {
constructor(public method: string, public args?: FnArg[]) {}

View File

@ -16,7 +16,8 @@ import {EventEmitter} from '../../facade/async';
* Communication is based on a channel abstraction. Messages published in a
* given channel to one MessageBusSink are received on the same channel
* by the corresponding MessageBusSource.
* @experimental
*
* @experimental WebWorker support in Angular is currenlty experimental.
*/
export abstract class MessageBus implements MessageBusSource, MessageBusSink {
/**
@ -51,7 +52,7 @@ export abstract class MessageBus implements MessageBusSource, MessageBusSink {
}
/**
* @experimental
* @experimental WebWorker support in Angular is currenlty experimental.
*/
export interface MessageBusSource {
/**
@ -77,7 +78,7 @@ export interface MessageBusSource {
}
/**
* @experimental
* @experimental WebWorker support in Angular is currenlty experimental.
*/
export interface MessageBusSink {
/**

View File

@ -20,7 +20,7 @@ import {LocationType} from './serialized_types';
// PRIMITIVE is any type that does not need to be serialized (string, number, boolean)
// We set it to String so that it is considered a Type.
/**
* @experimental
* @experimental WebWorker support in Angular is currently experimental.
*/
export const PRIMITIVE: Type = String;

View File

@ -14,6 +14,9 @@ import {FunctionWrapper, Type, isPresent} from '../../facade/lang';
import {MessageBus} from '../shared/message_bus';
import {Serializer} from '../shared/serializer';
/**
* @experimental WebWorker support in Angular is currently experimental.
*/
export abstract class ServiceMessageBrokerFactory {
/**
* Initializes the given channel and attaches a new {@link ServiceMessageBroker} to it.
@ -38,19 +41,18 @@ export class ServiceMessageBrokerFactory_ extends ServiceMessageBrokerFactory {
}
/**
* @experimental
* Helper class for UIComponents that allows components to register methods.
* If a registered method message is received from the broker on the worker,
* the UIMessageBroker deserializes its arguments and calls the registered method.
* If that method returns a promise, the UIMessageBroker returns the result to the worker.
*
* @experimental WebWorker support in Angular is currently experimental.
*/
export abstract class ServiceMessageBroker {
abstract registerMethod(
methodName: string, signature: Type[], method: Function, returnType?: Type): void;
}
/**
* Helper class for UIComponents that allows components to register methods.
* If a registered method message is received from the broker on the worker,
* the UIMessageBroker deserializes its arguments and calls the registered method.
* If that method returns a promise, the UIMessageBroker returns the result to the worker.
*/
export class ServiceMessageBroker_ extends ServiceMessageBroker {
private _sink: EventEmitter<any>;
private _methods: Map<string, Function> = new Map<string, Function>();
@ -100,7 +102,7 @@ export class ServiceMessageBroker_ extends ServiceMessageBroker {
}
/**
* @experimental
* @experimental WebWorker support in Angular is currently experimental.
*/
export class ReceivedMessage {
method: string;

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {APPLICATION_COMMON_PROVIDERS, APP_INITIALIZER, ApplicationRef, ExceptionHandler, Injectable, Injector, NgZone, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, PlatformRef, ReflectiveInjector, RootRenderer, Testability, assertPlatform, createPlatform, getPlatform} from '@angular/core';
import {APPLICATION_COMMON_PROVIDERS, APP_INITIALIZER, ExceptionHandler, Injectable, Injector, NgZone, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, PlatformRef, ReflectiveInjector, RootRenderer, Testability, assertPlatform, createPlatform, getPlatform} from '@angular/core';
import {AnimationDriver, NoOpAnimationDriver, wtfInit} from '../core_private';
@ -37,7 +37,8 @@ const WORKER_RENDER_PLATFORM_MARKER = new OpaqueToken('WorkerRenderPlatformMarke
/**
* Wrapper class that exposes the Worker
* and underlying {@link MessageBus} for lower level message passing.
* @experimental
*
* @experimental WebWorker support is currently experimental.
*/
@Injectable()
export class WebWorkerInstance {
@ -52,7 +53,7 @@ export class WebWorkerInstance {
}
/**
* @experimental
* @experimental WebWorker support is currently experimental.
*/
export const WORKER_SCRIPT: OpaqueToken = new OpaqueToken('WebWorkerScript');
@ -61,13 +62,13 @@ export const WORKER_SCRIPT: OpaqueToken = new OpaqueToken('WebWorkerScript');
* created.
*
* TODO(vicb): create an interface for startable services to implement
* @experimental
* @experimental WebWorker support is currently experimental.
*/
export const WORKER_UI_STARTABLE_MESSAGING_SERVICE =
new OpaqueToken('WorkerRenderStartableMsgService');
/**
* @experimental
* @experimental WebWorker support is currently experimental.
*/
export const WORKER_UI_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
PLATFORM_COMMON_PROVIDERS, {provide: WORKER_RENDER_PLATFORM_MARKER, useValue: true},
@ -75,7 +76,7 @@ export const WORKER_UI_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/
];
/**
* @experimental
* @experimental WebWorker support is currently experimental.
*/
export const WORKER_UI_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
APPLICATION_COMMON_PROVIDERS,
@ -128,7 +129,7 @@ function initWebWorkerRenderPlatform(): void {
}
/**
* @experimental
* @experimental WebWorker support is currently experimental.
*/
export function workerUiPlatform(): PlatformRef {
if (isBlank(getPlatform())) {

View File

@ -44,12 +44,16 @@ function createNgZone(): NgZone {
/**
* Default platform providers for testing.
*
* @stable
*/
export const TEST_BROWSER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
TEST_BROWSER_STATIC_PLATFORM_PROVIDERS;
/**
* Default application providers for testing without a compiler.
*
* @stable
*/
export const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
[BROWSER_APP_PROVIDERS, ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS];

View File

@ -12,6 +12,9 @@ import * as webdriver from 'selenium-webdriver';
declare var browser: any;
declare var expect: any;
/**
* @experimental This API will be moved to Protractor.
*/
export function verifyNoBrowserErrors() {
// TODO(tbosch): Bug in ChromeDriver: Need to execute at least one command
// so that the browser logs can be read out!

View File

@ -20,3 +20,7 @@ export type DomSharedStylesHost = typeof t.DomSharedStylesHost;
export var DomSharedStylesHost: typeof t.DomSharedStylesHost = r.DomSharedStylesHost;
export type SharedStylesHost = typeof t.SharedStylesHost;
export var SharedStylesHost: typeof t.SharedStylesHost = r.SharedStylesHost;
export type ELEMENT_PROBE_PROVIDERS = typeof t.ELEMENT_PROBE_PROVIDERS;
export var ELEMENT_PROBE_PROVIDERS: typeof t.ELEMENT_PROBE_PROVIDERS = r.ELEMENT_PROBE_PROVIDERS;
export type DomEventsPlugin = typeof t.DomEventsPlugin;
export var DomEventsPlugin: typeof t.DomEventsPlugin = r.DomEventsPlugin;

View File

@ -10,21 +10,21 @@ import {COMPILER_PROVIDERS, DirectiveResolver, ViewResolver, XHR} from '@angular
import {MockDirectiveResolver, MockViewResolver, OverridingTestComponentBuilder} from '@angular/compiler/testing';
import {APPLICATION_COMMON_PROVIDERS, APP_ID, NgZone, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, RootRenderer} from '@angular/core';
import {TestComponentBuilder, TestComponentRenderer} from '@angular/core/testing';
import {BROWSER_SANITIZATION_PROVIDERS, DOCUMENT, EVENT_MANAGER_PLUGINS, EventManager} from '@angular/platform-browser';
import {AnimationDriver, NoOpAnimationDriver} from '../core_private';
import {DOMTestComponentRenderer} from '../platform_browser_dynamic_testing_private';
import {DomEventsPlugin, DomRootRenderer, DomRootRenderer_, DomSharedStylesHost, ELEMENT_PROBE_PROVIDERS, SharedStylesHost, getDOM} from '../platform_browser_private';
import {Parse5DomAdapter} from '../src/parse5_adapter';
import {DOCUMENT, BROWSER_SANITIZATION_PROVIDERS, EventManager, EVENT_MANAGER_PLUGINS, ELEMENT_PROBE_PROVIDERS, DomEventsPlugin,} from '@angular/platform-browser';
import {getDOM, DomRootRenderer, DomRootRenderer_, DomSharedStylesHost, SharedStylesHost} from '../platform_browser_private';
import {LocationStrategy} from '@angular/common';
function initServerTests() {
Parse5DomAdapter.makeCurrent();
}
/**
* Default platform providers for testing.
*
* @experimental
*/
export const TEST_SERVER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/[
@ -52,6 +52,8 @@ function createNgZone(): NgZone {
/**
* Default application providers for testing.
*
* @experimental
*/
export const TEST_SERVER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/[

View File

@ -20,4 +20,8 @@ export {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot
export {PRIMARY_OUTLET, Params} from './src/shared';
export {DefaultUrlSerializer, UrlPathWithParams, UrlSerializer, UrlTree} from './src/url_tree';
export const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkActive];
/**
* @experimental
*/
export const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkActive];

View File

@ -18,6 +18,9 @@ import {DefaultUrlSerializer, UrlSerializer} from './url_tree';
export const ROUTER_CONFIG = new OpaqueToken('ROUTER_CONFIG');
export const ROUTER_OPTIONS = new OpaqueToken('ROUTER_OPTIONS');
/**
* @experimental
*/
export interface ExtraOptions { enableTracing?: boolean; }
export function setupRouter(
@ -76,6 +79,8 @@ export function setupRouterInitializer(injector: Injector) {
*
* bootstrap(AppCmp, [provideRouter(router)]);
* ```
*
* @experimental
*/
export function provideRouter(_config: RouterConfig, _opts: ExtraOptions): any[] {
return [

View File

@ -8,14 +8,29 @@
import {Type} from '@angular/core';
/**
* @experimental
*/
export type RouterConfig = Route[];
/**
* @experimental
*/
export type Data = {
[name: string]: any
};
/**
* @experimental
*/
export type ResolveData = {
[name: string]: any
};
/**
* @experimental
*/
export interface Route {
path?: string;
@ -65,4 +80,4 @@ function validateNode(route: Route): void {
throw new Error(
`Invalid route configuration of route '{path: "${route.path}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
}
}
}

View File

@ -11,6 +11,8 @@ import {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state';
/**
* An interface a class can implement to be a guard deciding if a route can be activated.
*
* @experimental
*/
export interface CanActivate {
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot):
@ -19,12 +21,17 @@ export interface CanActivate {
/**
* An interface a class can implement to be a guard deciding if a route can be deactivated.
*
* @experimental
*/
export interface CanDeactivate<T> {
canDeactivate(component: T, route: ActivatedRouteSnapshot, state: RouterStateSnapshot):
Observable<boolean>|boolean;
}
/**
* @experimental
*/
export interface Resolve<T> {
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any>|any;
}
}

View File

@ -43,6 +43,8 @@ export interface NavigationExtras {
/**
* An event triggered when a navigation starts
*
* @experimental
*/
export class NavigationStart {
constructor(public id: number, public url: string) {}
@ -52,6 +54,8 @@ export class NavigationStart {
/**
* An event triggered when a navigation ends successfully
*
* @experimental
*/
export class NavigationEnd {
constructor(public id: number, public url: string, public urlAfterRedirects: string) {}
@ -63,6 +67,8 @@ export class NavigationEnd {
/**
* An event triggered when a navigation is canceled
*
* @experimental
*/
export class NavigationCancel {
constructor(public id: number, public url: string) {}
@ -72,6 +78,8 @@ export class NavigationCancel {
/**
* An event triggered when a navigation fails due to unexpected error
*
* @experimental
*/
export class NavigationError {
constructor(public id: number, public url: string, public error: any) {}
@ -83,6 +91,8 @@ export class NavigationError {
/**
* An event triggered when routes are recognized
*
* @experimental
*/
export class RoutesRecognized {
constructor(
@ -94,10 +104,15 @@ export class RoutesRecognized {
}
}
/**
* @experimental
*/
export type Event = NavigationStart | NavigationEnd | NavigationCancel | NavigationError;
/**
* The `Router` is responsible for mapping URLs to components.
*
* @experimental
*/
export class Router {
private currentUrlTree: UrlTree;
@ -350,9 +365,16 @@ export class Router {
}
}
/**
* @experimental
*/
class CanActivate {
constructor(public route: ActivatedRouteSnapshot) {}
}
/**
* @experimental
*/
class CanDeactivate {
constructor(public component: Object, public route: ActivatedRouteSnapshot) {}
}

View File

@ -8,6 +8,9 @@
import {RouterOutlet} from './directives/router_outlet';
/**
* @experimental
*/
export class RouterOutletMap {
/** @internal */
_outlets: {[name: string]: RouterOutlet} = {};

View File

@ -30,6 +30,8 @@ import {RouterConfig} from './config';
*
* bootstrap(AppCmp, [provideRouter(router)]);
* ```
*
* @experimental
*/
export function provideRouter(config: RouterConfig, opts: ExtraOptions = {}): any[] {
return [

View File

@ -31,6 +31,8 @@ import {Tree, TreeNode} from './utils/tree';
* }
* }
* ```
*
* @experimental
*/
export class RouterState extends Tree<ActivatedRoute> {
/**
@ -85,6 +87,8 @@ function createEmptyStateSnapshot(urlTree: UrlTree, rootComponent: Type): Router
* }
* }
* ```
*
* @experimental
*/
export class ActivatedRoute {
/** @internal */
@ -137,6 +141,8 @@ export class InheritedResolve {
* }
* }
* ```
*
* @experimental
*/
export class ActivatedRouteSnapshot {
/**
@ -188,6 +194,8 @@ export class ActivatedRouteSnapshot {
* }
* }
* ```
*
* @experimental
*/
export class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
/**
@ -227,4 +235,4 @@ export function advanceActivatedRoute(route: ActivatedRoute): void {
route.snapshot = route._futureSnapshot;
(<any>route.data).next(route._futureSnapshot.data);
}
}
}

View File

@ -9,11 +9,15 @@
/**
* Name of the primary outlet.
* @type {string}
*
* @experimental
*/
export const PRIMARY_OUTLET = 'PRIMARY_OUTLET';
/**
* A collection of parameters.
*
* @experimental
*/
export type Params = {
[key: string]: any

View File

@ -62,6 +62,8 @@ function containsSegmentHelper(
/**
* A URL in the tree form.
*
* @experimental
*/
export class UrlTree {
/**
@ -96,6 +98,10 @@ export class UrlSegment {
toString(): string { return serializePaths(this); }
}
/**
* @experimental
*/
export class UrlPathWithParams {
constructor(public path: string, public parameters: {[key: string]: string}) {}
toString(): string { return serializePath(this); }
@ -153,6 +159,8 @@ export function mapChildrenIntoArray<T>(
/**
* Defines a way to serialize/deserialize a url tree.
*
* @experimental
*/
export abstract class UrlSerializer {
/**
@ -168,6 +176,8 @@ export abstract class UrlSerializer {
/**
* A default implementation of the serialization.
*
* @experimental
*/
export class DefaultUrlSerializer implements UrlSerializer {
parse(url: string): UrlTree {
@ -427,4 +437,4 @@ class UrlParser {
return segments;
}
}
}

View File

@ -87,6 +87,8 @@ var upgradeCount: number = 0;
* "ng2[ng1[Hello World!](transclude)](project)");
* });
* ```
*
* @experimental
*/
export class UpgradeAdapter {
/* @internal */
@ -567,6 +569,8 @@ function ng1ComponentDirective(info: ComponentInfo, idPrefix: string): Function
/**
* Use `UgradeAdapterRef` to control a hybrid AngularJS v1 / Angular v2 application.
*
* @experimental
*/
export class UpgradeAdapterRef {
/* @internal */

View File

@ -8,7 +8,8 @@
import {bootstrap} from '@angular/platform-browser-dynamic';
import {Component} from '@angular/core';
import {KeyEventsPlugin} from '@angular/platform-browser';
// TODO: remove deep import by reimplementing the event name serialization
import {KeyEventsPlugin} from "@angular/platform-browser/src/dom/events/key_events";
@Component({
selector: 'key-events-app',

View File

@ -565,15 +565,17 @@ export declare class UpperCasePipe implements PipeTransform {
transform(value: string): string;
}
/** @stable */
/** @experimental */
export interface UrlChangeEvent {
type: string;
}
/** @experimental */
export interface UrlChangeListener {
(e: UrlChangeEvent): any;
}
/** @experimental */
export interface Validator {
validate(c: AbstractControl): {
[key: string]: any;

View File

@ -1,3 +1,4 @@
/** @experimental */
export declare class SpyLocation implements Location {
urlChanges: string[];
back(): void;

View File

@ -25,33 +25,40 @@ export declare abstract class AfterViewInit {
abstract ngAfterViewInit(): any;
}
/** @experimental */
export declare function animate(timing: string | number, styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata): AnimationAnimateMetadata;
/** @experimental */
export declare class AnimationAnimateMetadata extends AnimationMetadata {
styles: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata;
timings: string | number;
constructor(timings: string | number, styles: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata);
}
/** @experimental */
export declare class AnimationEntryMetadata {
definitions: AnimationStateMetadata[];
name: string;
constructor(name: string, definitions: AnimationStateMetadata[]);
}
/** @experimental */
export declare class AnimationGroupMetadata extends AnimationWithStepsMetadata {
steps: AnimationMetadata[];
constructor(_steps: AnimationMetadata[]);
}
/** @experimental */
export declare class AnimationKeyframesSequenceMetadata extends AnimationMetadata {
steps: AnimationStyleMetadata[];
constructor(steps: AnimationStyleMetadata[]);
}
/** @experimental */
export declare abstract class AnimationMetadata {
}
/** @experimental */
export declare abstract class AnimationPlayer {
parentPlayer: AnimationPlayer;
abstract destroy(): void;
@ -65,26 +72,31 @@ export declare abstract class AnimationPlayer {
abstract setPosition(p: any): void;
}
/** @experimental */
export declare class AnimationSequenceMetadata extends AnimationWithStepsMetadata {
steps: AnimationMetadata[];
constructor(_steps: AnimationMetadata[]);
}
/** @experimental */
export declare class AnimationStateDeclarationMetadata extends AnimationStateMetadata {
stateNameExpr: string;
styles: AnimationStyleMetadata;
constructor(stateNameExpr: string, styles: AnimationStyleMetadata);
}
/** @experimental */
export declare abstract class AnimationStateMetadata {
}
/** @experimental */
export declare class AnimationStateTransitionMetadata extends AnimationStateMetadata {
stateChangeExpr: string;
steps: AnimationMetadata;
constructor(stateChangeExpr: string, steps: AnimationMetadata);
}
/** @experimental */
export declare class AnimationStyleMetadata extends AnimationMetadata {
offset: number;
styles: Array<string | {
@ -95,6 +107,7 @@ export declare class AnimationStyleMetadata extends AnimationMetadata {
}>, offset?: number);
}
/** @experimental */
export declare abstract class AnimationWithStepsMetadata extends AnimationMetadata {
steps: AnimationMetadata[];
constructor();
@ -111,7 +124,7 @@ export declare const APPLICATION_COMMON_PROVIDERS: Array<Type | {
[k: string]: any;
} | any[]>;
/** @stable */
/** @experimental */
export declare abstract class ApplicationRef {
componentTypes: Type[];
injector: Injector;
@ -142,11 +155,13 @@ export declare class AttributeMetadata extends DependencyMetadata {
toString(): string;
}
/** @stable */
export interface AttributeMetadataFactory {
(name: string): TypeDecorator;
new (name: string): AttributeMetadata;
}
/** @experimental */
export declare const AUTO_STYLE: string;
/** @stable */
@ -194,6 +209,7 @@ export declare abstract class ChangeDetectorRef {
/** @stable */
export declare function Class(clsDef: ClassDefinition): ConcreteType;
/** @stable */
export interface ClassDefinition {
constructor: Function | any[];
extends?: Type;
@ -213,6 +229,7 @@ export declare class CollectionChangeRecord {
/** @stable */
export declare var Component: ComponentMetadataFactory;
/** @stable */
export interface ComponentDecorator extends TypeDecorator {
View(obj: {
templateUrl?: string;
@ -227,6 +244,7 @@ export interface ComponentDecorator extends TypeDecorator {
}): ViewDecorator;
}
/** @stable */
export declare class ComponentFactory<C> {
componentType: Type;
selector: string;
@ -234,6 +252,7 @@ export declare class ComponentFactory<C> {
create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any): ComponentRef<C>;
}
/** @stable */
export declare abstract class ComponentFactoryResolver {
abstract resolveComponentFactory<T>(component: ClassWithConstructor<T>): ComponentFactory<T>;
static NULL: ComponentFactoryResolver;
@ -282,6 +301,7 @@ export declare class ComponentMetadata extends DirectiveMetadata {
});
}
/** @stable */
export interface ComponentMetadataFactory {
(obj: {
selector?: string;
@ -485,6 +505,7 @@ export declare class DefaultIterableDiffer implements IterableDiffer {
/** @stable */
export declare var Directive: DirectiveMetadataFactory;
/** @stable */
export interface DirectiveDecorator extends TypeDecorator {
}
@ -518,6 +539,7 @@ export declare class DirectiveMetadata extends InjectableMetadata {
});
}
/** @stable */
export interface DirectiveMetadataFactory {
(obj: {
selector?: string;
@ -565,6 +587,7 @@ export declare abstract class DynamicComponentLoader {
abstract loadNextToLocation(type: Type, location: ViewContainerRef, providers?: ResolvedReflectiveProvider[], projectableNodes?: any[][]): Promise<ComponentRef<any>>;
}
/** @stable */
export declare class ElementRef {
/** @stable */ nativeElement: any;
constructor(nativeElement: any);
@ -577,7 +600,7 @@ export declare abstract class EmbeddedViewRef<C> extends ViewRef {
abstract destroy(): any;
}
/** @stable */
/** @experimental */
export declare function enableProdMode(): void;
/** @stable */
@ -604,6 +627,7 @@ export declare class ExpressionChangedAfterItHasBeenCheckedException extends Bas
/** @experimental */
export declare function forwardRef(forwardRefFn: ForwardRefFn): Type;
/** @experimental */
export interface ForwardRefFn {
(): any;
}
@ -614,11 +638,13 @@ export declare function getDebugNode(nativeNode: any): DebugNode;
/** @experimental */
export declare function getPlatform(): PlatformRef;
/** @experimental */
export interface GetTestability {
addToWindow(registry: TestabilityRegistry): void;
findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability;
}
/** @experimental */
export declare function group(steps: AnimationMetadata[]): AnimationGroupMetadata;
/** @stable */
@ -732,6 +758,7 @@ export declare class InvalidProviderError extends BaseException {
constructor(provider: any);
}
/** @experimental */
export declare function isDevMode(): boolean;
/** @stable */
@ -740,6 +767,7 @@ export interface IterableDiffer {
onDestroy(): any;
}
/** @stable */
export interface IterableDifferFactory {
create(cdRef: ChangeDetectorRef, trackByFn?: TrackByFn): IterableDiffer;
supports(objects: any): boolean;
@ -754,6 +782,7 @@ export declare class IterableDiffers {
static extend(factories: IterableDifferFactory[]): Provider;
}
/** @experimental */
export declare function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSequenceMetadata;
/** @stable */
@ -765,11 +794,13 @@ export declare class KeyValueChangeRecord {
toString(): string;
}
/** @stable */
export interface KeyValueDiffer {
diff(object: any): any;
onDestroy(): any;
}
/** @stable */
export interface KeyValueDifferFactory {
create(cdRef: ChangeDetectorRef): KeyValueDiffer;
supports(objects: any): boolean;
@ -784,6 +815,7 @@ export declare class KeyValueDiffers {
static extend(factories: KeyValueDifferFactory[]): Provider;
}
/** @experimental */
export declare function lockRunMode(): void;
/** @experimental */
@ -818,6 +850,7 @@ export declare class NoAnnotationError extends BaseException {
constructor(typeOrFunc: any, params: any[][]);
}
/** @stable */
export declare class NoComponentFactoryError extends BaseException {
component: Function;
constructor(component: Function);
@ -911,6 +944,7 @@ export interface PipeMetadataFactory {
}): any;
}
/** @stable */
export interface PipeTransform {
transform(value: any, ...args: any[]): any;
}
@ -927,7 +961,7 @@ export declare const PLATFORM_INITIALIZER: any;
/** @stable */
export declare const PLATFORM_PIPES: OpaqueToken;
/** @stable */
/** @experimental */
export declare abstract class PlatformRef {
disposed: boolean;
injector: Injector;
@ -1025,6 +1059,7 @@ export interface QueryMetadataFactory {
}): QueryMetadata;
}
/** @stable */
export declare abstract class ReflectiveInjector implements Injector {
parent: Injector;
createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
@ -1100,6 +1135,7 @@ export declare class ResolvedReflectiveFactory {
dependencies: ReflectiveDependency[]);
}
/** @experimental */
export interface ResolvedReflectiveProvider {
key: ReflectiveKey;
multiProvider: boolean;
@ -1128,6 +1164,7 @@ export interface SelfMetadataFactory {
new (): SelfMetadata;
}
/** @experimental */
export declare function sequence(steps: AnimationMetadata[]): AnimationSequenceMetadata;
/** @experimental */
@ -1160,8 +1197,10 @@ export interface SkipSelfMetadataFactory {
new (): SkipSelfMetadata;
}
/** @experimental */
export declare function state(stateNameExpr: string, styles: AnimationStyleMetadata): AnimationStateDeclarationMetadata;
/** @experimental */
export declare function style(tokens: string | {
[key: string]: string | number;
} | Array<string | {
@ -1209,16 +1248,21 @@ export declare class TestabilityRegistry {
registerApplication(token: any, testability: Testability): void;
}
/** @stable */
export interface TrackByFn {
(index: number, item: any): any;
}
/** @experimental */
export declare function transition(stateChangeExpr: string, steps: AnimationMetadata | AnimationMetadata[]): AnimationStateTransitionMetadata;
/** @experimental */
export declare function trigger(name: string, animation: AnimationMetadata[]): AnimationEntryMetadata;
/** @stable */
export declare var Type: FunctionConstructor;
/** @stable */
export interface TypeDecorator {
annotations: any[];
(target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;
@ -1282,6 +1326,7 @@ export declare abstract class ViewContainerRef {
abstract remove(index?: number): void;
}
/** @experimental */
export interface ViewDecorator extends TypeDecorator {
View(obj: {
templateUrl?: string;
@ -1303,6 +1348,7 @@ export declare enum ViewEncapsulation {
None = 2,
}
/** @experimental */
export declare class ViewMetadata {
animations: AnimationEntryMetadata[];
directives: Array<Type | any[]>;
@ -1326,6 +1372,7 @@ export declare class ViewMetadata {
});
}
/** @experimental */
export interface ViewMetadataFactory {
(obj: {
templateUrl?: string;
@ -1399,6 +1446,7 @@ export declare var wtfEndTimeRange: (range: any) => void;
/** @experimental */
export declare var wtfLeave: <T>(scope: any, returnValue?: T) => T;
/** @experimental */
export interface WtfScopeFn {
(arg0?: any, arg1?: any): any;
}

View File

@ -1,8 +1,10 @@
/** @stable */
export declare function addProviders(providers: Array<any>): void;
/** @deprecated */
export declare var afterEach: Function;
/** @stable */
export declare function async(fn: Function): (done: any) => any;
/** @deprecated */
@ -11,6 +13,7 @@ export declare var beforeEach: any;
/** @deprecated */
export declare function beforeEachProviders(fn: () => Array<any>): void;
/** @stable */
export declare class ComponentFixture<T> {
changeDetectorRef: ChangeDetectorRef;
componentInstance: any;
@ -28,8 +31,10 @@ export declare class ComponentFixture<T> {
whenStable(): Promise<any>;
}
/** @experimental */
export declare var ComponentFixtureAutoDetect: OpaqueToken;
/** @experimental */
export declare var ComponentFixtureNoNgZone: OpaqueToken;
/** @deprecated */
@ -38,11 +43,13 @@ export declare var ddescribe: any;
/** @deprecated */
export declare var describe: Function;
/** @experimental */
export declare function discardPeriodicTasks(): void;
/** @deprecated */
export declare var expect: Function;
/** @experimental */
export declare function fakeAsync(fn: Function): (...args: any[]) => any;
/** @deprecated */
@ -51,15 +58,19 @@ export declare var fdescribe: any;
/** @deprecated */
export declare var fit: any;
/** @experimental */
export declare function flushMicrotasks(): void;
/** @experimental */
export declare function getTestInjector(): TestInjector;
/** @deprecated */
export declare var iit: any;
/** @stable */
export declare function inject(tokens: any[], fn: Function): () => any;
/** @experimental */
export declare class InjectSetupWrapper {
constructor(_providers: () => any);
inject(tokens: any[], fn: Function): () => any;
@ -68,10 +79,13 @@ export declare class InjectSetupWrapper {
/** @deprecated */
export declare var it: any;
/** @experimental */
export declare function resetBaseTestProviders(): void;
/** @experimental */
export declare function setBaseTestProviders(platformProviders: Array<Type | Provider | any[]>, applicationProviders: Array<Type | Provider | any[]>): void;
/** @stable */
export declare class TestComponentBuilder {
protected _injector: Injector;
constructor(_injector: Injector);
@ -87,10 +101,12 @@ export declare class TestComponentBuilder {
overrideViewProviders(type: Type, providers: any[]): TestComponentBuilder;
}
/** @experimental */
export declare class TestComponentRenderer {
insertRootElement(rootElementId: string): void;
}
/** @experimental */
export declare class TestInjector {
applicationProviders: Array<Type | Provider | any[] | any>;
platformProviders: Array<Type | Provider | any[] | any>;
@ -101,8 +117,10 @@ export declare class TestInjector {
reset(): void;
}
/** @experimental */
export declare function tick(millis?: number): void;
/** @experimental */
export declare function withProviders(providers: () => any): InjectSetupWrapper;
/** @deprecated */

View File

@ -60,6 +60,7 @@ export declare abstract class AbstractControlDirective {
valueChanges: Observable<any>;
}
/** @experimental */
export interface AsyncValidatorFn {
(c: AbstractControl): any;
}
@ -98,6 +99,7 @@ export declare class DefaultValueAccessor implements ControlValueAccessor {
writeValue(value: any): void;
}
/** @experimental */
export declare function disableDeprecatedForms(): any[];
/** @experimental */
@ -114,6 +116,7 @@ export interface Form {
/** @experimental */
export declare const FORM_DIRECTIVES: Type[];
/** @experimental */
export declare const FORM_PROVIDERS: Type[];
/** @experimental */
@ -352,8 +355,10 @@ export declare class PatternValidator implements Validator {
};
}
/** @experimental */
export declare function provideForms(): any[];
/** @experimental */
export declare const REACTIVE_FORM_DIRECTIVES: Type[];
/** @experimental */
@ -371,12 +376,14 @@ export declare class SelectControlValueAccessor implements ControlValueAccessor
writeValue(value: any): void;
}
/** @experimental */
export interface Validator {
validate(c: AbstractControl): {
[key: string]: any;
};
}
/** @experimental */
export interface ValidatorFn {
(c: AbstractControl): {
[key: string]: any;

View File

@ -1,31 +1,38 @@
/** @experimental */
export declare class BaseRequestOptions extends RequestOptions {
constructor();
}
/** @experimental */
export declare class BaseResponseOptions extends ResponseOptions {
constructor();
}
/** @experimental */
export declare class BrowserXhr {
constructor();
build(): any;
}
/** @experimental */
export declare abstract class Connection {
readyState: ReadyState;
request: Request;
response: any;
}
/** @experimental */
export declare abstract class ConnectionBackend {
abstract createConnection(request: any): Connection;
}
/** @experimental */
export declare class CookieXSRFStrategy implements XSRFStrategy {
constructor(_cookieName?: string, _headerName?: string);
configureRequest(req: Request): void;
}
/** @experimental */
export declare class Headers {
constructor(headers?: Headers | {
[key: string]: any;
@ -46,6 +53,7 @@ export declare class Headers {
static fromResponseHeaderString(headersString: string): Headers;
}
/** @experimental */
export declare class Http {
protected _backend: ConnectionBackend;
protected _defaultOptions: RequestOptions;
@ -62,23 +70,29 @@ export declare class Http {
/** @deprecated */
export declare const HTTP_BINDINGS: any[];
/** @experimental */
export declare const HTTP_PROVIDERS: any[];
/** @experimental */
export declare function httpFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions): Http;
/** @deprecated */
export declare const JSON_BINDINGS: any[];
/** @experimental */
export declare class Jsonp extends Http {
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions);
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
}
/** @experimental */
export declare const JSONP_PROVIDERS: any[];
/** @experimental */
export declare abstract class JSONPBackend extends ConnectionBackend {
}
/** @experimental */
export declare abstract class JSONPConnection implements Connection {
readyState: ReadyState;
request: Request;
@ -86,6 +100,7 @@ export declare abstract class JSONPConnection implements Connection {
abstract finished(data?: any): void;
}
/** @experimental */
export declare enum ReadyState {
Unsent = 0,
Open = 1,
@ -95,6 +110,7 @@ export declare enum ReadyState {
Cancelled = 5,
}
/** @experimental */
export declare class Request {
headers: Headers;
method: RequestMethod;
@ -109,6 +125,7 @@ export declare class Request {
text(): string;
}
/** @experimental */
export declare enum RequestMethod {
Get = 0,
Post = 1,
@ -119,6 +136,7 @@ export declare enum RequestMethod {
Patch = 6,
}
/** @experimental */
export declare class RequestOptions {
body: any;
headers: Headers;
@ -130,6 +148,7 @@ export declare class RequestOptions {
merge(options?: RequestOptionsArgs): RequestOptions;
}
/** @experimental */
export interface RequestOptionsArgs {
body?: any;
headers?: Headers;
@ -139,6 +158,7 @@ export interface RequestOptionsArgs {
withCredentials?: boolean;
}
/** @experimental */
export declare class Response {
bytesLoaded: number;
headers: Headers;
@ -156,6 +176,7 @@ export declare class Response {
toString(): string;
}
/** @experimental */
export declare class ResponseOptions {
body: string | Object;
headers: Headers;
@ -165,6 +186,7 @@ export declare class ResponseOptions {
merge(options?: ResponseOptionsArgs): ResponseOptions;
}
/** @experimental */
export declare type ResponseOptionsArgs = {
body?: string | Object | FormData;
status?: number;
@ -174,6 +196,7 @@ export declare type ResponseOptionsArgs = {
url?: string;
};
/** @experimental */
export declare enum ResponseType {
Basic = 0,
Cors = 1,
@ -182,6 +205,7 @@ export declare enum ResponseType {
Opaque = 4,
}
/** @experimental */
export declare class URLSearchParams {
paramsMap: Map<string, string[]>;
rawParams: string;
@ -199,11 +223,13 @@ export declare class URLSearchParams {
toString(): string;
}
/** @experimental */
export declare class XHRBackend implements ConnectionBackend {
constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy);
createConnection(request: Request): XHRConnection;
}
/** @experimental */
export declare class XHRConnection implements Connection {
readyState: ReadyState;
request: Request;
@ -212,6 +238,7 @@ export declare class XHRConnection implements Connection {
setDetectedContentType(req: any, _xhr: any): void;
}
/** @experimental */
export declare abstract class XSRFStrategy {
abstract configureRequest(req: Request): void;
}

View File

@ -1,3 +1,4 @@
/** @experimental */
export declare class MockBackend implements ConnectionBackend {
connections: any;
connectionsArray: MockConnection[];
@ -8,6 +9,7 @@ export declare class MockBackend implements ConnectionBackend {
verifyNoPendingRequests(): void;
}
/** @experimental */
export declare class MockConnection implements Connection {
readyState: ReadyState;
request: Request;

View File

@ -1,3 +1,4 @@
/** @experimental */
export declare function bootstrap(appComponentType: Type, customProviders?: Array<any>): Promise<ComponentRef<any>>;
/** @experimental */
@ -6,6 +7,8 @@ export declare function bootstrapWorkerApp(appComponentType: Type, customProvide
/** @experimental */
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Array<any>): Promise<ApplicationRef>;
/** @experimental */
export declare const BROWSER_APP_COMPILER_PROVIDERS: Array<any>;
/** @experimental */
export declare const CACHED_TEMPLATE_PROVIDER: Array<any>;

View File

@ -1,3 +1,5 @@
/** @stable */
export declare const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any>;
/** @stable */
export declare const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any>;

View File

@ -1,13 +1,16 @@
/** @experimental */
export declare const BROWSER_APP_PROVIDERS: Array<any>;
/** @experimental */
export declare const BROWSER_PLATFORM_PROVIDERS: Array<any>;
export declare const BROWSER_PROVIDERS: any[];
/** @experimental */
export declare const BROWSER_SANITIZATION_PROVIDERS: Array<any>;
/** @experimental */
export declare function browserPlatform(): PlatformRef;
/** @stable */
export declare class BrowserPlatformLocation extends PlatformLocation {
hash: string;
pathname: string;
@ -22,6 +25,7 @@ export declare class BrowserPlatformLocation extends PlatformLocation {
replaceState(state: any, title: string, url: string): void;
}
/** @experimental */
export declare class By {
static all(): Predicate<DebugElement>;
static css(selector: string): Predicate<DebugElement>;
@ -38,16 +42,13 @@ export declare abstract class ClientMessageBrokerFactory {
abstract createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker;
}
/** @experimental */
export declare function disableDebugTools(): void;
/** @stable */
export declare const DOCUMENT: OpaqueToken;
export declare class DomEventsPlugin extends EventManagerPlugin {
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
addGlobalEventListener(target: string, eventName: string, handler: Function): Function;
supports(eventName: string): boolean;
}
/** @stable */
export declare abstract class DomSanitizationService implements SanitizationService {
abstract bypassSecurityTrustHtml(value: string): SafeHtml;
abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
@ -57,12 +58,13 @@ export declare abstract class DomSanitizationService implements SanitizationServ
abstract sanitize(context: SecurityContext, value: any): string;
}
export declare const ELEMENT_PROBE_PROVIDERS: any[];
/** @experimental */
export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
/** @stable */
export declare const EVENT_MANAGER_PLUGINS: OpaqueToken;
/** @stable */
export declare class EventManager {
constructor(plugins: EventManagerPlugin[], _zone: NgZone);
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
@ -77,8 +79,10 @@ export declare class FnArg {
constructor(value: any, type: Type);
}
/** @experimental */
export declare const HAMMER_GESTURE_CONFIG: OpaqueToken;
/** @experimental */
export declare class HammerGestureConfig {
events: string[];
overrides: {
@ -87,17 +91,6 @@ export declare class HammerGestureConfig {
buildHammer(element: HTMLElement): HammerInstance;
}
export declare class KeyEventsPlugin extends EventManagerPlugin {
constructor();
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
supports(eventName: string): boolean;
static eventCallback(element: HTMLElement, fullKey: any, handler: Function, zone: NgZone): Function;
static getEventFullKey(event: KeyboardEvent): string;
static parseEventName(eventName: string): {
[key: string]: string;
};
}
/** @experimental */
export declare abstract class MessageBus implements MessageBusSource, MessageBusSink {
abstract attachToZone(zone: NgZone): void;
@ -134,21 +127,27 @@ export declare class ReceivedMessage {
});
}
/** @stable */
export interface SafeHtml extends SafeValue {
}
/** @stable */
export interface SafeResourceUrl extends SafeValue {
}
/** @stable */
export interface SafeScript extends SafeValue {
}
/** @stable */
export interface SafeStyle extends SafeValue {
}
/** @stable */
export interface SafeUrl extends SafeValue {
}
/** @experimental */
export declare var SecurityContext: typeof t.SecurityContext;
/** @experimental */
@ -156,6 +155,7 @@ export declare abstract class ServiceMessageBroker {
abstract registerMethod(methodName: string, signature: Type[], method: Function, returnType?: Type): void;
}
/** @experimental */
export declare abstract class ServiceMessageBrokerFactory {
abstract createMessageBroker(channel: string, runInZone?: boolean): ServiceMessageBroker;
}

View File

@ -1,3 +1,5 @@
/** @stable */
export declare const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any>;
/** @stable */
export declare const TEST_BROWSER_PLATFORM_PROVIDERS: Array<any>;

View File

@ -1 +1,2 @@
/** @experimental */
export declare function verifyNoBrowserErrors(): void;

View File

@ -1,3 +1,5 @@
/** @experimental */
export declare const TEST_SERVER_APPLICATION_PROVIDERS: Array<any>;
/** @experimental */
export declare const TEST_SERVER_PLATFORM_PROVIDERS: Array<any>;

Some files were not shown because too many files have changed in this diff Show More