From 0977d95802f356830a0ae97198ecb7eae32c38e7 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 19 Feb 2019 19:52:21 +0000 Subject: [PATCH] docs(core): export the `...Decorator` interfaces to ensure they are documented (#28836) (#28961) If an interface is not exported publicly from its package, then the doc-gen does not see it, and so cannot include it in the generated documentation. This was the case for a number of `...Decorator` interfaces, such as `PipeDecorator` and `InputDecorator. This commit adds these interfaces to the public export to fix this problem. PR Close #28836 PR Close #28961 --- packages/core/src/metadata.ts | 2 +- tools/public_api_guard/core/core.d.ts | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/core/src/metadata.ts b/packages/core/src/metadata.ts index d377b0afae..adcd4531e0 100644 --- a/packages/core/src/metadata.ts +++ b/packages/core/src/metadata.ts @@ -17,7 +17,7 @@ import {DoBootstrap, ModuleWithProviders, NgModule, SchemaMetadata} from './meta import {ViewEncapsulation} from './metadata/view'; export {ANALYZE_FOR_ENTRY_COMPONENTS, Attribute, ContentChild, ContentChildDecorator, ContentChildren, ContentChildrenDecorator, Query, ViewChild, ViewChildDecorator, ViewChildren, ViewChildrenDecorator} from './metadata/di'; -export {Component, ComponentDecorator, Directive, DirectiveDecorator, HostBinding, HostListener, Input, Output, Pipe} from './metadata/directives'; +export {Component, ComponentDecorator, Directive, DirectiveDecorator, HostBinding, HostBindingDecorator, HostListener, HostListenerDecorator, Input, InputDecorator, Output, OutputDecorator, Pipe, PipeDecorator} from './metadata/directives'; export {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit} from './metadata/lifecycle_hooks'; export {CUSTOM_ELEMENTS_SCHEMA, DoBootstrap, ModuleWithProviders, NO_ERRORS_SCHEMA, NgModule, SchemaMetadata} from './metadata/ng_module'; export {ViewEncapsulation} from './metadata/view'; diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index f9fd78569c..ddb3d4a20f 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -354,6 +354,11 @@ export interface HostBinding { export declare const HostBinding: HostBindingDecorator; +export interface HostBindingDecorator { + (hostPropertyName?: string): any; + new (hostPropertyName?: string): any; +} + export interface HostDecorator { (): any; new (): Host; @@ -366,6 +371,11 @@ export interface HostListener { export declare const HostListener: HostListenerDecorator; +export interface HostListenerDecorator { + (eventName: string, args?: string[]): any; + new (eventName: string, args?: string[]): any; +} + export declare function inject(token: Type | InjectionToken): T; export declare function inject(token: Type | InjectionToken, flags?: InjectFlags): T | null; @@ -447,6 +457,11 @@ export interface Input { export declare const Input: InputDecorator; +export interface InputDecorator { + (bindingPropertyName?: string): any; + new (bindingPropertyName?: string): any; +} + export declare function isDevMode(): boolean; export interface IterableChangeRecord { @@ -627,6 +642,11 @@ export interface Output { export declare const Output: OutputDecorator; +export interface OutputDecorator { + (bindingPropertyName?: string): any; + new (bindingPropertyName?: string): any; +} + export declare const PACKAGE_ROOT_URL: InjectionToken; export interface Pipe { @@ -636,6 +656,11 @@ export interface Pipe { export declare const Pipe: PipeDecorator; +export interface PipeDecorator { + (obj: Pipe): TypeDecorator; + new (obj: Pipe): Pipe; +} + export interface PipeTransform { transform(value: any, ...args: any[]): any; }