@angular/platform-browser
Advanced tools
Comparing version
/** | ||
* @license Angular v20.0.0-next.1 | ||
* @license Angular v20.0.0-next.2 | ||
* (c) 2010-2025 Google LLC. https://angular.io/ | ||
@@ -7,13 +7,5 @@ * License: MIT | ||
import { EnvironmentProviders } from '@angular/core'; | ||
import * as i0 from '@angular/core'; | ||
import { InjectionToken } from '@angular/core'; | ||
import { NgZone } from '@angular/core'; | ||
import { OnDestroy } from '@angular/core'; | ||
import { Renderer2 } from '@angular/core'; | ||
import { RendererFactory2 } from '@angular/core'; | ||
import { RendererType2 } from '@angular/core'; | ||
import { ɵAnimationEngine } from '@angular/animations/browser'; | ||
import { ɵAnimationRendererFactory } from '@angular/animations/browser'; | ||
import { EnvironmentProviders, OnDestroy, RendererFactory2, NgZone, RendererType2, Renderer2, InjectionToken } from '@angular/core'; | ||
import { ɵAnimationEngine as _AnimationEngine, ɵAnimationRendererFactory as _AnimationRendererFactory } from '@angular/animations/browser'; | ||
@@ -47,12 +39,5 @@ /** | ||
*/ | ||
export declare function provideAnimationsAsync(type?: 'animations' | 'noop'): EnvironmentProviders; | ||
declare function provideAnimationsAsync(type?: 'animations' | 'noop'): EnvironmentProviders; | ||
/** | ||
* Provides a custom scheduler function for the async loading of the animation package. | ||
* | ||
* Private token for investigation purposes | ||
*/ | ||
export declare const ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN: InjectionToken<(<T>(loadFn: () => T) => T)>; | ||
export declare class ɵAsyncAnimationRendererFactory implements OnDestroy, RendererFactory2 { | ||
declare class AsyncAnimationRendererFactory implements OnDestroy, RendererFactory2 { | ||
private doc; | ||
@@ -73,4 +58,4 @@ private delegate; | ||
constructor(doc: Document, delegate: RendererFactory2, zone: NgZone, animationType: 'animations' | 'noop', moduleImpl?: Promise<{ | ||
ɵcreateEngine: (type: "animations" | "noop", doc: Document) => ɵAnimationEngine; | ||
ɵAnimationRendererFactory: typeof ɵAnimationRendererFactory; | ||
ɵcreateEngine: (type: "animations" | "noop", doc: Document) => _AnimationEngine; | ||
ɵAnimationRendererFactory: typeof _AnimationRendererFactory; | ||
}> | undefined); | ||
@@ -96,6 +81,12 @@ /** @nodoc */ | ||
protected componentReplaced(componentId: string): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵAsyncAnimationRendererFactory, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵAsyncAnimationRendererFactory>; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<AsyncAnimationRendererFactory, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<AsyncAnimationRendererFactory>; | ||
} | ||
/** | ||
* Provides a custom scheduler function for the async loading of the animation package. | ||
* | ||
* Private token for investigation purposes | ||
*/ | ||
declare const ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN: InjectionToken<(<T>(loadFn: () => T) => T)>; | ||
export { } | ||
export { provideAnimationsAsync, ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN, AsyncAnimationRendererFactory as ɵAsyncAnimationRendererFactory }; |
/** | ||
* @license Angular v20.0.0-next.1 | ||
* @license Angular v20.0.0-next.2 | ||
* (c) 2010-2025 Google LLC. https://angular.io/ | ||
@@ -7,16 +7,20 @@ * License: MIT | ||
import { ANIMATION_MODULE_TYPE } from '@angular/core'; | ||
import { AnimationDriver } from '@angular/animations/browser'; | ||
import * as i0 from '@angular/core'; | ||
import { ModuleWithProviders, Provider, OnDestroy } from '@angular/core'; | ||
export { ANIMATION_MODULE_TYPE } from '@angular/core'; | ||
import * as i1 from '@angular/platform-browser'; | ||
import { ModuleWithProviders } from '@angular/core'; | ||
import { OnDestroy } from '@angular/core'; | ||
import { Provider } from '@angular/core'; | ||
import { ɵAnimationEngine } from '@angular/animations/browser'; | ||
import { ɵAnimationStyleNormalizer } from '@angular/animations/browser'; | ||
import { ɵAnimationEngine as _AnimationEngine, AnimationDriver, ɵAnimationStyleNormalizer as _AnimationStyleNormalizer } from '@angular/animations/browser'; | ||
export { ANIMATION_MODULE_TYPE } | ||
/** | ||
* Object used to configure the behavior of {@link BrowserAnimationsModule} | ||
* @publicApi | ||
*/ | ||
interface BrowserAnimationsModuleConfig { | ||
/** | ||
* Whether animations should be disabled. Passing this is identical to providing the | ||
* `NoopAnimationsModule`, but it can be controlled based on a runtime value. | ||
*/ | ||
disableAnimations?: boolean; | ||
} | ||
/** | ||
* Exports `BrowserModule` with additional dependency-injection providers | ||
@@ -26,3 +30,3 @@ * for use with animations. See [Animations](guide/animations). | ||
*/ | ||
export declare class BrowserAnimationsModule { | ||
declare class BrowserAnimationsModule { | ||
/** | ||
@@ -49,26 +53,3 @@ * Configures the module based on the specified object. | ||
} | ||
/** | ||
* Object used to configure the behavior of {@link BrowserAnimationsModule} | ||
* @publicApi | ||
*/ | ||
export declare interface BrowserAnimationsModuleConfig { | ||
/** | ||
* Whether animations should be disabled. Passing this is identical to providing the | ||
* `NoopAnimationsModule`, but it can be controlled based on a runtime value. | ||
*/ | ||
disableAnimations?: boolean; | ||
} | ||
/** | ||
* A null player that must be imported to allow disabling of animations. | ||
* @publicApi | ||
*/ | ||
export declare class NoopAnimationsModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<NoopAnimationsModule, never>; | ||
static ɵmod: i0.ɵɵNgModuleDeclaration<NoopAnimationsModule, never, never, [typeof i1.BrowserModule]>; | ||
static ɵinj: i0.ɵɵInjectorDeclaration<NoopAnimationsModule>; | ||
} | ||
/** | ||
* Returns the set of dependency-injection providers | ||
@@ -95,5 +76,13 @@ * to enable animations in an application. See [animations guide](guide/animations) | ||
*/ | ||
export declare function provideAnimations(): Provider[]; | ||
declare function provideAnimations(): Provider[]; | ||
/** | ||
* A null player that must be imported to allow disabling of animations. | ||
* @publicApi | ||
*/ | ||
declare class NoopAnimationsModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<NoopAnimationsModule, never>; | ||
static ɵmod: i0.ɵɵNgModuleDeclaration<NoopAnimationsModule, never, never, [typeof i1.BrowserModule]>; | ||
static ɵinj: i0.ɵɵInjectorDeclaration<NoopAnimationsModule>; | ||
} | ||
/** | ||
* Returns the set of dependency-injection providers | ||
@@ -119,11 +108,11 @@ * to disable animations in an application. See [animations guide](guide/animations) | ||
*/ | ||
export declare function provideNoopAnimations(): Provider[]; | ||
declare function provideNoopAnimations(): Provider[]; | ||
export declare class ɵInjectableAnimationEngine extends ɵAnimationEngine implements OnDestroy { | ||
constructor(doc: Document, driver: AnimationDriver, normalizer: ɵAnimationStyleNormalizer); | ||
declare class InjectableAnimationEngine extends _AnimationEngine implements OnDestroy { | ||
constructor(doc: Document, driver: AnimationDriver, normalizer: _AnimationStyleNormalizer); | ||
ngOnDestroy(): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵInjectableAnimationEngine, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵInjectableAnimationEngine>; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<InjectableAnimationEngine, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<InjectableAnimationEngine>; | ||
} | ||
export { } | ||
export { BrowserAnimationsModule, type BrowserAnimationsModuleConfig, NoopAnimationsModule, provideAnimations, provideNoopAnimations, InjectableAnimationEngine as ɵInjectableAnimationEngine }; |
1096
index.d.ts
/** | ||
* @license Angular v20.0.0-next.1 | ||
* @license Angular v20.0.0-next.2 | ||
* (c) 2010-2025 Google LLC. https://angular.io/ | ||
@@ -7,35 +7,8 @@ * License: MIT | ||
import { ApplicationConfig as ApplicationConfig_2 } from '@angular/core'; | ||
import { ApplicationRef } from '@angular/core'; | ||
import { ComponentRef } from '@angular/core'; | ||
import { DebugElement } from '@angular/core'; | ||
import { DebugNode } from '@angular/core'; | ||
import { EnvironmentProviders } from '@angular/core'; | ||
import { GetTestability } from '@angular/core'; | ||
import { HttpTransferCacheOptions } from '@angular/common/http'; | ||
import * as i0 from '@angular/core'; | ||
import { ApplicationConfig as ApplicationConfig$1, Type, ApplicationRef, StaticProvider, PlatformRef, Provider, ComponentRef, Predicate, DebugNode, DebugElement, InjectionToken, NgZone, ListenerOptions, OnDestroy, RendererFactory2, ɵTracingService as _TracingService, ɵTracingSnapshot as _TracingSnapshot, RendererType2, Renderer2, Injector, Sanitizer, SecurityContext, EnvironmentProviders, GetTestability, TestabilityRegistry, Testability, Version } from '@angular/core'; | ||
import * as i1 from '@angular/common'; | ||
import { InjectionToken } from '@angular/core'; | ||
import { Injector } from '@angular/core'; | ||
import { ListenerOptions } from '@angular/core'; | ||
import { NgZone } from '@angular/core'; | ||
import { OnDestroy } from '@angular/core'; | ||
import { PlatformRef } from '@angular/core'; | ||
import { Predicate } from '@angular/core'; | ||
import { Provider } from '@angular/core'; | ||
import { Renderer2 } from '@angular/core'; | ||
import { RendererFactory2 } from '@angular/core'; | ||
import { RendererType2 } from '@angular/core'; | ||
import { Sanitizer } from '@angular/core'; | ||
import { SecurityContext } from '@angular/core'; | ||
import { StaticProvider } from '@angular/core'; | ||
import { Testability } from '@angular/core'; | ||
import { TestabilityRegistry } from '@angular/core'; | ||
import { Type } from '@angular/core'; | ||
import { Version } from '@angular/core'; | ||
import { ɵDomAdapter } from '@angular/common'; | ||
import { ɵgetDOM } from '@angular/common'; | ||
import { ɵTracingService } from '@angular/core'; | ||
import { ɵTracingSnapshot } from '@angular/core'; | ||
import { ɵDomAdapter as _DomAdapter } from '@angular/common'; | ||
export { ɵgetDOM } from '@angular/common'; | ||
import { HttpTransferCacheOptions } from '@angular/common/http'; | ||
@@ -50,3 +23,3 @@ /** | ||
*/ | ||
export declare type ApplicationConfig = ApplicationConfig_2; | ||
type ApplicationConfig = ApplicationConfig$1; | ||
@@ -112,5 +85,38 @@ /** | ||
*/ | ||
export declare function bootstrapApplication(rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef>; | ||
declare function bootstrapApplication(rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef>; | ||
/** | ||
* Create an instance of an Angular application without bootstrapping any components. This is useful | ||
* for the situation where one wants to decouple application environment creation (a platform and | ||
* associated injectors) from rendering components on a screen. Components can be subsequently | ||
* bootstrapped on the returned `ApplicationRef`. | ||
* | ||
* @param options Extra configuration for the application environment, see `ApplicationConfig` for | ||
* additional info. | ||
* @returns A promise that returns an `ApplicationRef` instance once resolved. | ||
* | ||
* @publicApi | ||
*/ | ||
declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>; | ||
/** | ||
* Returns a set of providers required to setup [Testability](api/core/Testability) for an | ||
* application bootstrapped using the `bootstrapApplication` function. The set of providers is | ||
* needed to support testing an application with Protractor (which relies on the Testability APIs | ||
* to be present). | ||
* | ||
* @returns An array of providers required to setup Testability for an application and make it | ||
* available for testing using Protractor. | ||
* | ||
* @publicApi | ||
*/ | ||
declare function provideProtractorTestingSupport(): Provider[]; | ||
declare function initDomAdapter(): void; | ||
declare const INTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[]; | ||
/** | ||
* A factory function that returns a `PlatformRef` instance associated with browser service | ||
* providers. | ||
* | ||
* @publicApi | ||
*/ | ||
declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef; | ||
/** | ||
* Exports required infrastructure for all Angular apps. | ||
@@ -124,3 +130,3 @@ * Included by default in all Angular apps created with the CLI | ||
*/ | ||
export declare class BrowserModule { | ||
declare class BrowserModule { | ||
constructor(); | ||
@@ -133,51 +139,154 @@ static ɵfac: i0.ɵɵFactoryDeclaration<BrowserModule, never>; | ||
/** | ||
* Predicates for use with {@link DebugElement}'s query functions. | ||
* Represents the attributes of an HTML `<meta>` element. The element itself is | ||
* represented by the internal `HTMLMetaElement`. | ||
* | ||
* @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) | ||
* @see {@link Meta} | ||
* | ||
* @publicApi | ||
*/ | ||
export declare class By { | ||
type MetaDefinition = { | ||
charset?: string; | ||
content?: string; | ||
httpEquiv?: string; | ||
id?: string; | ||
itemprop?: string; | ||
name?: string; | ||
property?: string; | ||
scheme?: string; | ||
url?: string; | ||
} & { | ||
[prop: string]: string; | ||
}; | ||
/** | ||
* A service for managing HTML `<meta>` tags. | ||
* | ||
* Properties of the `MetaDefinition` object match the attributes of the | ||
* HTML `<meta>` tag. These tags define document metadata that is important for | ||
* things like configuring a Content Security Policy, defining browser compatibility | ||
* and security settings, setting HTTP Headers, defining rich content for social sharing, | ||
* and Search Engine Optimization (SEO). | ||
* | ||
* To identify specific `<meta>` tags in a document, use an attribute selection | ||
* string in the format `"tag_attribute='value string'"`. | ||
* For example, an `attrSelector` value of `"name='description'"` matches a tag | ||
* whose `name` attribute has the value `"description"`. | ||
* Selectors are used with the `querySelector()` Document method, | ||
* in the format `meta[{attrSelector}]`. | ||
* | ||
* @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) | ||
* @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector) | ||
* | ||
* | ||
* @publicApi | ||
*/ | ||
declare class Meta { | ||
private _doc; | ||
private _dom; | ||
constructor(_doc: any); | ||
/** | ||
* Match all nodes. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'} | ||
* Retrieves or creates a specific `<meta>` tag element in the current HTML document. | ||
* In searching for an existing tag, Angular attempts to match the `name` or `property` attribute | ||
* values in the provided tag definition, and verifies that all other attribute values are equal. | ||
* If an existing element is found, it is returned and is not modified in any way. | ||
* @param tag The definition of a `<meta>` element to match or create. | ||
* @param forceCreation True to create a new element without checking whether one already exists. | ||
* @returns The existing element with the same attributes and values if found, | ||
* the new element if no match is found, or `null` if the tag parameter is not defined. | ||
*/ | ||
static all(): Predicate<DebugNode>; | ||
addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null; | ||
/** | ||
* Match elements by the given CSS selector. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'} | ||
* Retrieves or creates a set of `<meta>` tag elements in the current HTML document. | ||
* In searching for an existing tag, Angular attempts to match the `name` or `property` attribute | ||
* values in the provided tag definition, and verifies that all other attribute values are equal. | ||
* @param tags An array of tag definitions to match or create. | ||
* @param forceCreation True to create new elements without checking whether they already exist. | ||
* @returns The matching elements if found, or the new elements. | ||
*/ | ||
static css(selector: string): Predicate<DebugElement>; | ||
addTags(tags: MetaDefinition[], forceCreation?: boolean): HTMLMetaElement[]; | ||
/** | ||
* Match nodes that have the given directive present. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'} | ||
* Retrieves a `<meta>` tag element in the current HTML document. | ||
* @param attrSelector The tag attribute and value to match against, in the format | ||
* `"tag_attribute='value string'"`. | ||
* @returns The matching element, if any. | ||
*/ | ||
static directive(type: Type<any>): Predicate<DebugNode>; | ||
getTag(attrSelector: string): HTMLMetaElement | null; | ||
/** | ||
* Retrieves a set of `<meta>` tag elements in the current HTML document. | ||
* @param attrSelector The tag attribute and value to match against, in the format | ||
* `"tag_attribute='value string'"`. | ||
* @returns The matching elements, if any. | ||
*/ | ||
getTags(attrSelector: string): HTMLMetaElement[]; | ||
/** | ||
* Modifies an existing `<meta>` tag element in the current HTML document. | ||
* @param tag The tag description with which to replace the existing tag content. | ||
* @param selector A tag attribute and value to match against, to identify | ||
* an existing tag. A string in the format `"tag_attribute=`value string`"`. | ||
* If not supplied, matches a tag with the same `name` or `property` attribute value as the | ||
* replacement tag. | ||
* @return The modified element. | ||
*/ | ||
updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null; | ||
/** | ||
* Removes an existing `<meta>` tag element from the current HTML document. | ||
* @param attrSelector A tag attribute and value to match against, to identify | ||
* an existing tag. A string in the format `"tag_attribute=`value string`"`. | ||
*/ | ||
removeTag(attrSelector: string): void; | ||
/** | ||
* Removes an existing `<meta>` tag element from the current HTML document. | ||
* @param meta The tag definition to match against to identify an existing tag. | ||
*/ | ||
removeTagElement(meta: HTMLMetaElement): void; | ||
private _getOrCreateElement; | ||
private _setMetaElementAttributes; | ||
private _parseSelector; | ||
private _containsAttributes; | ||
private _getMetaKeyMap; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<Meta, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<Meta>; | ||
} | ||
/** | ||
* Create an instance of an Angular application without bootstrapping any components. This is useful | ||
* for the situation where one wants to decouple application environment creation (a platform and | ||
* associated injectors) from rendering components on a screen. Components can be subsequently | ||
* bootstrapped on the returned `ApplicationRef`. | ||
* A service that can be used to get and set the title of a current HTML document. | ||
* | ||
* @param options Extra configuration for the application environment, see `ApplicationConfig` for | ||
* additional info. | ||
* @returns A promise that returns an `ApplicationRef` instance once resolved. | ||
* Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag) | ||
* it is not possible to bind to the `text` property of the `HTMLTitleElement` elements | ||
* (representing the `<title>` tag). Instead, this service can be used to set and get the current | ||
* title value. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>; | ||
declare class Title { | ||
private _doc; | ||
constructor(_doc: any); | ||
/** | ||
* Get the title of the current HTML document. | ||
*/ | ||
getTitle(): string; | ||
/** | ||
* Set the title of the current HTML document. | ||
* @param newTitle | ||
*/ | ||
setTitle(newTitle: string): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<Title, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<Title>; | ||
} | ||
/** | ||
* Enabled Angular debug tools that are accessible via your browser's | ||
* developer console. | ||
* | ||
* Usage: | ||
* | ||
* 1. Open developer console (e.g. in Chrome Ctrl + Shift + j) | ||
* 1. Type `ng.` (usually the console will show auto-complete suggestion) | ||
* 1. Try the change detection profiler `ng.profiler.timeChangeDetection()` | ||
* then hit Enter. | ||
* | ||
* @publicApi | ||
*/ | ||
declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>; | ||
/** | ||
* Disables Angular tools. | ||
@@ -187,105 +296,40 @@ * | ||
*/ | ||
export declare function disableDebugTools(): void; | ||
declare function disableDebugTools(): void; | ||
/** | ||
* DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing | ||
* values to be safe to use in the different DOM contexts. | ||
* Predicates for use with {@link DebugElement}'s query functions. | ||
* | ||
* For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be | ||
* sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on | ||
* the website. | ||
* | ||
* In specific situations, it might be necessary to disable sanitization, for example if the | ||
* application genuinely needs to produce a `javascript:` style link with a dynamic value in it. | ||
* Users can bypass security by constructing a value with one of the `bypassSecurityTrust...` | ||
* methods, and then binding to that value from the template. | ||
* | ||
* These situations should be very rare, and extraordinary care must be taken to avoid creating a | ||
* Cross Site Scripting (XSS) security bug! | ||
* | ||
* When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as | ||
* close as possible to the source of the value, to make it easy to verify no security bug is | ||
* created by its use. | ||
* | ||
* It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that | ||
* does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous | ||
* code. The sanitizer leaves safe values intact. | ||
* | ||
* @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in | ||
* sanitization for the value passed in. Carefully check and audit all values and code paths going | ||
* into this call. Make sure any user data is appropriately escaped for this security context. | ||
* For more detail, see the [Security Guide](https://g.co/ng/security). | ||
* | ||
* @publicApi | ||
*/ | ||
export declare abstract class DomSanitizer implements Sanitizer { | ||
declare class By { | ||
/** | ||
* Gets a safe value from either a known safe value or a value with unknown safety. | ||
* Match all nodes. | ||
* | ||
* If the given value is already a `SafeValue`, this method returns the unwrapped value. | ||
* If the security context is HTML and the given value is a plain string, this method | ||
* sanitizes the string, removing any potentially unsafe content. | ||
* For any other security context, this method throws an error if provided | ||
* with a plain string. | ||
*/ | ||
abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null; | ||
/** | ||
* Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML | ||
* is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will | ||
* leave safe HTML intact, so in most situations this method should not be used. | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'} | ||
*/ | ||
abstract bypassSecurityTrustHtml(value: string): SafeHtml; | ||
static all(): Predicate<DebugNode>; | ||
/** | ||
* Bypass security and trust the given value to be safe style value (CSS). | ||
* Match elements by the given CSS selector. | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
*/ | ||
abstract bypassSecurityTrustStyle(value: string): SafeStyle; | ||
/** | ||
* Bypass security and trust the given value to be safe JavaScript. | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'} | ||
*/ | ||
abstract bypassSecurityTrustScript(value: string): SafeScript; | ||
static css(selector: string): Predicate<DebugElement>; | ||
/** | ||
* Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used | ||
* in hyperlinks or `<img src>`. | ||
* Match nodes that have the given directive present. | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
*/ | ||
abstract bypassSecurityTrustUrl(value: string): SafeUrl; | ||
/** | ||
* Bypass security and trust the given value to be a safe resource URL, i.e. a location that may | ||
* be used to load executable code from, like `<script src>`, or `<iframe src>`. | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'} | ||
*/ | ||
abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<DomSanitizer, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizer>; | ||
static directive(type: Type<any>): Predicate<DebugNode>; | ||
} | ||
/** | ||
* Enabled Angular debug tools that are accessible via your browser's | ||
* developer console. | ||
* | ||
* Usage: | ||
* | ||
* 1. Open developer console (e.g. in Chrome Ctrl + Shift + j) | ||
* 1. Type `ng.` (usually the console will show auto-complete suggestion) | ||
* 1. Try the change detection profiler `ng.profiler.timeChangeDetection()` | ||
* then hit Enter. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>; | ||
/** | ||
* The injection token for plugins of the `EventManager` service. | ||
@@ -295,4 +339,3 @@ * | ||
*/ | ||
export declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>; | ||
declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>; | ||
/** | ||
@@ -304,3 +347,3 @@ * An injectable service that provides event management for Angular | ||
*/ | ||
export declare class EventManager { | ||
declare class EventManager { | ||
private _zone; | ||
@@ -331,3 +374,2 @@ private _plugins; | ||
} | ||
/** | ||
@@ -341,3 +383,3 @@ * The plugin definition for the `EventManager` class | ||
*/ | ||
export declare abstract class EventManagerPlugin { | ||
declare abstract class EventManagerPlugin { | ||
private _doc; | ||
@@ -357,9 +399,90 @@ constructor(_doc: any); | ||
/** | ||
* Provides DOM operations in any browser environment. | ||
* A record of usage for a specific style including all elements added to the DOM | ||
* that contain a given style. | ||
*/ | ||
interface UsageRecord<T> { | ||
elements: T[]; | ||
usage: number; | ||
} | ||
declare class SharedStylesHost implements OnDestroy { | ||
private readonly doc; | ||
private readonly appId; | ||
private readonly nonce?; | ||
/** | ||
* Provides usage information for active inline style content and associated HTML <style> elements. | ||
* Embedded styles typically originate from the `styles` metadata of a rendered component. | ||
*/ | ||
private readonly inline; | ||
/** | ||
* Provides usage information for active external style URLs and the associated HTML <link> elements. | ||
* External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component. | ||
*/ | ||
private readonly external; | ||
/** | ||
* Set of host DOM nodes that will have styles attached. | ||
*/ | ||
private readonly hosts; | ||
/** | ||
* Whether the application code is currently executing on a server. | ||
*/ | ||
private readonly isServer; | ||
constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object); | ||
/** | ||
* Adds embedded styles to the DOM via HTML `style` elements. | ||
* @param styles An array of style content strings. | ||
*/ | ||
addStyles(styles: string[], urls?: string[]): void; | ||
/** | ||
* Removes embedded styles from the DOM that were added as HTML `style` elements. | ||
* @param styles An array of style content strings. | ||
*/ | ||
removeStyles(styles: string[], urls?: string[]): void; | ||
protected addUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>, creator: (value: string, doc: Document) => T): void; | ||
protected removeUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>): void; | ||
ngOnDestroy(): void; | ||
/** | ||
* Adds a host node to the set of style hosts and adds all existing style usage to | ||
* the newly added host node. | ||
* | ||
* This is currently only used for Shadow DOM encapsulation mode. | ||
*/ | ||
addHost(hostNode: Node): void; | ||
removeHost(hostNode: Node): void; | ||
private addElement; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<SharedStylesHost, [null, null, { optional: true; }, null]>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<SharedStylesHost>; | ||
} | ||
/** | ||
* A DI token that indicates whether styles | ||
* of destroyed components should be removed from DOM. | ||
* | ||
* @security Tread carefully! Interacting with the DOM directly is dangerous and | ||
* can introduce XSS risks. | ||
* By default, the value is set to `true`. | ||
* @publicApi | ||
*/ | ||
declare abstract class GenericBrowserDomAdapter extends ɵDomAdapter { | ||
readonly supportsDOMEvents: boolean; | ||
declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>; | ||
declare class DomRendererFactory2 implements RendererFactory2, OnDestroy { | ||
private readonly eventManager; | ||
private readonly sharedStylesHost; | ||
private readonly appId; | ||
private removeStylesOnCompDestroy; | ||
private readonly doc; | ||
readonly platformId: Object; | ||
readonly ngZone: NgZone; | ||
private readonly nonce; | ||
private readonly tracingService; | ||
private readonly rendererByCompId; | ||
private readonly defaultRenderer; | ||
private readonly platformIsServer; | ||
constructor(eventManager: EventManager, sharedStylesHost: SharedStylesHost, appId: string, removeStylesOnCompDestroy: boolean, doc: Document, platformId: Object, ngZone: NgZone, nonce?: string | null, tracingService?: _TracingService<_TracingSnapshot> | null); | ||
createRenderer(element: any, type: RendererType2 | null): Renderer2; | ||
private getOrCreateRenderer; | ||
ngOnDestroy(): void; | ||
/** | ||
* Used during HMR to clear any cached data about a component. | ||
* @param componentId ID of the component that is being replaced. | ||
*/ | ||
protected componentReplaced(componentId: string): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<DomRendererFactory2, [null, null, null, null, null, null, null, null, { optional: true; }]>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<DomRendererFactory2>; | ||
} | ||
@@ -373,6 +496,15 @@ | ||
* @publicApi | ||
* | ||
* @deprecated The HammerJS integration is deprecated. Replace it by your own implementation. | ||
*/ | ||
export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>; | ||
declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>; | ||
/** | ||
* Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded. | ||
* | ||
* @publicApi | ||
* | ||
* @deprecated The hammerjs integration is deprecated. Replace it by your own implementation. | ||
*/ | ||
type HammerLoader = () => Promise<void>; | ||
/** | ||
* Injection token used to provide a HammerLoader to Angular. | ||
@@ -383,5 +515,11 @@ * | ||
* @publicApi | ||
* | ||
* @deprecated The HammerJS integration is deprecated. Replace it by your own implementation. | ||
*/ | ||
export declare const HAMMER_LOADER: InjectionToken<HammerLoader>; | ||
declare const HAMMER_LOADER: InjectionToken<HammerLoader>; | ||
interface HammerInstance { | ||
on(eventName: string, callback?: Function): void; | ||
off(eventName: string, callback?: Function): void; | ||
destroy?(): void; | ||
} | ||
/** | ||
@@ -391,4 +529,6 @@ * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager) | ||
* @publicApi | ||
* | ||
* @deprecated The HammerJS integration is deprecated. Replace it by your own implementation. | ||
*/ | ||
export declare class HammerGestureConfig { | ||
declare class HammerGestureConfig { | ||
/** | ||
@@ -446,16 +586,19 @@ * A set of supported event names for gestures to be used in Angular. | ||
} | ||
declare interface HammerInstance { | ||
on(eventName: string, callback?: Function): void; | ||
off(eventName: string, callback?: Function): void; | ||
destroy?(): void; | ||
} | ||
/** | ||
* Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded. | ||
* Event plugin that adds Hammer support to an application. | ||
* | ||
* @publicApi | ||
* @ngModule HammerModule | ||
*/ | ||
export declare type HammerLoader = () => Promise<void>; | ||
declare class HammerGesturesPlugin extends EventManagerPlugin { | ||
private _config; | ||
private _injector; | ||
private loader?; | ||
private _loaderPromise; | ||
constructor(doc: any, _config: HammerGestureConfig, _injector: Injector, loader?: (HammerLoader | null) | undefined); | ||
supports(eventName: string): boolean; | ||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
isCustomEvent(eventName: string): boolean; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<HammerGesturesPlugin, [null, null, null, { optional: true; }]>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<HammerGesturesPlugin>; | ||
} | ||
/** | ||
@@ -471,4 +614,6 @@ * Adds support for HammerJS. | ||
* @publicApi | ||
* | ||
* @deprecated The hammer integration is deprecated. Replace it by your own implementation. | ||
*/ | ||
export declare class HammerModule { | ||
declare class HammerModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<HammerModule, never>; | ||
@@ -480,308 +625,186 @@ static ɵmod: i0.ɵɵNgModuleDeclaration<HammerModule, never, never, never>; | ||
/** | ||
* Helper type to represent a Hydration feature. | ||
* Marker interface for a value that's safe to use in a particular context. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare interface HydrationFeature<FeatureKind extends HydrationFeatureKind> { | ||
ɵkind: FeatureKind; | ||
ɵproviders: Provider[]; | ||
interface SafeValue { | ||
} | ||
/** | ||
* The list of features as an enum to uniquely type each `HydrationFeature`. | ||
* @see {@link HydrationFeature} | ||
* Marker interface for a value that's safe to use as HTML. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare enum HydrationFeatureKind { | ||
NoHttpTransferCache = 0, | ||
HttpTransferCacheOptions = 1, | ||
I18nSupport = 2, | ||
EventReplay = 3, | ||
IncrementalHydration = 4 | ||
interface SafeHtml extends SafeValue { | ||
} | ||
/** | ||
* A service for managing HTML `<meta>` tags. | ||
* Marker interface for a value that's safe to use as style (CSS). | ||
* | ||
* Properties of the `MetaDefinition` object match the attributes of the | ||
* HTML `<meta>` tag. These tags define document metadata that is important for | ||
* things like configuring a Content Security Policy, defining browser compatibility | ||
* and security settings, setting HTTP Headers, defining rich content for social sharing, | ||
* and Search Engine Optimization (SEO). | ||
* | ||
* To identify specific `<meta>` tags in a document, use an attribute selection | ||
* string in the format `"tag_attribute='value string'"`. | ||
* For example, an `attrSelector` value of `"name='description'"` matches a tag | ||
* whose `name` attribute has the value `"description"`. | ||
* Selectors are used with the `querySelector()` Document method, | ||
* in the format `meta[{attrSelector}]`. | ||
* | ||
* @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) | ||
* @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector) | ||
* | ||
* | ||
* @publicApi | ||
*/ | ||
export declare class Meta { | ||
private _doc; | ||
private _dom; | ||
constructor(_doc: any); | ||
/** | ||
* Retrieves or creates a specific `<meta>` tag element in the current HTML document. | ||
* In searching for an existing tag, Angular attempts to match the `name` or `property` attribute | ||
* values in the provided tag definition, and verifies that all other attribute values are equal. | ||
* If an existing element is found, it is returned and is not modified in any way. | ||
* @param tag The definition of a `<meta>` element to match or create. | ||
* @param forceCreation True to create a new element without checking whether one already exists. | ||
* @returns The existing element with the same attributes and values if found, | ||
* the new element if no match is found, or `null` if the tag parameter is not defined. | ||
*/ | ||
addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null; | ||
/** | ||
* Retrieves or creates a set of `<meta>` tag elements in the current HTML document. | ||
* In searching for an existing tag, Angular attempts to match the `name` or `property` attribute | ||
* values in the provided tag definition, and verifies that all other attribute values are equal. | ||
* @param tags An array of tag definitions to match or create. | ||
* @param forceCreation True to create new elements without checking whether they already exist. | ||
* @returns The matching elements if found, or the new elements. | ||
*/ | ||
addTags(tags: MetaDefinition[], forceCreation?: boolean): HTMLMetaElement[]; | ||
/** | ||
* Retrieves a `<meta>` tag element in the current HTML document. | ||
* @param attrSelector The tag attribute and value to match against, in the format | ||
* `"tag_attribute='value string'"`. | ||
* @returns The matching element, if any. | ||
*/ | ||
getTag(attrSelector: string): HTMLMetaElement | null; | ||
/** | ||
* Retrieves a set of `<meta>` tag elements in the current HTML document. | ||
* @param attrSelector The tag attribute and value to match against, in the format | ||
* `"tag_attribute='value string'"`. | ||
* @returns The matching elements, if any. | ||
*/ | ||
getTags(attrSelector: string): HTMLMetaElement[]; | ||
/** | ||
* Modifies an existing `<meta>` tag element in the current HTML document. | ||
* @param tag The tag description with which to replace the existing tag content. | ||
* @param selector A tag attribute and value to match against, to identify | ||
* an existing tag. A string in the format `"tag_attribute=`value string`"`. | ||
* If not supplied, matches a tag with the same `name` or `property` attribute value as the | ||
* replacement tag. | ||
* @return The modified element. | ||
*/ | ||
updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null; | ||
/** | ||
* Removes an existing `<meta>` tag element from the current HTML document. | ||
* @param attrSelector A tag attribute and value to match against, to identify | ||
* an existing tag. A string in the format `"tag_attribute=`value string`"`. | ||
*/ | ||
removeTag(attrSelector: string): void; | ||
/** | ||
* Removes an existing `<meta>` tag element from the current HTML document. | ||
* @param meta The tag definition to match against to identify an existing tag. | ||
*/ | ||
removeTagElement(meta: HTMLMetaElement): void; | ||
private _getOrCreateElement; | ||
private _setMetaElementAttributes; | ||
private _parseSelector; | ||
private _containsAttributes; | ||
private _getMetaKeyMap; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<Meta, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<Meta>; | ||
interface SafeStyle extends SafeValue { | ||
} | ||
/** | ||
* Represents the attributes of an HTML `<meta>` element. The element itself is | ||
* represented by the internal `HTMLMetaElement`. | ||
* Marker interface for a value that's safe to use as JavaScript. | ||
* | ||
* @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) | ||
* @see {@link Meta} | ||
* | ||
* @publicApi | ||
*/ | ||
export declare type MetaDefinition = { | ||
charset?: string; | ||
content?: string; | ||
httpEquiv?: string; | ||
id?: string; | ||
itemprop?: string; | ||
name?: string; | ||
property?: string; | ||
scheme?: string; | ||
url?: string; | ||
} & { | ||
[prop: string]: string; | ||
}; | ||
interface SafeScript extends SafeValue { | ||
} | ||
/** | ||
* A factory function that returns a `PlatformRef` instance associated with browser service | ||
* providers. | ||
* Marker interface for a value that's safe to use as a URL linking to a document. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef; | ||
interface SafeUrl extends SafeValue { | ||
} | ||
/** | ||
* Sets up providers necessary to enable hydration functionality for the application. | ||
* Marker interface for a value that's safe to use as a URL to load executable code from. | ||
* | ||
* By default, the function enables the recommended set of features for the optimal | ||
* performance for most of the applications. It includes the following features: | ||
* | ||
* * Reconciling DOM hydration. Learn more about it [here](guide/hydration). | ||
* * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and | ||
* transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching | ||
* [here](guide/ssr#caching-data-when-using-httpclient). | ||
* | ||
* These functions allow you to disable some of the default features or enable new ones: | ||
* | ||
* * {@link withNoHttpTransferCache} to disable HTTP transfer cache | ||
* * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options | ||
* * {@link withI18nSupport} to enable hydration support for i18n blocks | ||
* * {@link withEventReplay} to enable support for replaying user events | ||
* | ||
* @usageNotes | ||
* | ||
* Basic example of how you can enable hydration in your application when | ||
* `bootstrapApplication` function is used: | ||
* ```ts | ||
* bootstrapApplication(AppComponent, { | ||
* providers: [provideClientHydration()] | ||
* }); | ||
* ``` | ||
* | ||
* Alternatively if you are using NgModules, you would add `provideClientHydration` | ||
* to your root app module's provider list. | ||
* ```ts | ||
* @NgModule({ | ||
* declarations: [RootCmp], | ||
* bootstrap: [RootCmp], | ||
* providers: [provideClientHydration()], | ||
* }) | ||
* export class AppModule {} | ||
* ``` | ||
* | ||
* @see {@link withNoHttpTransferCache} | ||
* @see {@link withHttpTransferCacheOptions} | ||
* @see {@link withI18nSupport} | ||
* @see {@link withEventReplay} | ||
* | ||
* @param features Optional features to configure additional router behaviors. | ||
* @returns A set of providers to enable hydration. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders; | ||
interface SafeResourceUrl extends SafeValue { | ||
} | ||
/** | ||
* Returns a set of providers required to setup [Testability](api/core/Testability) for an | ||
* application bootstrapped using the `bootstrapApplication` function. The set of providers is | ||
* needed to support testing an application with Protractor (which relies on the Testability APIs | ||
* to be present). | ||
* DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing | ||
* values to be safe to use in the different DOM contexts. | ||
* | ||
* @returns An array of providers required to setup Testability for an application and make it | ||
* available for testing using Protractor. | ||
* For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be | ||
* sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on | ||
* the website. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare function provideProtractorTestingSupport(): Provider[]; | ||
/** | ||
* A DI token that indicates whether styles | ||
* of destroyed components should be removed from DOM. | ||
* In specific situations, it might be necessary to disable sanitization, for example if the | ||
* application genuinely needs to produce a `javascript:` style link with a dynamic value in it. | ||
* Users can bypass security by constructing a value with one of the `bypassSecurityTrust...` | ||
* methods, and then binding to that value from the template. | ||
* | ||
* By default, the value is set to `true`. | ||
* @publicApi | ||
*/ | ||
export declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>; | ||
/** | ||
* Marker interface for a value that's safe to use as HTML. | ||
* These situations should be very rare, and extraordinary care must be taken to avoid creating a | ||
* Cross Site Scripting (XSS) security bug! | ||
* | ||
* @publicApi | ||
*/ | ||
export declare interface SafeHtml extends SafeValue { | ||
} | ||
/** | ||
* Marker interface for a value that's safe to use as a URL to load executable code from. | ||
* When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as | ||
* close as possible to the source of the value, to make it easy to verify no security bug is | ||
* created by its use. | ||
* | ||
* It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that | ||
* does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous | ||
* code. The sanitizer leaves safe values intact. | ||
* | ||
* @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in | ||
* sanitization for the value passed in. Carefully check and audit all values and code paths going | ||
* into this call. Make sure any user data is appropriately escaped for this security context. | ||
* For more detail, see the [Security Guide](https://g.co/ng/security). | ||
* | ||
* @publicApi | ||
*/ | ||
export declare interface SafeResourceUrl extends SafeValue { | ||
declare abstract class DomSanitizer implements Sanitizer { | ||
/** | ||
* Gets a safe value from either a known safe value or a value with unknown safety. | ||
* | ||
* If the given value is already a `SafeValue`, this method returns the unwrapped value. | ||
* If the security context is HTML and the given value is a plain string, this method | ||
* sanitizes the string, removing any potentially unsafe content. | ||
* For any other security context, this method throws an error if provided | ||
* with a plain string. | ||
*/ | ||
abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null; | ||
/** | ||
* Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML | ||
* is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will | ||
* leave safe HTML intact, so in most situations this method should not be used. | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
*/ | ||
abstract bypassSecurityTrustHtml(value: string): SafeHtml; | ||
/** | ||
* Bypass security and trust the given value to be safe style value (CSS). | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
*/ | ||
abstract bypassSecurityTrustStyle(value: string): SafeStyle; | ||
/** | ||
* Bypass security and trust the given value to be safe JavaScript. | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
*/ | ||
abstract bypassSecurityTrustScript(value: string): SafeScript; | ||
/** | ||
* Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used | ||
* in hyperlinks or `<img src>`. | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
*/ | ||
abstract bypassSecurityTrustUrl(value: string): SafeUrl; | ||
/** | ||
* Bypass security and trust the given value to be a safe resource URL, i.e. a location that may | ||
* be used to load executable code from, like `<script src>`, or `<iframe src>`. | ||
* | ||
* **WARNING:** calling this method with untrusted user data exposes your application to XSS | ||
* security risks! | ||
*/ | ||
abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<DomSanitizer, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizer>; | ||
} | ||
declare class DomSanitizerImpl extends DomSanitizer { | ||
private _doc; | ||
constructor(_doc: any); | ||
sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null; | ||
bypassSecurityTrustHtml(value: string): SafeHtml; | ||
bypassSecurityTrustStyle(value: string): SafeStyle; | ||
bypassSecurityTrustScript(value: string): SafeScript; | ||
bypassSecurityTrustUrl(value: string): SafeUrl; | ||
bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<DomSanitizerImpl, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizerImpl>; | ||
} | ||
/** | ||
* Marker interface for a value that's safe to use as JavaScript. | ||
* The list of features as an enum to uniquely type each `HydrationFeature`. | ||
* @see {@link HydrationFeature} | ||
* | ||
* @publicApi | ||
*/ | ||
export declare interface SafeScript extends SafeValue { | ||
declare enum HydrationFeatureKind { | ||
NoHttpTransferCache = 0, | ||
HttpTransferCacheOptions = 1, | ||
I18nSupport = 2, | ||
EventReplay = 3, | ||
IncrementalHydration = 4 | ||
} | ||
/** | ||
* Marker interface for a value that's safe to use as style (CSS). | ||
* Helper type to represent a Hydration feature. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare interface SafeStyle extends SafeValue { | ||
interface HydrationFeature<FeatureKind extends HydrationFeatureKind> { | ||
ɵkind: FeatureKind; | ||
ɵproviders: Provider[]; | ||
} | ||
/** | ||
* Marker interface for a value that's safe to use as a URL linking to a document. | ||
* Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the | ||
* server and other one on the browser. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare interface SafeUrl extends SafeValue { | ||
} | ||
declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>; | ||
/** | ||
* Marker interface for a value that's safe to use in a particular context. | ||
* The function accepts an object, which allows to configure cache parameters, | ||
* such as which headers should be included (no headers are included by default), | ||
* whether POST requests should be cached or a callback function to determine if a | ||
* particular request should be cached. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare interface SafeValue { | ||
} | ||
declare function withHttpTransferCacheOptions(options: HttpTransferCacheOptions): HydrationFeature<HydrationFeatureKind.HttpTransferCacheOptions>; | ||
/** | ||
* A service that can be used to get and set the title of a current HTML document. | ||
* Enables support for hydrating i18n blocks. | ||
* | ||
* Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag) | ||
* it is not possible to bind to the `text` property of the `HTMLTitleElement` elements | ||
* (representing the `<title>` tag). Instead, this service can be used to set and get the current | ||
* title value. | ||
* | ||
* @developerPreview | ||
* @publicApi | ||
*/ | ||
export declare class Title { | ||
private _doc; | ||
constructor(_doc: any); | ||
/** | ||
* Get the title of the current HTML document. | ||
*/ | ||
getTitle(): string; | ||
/** | ||
* Set the title of the current HTML document. | ||
* @param newTitle | ||
*/ | ||
setTitle(newTitle: string): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<Title, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<Title>; | ||
} | ||
declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind.I18nSupport>; | ||
/** | ||
* A record of usage for a specific style including all elements added to the DOM | ||
* that contain a given style. | ||
*/ | ||
declare interface UsageRecord<T> { | ||
elements: T[]; | ||
usage: number; | ||
} | ||
/** | ||
* @publicApi | ||
*/ | ||
export declare const VERSION: Version; | ||
/** | ||
* Enables support for replaying user events (e.g. `click`s) that happened on a page | ||
@@ -803,23 +826,4 @@ * before hydration logic has completed. Once an application is hydrated, all captured | ||
*/ | ||
export declare function withEventReplay(): HydrationFeature<HydrationFeatureKind.EventReplay>; | ||
declare function withEventReplay(): HydrationFeature<HydrationFeatureKind.EventReplay>; | ||
/** | ||
* The function accepts an object, which allows to configure cache parameters, | ||
* such as which headers should be included (no headers are included by default), | ||
* whether POST requests should be cached or a callback function to determine if a | ||
* particular request should be cached. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare function withHttpTransferCacheOptions(options: HttpTransferCacheOptions): HydrationFeature<HydrationFeatureKind.HttpTransferCacheOptions>; | ||
/** | ||
* Enables support for hydrating i18n blocks. | ||
* | ||
* @developerPreview | ||
* @publicApi | ||
*/ | ||
export declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind.I18nSupport>; | ||
/** | ||
* Enables support for incremental hydration using the `hydrate` trigger syntax. | ||
@@ -840,13 +844,65 @@ * | ||
*/ | ||
export declare function withIncrementalHydration(): HydrationFeature<HydrationFeatureKind.IncrementalHydration>; | ||
declare function withIncrementalHydration(): HydrationFeature<HydrationFeatureKind.IncrementalHydration>; | ||
/** | ||
* Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the | ||
* server and other one on the browser. | ||
* Sets up providers necessary to enable hydration functionality for the application. | ||
* | ||
* By default, the function enables the recommended set of features for the optimal | ||
* performance for most of the applications. It includes the following features: | ||
* | ||
* * Reconciling DOM hydration. Learn more about it [here](guide/hydration). | ||
* * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and | ||
* transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching | ||
* [here](guide/ssr#caching-data-when-using-httpclient). | ||
* | ||
* These functions allow you to disable some of the default features or enable new ones: | ||
* | ||
* * {@link withNoHttpTransferCache} to disable HTTP transfer cache | ||
* * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options | ||
* * {@link withI18nSupport} to enable hydration support for i18n blocks | ||
* * {@link withEventReplay} to enable support for replaying user events | ||
* | ||
* @usageNotes | ||
* | ||
* Basic example of how you can enable hydration in your application when | ||
* `bootstrapApplication` function is used: | ||
* ```ts | ||
* bootstrapApplication(AppComponent, { | ||
* providers: [provideClientHydration()] | ||
* }); | ||
* ``` | ||
* | ||
* Alternatively if you are using NgModules, you would add `provideClientHydration` | ||
* to your root app module's provider list. | ||
* ```ts | ||
* @NgModule({ | ||
* declarations: [RootCmp], | ||
* bootstrap: [RootCmp], | ||
* providers: [provideClientHydration()], | ||
* }) | ||
* export class AppModule {} | ||
* ``` | ||
* | ||
* @see {@link withNoHttpTransferCache} | ||
* @see {@link withHttpTransferCacheOptions} | ||
* @see {@link withI18nSupport} | ||
* @see {@link withEventReplay} | ||
* | ||
* @param features Optional features to configure additional router behaviors. | ||
* @returns A set of providers to enable hydration. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>; | ||
declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders; | ||
/** | ||
* Provides DOM operations in any browser environment. | ||
* | ||
* @security Tread carefully! Interacting with the DOM directly is dangerous and | ||
* can introduce XSS risks. | ||
*/ | ||
declare abstract class GenericBrowserDomAdapter extends _DomAdapter { | ||
readonly supportsDOMEvents: boolean; | ||
} | ||
/** | ||
* A `DomAdapter` powered by full browser DOM APIs. | ||
@@ -857,3 +913,3 @@ * | ||
*/ | ||
export declare class ɵBrowserDomAdapter extends GenericBrowserDomAdapter { | ||
declare class BrowserDomAdapter extends GenericBrowserDomAdapter { | ||
static makeCurrent(): void; | ||
@@ -876,3 +932,3 @@ onAndCancel(el: Node, evt: any, listener: any, options: any): Function; | ||
export declare class ɵBrowserGetTestability implements GetTestability { | ||
declare class BrowserGetTestability implements GetTestability { | ||
addToWindow(registry: TestabilityRegistry): void; | ||
@@ -882,3 +938,3 @@ findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null; | ||
export declare class ɵDomEventsPlugin extends EventManagerPlugin { | ||
declare class DomEventsPlugin extends EventManagerPlugin { | ||
constructor(doc: any); | ||
@@ -888,73 +944,10 @@ supports(eventName: string): boolean; | ||
removeEventListener(target: any, eventName: string, callback: Function, options?: ListenerOptions): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomEventsPlugin, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomEventsPlugin>; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<DomEventsPlugin, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<DomEventsPlugin>; | ||
} | ||
export declare class ɵDomRendererFactory2 implements RendererFactory2, OnDestroy { | ||
private readonly eventManager; | ||
private readonly sharedStylesHost; | ||
private readonly appId; | ||
private removeStylesOnCompDestroy; | ||
private readonly doc; | ||
readonly platformId: Object; | ||
readonly ngZone: NgZone; | ||
private readonly nonce; | ||
private readonly tracingService; | ||
private readonly rendererByCompId; | ||
private readonly defaultRenderer; | ||
private readonly platformIsServer; | ||
constructor(eventManager: EventManager, sharedStylesHost: ɵSharedStylesHost, appId: string, removeStylesOnCompDestroy: boolean, doc: Document, platformId: Object, ngZone: NgZone, nonce?: string | null, tracingService?: ɵTracingService<ɵTracingSnapshot> | null); | ||
createRenderer(element: any, type: RendererType2 | null): Renderer2; | ||
private getOrCreateRenderer; | ||
ngOnDestroy(): void; | ||
/** | ||
* Used during HMR to clear any cached data about a component. | ||
* @param componentId ID of the component that is being replaced. | ||
*/ | ||
protected componentReplaced(componentId: string): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomRendererFactory2, [null, null, null, null, null, null, null, null, { optional: true; }]>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomRendererFactory2>; | ||
} | ||
export declare class ɵDomSanitizerImpl extends DomSanitizer { | ||
private _doc; | ||
constructor(_doc: any); | ||
sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null; | ||
bypassSecurityTrustHtml(value: string): SafeHtml; | ||
bypassSecurityTrustStyle(value: string): SafeStyle; | ||
bypassSecurityTrustScript(value: string): SafeScript; | ||
bypassSecurityTrustUrl(value: string): SafeUrl; | ||
bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomSanitizerImpl, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomSanitizerImpl>; | ||
} | ||
export { ɵgetDOM } | ||
/** | ||
* Event plugin that adds Hammer support to an application. | ||
* | ||
* @ngModule HammerModule | ||
*/ | ||
export declare class ɵHammerGesturesPlugin extends EventManagerPlugin { | ||
private _config; | ||
private _injector; | ||
private loader?; | ||
private _loaderPromise; | ||
constructor(doc: any, _config: HammerGestureConfig, _injector: Injector, loader?: (HammerLoader | null) | undefined); | ||
supports(eventName: string): boolean; | ||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
isCustomEvent(eventName: string): boolean; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵHammerGesturesPlugin, [null, null, null, { optional: true; }]>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵHammerGesturesPlugin>; | ||
} | ||
export declare function ɵinitDomAdapter(): void; | ||
export declare const ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[]; | ||
/** | ||
* A browser plug-in that provides support for handling of key events in Angular. | ||
*/ | ||
export declare class ɵKeyEventsPlugin extends EventManagerPlugin { | ||
declare class KeyEventsPlugin extends EventManagerPlugin { | ||
/** | ||
@@ -1012,7 +1005,6 @@ * Initializes an instance of the browser plug-in. | ||
static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵKeyEventsPlugin, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵKeyEventsPlugin>; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<KeyEventsPlugin, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<KeyEventsPlugin>; | ||
} | ||
/** | ||
@@ -1022,3 +1014,3 @@ * The list of error codes used in runtime code of the `platform-browser` package. | ||
*/ | ||
export declare const enum ɵRuntimeErrorCode { | ||
declare const enum RuntimeErrorCode { | ||
UNSUPPORTED_ZONEJS_INSTANCE = -5000, | ||
@@ -1037,51 +1029,13 @@ BROWSER_MODULE_ALREADY_LOADED = 5100, | ||
export declare class ɵSharedStylesHost implements OnDestroy { | ||
private readonly doc; | ||
private readonly appId; | ||
private readonly nonce?; | ||
/** | ||
* Provides usage information for active inline style content and associated HTML <style> elements. | ||
* Embedded styles typically originate from the `styles` metadata of a rendered component. | ||
*/ | ||
private readonly inline; | ||
/** | ||
* Provides usage information for active external style URLs and the associated HTML <link> elements. | ||
* External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component. | ||
*/ | ||
private readonly external; | ||
/** | ||
* Set of host DOM nodes that will have styles attached. | ||
*/ | ||
private readonly hosts; | ||
/** | ||
* Whether the application code is currently executing on a server. | ||
*/ | ||
private readonly isServer; | ||
constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object); | ||
/** | ||
* Adds embedded styles to the DOM via HTML `style` elements. | ||
* @param styles An array of style content strings. | ||
*/ | ||
addStyles(styles: string[], urls?: string[]): void; | ||
/** | ||
* Removes embedded styles from the DOM that were added as HTML `style` elements. | ||
* @param styles An array of style content strings. | ||
*/ | ||
removeStyles(styles: string[], urls?: string[]): void; | ||
protected addUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>, creator: (value: string, doc: Document) => T): void; | ||
protected removeUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>): void; | ||
ngOnDestroy(): void; | ||
/** | ||
* Adds a host node to the set of style hosts and adds all existing style usage to | ||
* the newly added host node. | ||
* | ||
* This is currently only used for Shadow DOM encapsulation mode. | ||
*/ | ||
addHost(hostNode: Node): void; | ||
removeHost(hostNode: Node): void; | ||
private addElement; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵSharedStylesHost, [null, null, { optional: true; }, null]>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵSharedStylesHost>; | ||
} | ||
/** | ||
* @module | ||
* @description | ||
* Entry point for all public APIs of the platform-browser package. | ||
*/ | ||
export { } | ||
/** | ||
* @publicApi | ||
*/ | ||
declare const VERSION: Version; | ||
export { type ApplicationConfig, BrowserModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, EventManagerPlugin, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, type HammerLoader, HammerModule, type HydrationFeature, HydrationFeatureKind, Meta, type MetaDefinition, REMOVE_STYLES_ON_COMPONENT_DESTROY, type SafeHtml, type SafeResourceUrl, type SafeScript, type SafeStyle, type SafeUrl, type SafeValue, Title, VERSION, bootstrapApplication, createApplication, disableDebugTools, enableDebugTools, platformBrowser, provideClientHydration, provideProtractorTestingSupport, withEventReplay, withHttpTransferCacheOptions, withI18nSupport, withIncrementalHydration, withNoHttpTransferCache, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, HammerGesturesPlugin as ɵHammerGesturesPlugin, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, KeyEventsPlugin as ɵKeyEventsPlugin, RuntimeErrorCode as ɵRuntimeErrorCode, SharedStylesHost as ɵSharedStylesHost, initDomAdapter as ɵinitDomAdapter }; |
{ | ||
"name": "@angular/platform-browser", | ||
"version": "20.0.0-next.1", | ||
"version": "20.0.0-next.2", | ||
"description": "Angular - library for using Angular in a web browser", | ||
@@ -14,5 +14,5 @@ "author": "angular", | ||
"peerDependencies": { | ||
"@angular/animations": "20.0.0-next.1", | ||
"@angular/core": "20.0.0-next.1", | ||
"@angular/common": "20.0.0-next.1" | ||
"@angular/animations": "20.0.0-next.2", | ||
"@angular/core": "20.0.0-next.2", | ||
"@angular/common": "20.0.0-next.2" | ||
}, | ||
@@ -19,0 +19,0 @@ "peerDependenciesMeta": { |
/** | ||
* @license Angular v20.0.0-next.1 | ||
* @license Angular v20.0.0-next.2 | ||
* (c) 2010-2025 Google LLC. https://angular.io/ | ||
@@ -7,9 +7,13 @@ * License: MIT | ||
import * as i0 from '@angular/core'; | ||
import { StaticProvider } from '@angular/core'; | ||
import * as i1 from '@angular/platform-browser'; | ||
import { PlatformRef } from '@angular/core'; | ||
import { StaticProvider } from '@angular/core'; | ||
/** | ||
* Platform for testing | ||
* | ||
* @publicApi | ||
*/ | ||
declare const platformBrowserTesting: (extraProviders?: StaticProvider[]) => i0.PlatformRef; | ||
/** | ||
* NgModule for testing. | ||
@@ -19,3 +23,3 @@ * | ||
*/ | ||
export declare class BrowserTestingModule { | ||
declare class BrowserTestingModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<BrowserTestingModule, never>; | ||
@@ -26,9 +30,2 @@ static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserTestingModule, never, never, [typeof i1.BrowserModule]>; | ||
/** | ||
* Platform for testing | ||
* | ||
* @publicApi | ||
*/ | ||
export declare const platformBrowserTesting: (extraProviders?: StaticProvider[]) => PlatformRef; | ||
export { } | ||
export { BrowserTestingModule, platformBrowserTesting }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
411731
-2.34%4022
-1.32%