From 3903e5ebe7b5fd567edf83c098e3daaeefd33b34 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Fri, 19 Oct 2018 16:27:04 +0100 Subject: [PATCH] docs: update core to use `@publicApi` tags (#26595) PR Close #26595 --- packages/core/src/application_init.ts | 4 ++ packages/core/src/application_ref.ts | 6 +- .../change_detection/change_detection_util.ts | 2 + .../change_detection/change_detector_ref.ts | 1 + .../core/src/change_detection/constants.ts | 3 +- .../differs/default_iterable_differ.ts | 1 + .../differs/iterable_differs.ts | 14 ++-- .../differs/keyvalue_differs.ts | 9 +-- .../src/change_detection/pipe_transform.ts | 2 +- packages/core/src/di/injectable.ts | 11 +-- packages/core/src/di/injection_token.ts | 2 + packages/core/src/di/injector.ts | 4 +- packages/core/src/di/metadata.ts | 29 +++++++- packages/core/src/di/provider.ts | 14 ++++ packages/core/src/di/reflective_injector.ts | 2 +- packages/core/src/di/reflective_key.ts | 2 + packages/core/src/error_handler.ts | 2 + packages/core/src/event_emitter.ts | 1 + packages/core/src/is_dev_mode.ts | 2 + packages/core/src/linker/compiler.ts | 1 + packages/core/src/linker/component_factory.ts | 4 ++ .../src/linker/component_factory_resolver.ts | 3 + packages/core/src/linker/element_ref.ts | 2 +- packages/core/src/linker/ng_module_factory.ts | 2 +- .../src/linker/ng_module_factory_loader.ts | 1 + packages/core/src/linker/query_list.ts | 2 + packages/core/src/linker/template_ref.ts | 1 + .../core/src/linker/view_container_ref.ts | 1 + packages/core/src/linker/view_ref.ts | 2 + packages/core/src/metadata/di.ts | 16 +++-- packages/core/src/metadata/directives.ts | 25 +++++-- packages/core/src/metadata/lifecycle_hooks.ts | 23 ++++--- packages/core/src/metadata/ng_module.ts | 10 +-- packages/core/src/metadata/view.ts | 3 + packages/core/src/render/api.ts | 3 + packages/core/src/sanitization/security.ts | 4 +- packages/core/src/testability/testability.ts | 1 - packages/core/src/type.ts | 2 +- packages/core/src/util/decorators.ts | 1 + packages/core/src/version.ts | 5 +- packages/core/testing/src/async.ts | 2 +- .../core/testing/src/component_fixture.ts | 2 +- packages/core/testing/src/test_bed.ts | 4 +- packages/core/testing/src/test_bed_common.ts | 4 +- tools/public_api_guard/core/core.d.ts | 67 +------------------ tools/public_api_guard/core/testing.d.ts | 16 +---- 46 files changed, 179 insertions(+), 139 deletions(-) diff --git a/packages/core/src/application_init.ts b/packages/core/src/application_init.ts index f04d5181e4..4d85196e66 100644 --- a/packages/core/src/application_init.ts +++ b/packages/core/src/application_init.ts @@ -13,11 +13,15 @@ import {Inject, Injectable, InjectionToken, Optional} from './di'; /** * A function that will be executed when an application is initialized. + * + * @publicApi */ export const APP_INITIALIZER = new InjectionToken void>>('Application Initializer'); /** * A class that reflects the state of running {@link APP_INITIALIZER}s. + * + * @publicApi */ @Injectable() export class ApplicationInitStatus { diff --git a/packages/core/src/application_ref.ts b/packages/core/src/application_ref.ts index 53b24096ee..ea3ab5cc2d 100644 --- a/packages/core/src/application_ref.ts +++ b/packages/core/src/application_ref.ts @@ -171,6 +171,8 @@ export interface BootstrapOptions { * * A page's platform is initialized implicitly when a platform is created via a platform factory * (e.g. {@link platformBrowser}), or explicitly by calling the {@link createPlatform} function. + * + * @publicApi */ @Injectable() export class PlatformRef { @@ -202,8 +204,6 @@ export class PlatformRef { * * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory); * ``` - * - * @publicApi */ bootstrapModuleFactory(moduleFactory: NgModuleFactory, options?: BootstrapOptions): Promise> { @@ -346,6 +346,8 @@ function optionsReducer(dst: any, objs: T | T[]): T { /** * A reference to an Angular application running on a page. + * + * @publicApi */ @Injectable() export class ApplicationRef { diff --git a/packages/core/src/change_detection/change_detection_util.ts b/packages/core/src/change_detection/change_detection_util.ts index c0f179efbb..60b36744d7 100644 --- a/packages/core/src/change_detection/change_detection_util.ts +++ b/packages/core/src/change_detection/change_detection_util.ts @@ -42,6 +42,7 @@ export function devModeEqual(a: any, b: any): boolean { * } * ``` * + * @publicApi */ export class WrappedValue { /** @deprecated from 5.3, use `unwrap()` instead - will switch to protected */ @@ -65,6 +66,7 @@ export class WrappedValue { /** * Represents a basic change from a previous to a new value. * + * @publicApi */ export class SimpleChange { constructor(public previousValue: any, public currentValue: any, public firstChange: boolean) {} diff --git a/packages/core/src/change_detection/change_detector_ref.ts b/packages/core/src/change_detection/change_detector_ref.ts index 874a1dd921..823c414a81 100644 --- a/packages/core/src/change_detection/change_detector_ref.ts +++ b/packages/core/src/change_detection/change_detector_ref.ts @@ -48,6 +48,7 @@ import {injectChangeDetectorRef as render3InjectChangeDetectorRef} from '../rend * * * + * @publicApi */ export abstract class ChangeDetectorRef { /** diff --git a/packages/core/src/change_detection/constants.ts b/packages/core/src/change_detection/constants.ts index 3713b0f5a5..60d80cf23a 100644 --- a/packages/core/src/change_detection/constants.ts +++ b/packages/core/src/change_detection/constants.ts @@ -11,6 +11,7 @@ * The strategy that the default change detector uses to detect changes. * When set, takes effect the next time change detection is triggered. * + * @publicApi */ export enum ChangeDetectionStrategy { /** @@ -74,7 +75,7 @@ export enum ChangeDetectorStatus { * @param changeDetectionStrategy The strategy to check. * @returns True if the given strategy is the current default, false otherwise. * @see `ChangeDetectorStatus` - * @see `ChangeDetectorRef` + * @see `ChangeDetectorRef` */ export function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy): boolean { diff --git a/packages/core/src/change_detection/differs/default_iterable_differ.ts b/packages/core/src/change_detection/differs/default_iterable_differ.ts index bf67045dc2..9cfccfd065 100644 --- a/packages/core/src/change_detection/differs/default_iterable_differ.ts +++ b/packages/core/src/change_detection/differs/default_iterable_differ.ts @@ -24,6 +24,7 @@ const trackByIdentity = (index: number, item: any) => item; /** * @deprecated v4.0.0 - Should not be part of public API. + * @publicApi */ export class DefaultIterableDiffer implements IterableDiffer, IterableChanges { public readonly length: number = 0; diff --git a/packages/core/src/change_detection/differs/iterable_differs.ts b/packages/core/src/change_detection/differs/iterable_differs.ts index 1c7ede1213..22f8d4c9d2 100644 --- a/packages/core/src/change_detection/differs/iterable_differs.ts +++ b/packages/core/src/change_detection/differs/iterable_differs.ts @@ -15,7 +15,7 @@ import {DefaultIterableDifferFactory} from '../differs/default_iterable_differ'; /** * A type describing supported iterable types. * - * + * @publicApi */ export type NgIterable = Array| Iterable; @@ -23,7 +23,7 @@ export type NgIterable = Array| Iterable; * A strategy for tracking changes over time to an iterable. Used by {@link NgForOf} to * respond to changes in an iterable by effecting equivalent changes in the DOM. * - * + * @publicApi */ export interface IterableDiffer { /** @@ -40,7 +40,7 @@ export interface IterableDiffer { * An object describing the changes in the `Iterable` collection since last time * `IterableDiffer#diff()` was invoked. * - * + * @publicApi */ export interface IterableChanges { /** @@ -93,7 +93,7 @@ export interface IterableChanges { /** * Record representing the item change information. * - * + * @publicApi */ export interface IterableChangeRecord { /** Current index of the item in `Iterable` or null if removed. */ @@ -111,6 +111,7 @@ export interface IterableChangeRecord { /** * @deprecated v4.0.0 - Use IterableChangeRecord instead. + * @publicApi */ export interface CollectionChangeRecord extends IterableChangeRecord {} @@ -118,14 +119,14 @@ export interface CollectionChangeRecord extends IterableChangeRecord {} * An optional function passed into {@link NgForOf} that defines how to track * items in an iterable (e.g. fby index or id) * - * + * @publicApi */ export interface TrackByFunction { (index: number, item: T): any; } /** * Provides a factory for {@link IterableDiffer}. * - * + * @publicApi */ export interface IterableDifferFactory { supports(objects: any): boolean; @@ -135,6 +136,7 @@ export interface IterableDifferFactory { /** * A repository of different iterable diffing strategies used by NgFor, NgClass, and others. * + * @publicApi */ export class IterableDiffers { static ngInjectableDef = defineInjectable({ diff --git a/packages/core/src/change_detection/differs/keyvalue_differs.ts b/packages/core/src/change_detection/differs/keyvalue_differs.ts index 47dcaf81b6..5ce392b9ad 100644 --- a/packages/core/src/change_detection/differs/keyvalue_differs.ts +++ b/packages/core/src/change_detection/differs/keyvalue_differs.ts @@ -12,7 +12,7 @@ import {Optional, SkipSelf, StaticProvider} from '../../di'; /** * A differ that tracks changes made to an object over time. * - * + * @publicApi */ export interface KeyValueDiffer { /** @@ -40,7 +40,7 @@ export interface KeyValueDiffer { * An object describing the changes in the `Map` or `{[k:string]: string}` since last time * `KeyValueDiffer#diff()` was invoked. * - * + * @publicApi */ export interface KeyValueChanges { /** @@ -74,7 +74,7 @@ export interface KeyValueChanges { /** * Record representing the item change information. * - * + * @publicApi */ export interface KeyValueChangeRecord { /** @@ -96,7 +96,7 @@ export interface KeyValueChangeRecord { /** * Provides a factory for {@link KeyValueDiffer}. * - * + * @publicApi */ export interface KeyValueDifferFactory { /** @@ -113,6 +113,7 @@ export interface KeyValueDifferFactory { /** * A repository of different Map diffing strategies used by NgClass, NgStyle, and others. * + * @publicApi */ export class KeyValueDiffers { /** diff --git a/packages/core/src/change_detection/pipe_transform.ts b/packages/core/src/change_detection/pipe_transform.ts index 740581d6ac..d52593b83f 100644 --- a/packages/core/src/change_detection/pipe_transform.ts +++ b/packages/core/src/change_detection/pipe_transform.ts @@ -30,6 +30,6 @@ * * Invoking `{{ 'ok' | repeat:3 }}` in a template produces `okokok`. * - * + * @publicApi */ export interface PipeTransform { transform(value: any, ...args: any[]): any; } diff --git a/packages/core/src/di/injectable.ts b/packages/core/src/di/injectable.ts index ac6ddaa22b..4e8420232e 100644 --- a/packages/core/src/di/injectable.ts +++ b/packages/core/src/di/injectable.ts @@ -25,6 +25,8 @@ export type InjectableProvider = ValueSansProvider | ExistingSansProvider | /** * Type of the Injectable decorator / constructor function. + * + * @publicApi */ export interface InjectableDecorator { /** @@ -57,10 +59,11 @@ export interface InjectableDecorator { export interface Injectable { providedIn?: Type|'root'|null; } /** -* Injectable decorator and metadata. -* -* @Annotation -*/ + * Injectable decorator and metadata. + * + * @Annotation + * @publicApi + */ export const Injectable: InjectableDecorator = makeDecorator( 'Injectable', undefined, undefined, undefined, (type: Type, meta: Injectable) => SWITCH_COMPILE_INJECTABLE(type as any, meta)); diff --git a/packages/core/src/di/injection_token.ts b/packages/core/src/di/injection_token.ts index b26a73f159..43ebde5302 100644 --- a/packages/core/src/di/injection_token.ts +++ b/packages/core/src/di/injection_token.ts @@ -47,6 +47,8 @@ import {defineInjectable} from './defs'; * * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'} * + * + * @publicApi */ export class InjectionToken { /** @internal */ diff --git a/packages/core/src/di/injector.ts b/packages/core/src/di/injector.ts index dfa114c5fa..55113fa5d0 100644 --- a/packages/core/src/di/injector.ts +++ b/packages/core/src/di/injector.ts @@ -57,7 +57,7 @@ export class NullInjector implements Injector { * * {@example core/di/ts/injector_spec.ts region='injectInjector'} * - * + * @publicApi */ export abstract class Injector { static THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND; @@ -399,6 +399,8 @@ function staticError(text: string, obj: any): Error { /** * Injection flags for DI. + * + * @publicApi */ export const enum InjectFlags { Default = 0b0000, diff --git a/packages/core/src/di/metadata.ts b/packages/core/src/di/metadata.ts index 8198c9d0ea..b3a0e72d8e 100644 --- a/packages/core/src/di/metadata.ts +++ b/packages/core/src/di/metadata.ts @@ -15,6 +15,8 @@ import {EMPTY_ARRAY} from '../view/util'; /** * Type of the Inject decorator / constructor function. + * + * @publicApi */ export interface InjectDecorator { /** @@ -40,6 +42,8 @@ export interface InjectDecorator { /** * Type of the Inject metadata. + * + * @publicApi */ export interface Inject { /** @@ -52,19 +56,22 @@ export interface Inject { * Inject decorator and metadata. * * @Annotation + * @publicApi */ export const Inject: InjectDecorator = makeParamDecorator('Inject', (token: any) => ({token})); /** * Type of the Optional decorator / constructor function. + * + * @publicApi */ export interface OptionalDecorator { /** * A constructor parameter decorator that marks a dependency as optional. * * The DI framework provides null if the dependency is not found. - * For example, the following code allows the possibility of a null result: + * For example, the following code allows the possibility of a null result: * * {@example core/di/ts/metadata_spec.ts region='Optional'} * @@ -76,6 +83,8 @@ export interface OptionalDecorator { /** * Type of the Optional metadata. + * + * @publicApi */ export interface Optional {} @@ -83,11 +92,14 @@ export interface Optional {} * Optional decorator and metadata. * * @Annotation + * @publicApi */ export const Optional: OptionalDecorator = makeParamDecorator('Optional'); /** * Type of the Self decorator / constructor function. + * + * @publicApi */ export interface SelfDecorator { /** @@ -110,6 +122,8 @@ export interface SelfDecorator { /** * Type of the Self metadata. + * + * @publicApi */ export interface Self {} @@ -117,12 +131,15 @@ export interface Self {} * Self decorator and metadata. * * @Annotation + * @publicApi */ export const Self: SelfDecorator = makeParamDecorator('Self'); /** * Type of the SkipSelf decorator / constructor function. + * + * @publicApi */ export interface SkipSelfDecorator { /** @@ -145,7 +162,7 @@ export interface SkipSelfDecorator { /** * Type of the SkipSelf metadata. * - * + * @publicApi */ export interface SkipSelf {} @@ -153,11 +170,14 @@ export interface SkipSelf {} * SkipSelf decorator and metadata. * * @Annotation + * @publicApi */ export const SkipSelf: SkipSelfDecorator = makeParamDecorator('SkipSelf'); /** * Type of the Host decorator / constructor function. + * + * @publicApi */ export interface HostDecorator { /** @@ -167,7 +187,7 @@ export interface HostDecorator { * * @see ["Dependency Injection Guide"](guide/dependency-injection). * - * @usageNotes + * @usageNotes * * {@example core/di/ts/metadata_spec.ts region='Host'} */ @@ -177,6 +197,8 @@ export interface HostDecorator { /** * Type of the Host metadata. + * + * @publicApi */ export interface Host {} @@ -184,5 +206,6 @@ export interface Host {} * Host decorator and metadata. * * @Annotation + * @publicApi */ export const Host: HostDecorator = makeParamDecorator('Host'); diff --git a/packages/core/src/di/provider.ts b/packages/core/src/di/provider.ts index 96e71bdad9..7263eebe13 100644 --- a/packages/core/src/di/provider.ts +++ b/packages/core/src/di/provider.ts @@ -40,6 +40,8 @@ export interface ValueSansProvider { * ### Multi-value example * * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'} + * + * @publicApi */ export interface ValueProvider extends ValueSansProvider { /** @@ -191,6 +193,8 @@ export interface ExistingSansProvider { * ### Multi-value example * * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'} + * + * @publicApi */ export interface ExistingProvider extends ExistingSansProvider { /** @@ -248,6 +252,8 @@ export interface FactorySansProvider { * ### Multi-value example * * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'} + * + * @publicApi */ export interface FactoryProvider extends FactorySansProvider { /** @@ -270,6 +276,8 @@ export interface FactoryProvider extends FactorySansProvider { * @see `ValueProvider` * @see `ExistingProvider` * @see `FactoryProvider` + * + * @publicApi */ export type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[]; @@ -287,6 +295,8 @@ export type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvi * ### Example * * {@example core/di/ts/provider_spec.ts region='TypeProvider'} + * + * @publicApi */ export interface TypeProvider extends Type {} @@ -326,6 +336,8 @@ export interface ClassSansProvider { * ### Multi-value example * * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'} + * + * @publicApi */ export interface ClassProvider extends ClassSansProvider { /** @@ -348,6 +360,8 @@ export interface ClassProvider extends ClassSansProvider { * @see `TypeProvider` * @see `ClassProvider` * @see `StaticProvider` + * + * @publicApi */ export type Provider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | any[]; diff --git a/packages/core/src/di/reflective_injector.ts b/packages/core/src/di/reflective_injector.ts index 4107a6a0f7..aa30e76ed2 100644 --- a/packages/core/src/di/reflective_injector.ts +++ b/packages/core/src/di/reflective_injector.ts @@ -51,6 +51,7 @@ const UNDEFINED = new Object(); * resolve all of the object's dependencies automatically. * * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead. + * @publicApi */ export abstract class ReflectiveInjector implements Injector { /** @@ -140,7 +141,6 @@ export abstract class ReflectiveInjector implements Injector { * var injector = ReflectiveInjector.fromResolvedProviders(providers); * expect(injector.get(Car) instanceof Car).toBe(true); * ``` - * @publicApi */ static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector { diff --git a/packages/core/src/di/reflective_key.ts b/packages/core/src/di/reflective_key.ts index 5f54b80ca8..476f62906f 100644 --- a/packages/core/src/di/reflective_key.ts +++ b/packages/core/src/di/reflective_key.ts @@ -24,7 +24,9 @@ import {resolveForwardRef} from './forward_ref'; * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when * resolving * providers. + * * @deprecated No replacement + * @publicApi */ export class ReflectiveKey { public readonly displayName: string; diff --git a/packages/core/src/error_handler.ts b/packages/core/src/error_handler.ts index da2b8af72c..a85273ccac 100644 --- a/packages/core/src/error_handler.ts +++ b/packages/core/src/error_handler.ts @@ -32,6 +32,8 @@ import {ERROR_ORIGINAL_ERROR, getDebugContext, getErrorLogger, getOriginalError} * }) * class MyModule {} * ``` + * + * @publicApi */ export class ErrorHandler { /** diff --git a/packages/core/src/event_emitter.ts b/packages/core/src/event_emitter.ts index 1e5368e88e..40482cd8df 100644 --- a/packages/core/src/event_emitter.ts +++ b/packages/core/src/event_emitter.ts @@ -59,6 +59,7 @@ import {Subject, Subscription} from 'rxjs'; * * Once a reference implementation of the spec is available, switch to it. * + * @publicApi */ export class EventEmitter extends Subject { // TODO: mark this as internal once all the facades are gone diff --git a/packages/core/src/is_dev_mode.ts b/packages/core/src/is_dev_mode.ts index 2ecf69eb05..10d2e4554f 100644 --- a/packages/core/src/is_dev_mode.ts +++ b/packages/core/src/is_dev_mode.ts @@ -37,6 +37,8 @@ export function isDevMode(): boolean { * 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). + * + * @publicApi */ export function enableProdMode(): void { if (_runModeLocked) { diff --git a/packages/core/src/linker/compiler.ts b/packages/core/src/linker/compiler.ts index ee9cbfea13..10ccd01df5 100644 --- a/packages/core/src/linker/compiler.ts +++ b/packages/core/src/linker/compiler.ts @@ -43,6 +43,7 @@ function _throwError() { * that will use the directives/pipes of the ng module for compilation * of components. * + * @publicApi */ @Injectable() export class Compiler { diff --git a/packages/core/src/linker/component_factory.ts b/packages/core/src/linker/component_factory.ts index 9a6692c5da..b5c256c3d1 100644 --- a/packages/core/src/linker/component_factory.ts +++ b/packages/core/src/linker/component_factory.ts @@ -19,6 +19,7 @@ import {ViewRef} from './view_ref'; * Provides access to the component instance and related objects, * and provides the means of destroying the instance. * + * @publicApi */ export abstract class ComponentRef { /** @@ -66,6 +67,9 @@ export abstract class ComponentRef { abstract onDestroy(callback: Function): void; } +/** + * @publicApi + */ export abstract class ComponentFactory { /** * The comonent's HTML selector. diff --git a/packages/core/src/linker/component_factory_resolver.ts b/packages/core/src/linker/component_factory_resolver.ts index a478419c61..ac1f0abbe4 100644 --- a/packages/core/src/linker/component_factory_resolver.ts +++ b/packages/core/src/linker/component_factory_resolver.ts @@ -33,6 +33,9 @@ class _NullComponentFactoryResolver implements ComponentFactoryResolver { } } +/** + * @publicApi + */ export abstract class ComponentFactoryResolver { static NULL: ComponentFactoryResolver = new _NullComponentFactoryResolver(); abstract resolveComponentFactory(component: Type): ComponentFactory; diff --git a/packages/core/src/linker/element_ref.ts b/packages/core/src/linker/element_ref.ts index b258adb625..4bdec33372 100644 --- a/packages/core/src/linker/element_ref.ts +++ b/packages/core/src/linker/element_ref.ts @@ -19,7 +19,7 @@ import {noop} from '../util/noop'; * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the * [Security Guide](http://g.co/ng/security). * - * + * @publicApi */ // 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 diff --git a/packages/core/src/linker/ng_module_factory.ts b/packages/core/src/linker/ng_module_factory.ts index 87fb6d11a7..e307100003 100644 --- a/packages/core/src/linker/ng_module_factory.ts +++ b/packages/core/src/linker/ng_module_factory.ts @@ -18,7 +18,7 @@ import {ComponentFactoryResolver} from './component_factory_resolver'; * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this * NgModule Instance. * - * + * @publicApi */ export abstract class NgModuleRef { /** diff --git a/packages/core/src/linker/ng_module_factory_loader.ts b/packages/core/src/linker/ng_module_factory_loader.ts index ab17496424..c90526fd68 100644 --- a/packages/core/src/linker/ng_module_factory_loader.ts +++ b/packages/core/src/linker/ng_module_factory_loader.ts @@ -11,6 +11,7 @@ import {NgModuleFactory} from './ng_module_factory'; /** * Used to load ng module factories. * + * @publicApi */ export abstract class NgModuleFactoryLoader { abstract load(path: string): Promise>; diff --git a/packages/core/src/linker/query_list.ts b/packages/core/src/linker/query_list.ts index fd06b021f4..9060cb6dbc 100644 --- a/packages/core/src/linker/query_list.ts +++ b/packages/core/src/linker/query_list.ts @@ -35,6 +35,8 @@ import {getSymbolIterator} from '../util'; * @ViewChildren(Item) items:QueryList; * } * ``` + * + * @publicApi */ export class QueryList/* implements Iterable */ { public readonly dirty = true; diff --git a/packages/core/src/linker/template_ref.ts b/packages/core/src/linker/template_ref.ts index e1ce4d8baa..ebc9cdabde 100644 --- a/packages/core/src/linker/template_ref.ts +++ b/packages/core/src/linker/template_ref.ts @@ -29,6 +29,7 @@ import {EmbeddedViewRef} from './view_ref'; * @see `ViewContainerRef` * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree) * + * @publicApi */ export abstract class TemplateRef { /** diff --git a/packages/core/src/linker/view_container_ref.ts b/packages/core/src/linker/view_container_ref.ts index 392f206fda..ae08347c55 100644 --- a/packages/core/src/linker/view_container_ref.ts +++ b/packages/core/src/linker/view_container_ref.ts @@ -30,6 +30,7 @@ import {EmbeddedViewRef, ViewRef} from './view_ref'; * @see `ComponentRef` * @see `EmbeddedViewRef` * + * @publicApi */ export abstract class ViewContainerRef { /** diff --git a/packages/core/src/linker/view_ref.ts b/packages/core/src/linker/view_ref.ts index cbf765d444..1687c5799b 100644 --- a/packages/core/src/linker/view_ref.ts +++ b/packages/core/src/linker/view_ref.ts @@ -16,6 +16,8 @@ import {ChangeDetectorRef} from '../change_detection/change_detector_ref'; * that adds destroy methods for [embedded views](guide/glossary#view-tree). * * @see `EmbeddedViewRef` + * + * @publicApi */ export abstract class ViewRef extends ChangeDetectorRef { /** diff --git a/packages/core/src/metadata/di.ts b/packages/core/src/metadata/di.ts index c93f1feb15..607b39062c 100644 --- a/packages/core/src/metadata/di.ts +++ b/packages/core/src/metadata/di.ts @@ -106,6 +106,7 @@ export interface Attribute { attributeName?: string; } * Attribute decorator and metadata. * * @Annotation + * @publicApi */ export const Attribute: AttributeDecorator = makeParamDecorator('Attribute', (attributeName?: string) => ({attributeName})); @@ -128,6 +129,8 @@ export interface Query { * @see `ContentChild`. * @see `ViewChildren`. * @see `ViewChild`. + * + * @publicApi */ export abstract class Query {} @@ -135,6 +138,7 @@ export abstract class Query {} * Type of the ContentChildren decorator / constructor function. * * @see `ContentChildren`. + * @publicApi */ export interface ContentChildrenDecorator { /** @@ -184,7 +188,8 @@ export type ContentChildren = Query; * ContentChildren decorator and metadata. * * - * @Annotation + * @Annotation + * @publicApi */ export const ContentChildren: ContentChildrenDecorator = makePropDecorator( 'ContentChildren', @@ -195,8 +200,7 @@ export const ContentChildren: ContentChildrenDecorator = makePropDecorator( /** * Type of the ContentChild decorator / constructor function. * - * - * + * @publicApi */ export interface ContentChildDecorator { /** @@ -242,6 +246,7 @@ export type ContentChild = Query; * * * @Annotation + * @publicApi */ export const ContentChild: ContentChildDecorator = makePropDecorator( 'ContentChild', (selector?: any, data: any = {}) => @@ -253,7 +258,7 @@ export const ContentChild: ContentChildDecorator = makePropDecorator( * * @see `ViewChildren`. * - * + * @publicApi */ export interface ViewChildrenDecorator { /** @@ -295,6 +300,7 @@ export type ViewChildren = Query; * ViewChildren decorator and metadata. * * @Annotation + * @publicApi */ export const ViewChildren: ViewChildrenDecorator = makePropDecorator( 'ViewChildren', (selector?: any, data: any = {}) => @@ -305,6 +311,7 @@ export const ViewChildren: ViewChildrenDecorator = makePropDecorator( * Type of the ViewChild decorator / constructor function. * * @see `ViewChild`. + * @publicApi */ export interface ViewChildDecorator { /** @@ -359,6 +366,7 @@ export type ViewChild = Query; * ViewChild decorator and metadata. * * @Annotation + * @publicApi */ export const ViewChild: ViewChildDecorator = makePropDecorator( 'ViewChild', (selector: any, data: any) => diff --git a/packages/core/src/metadata/directives.ts b/packages/core/src/metadata/directives.ts index b2333d15bd..45e9fe2669 100644 --- a/packages/core/src/metadata/directives.ts +++ b/packages/core/src/metadata/directives.ts @@ -22,6 +22,7 @@ import {ViewEncapsulation} from './view'; /** * Type of the Directive decorator / constructor function. + * @publicApi */ export interface DirectiveDecorator { /** @@ -349,6 +350,8 @@ export interface Directive { /** * Type of the Directive metadata. + * + * @publicApi */ export const Directive: DirectiveDecorator = makeDecorator( 'Directive', (dir: Directive = {}) => dir, undefined, undefined, @@ -357,6 +360,7 @@ export const Directive: DirectiveDecorator = makeDecorator( /** * Component decorator interface * + * @publicApi */ export interface ComponentDecorator { /** @@ -633,6 +637,7 @@ export interface Component extends Directive { * `ngPreserveWhitespaces` attribute. * * @Annotation + * @publicApi */ export const Component: ComponentDecorator = makeDecorator( 'Component', (c: Component = {}) => ({changeDetection: ChangeDetectionStrategy.Default, ...c}), @@ -641,6 +646,8 @@ export const Component: ComponentDecorator = makeDecorator( /** * Type of the Pipe decorator / constructor function. + * + * @publicApi */ export interface PipeDecorator { /** @@ -679,9 +686,8 @@ export interface Pipe { } /** - * - * * @Annotation + * @publicApi */ export const Pipe: PipeDecorator = makeDecorator( 'Pipe', (p: Pipe) => ({pure: true, ...p}), undefined, undefined, @@ -689,7 +695,7 @@ export const Pipe: PipeDecorator = makeDecorator( /** - * + * @publicApi */ export interface InputDecorator { /** @@ -802,8 +808,8 @@ const updateBaseDefFromIOProp = (getProp: (baseDef: {inputs?: any, outputs?: any }; /** - * * @Annotation + * @publicApi */ export const Input: InputDecorator = makePropDecorator( 'Input', (bindingPropertyName?: string) => ({bindingPropertyName}), undefined, @@ -811,6 +817,8 @@ export const Input: InputDecorator = makePropDecorator( /** * Type of the Output decorator / constructor function. + * + * @publicApi */ export interface OutputDecorator { /** @@ -838,8 +846,8 @@ export interface OutputDecorator { export interface Output { bindingPropertyName?: string; } /** - * * @Annotation + * @publicApi */ export const Output: OutputDecorator = makePropDecorator( 'Output', (bindingPropertyName?: string) => ({bindingPropertyName}), undefined, @@ -849,6 +857,8 @@ export const Output: OutputDecorator = makePropDecorator( /** * Type of the HostBinding decorator / constructor function. + * + * @publicApi */ export interface HostBindingDecorator { /** @@ -890,8 +900,8 @@ export interface HostBindingDecorator { export interface HostBinding { hostPropertyName?: string; } /** - * * @Annotation + * @publicApi */ export const HostBinding: HostBindingDecorator = makePropDecorator('HostBinding', (hostPropertyName?: string) => ({hostPropertyName})); @@ -899,6 +909,8 @@ export const HostBinding: HostBindingDecorator = /** * Type of the HostListener decorator / constructor function. + * + * @publicApi */ export interface HostListenerDecorator { (eventName: string, args?: string[]): any; @@ -949,6 +961,7 @@ export interface HostListener { * ``` * * @Annotation + * @publicApi */ export const HostListener: HostListenerDecorator = makePropDecorator('HostListener', (eventName?: string, args?: string[]) => ({eventName, args})); diff --git a/packages/core/src/metadata/lifecycle_hooks.ts b/packages/core/src/metadata/lifecycle_hooks.ts index 61ce3af80a..40a261e2d6 100644 --- a/packages/core/src/metadata/lifecycle_hooks.ts +++ b/packages/core/src/metadata/lifecycle_hooks.ts @@ -15,6 +15,7 @@ import {SimpleChange} from '../change_detection/change_detection_util'; * * @see `OnChanges` * + * @publicApi */ export interface SimpleChanges { [propName: string]: SimpleChange; } @@ -33,6 +34,7 @@ export interface SimpleChanges { [propName: string]: SimpleChange; } * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnChanges'} * + * @publicApi */ export interface OnChanges { /** @@ -60,7 +62,7 @@ export interface OnChanges { * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnInit'} * - * + * @publicApi */ export interface OnInit { /** @@ -76,7 +78,7 @@ export interface OnInit { /** * A lifecycle hook that invokes a custom change-detection function for a directive, * in addition to the check performed by the default change-detector. - * + * * The default change-detection algorithm looks for differences by comparing * bound-property values by reference across change detection runs. You can use this * hook to check for and respond to changes by some other means. @@ -84,17 +86,18 @@ export interface OnInit { * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied, * regardless of whether you perform additional change detection. * Typically, you should not use both `DoCheck` and `OnChanges` to respond to - * changes on the same input. - * + * changes on the same input. + * * @see `OnChanges` * @see [Lifecycle Hooks](guide/lifecycle-hooks#onchanges) guide * * @usageNotes * The following snippet shows how a component can implement this interface - * to invoke it own change-detection cycle. + * to invoke it own change-detection cycle. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'} * + * @publicApi */ export interface DoCheck { /** @@ -116,9 +119,10 @@ export interface DoCheck { * @usageNotes * The following snippet shows how a component can implement this interface * to define its own custom clean-up method. - * + * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnDestroy'} * + * @publicApi */ export interface OnDestroy { /** @@ -144,7 +148,7 @@ export interface OnDestroy { * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentInit'} * - * + * @publicApi */ export interface AfterContentInit { /** @@ -170,7 +174,7 @@ export interface AfterContentInit { * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentChecked'} * - * + * @publicApi */ export interface AfterContentChecked { /** @@ -197,7 +201,7 @@ export interface AfterContentChecked { * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewInit'} * - * + * @publicApi */ export interface AfterViewInit { /** @@ -223,6 +227,7 @@ export interface AfterViewInit { * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewChecked'} * + * @publicApi */ export interface AfterViewChecked { /** diff --git a/packages/core/src/metadata/ng_module.ts b/packages/core/src/metadata/ng_module.ts index c129455159..4a672d5142 100644 --- a/packages/core/src/metadata/ng_module.ts +++ b/packages/core/src/metadata/ng_module.ts @@ -72,6 +72,8 @@ export interface NgModuleDef { * * @param T the module type. In Ivy applications, this must be explicitly * provided. + * + * @publicApi */ export interface ModuleWithProviders< T = any /** TODO(alxhub): remove default when callers pass explicit type param */> { @@ -96,7 +98,7 @@ export interface SchemaMetadata { name: string; } * - Element properties named with dash case (`-`). * Dash case is the naming convention for custom elements. * - * + * @publicApi */ export const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata = { name: 'custom-elements' @@ -114,8 +116,6 @@ export const NO_ERRORS_SCHEMA: SchemaMetadata = { /** * Type of the NgModule decorator / constructor function. - * - * */ export interface NgModuleDecorator { /** @@ -127,8 +127,6 @@ export interface NgModuleDecorator { /** * Type of the NgModule metadata. - * - * */ export interface NgModule { /** @@ -322,6 +320,7 @@ export interface NgModule { /** * @Annotation + * @publicApi */ export const NgModule: NgModuleDecorator = makeDecorator( 'NgModule', (ngModule: NgModule) => ngModule, undefined, undefined, @@ -356,6 +355,7 @@ export const NgModule: NgModuleDecorator = makeDecorator( * } * ``` * + * @publicApi */ export interface DoBootstrap { ngDoBootstrap(appRef: ApplicationRef): void; } diff --git a/packages/core/src/metadata/view.ts b/packages/core/src/metadata/view.ts index 725d45663d..08406a5c7e 100644 --- a/packages/core/src/metadata/view.ts +++ b/packages/core/src/metadata/view.ts @@ -13,7 +13,10 @@ * * @usageNotes * ### Example + * * {@example core/ts/metadata/encapsulation.ts region='longform'} + * + * @publicApi */ export enum ViewEncapsulation { /** diff --git a/packages/core/src/render/api.ts b/packages/core/src/render/api.ts index ec835cb8e3..061f4fcde7 100644 --- a/packages/core/src/render/api.ts +++ b/packages/core/src/render/api.ts @@ -15,6 +15,7 @@ import {noop} from '../util/noop'; /** * @deprecated Use `RendererType2` (and `Renderer2`) instead. + * @publicApi */ export class RenderComponentType { constructor( @@ -48,6 +49,7 @@ export interface DirectRenderer { /** * @deprecated Use the `Renderer2` instead. + * @publicApi */ export abstract class Renderer { abstract selectRootElement(selectorOrNode: string|any, debugInfo?: RenderDebugInfo): any; @@ -111,6 +113,7 @@ export const Renderer2Interceptor = new InjectionToken('Renderer2In * The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`. * * @deprecated Use `RendererFactory2` instead. + * @publicApi */ export abstract class RootRenderer { abstract renderComponent(componentType: RenderComponentType): Renderer; diff --git a/packages/core/src/sanitization/security.ts b/packages/core/src/sanitization/security.ts index bef465345b..7bfdd9bc7c 100644 --- a/packages/core/src/sanitization/security.ts +++ b/packages/core/src/sanitization/security.ts @@ -13,7 +13,7 @@ * * See DomSanitizer for more details on security in Angular applications. * - * + * @publicApi */ export enum SecurityContext { NONE = 0, @@ -27,7 +27,7 @@ export enum SecurityContext { /** * Sanitizer is used by the views to sanitize potentially dangerous values. * - * + * @publicApi */ export abstract class Sanitizer { abstract sanitize(context: SecurityContext, value: {}|string|null): string|null; diff --git a/packages/core/src/testability/testability.ts b/packages/core/src/testability/testability.ts index 215cdc0deb..f40bdd889f 100644 --- a/packages/core/src/testability/testability.ts +++ b/packages/core/src/testability/testability.ts @@ -284,7 +284,6 @@ export class TestabilityRegistry { * particular context. * * @publicApi - * the Protractor team. */ export interface GetTestability { addToWindow(registry: TestabilityRegistry): void; diff --git a/packages/core/src/type.ts b/packages/core/src/type.ts index eed33add7d..f99a53df75 100644 --- a/packages/core/src/type.ts +++ b/packages/core/src/type.ts @@ -14,7 +14,7 @@ * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by * the `MyCustomComponent` constructor function. * - * + * @publicApi */ export const Type = Function; diff --git a/packages/core/src/util/decorators.ts b/packages/core/src/util/decorators.ts index da5fe6ae02..506579f24b 100644 --- a/packages/core/src/util/decorators.ts +++ b/packages/core/src/util/decorators.ts @@ -20,6 +20,7 @@ import {Type} from '../type'; * class MyClass {...} * ``` * + * @publicApi */ export interface TypeDecorator { /** diff --git a/packages/core/src/version.ts b/packages/core/src/version.ts index f095fc9526..404a49fd15 100644 --- a/packages/core/src/version.ts +++ b/packages/core/src/version.ts @@ -9,7 +9,7 @@ /** * @description Represents the version of Angular * - * + * @publicApi */ export class Version { public readonly major: string; @@ -23,4 +23,7 @@ export class Version { } } +/** + * @publicApi + */ export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/packages/core/testing/src/async.ts b/packages/core/testing/src/async.ts index 1d67a2d25e..f7ec1c3638 100644 --- a/packages/core/testing/src/async.ts +++ b/packages/core/testing/src/async.ts @@ -23,7 +23,7 @@ import {asyncFallback} from './async_fallback'; * }); * ``` * - * + * @publicApi */ export function async(fn: Function): (done: any) => any { const _Zone: any = typeof Zone !== 'undefined' ? Zone : null; diff --git a/packages/core/testing/src/component_fixture.ts b/packages/core/testing/src/component_fixture.ts index 88c5acd32e..bb15761f22 100644 --- a/packages/core/testing/src/component_fixture.ts +++ b/packages/core/testing/src/component_fixture.ts @@ -12,7 +12,7 @@ import {ChangeDetectorRef, ComponentRef, DebugElement, ElementRef, NgZone, Rende /** * Fixture for debugging and testing a component. * - * + * @publicApi */ export class ComponentFixture { /** diff --git a/packages/core/testing/src/test_bed.ts b/packages/core/testing/src/test_bed.ts index a59f01bc70..1a123b1fa8 100644 --- a/packages/core/testing/src/test_bed.ts +++ b/packages/core/testing/src/test_bed.ts @@ -635,6 +635,8 @@ export class TestBedViewEngine implements Injector, TestBed { * * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3` * according to the compiler used. + * + * @publicApi */ export const TestBed: TestBedStatic = ivyEnabled ? TestBedRender3 as any as TestBedStatic : TestBedViewEngine as any as TestBedStatic; @@ -676,7 +678,7 @@ function _getTestBedViewEngine(): TestBedViewEngine { * eventually * becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });` * - * + * @publicApi */ export function inject(tokens: any[], fn: Function): () => any { const testBed = getTestBed(); diff --git a/packages/core/testing/src/test_bed_common.ts b/packages/core/testing/src/test_bed_common.ts index 3244d118dc..493179ccaf 100644 --- a/packages/core/testing/src/test_bed_common.ts +++ b/packages/core/testing/src/test_bed_common.ts @@ -45,6 +45,8 @@ export type TestModuleMetadata = { /** * Static methods implemented by the `TestBedViewEngine` and `TestBedRender3` + * + * @publicApi */ export interface TestBedStatic { new (...args: any[]): TestBed; @@ -54,8 +56,6 @@ export interface TestBedStatic { /** * Reset the providers for the test injector. - * - * @publicApi */ resetTestEnvironment(): void; diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index 437f4297a0..3cd68fc4ac 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -14,13 +14,10 @@ export interface AfterViewInit { ngAfterViewInit(): void; } -/** @experimental */ export declare const ANALYZE_FOR_ENTRY_COMPONENTS: InjectionToken; -/** @experimental */ export declare const APP_BOOTSTRAP_LISTENER: InjectionToken<((compRef: ComponentRef) => void)[]>; -/** @experimental */ export declare const APP_ID: InjectionToken; export declare const APP_INITIALIZER: InjectionToken<(() => void)[]>; @@ -31,7 +28,6 @@ export declare class ApplicationInitStatus { constructor(appInits: (() => any)[]); } -/** @experimental */ export declare class ApplicationModule { constructor(appRef: ApplicationRef); } @@ -47,10 +43,8 @@ export declare class ApplicationRef { tick(): void; } -/** @experimental */ export declare function asNativeElements(debugEls: DebugElement[]): any; -/** @experimental */ export declare function assertPlatform(requiredToken: any): PlatformRef; export declare const Attribute: AttributeDecorator; @@ -87,15 +81,12 @@ export declare class Compiler { getModuleId(moduleType: Type): string | undefined; } -/** @experimental */ export declare const COMPILER_OPTIONS: InjectionToken; -/** @experimental */ export declare abstract class CompilerFactory { abstract createCompiler(options?: CompilerOptions[]): Compiler; } -/** @experimental */ export declare type CompilerOptions = { useJit?: boolean; defaultEncapsulation?: ViewEncapsulation; @@ -142,7 +133,6 @@ export declare abstract class ComponentRef { abstract onDestroy(callback: Function): void; } -/** @experimental */ export interface ConstructorSansProvider { deps?: any[]; } @@ -171,18 +161,14 @@ export interface ContentChildrenDecorator { }): Query; } -/** @experimental */ export declare function createInjector(defType: any, parent?: Injector | null, additionalProviders?: StaticProvider[] | null): Injector; -/** @experimental */ export declare function createPlatform(injector: Injector): PlatformRef; -/** @experimental */ export declare function createPlatformFactory(parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null, name: string, providers?: StaticProvider[]): (extraProviders?: StaticProvider[]) => PlatformRef; export declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata; -/** @experimental */ export declare class DebugElement extends DebugNode { attributes: { [key: string]: string | null; @@ -211,7 +197,6 @@ export declare class DebugElement extends DebugNode { triggerEventHandler(eventName: string, eventObj: any): void; } -/** @experimental */ export declare class DebugNode { readonly componentInstance: any; readonly context: any; @@ -244,20 +229,17 @@ export declare class DefaultIterableDiffer implements IterableDiffer, Iter onDestroy(): void; } -/** @experimental */ export declare function defineInjectable(opts: { providedIn?: Type | 'root' | 'any' | null; factory: () => T; }): never; -/** @experimental */ export declare function defineInjector(options: { factory: () => any; providers?: any[]; imports?: any[]; }): never; -/** @experimental */ export declare function destroyPlatform(): void; export declare const Directive: DirectiveDecorator; @@ -280,7 +262,6 @@ export declare class ElementRef { constructor(nativeElement: T); } -/** @experimental */ export declare abstract class EmbeddedViewRef extends ViewRef { abstract readonly context: C; abstract readonly rootNodes: any[]; @@ -309,24 +290,18 @@ export interface FactoryProvider extends FactorySansProvider { provide: any; } -/** @experimental */ export declare function forwardRef(forwardRefFn: ForwardRefFn): Type; -/** @experimental */ export interface ForwardRefFn { (): any; } -/** @experimental */ export declare function getDebugNode(nativeNode: any): DebugNode | null; -/** @experimental */ export declare function getModuleFactory(id: string): NgModuleFactory; -/** @experimental */ export declare function getPlatform(): PlatformRef | null; -/** @experimental */ export interface GetTestability { addToWindow(registry: TestabilityRegistry): void; findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null; @@ -343,7 +318,6 @@ export interface HostDecorator { export declare const HostListener: HostListenerDecorator; -/** @experimental */ export declare function inject(token: Type | InjectionToken): T; export declare function inject(token: Type | InjectionToken, flags?: InjectFlags): T | null; @@ -362,10 +336,8 @@ export interface InjectableDecorator { } & InjectableProvider): Injectable; } -/** @experimental */ export declare type InjectableProvider = ValueSansProvider | ExistingSansProvider | StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider; -/** @experimental */ export interface InjectableType extends Type { ngInjectableDef: never; } @@ -407,17 +379,14 @@ export declare abstract class Injector { }): Injector; } -/** @experimental */ export declare const INJECTOR: InjectionToken; -/** @experimental */ export interface InjectorType extends Type { ngInjectorDef: never; } export declare const Input: InputDecorator; -/** @experimental */ export declare function isDevMode(): boolean; export interface IterableChangeRecord { @@ -489,17 +458,14 @@ export declare class KeyValueDiffers { static extend(factories: KeyValueDifferFactory[]): StaticProvider; } -/** @experimental */ export declare const LOCALE_ID: InjectionToken; -/** @experimental */ export declare enum MissingTranslationStrategy { Error = 0, Warning = 1, Ignore = 2 } -/** @experimental */ export declare class ModuleWithComponentFactories { componentFactories: ComponentFactory[]; ngModuleFactory: NgModuleFactory; @@ -515,7 +481,6 @@ export declare type NgIterable = Array | Iterable; export declare const NgModule: NgModuleDecorator; -/** @experimental */ export declare abstract class NgModuleFactory { abstract readonly moduleType: Type; abstract create(parentInjector: Injector | null): NgModuleRef; @@ -533,14 +498,12 @@ export declare abstract class NgModuleRef { abstract onDestroy(callback: () => void): void; } -/** @experimental */ export declare class NgProbeToken { name: string; token: any; constructor(name: string, token: any); } -/** @experimental */ export declare class NgZone { readonly hasPendingMacrotasks: boolean; readonly hasPendingMicrotasks: boolean; @@ -561,7 +524,6 @@ export declare class NgZone { static isInAngularZone(): boolean; } -/** @experimental */ export declare const NO_ERRORS_SCHEMA: SchemaMetadata; export interface OnChanges { @@ -585,7 +547,6 @@ export interface OptionalDecorator { export declare const Output: OutputDecorator; -/** @experimental */ export declare const PACKAGE_ROOT_URL: InjectionToken; export declare const Pipe: PipeDecorator; @@ -594,25 +555,21 @@ export interface PipeTransform { transform(value: any, ...args: any[]): any; } -/** @experimental */ export declare const PLATFORM_ID: InjectionToken; -/** @experimental */ export declare const PLATFORM_INITIALIZER: InjectionToken<(() => void)[]>; -/** @experimental */ export declare const platformCore: (extraProviders?: StaticProvider[] | undefined) => PlatformRef; export declare class PlatformRef { readonly destroyed: boolean; readonly injector: Injector; bootstrapModule(moduleType: Type, compilerOptions?: (CompilerOptions & BootstrapOptions) | Array): Promise>; - /** @experimental */ bootstrapModuleFactory(moduleFactory: NgModuleFactory, options?: BootstrapOptions): Promise>; + bootstrapModuleFactory(moduleFactory: NgModuleFactory, options?: BootstrapOptions): Promise>; destroy(): void; onDestroy(callback: () => void): void; } -/** @experimental */ export interface Predicate { (value: T): boolean; } @@ -650,7 +607,7 @@ export declare abstract class ReflectiveInjector implements Injector { abstract instantiateResolved(provider: ResolvedReflectiveProvider): any; abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector; abstract resolveAndInstantiate(provider: Provider): any; - /** @experimental */ static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector; + static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector; static resolve(providers: Provider[]): ResolvedReflectiveProvider[]; static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector; } @@ -699,7 +656,6 @@ export declare abstract class Renderer { abstract setText(renderNode: any, text: string): void; } -/** @experimental */ export declare abstract class Renderer2 { abstract readonly data: { [key: string]: any; @@ -726,7 +682,6 @@ export declare abstract class Renderer2 { abstract setValue(node: any, value: string): void; } -/** @experimental */ export declare abstract class RendererFactory2 { abstract begin?(): void; abstract createRenderer(hostElement: any, type: RendererType2 | null): Renderer2; @@ -734,13 +689,11 @@ export declare abstract class RendererFactory2 { abstract whenRenderingDone?(): Promise; } -/** @experimental */ export declare enum RendererStyleFlags2 { Important = 1, DashCase = 2 } -/** @experimental */ export interface RendererType2 { data: { [kind: string]: any; @@ -750,7 +703,6 @@ export interface RendererType2 { styles: (string | any[])[]; } -/** @experimental */ export declare class ResolvedReflectiveFactory { dependencies: ReflectiveDependency[]; factory: Function; @@ -759,14 +711,12 @@ export declare class ResolvedReflectiveFactory { dependencies: ReflectiveDependency[]); } -/** @experimental */ export interface ResolvedReflectiveProvider { key: ReflectiveKey; multiProvider: boolean; resolvedFactories: ResolvedReflectiveFactory[]; } -/** @experimental */ export declare function resolveForwardRef(type: any): any; /** @deprecated */ @@ -778,7 +728,6 @@ export declare abstract class Sanitizer { abstract sanitize(context: SecurityContext, value: {} | string | null): string | null; } -/** @experimental */ export interface SchemaMetadata { name: string; } @@ -799,7 +748,6 @@ export interface SelfDecorator { new (): Self; } -/** @experimental */ export declare function setTestabilityGetter(getter: GetTestability): void; export declare class SimpleChange { @@ -823,13 +771,11 @@ export interface SkipSelfDecorator { export declare type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[]; -/** @experimental */ export declare class SystemJsNgModuleLoader implements NgModuleFactoryLoader { constructor(_compiler: Compiler, config?: SystemJsNgModuleLoaderConfig); load(path: string): Promise>; } -/** @experimental */ export declare abstract class SystemJsNgModuleLoaderConfig { factoryPathPrefix: string; factoryPathSuffix: string; @@ -840,7 +786,6 @@ export declare abstract class TemplateRef { abstract createEmbeddedView(context: C): EmbeddedViewRef; } -/** @experimental */ export declare class Testability implements PublicTestability { constructor(_ngZone: NgZone); /** @deprecated */ decreasePendingRequestCount(): number; @@ -851,7 +796,6 @@ export declare class Testability implements PublicTestability { whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void; } -/** @experimental */ export declare class TestabilityRegistry { constructor(); findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null; @@ -867,10 +811,8 @@ export interface TrackByFunction { (index: number, item: T): any; } -/** @experimental */ export declare const TRANSLATIONS: InjectionToken; -/** @experimental */ export declare const TRANSLATIONS_FORMAT: InjectionToken; export declare const Type: FunctionConstructor; @@ -957,19 +899,14 @@ export declare class WrappedValue { static wrap(value: any): WrappedValue; } -/** @experimental */ export declare const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn; -/** @experimental */ export declare const wtfEndTimeRange: (range: any) => void; -/** @experimental */ export declare const wtfLeave: (scope: any, returnValue?: T) => T; -/** @experimental */ export interface WtfScopeFn { (arg0?: any, arg1?: any): any; } -/** @experimental */ export declare const wtfStartTimeRange: (rangeType: string, action: string) => any; diff --git a/tools/public_api_guard/core/testing.d.ts b/tools/public_api_guard/core/testing.d.ts index f4b77d98fd..a7a5afa4cc 100644 --- a/tools/public_api_guard/core/testing.d.ts +++ b/tools/public_api_guard/core/testing.d.ts @@ -18,43 +18,33 @@ export declare class ComponentFixture { whenStable(): Promise; } -/** @experimental */ export declare const ComponentFixtureAutoDetect: InjectionToken; -/** @experimental */ export declare const ComponentFixtureNoNgZone: InjectionToken; -/** @experimental */ export declare function discardPeriodicTasks(): void; -/** @experimental */ export declare function fakeAsync(fn: Function): (...args: any[]) => any; -/** @experimental */ export declare function flush(maxTurns?: number): number; -/** @experimental */ export declare function flushMicrotasks(): void; -/** @experimental */ export declare const getTestBed: () => TestBed; export declare function inject(tokens: any[], fn: Function): () => any; -/** @experimental */ export declare class InjectSetupWrapper { constructor(_moduleDef: () => TestModuleMetadata); inject(tokens: any[], fn: Function): () => any; } -/** @experimental */ export declare type MetadataOverride = { add?: Partial; remove?: Partial; set?: Partial; }; -/** @experimental */ export declare function resetFakeAsyncZone(): void; export declare const TestBed: TestBedStatic; @@ -100,16 +90,14 @@ export interface TestBedStatic { }): TestBedStatic; overrideTemplate(component: Type, template: string): TestBedStatic; overrideTemplateUsingTestingModule(component: Type, template: string): TestBedStatic; - /** @experimental */ resetTestEnvironment(): void; + resetTestEnvironment(): void; resetTestingModule(): TestBedStatic; } -/** @experimental */ export declare class TestComponentRenderer { insertRootElement(rootElementId: string): void; } -/** @experimental */ export declare type TestModuleMetadata = { providers?: any[]; declarations?: any[]; @@ -118,9 +106,7 @@ export declare type TestModuleMetadata = { aotSummaries?: () => any[]; }; -/** @experimental */ export declare function tick(millis?: number): void; -/** @experimental */ export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper; export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;