docs: update core to use @publicApi tags (#26595)

PR Close #26595
This commit is contained in:
Pete Bacon Darwin
2018-10-19 16:27:04 +01:00
committed by Alex Rickabaugh
parent 0918adf39d
commit 3903e5ebe7
46 changed files with 179 additions and 139 deletions

View File

@ -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) =>

View File

@ -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}));

View File

@ -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 {
/**

View File

@ -72,6 +72,8 @@ export interface NgModuleDef<T> {
*
* @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; }

View File

@ -13,7 +13,10 @@
*
* @usageNotes
* ### Example
*
* {@example core/ts/metadata/encapsulation.ts region='longform'}
*
* @publicApi
*/
export enum ViewEncapsulation {
/**