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]},
];
/**
* @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<BrowserModule> {
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).
*
* @deprecated import from `@angular/common` instead.
* @publicApi
*/
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.
*
* @publicApi
*/
export const EVENT_MANAGER_PLUGINS =
new InjectionToken<EventManagerPlugin[]>('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 {

View File

@ -62,10 +62,18 @@ const EVENT_NAMES = {
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>;
/** 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 interface HammerInstance {

View File

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

View File

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

View File

@ -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],

View File

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

View File

@ -1,22 +1,19 @@
export declare class BrowserModule {
constructor(parentModule: BrowserModule | null);
/** @experimental */ static withServerTransition(params: {
static withServerTransition(params: {
appId: string;
}): ModuleWithProviders<BrowserModule>;
}
/** @experimental */
export declare class BrowserTransferStateModule {
}
/** @experimental */
export declare class By {
static all(): Predicate<DebugElement>;
static css(selector: string): Predicate<DebugElement>;
static directive(type: Type<any>): Predicate<DebugElement>;
}
/** @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<T>(ref: ComponentRef<T>): ComponentRef<T>;
export declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>;
@ -43,12 +39,10 @@ export declare class EventManager {
getZone(): NgZone;
}
/** @experimental */
export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
export declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
/** @experimental */
export declare class HammerGestureConfig {
events: string[];
options?: {
@ -69,10 +63,8 @@ export declare class HammerGestureConfig {
export declare type HammerLoader = () => Promise<void>;
/** @experimental */
export declare function makeStateKey<T = void>(key: string): StateKey<T>;
/** @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<T> = 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<T>(key: StateKey<T>, defaultValue: T): T;
hasKey<T>(key: StateKey<T>): boolean;