docs: update platform-browser with `@publicApi` tags (#26595)

PR Close #26595
This commit is contained in:
Pete Bacon Darwin 2018-10-19 14:37:01 +01:00 committed by Alex Rickabaugh
parent c5949f85ef
commit 0bae97a726
9 changed files with 32 additions and 30 deletions

View File

@ -41,6 +41,9 @@ export const BROWSER_SANITIZATION_PROVIDERS: StaticProvider[] = [
{provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT]}, {provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT]},
]; ];
/**
* @publicApi
*/
export const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef = export const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef =
createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS); createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
@ -95,7 +98,7 @@ export const BROWSER_MODULE_PROVIDERS: StaticProvider[] = [
* Re-exports `CommonModule` and `ApplicationModule`, making their * Re-exports `CommonModule` and `ApplicationModule`, making their
* exports and providers available to all apps. * exports and providers available to all apps.
* *
* * @publicApi
*/ */
@NgModule({providers: BROWSER_MODULE_PROVIDERS, exports: [CommonModule, ApplicationModule]}) @NgModule({providers: BROWSER_MODULE_PROVIDERS, exports: [CommonModule, ApplicationModule]})
export class BrowserModule { export class BrowserModule {
@ -113,8 +116,6 @@ export class BrowserModule {
* @param params An object containing an identifier for the app to transition. * @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. * 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`. * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.
*
* @publicApi
*/ */
static withServerTransition(params: {appId: string}): ModuleWithProviders<BrowserModule> { static withServerTransition(params: {appId: string}): ModuleWithProviders<BrowserModule> {
return { return {

View File

@ -17,5 +17,6 @@ import {InjectionToken} from '@angular/core';
* Contexts are not the same (e.g. when running the application into a Web Worker). * Contexts are not the same (e.g. when running the application into a Web Worker).
* *
* @deprecated import from `@angular/common` instead. * @deprecated import from `@angular/common` instead.
* @publicApi
*/ */
export const DOCUMENT = commonDOCUMENT; export const DOCUMENT = commonDOCUMENT;

View File

@ -12,6 +12,8 @@ import {getDOM} from '../dom_adapter';
/** /**
* The injection token for the event-manager plug-in service. * The injection token for the event-manager plug-in service.
*
* @publicApi
*/ */
export const EVENT_MANAGER_PLUGINS = export const EVENT_MANAGER_PLUGINS =
new InjectionToken<EventManagerPlugin[]>('EventManagerPlugins'); new InjectionToken<EventManagerPlugin[]>('EventManagerPlugins');
@ -19,6 +21,8 @@ export const EVENT_MANAGER_PLUGINS =
/** /**
* An injectable service that provides event management for Angular * An injectable service that provides event management for Angular
* through a browser plug-in. * through a browser plug-in.
*
* @publicApi
*/ */
@Injectable() @Injectable()
export class EventManager { export class EventManager {

View File

@ -62,10 +62,18 @@ const EVENT_NAMES = {
export const HAMMER_GESTURE_CONFIG = new InjectionToken<HammerGestureConfig>('HammerGestureConfig'); export const HAMMER_GESTURE_CONFIG = new InjectionToken<HammerGestureConfig>('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<void>; export type HammerLoader = () => Promise<void>;
/** 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>('HammerLoader'); export const HAMMER_LOADER = new InjectionToken<HammerLoader>('HammerLoader');
export interface HammerInstance { export interface HammerInstance {

View File

@ -17,42 +17,42 @@ export {SecurityContext};
/** /**
* Marker interface for a value that's safe to use in a particular context. * Marker interface for a value that's safe to use in a particular context.
* *
* * @publicApi
*/ */
export interface SafeValue {} 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.
* *
* * @publicApi
*/ */
export interface SafeHtml extends SafeValue {} 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).
* *
* * @publicApi
*/ */
export interface SafeStyle extends SafeValue {} 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.
* *
* * @publicApi
*/ */
export interface SafeScript extends SafeValue {} 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.
* *
* * @publicApi
*/ */
export interface SafeUrl extends SafeValue {} 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.
* *
* * @publicApi
*/ */
export interface SafeResourceUrl extends SafeValue {} 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. * 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). * For more detail, see the [Security Guide](http://g.co/ng/security).
* *
* * @publicApi
*/ */
export abstract class DomSanitizer implements Sanitizer { export abstract class DomSanitizer implements Sanitizer {
/** /**

View File

@ -14,4 +14,7 @@
import {Version} from '@angular/core'; import {Version} from '@angular/core';
/**
* @publicApi
*/
export const VERSION = new Version('0.0.0-PLACEHOLDER'); export const VERSION = new Version('0.0.0-PLACEHOLDER');

View File

@ -20,7 +20,7 @@ const _TEST_BROWSER_PLATFORM_PROVIDERS: StaticProvider[] =
/** /**
* Platform for testing * Platform for testing
* *
* * @publicApi
*/ */
export const platformBrowserTesting = export const platformBrowserTesting =
createPlatformFactory(platformCore, 'browserTesting', _TEST_BROWSER_PLATFORM_PROVIDERS); createPlatformFactory(platformCore, 'browserTesting', _TEST_BROWSER_PLATFORM_PROVIDERS);
@ -28,7 +28,7 @@ export const platformBrowserTesting =
/** /**
* NgModule for testing. * NgModule for testing.
* *
* * @publicApi
*/ */
@NgModule({ @NgModule({
exports: [BrowserModule], exports: [BrowserModule],

View File

@ -1,10 +1,7 @@
/** @experimental */
export declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">; export declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">;
/** @experimental */
export declare class BrowserAnimationsModule { export declare class BrowserAnimationsModule {
} }
/** @experimental */
export declare class NoopAnimationsModule { export declare class NoopAnimationsModule {
} }

View File

@ -1,22 +1,19 @@
export declare class BrowserModule { export declare class BrowserModule {
constructor(parentModule: BrowserModule | null); constructor(parentModule: BrowserModule | null);
/** @experimental */ static withServerTransition(params: { static withServerTransition(params: {
appId: string; appId: string;
}): ModuleWithProviders<BrowserModule>; }): ModuleWithProviders<BrowserModule>;
} }
/** @experimental */
export declare class BrowserTransferStateModule { export declare class BrowserTransferStateModule {
} }
/** @experimental */
export declare class By { export declare class By {
static all(): Predicate<DebugElement>; static all(): Predicate<DebugElement>;
static css(selector: string): Predicate<DebugElement>; static css(selector: string): Predicate<DebugElement>;
static directive(type: Type<any>): Predicate<DebugElement>; static directive(type: Type<any>): Predicate<DebugElement>;
} }
/** @experimental */
export declare function disableDebugTools(): void; export declare function disableDebugTools(): void;
/** @deprecated */ /** @deprecated */
@ -31,7 +28,6 @@ export declare abstract class DomSanitizer implements Sanitizer {
abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null; abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null;
} }
/** @experimental */
export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>; export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
export declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>; export declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>;
@ -43,12 +39,10 @@ export declare class EventManager {
getZone(): NgZone; getZone(): NgZone;
} }
/** @experimental */
export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>; export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
export declare const HAMMER_LOADER: InjectionToken<HammerLoader>; export declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
/** @experimental */
export declare class HammerGestureConfig { export declare class HammerGestureConfig {
events: string[]; events: string[];
options?: { options?: {
@ -69,10 +63,8 @@ export declare class HammerGestureConfig {
export declare type HammerLoader = () => Promise<void>; export declare type HammerLoader = () => Promise<void>;
/** @experimental */
export declare function makeStateKey<T = void>(key: string): StateKey<T>; export declare function makeStateKey<T = void>(key: string): StateKey<T>;
/** @experimental */
export declare class Meta { export declare class Meta {
constructor(_doc: any); constructor(_doc: any);
addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null; addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null;
@ -84,7 +76,6 @@ export declare class Meta {
updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null; updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null;
} }
/** @experimental */
export declare type MetaDefinition = { export declare type MetaDefinition = {
charset?: string; charset?: string;
content?: string; content?: string;
@ -119,19 +110,16 @@ export interface SafeUrl extends SafeValue {
export interface SafeValue { export interface SafeValue {
} }
/** @experimental */
export declare type StateKey<T> = string & { export declare type StateKey<T> = string & {
__not_a_string: never; __not_a_string: never;
}; };
/** @experimental */
export declare class Title { export declare class Title {
constructor(_doc: any); constructor(_doc: any);
getTitle(): string; getTitle(): string;
setTitle(newTitle: string): void; setTitle(newTitle: string): void;
} }
/** @experimental */
export declare class TransferState { export declare class TransferState {
get<T>(key: StateKey<T>, defaultValue: T): T; get<T>(key: StateKey<T>, defaultValue: T): T;
hasKey<T>(key: StateKey<T>): boolean; hasKey<T>(key: StateKey<T>): boolean;