From 7fbe547f782187acd9cf37444ed7fd41483773ec Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Fri, 19 Oct 2018 14:37:01 +0100 Subject: [PATCH] docs: update platform-browser with `@publicApi` tags (#26595) PR Close #26595 --- packages/platform-browser/src/browser.ts | 7 ++++--- packages/platform-browser/src/dom/dom_tokens.ts | 1 + .../src/dom/events/event_manager.ts | 4 ++++ .../src/dom/events/hammer_gestures.ts | 12 ++++++++++-- .../src/security/dom_sanitization_service.ts | 14 +++++++------- packages/platform-browser/src/version.ts | 3 +++ packages/platform-browser/testing/src/browser.ts | 4 ++-- .../platform-browser/animations.d.ts | 3 --- .../platform-browser/platform-browser.d.ts | 14 +------------- 9 files changed, 32 insertions(+), 30 deletions(-) diff --git a/packages/platform-browser/src/browser.ts b/packages/platform-browser/src/browser.ts index 2bc3a0e77e..ac7768edfb 100644 --- a/packages/platform-browser/src/browser.ts +++ b/packages/platform-browser/src/browser.ts @@ -41,6 +41,9 @@ export const BROWSER_SANITIZATION_PROVIDERS: StaticProvider[] = [ {provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT]}, ]; +/** + * @publicApi + */ export const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS); @@ -95,7 +98,7 @@ export const BROWSER_MODULE_PROVIDERS: StaticProvider[] = [ * Re-exports `CommonModule` and `ApplicationModule`, making their * exports and providers available to all apps. * - * + * @publicApi */ @NgModule({providers: BROWSER_MODULE_PROVIDERS, exports: [CommonModule, ApplicationModule]}) export class BrowserModule { @@ -113,8 +116,6 @@ export class BrowserModule { * @param params An object containing an identifier for the app to transition. * The ID must match between the client and server versions of the app. * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`. - * - * @publicApi */ static withServerTransition(params: {appId: string}): ModuleWithProviders { return { diff --git a/packages/platform-browser/src/dom/dom_tokens.ts b/packages/platform-browser/src/dom/dom_tokens.ts index aa05acce33..239805dc39 100644 --- a/packages/platform-browser/src/dom/dom_tokens.ts +++ b/packages/platform-browser/src/dom/dom_tokens.ts @@ -17,5 +17,6 @@ import {InjectionToken} from '@angular/core'; * Contexts are not the same (e.g. when running the application into a Web Worker). * * @deprecated import from `@angular/common` instead. + * @publicApi */ export const DOCUMENT = commonDOCUMENT; diff --git a/packages/platform-browser/src/dom/events/event_manager.ts b/packages/platform-browser/src/dom/events/event_manager.ts index f362b9c0d2..e54c2fc51e 100644 --- a/packages/platform-browser/src/dom/events/event_manager.ts +++ b/packages/platform-browser/src/dom/events/event_manager.ts @@ -12,6 +12,8 @@ import {getDOM} from '../dom_adapter'; /** * The injection token for the event-manager plug-in service. + * + * @publicApi */ export const EVENT_MANAGER_PLUGINS = new InjectionToken('EventManagerPlugins'); @@ -19,6 +21,8 @@ export const EVENT_MANAGER_PLUGINS = /** * An injectable service that provides event management for Angular * through a browser plug-in. + * + * @publicApi */ @Injectable() export class EventManager { diff --git a/packages/platform-browser/src/dom/events/hammer_gestures.ts b/packages/platform-browser/src/dom/events/hammer_gestures.ts index 37bdd3631a..9781bca718 100644 --- a/packages/platform-browser/src/dom/events/hammer_gestures.ts +++ b/packages/platform-browser/src/dom/events/hammer_gestures.ts @@ -62,10 +62,18 @@ const EVENT_NAMES = { export const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig'); -/** Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded. */ +/** + * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded. + * + * @publicApi + */ export type HammerLoader = () => Promise; -/** Injection token used to provide a {@link HammerLoader} to Angular. */ +/** + * Injection token used to provide a {@link HammerLoader} to Angular. + * + * @publicApi + */ export const HAMMER_LOADER = new InjectionToken('HammerLoader'); export interface HammerInstance { diff --git a/packages/platform-browser/src/security/dom_sanitization_service.ts b/packages/platform-browser/src/security/dom_sanitization_service.ts index 7c2dd51bb5..c0ac08fa8e 100644 --- a/packages/platform-browser/src/security/dom_sanitization_service.ts +++ b/packages/platform-browser/src/security/dom_sanitization_service.ts @@ -17,42 +17,42 @@ export {SecurityContext}; /** * Marker interface for a value that's safe to use in a particular context. * - * + * @publicApi */ export interface SafeValue {} /** * Marker interface for a value that's safe to use as HTML. * - * + * @publicApi */ export interface SafeHtml extends SafeValue {} /** * Marker interface for a value that's safe to use as style (CSS). * - * + * @publicApi */ export interface SafeStyle extends SafeValue {} /** * Marker interface for a value that's safe to use as JavaScript. * - * + * @publicApi */ export interface SafeScript extends SafeValue {} /** * Marker interface for a value that's safe to use as a URL linking to a document. * - * + * @publicApi */ export interface SafeUrl extends SafeValue {} /** * Marker interface for a value that's safe to use as a URL to load executable code from. * - * + * @publicApi */ export interface SafeResourceUrl extends SafeValue {} @@ -85,7 +85,7 @@ export interface SafeResourceUrl extends SafeValue {} * into this call. Make sure any user data is appropriately escaped for this security context. * For more detail, see the [Security Guide](http://g.co/ng/security). * - * + * @publicApi */ export abstract class DomSanitizer implements Sanitizer { /** diff --git a/packages/platform-browser/src/version.ts b/packages/platform-browser/src/version.ts index af66f0fa27..9469ebe5e5 100644 --- a/packages/platform-browser/src/version.ts +++ b/packages/platform-browser/src/version.ts @@ -14,4 +14,7 @@ import {Version} from '@angular/core'; +/** + * @publicApi + */ export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/packages/platform-browser/testing/src/browser.ts b/packages/platform-browser/testing/src/browser.ts index 2ed2e6c194..77f9d7675f 100644 --- a/packages/platform-browser/testing/src/browser.ts +++ b/packages/platform-browser/testing/src/browser.ts @@ -20,7 +20,7 @@ const _TEST_BROWSER_PLATFORM_PROVIDERS: StaticProvider[] = /** * Platform for testing * - * + * @publicApi */ export const platformBrowserTesting = createPlatformFactory(platformCore, 'browserTesting', _TEST_BROWSER_PLATFORM_PROVIDERS); @@ -28,7 +28,7 @@ export const platformBrowserTesting = /** * NgModule for testing. * - * + * @publicApi */ @NgModule({ exports: [BrowserModule], diff --git a/tools/public_api_guard/platform-browser/animations.d.ts b/tools/public_api_guard/platform-browser/animations.d.ts index bd3ae195d5..80b165214e 100644 --- a/tools/public_api_guard/platform-browser/animations.d.ts +++ b/tools/public_api_guard/platform-browser/animations.d.ts @@ -1,10 +1,7 @@ -/** @experimental */ export declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">; -/** @experimental */ export declare class BrowserAnimationsModule { } -/** @experimental */ export declare class NoopAnimationsModule { } diff --git a/tools/public_api_guard/platform-browser/platform-browser.d.ts b/tools/public_api_guard/platform-browser/platform-browser.d.ts index df3c1c135a..41edf392a5 100644 --- a/tools/public_api_guard/platform-browser/platform-browser.d.ts +++ b/tools/public_api_guard/platform-browser/platform-browser.d.ts @@ -1,22 +1,19 @@ export declare class BrowserModule { constructor(parentModule: BrowserModule | null); - /** @experimental */ static withServerTransition(params: { + static withServerTransition(params: { appId: string; }): ModuleWithProviders; } -/** @experimental */ export declare class BrowserTransferStateModule { } -/** @experimental */ export declare class By { static all(): Predicate; static css(selector: string): Predicate; static directive(type: Type): Predicate; } -/** @experimental */ export declare function disableDebugTools(): void; /** @deprecated */ @@ -31,7 +28,6 @@ export declare abstract class DomSanitizer implements Sanitizer { abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null; } -/** @experimental */ export declare function enableDebugTools(ref: ComponentRef): ComponentRef; export declare const EVENT_MANAGER_PLUGINS: InjectionToken; @@ -43,12 +39,10 @@ export declare class EventManager { getZone(): NgZone; } -/** @experimental */ export declare const HAMMER_GESTURE_CONFIG: InjectionToken; export declare const HAMMER_LOADER: InjectionToken; -/** @experimental */ export declare class HammerGestureConfig { events: string[]; options?: { @@ -69,10 +63,8 @@ export declare class HammerGestureConfig { export declare type HammerLoader = () => Promise; -/** @experimental */ export declare function makeStateKey(key: string): StateKey; -/** @experimental */ export declare class Meta { constructor(_doc: any); addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null; @@ -84,7 +76,6 @@ export declare class Meta { updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null; } -/** @experimental */ export declare type MetaDefinition = { charset?: string; content?: string; @@ -119,19 +110,16 @@ export interface SafeUrl extends SafeValue { export interface SafeValue { } -/** @experimental */ export declare type StateKey = string & { __not_a_string: never; }; -/** @experimental */ export declare class Title { constructor(_doc: any); getTitle(): string; setTitle(newTitle: string): void; } -/** @experimental */ export declare class TransferState { get(key: StateKey, defaultValue: T): T; hasKey(key: StateKey): boolean;