@angular/platform-browser
Advanced tools
Comparing version 14.3.0 to 16.2.12
/** | ||
* @license Angular v14.3.0 | ||
* @license Angular v16.2.12 | ||
* (c) 2010-2022 Google LLC. https://angular.io/ | ||
@@ -40,3 +40,3 @@ * License: MIT | ||
}; | ||
destroyNode: ((n: any) => void) | null; | ||
destroyNode(node: any): void; | ||
destroy(): void; | ||
@@ -74,3 +74,3 @@ createElement(name: string, namespace?: string | null | undefined): any; | ||
* @param config Object used to configure the behavior of the `BrowserAnimationsModule`. | ||
* @see `BrowserAnimationsModuleConfig` | ||
* @see {@link BrowserAnimationsModuleConfig} | ||
* | ||
@@ -136,3 +136,2 @@ * @usageNotes | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
@@ -161,3 +160,2 @@ export declare function provideAnimations(): Provider[]; | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
@@ -182,3 +180,2 @@ export declare function provideNoopAnimations(): Provider[]; | ||
private _cdRecurDepth; | ||
private promise; | ||
constructor(delegate: RendererFactory2, engine: ɵAnimationEngine, _zone: NgZone); | ||
@@ -185,0 +182,0 @@ createRenderer(hostElement: any, type: RendererType2): Renderer2; |
325
index.d.ts
/** | ||
* @license Angular v14.3.0 | ||
* @license Angular v16.2.12 | ||
* (c) 2010-2022 Google LLC. https://angular.io/ | ||
@@ -8,2 +8,3 @@ * License: MIT | ||
import { ApplicationConfig as ApplicationConfig_2 } from '@angular/core'; | ||
import { ApplicationRef } from '@angular/core'; | ||
@@ -13,7 +14,8 @@ import { ComponentRef } from '@angular/core'; | ||
import { DebugNode } from '@angular/core'; | ||
import { EnvironmentProviders } from '@angular/core'; | ||
import { GetTestability } from '@angular/core'; | ||
import * as i0 from '@angular/core'; | ||
import * as i1 from '@angular/common'; | ||
import { ImportedNgModuleProviders } from '@angular/core'; | ||
import { InjectionToken } from '@angular/core'; | ||
import { makeStateKey as makeStateKey_2 } from '@angular/core'; | ||
import { ModuleWithProviders } from '@angular/core'; | ||
@@ -30,5 +32,7 @@ import { NgZone } from '@angular/core'; | ||
import { SecurityContext } from '@angular/core'; | ||
import { StateKey as StateKey_2 } from '@angular/core'; | ||
import { StaticProvider } from '@angular/core'; | ||
import { Testability } from '@angular/core'; | ||
import { TestabilityRegistry } from '@angular/core'; | ||
import { TransferState as TransferState_2 } from '@angular/core'; | ||
import { Type } from '@angular/core'; | ||
@@ -43,11 +47,8 @@ import { Version } from '@angular/core'; | ||
* | ||
* @developerPreview | ||
* @publicApi | ||
* | ||
* @deprecated | ||
* `ApplicationConfig` has moved, please import `ApplicationConfig` from `@angular/core` instead. | ||
*/ | ||
export declare interface ApplicationConfig { | ||
/** | ||
* List of providers that should be available to the root component and all its children. | ||
*/ | ||
providers: Array<Provider | ImportedNgModuleProviders>; | ||
} | ||
export declare type ApplicationConfig = ApplicationConfig_2; | ||
@@ -112,3 +113,2 @@ /** | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
@@ -135,2 +135,4 @@ export declare function bootstrapApplication(rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef>; | ||
* @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`. | ||
* | ||
* @deprecated Use {@link APP_ID} instead to set the application ID. | ||
*/ | ||
@@ -146,16 +148,2 @@ static withServerTransition(params: { | ||
/** | ||
* NgModule to install on the client side while using the `TransferState` to transfer state from | ||
* server to client. | ||
* | ||
* @publicApi | ||
* @deprecated no longer needed, you can inject the `TransferState` in an app without providing | ||
* this module. | ||
*/ | ||
export declare class BrowserTransferStateModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<BrowserTransferStateModule, never>; | ||
static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserTransferStateModule, never, never, never>; | ||
static ɵinj: i0.ɵɵInjectorDeclaration<BrowserTransferStateModule>; | ||
} | ||
/** | ||
* Predicates for use with {@link DebugElement}'s query functions. | ||
@@ -206,3 +194,2 @@ * | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
@@ -251,8 +238,9 @@ export declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>; | ||
/** | ||
* Sanitizes a value for use in the given SecurityContext. | ||
* Gets a safe value from either a known safe value or a value with unknown safety. | ||
* | ||
* If value is trusted for the context, this method will unwrap the contained safe value and use | ||
* it directly. Otherwise, value will be sanitized to be safe in the given context, for example | ||
* by replacing URLs that have an unsafe protocol part (such as `javascript:`). The implementation | ||
* is responsible to make sure that the value can definitely be safely used in the given context. | ||
* 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. | ||
*/ | ||
@@ -350,13 +338,2 @@ abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null; | ||
/** | ||
* Registers a global handler for an event in a target view. | ||
* | ||
* @param target A target for global event notifications. One of "window", "document", or "body". | ||
* @param eventName The name of the event to listen for. | ||
* @param handler A function to call when the notification occurs. Receives the | ||
* event object as an argument. | ||
* @returns A callback function that can be used to remove the handler. | ||
* @deprecated No longer being used in Ivy code. To be removed in version 14. | ||
*/ | ||
addGlobalEventListener(target: string, eventName: string, handler: Function): Function; | ||
/** | ||
* Retrieves the compilation zone in which event listeners are registered. | ||
@@ -375,3 +352,2 @@ */ | ||
abstract addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
addGlobalEventListener(element: string, eventName: string, handler: Function): Function; | ||
} | ||
@@ -391,3 +367,3 @@ | ||
* DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular. | ||
* @see `HammerGestureConfig` | ||
* @see {@link HammerGestureConfig} | ||
* | ||
@@ -496,2 +472,25 @@ * @ngModule HammerModule | ||
/** | ||
* Helper type to represent a Hydration feature. | ||
* | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
export declare interface HydrationFeature<FeatureKind extends HydrationFeatureKind> { | ||
ɵkind: FeatureKind; | ||
ɵproviders: Provider[]; | ||
} | ||
/** | ||
* The list of features as an enum to uniquely type each `HydrationFeature`. | ||
* @see {@link HydrationFeature} | ||
* | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
export declare const enum HydrationFeatureKind { | ||
NoDomReuseFeature = 0, | ||
NoHttpTransferCache = 1 | ||
} | ||
/** | ||
* Create a `StateKey<T>` that can be used to store value of type T with `TransferState`. | ||
@@ -509,4 +508,5 @@ * | ||
* @publicApi | ||
* @deprecated `makeStateKey` has moved, please import `makeStateKey` from `@angular/core` instead. | ||
*/ | ||
export declare function makeStateKey<T = void>(key: string): StateKey<T>; | ||
export declare const makeStateKey: typeof makeStateKey_2; | ||
@@ -608,3 +608,3 @@ /** | ||
* @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) | ||
* @see `Meta` | ||
* @see {@link Meta} | ||
* | ||
@@ -636,2 +636,52 @@ * @publicApi | ||
/** | ||
* 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. You can enable/disable features by | ||
* passing special functions (from the `HydrationFeatures` set) as arguments to the | ||
* `provideClientHydration` function. 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/universal#caching-data-when-using-httpclient). | ||
* | ||
* These functions functions will allow you to disable some of the default features: | ||
* * {@link withNoDomReuse} to disable DOM nodes reuse during hydration | ||
* * {@link withNoHttpTransferCache} to disable HTTP transfer cache | ||
* | ||
* | ||
* @usageNotes | ||
* | ||
* Basic example of how you can enable hydration in your application when | ||
* `bootstrapApplication` function is used: | ||
* ``` | ||
* bootstrapApplication(AppComponent, { | ||
* providers: [provideClientHydration()] | ||
* }); | ||
* ``` | ||
* | ||
* Alternatively if you are using NgModules, you would add `provideClientHydration` | ||
* to your root app module's provider list. | ||
* ``` | ||
* @NgModule({ | ||
* declarations: [RootCmp], | ||
* bootstrap: [RootCmp], | ||
* providers: [provideClientHydration()], | ||
* }) | ||
* export class AppModule {} | ||
* ``` | ||
* | ||
* @see {@link withNoDomReuse} | ||
* @see {@link withNoHttpTransferCache} | ||
* | ||
* @param features Optional features to configure additional router behaviors. | ||
* @returns A set of providers to enable hydration. | ||
* | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
export declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders; | ||
/** | ||
* Returns a set of providers required to setup [Testability](api/core/Testability) for an | ||
@@ -645,3 +695,2 @@ * application bootstrapped using the `bootstrapApplication` function. The set of providers is | ||
* | ||
* @developerPreview | ||
* @publicApi | ||
@@ -652,2 +701,11 @@ */ | ||
/** | ||
* A [DI token](guide/glossary#di-token "DI token definition") that indicates whether styles | ||
* of destroyed components should be removed from DOM. | ||
* | ||
* By default, the value is set to `false`. This will be changed in the next major version. | ||
* @publicApi | ||
*/ | ||
export declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>; | ||
/** | ||
* Marker interface for a value that's safe to use as HTML. | ||
@@ -711,9 +769,7 @@ * | ||
* ``` | ||
* @publicApi | ||
* | ||
* @publicApi | ||
* @deprecated `StateKey` has moved, please import `StateKey` from `@angular/core` instead. | ||
*/ | ||
export declare type StateKey<T> = string & { | ||
__not_a_string: never; | ||
__value_type?: T; | ||
}; | ||
export declare type StateKey<T> = StateKey_2<T>; | ||
@@ -747,2 +803,3 @@ /** | ||
/** | ||
* | ||
* A key value store that is transferred from the application on the server side to the application | ||
@@ -761,38 +818,12 @@ * on the client side. | ||
* @publicApi | ||
* | ||
* @deprecated `TransferState` has moved, please import `TransferState` from `@angular/core` | ||
* instead. | ||
*/ | ||
export declare class TransferState { | ||
private store; | ||
private onSerializeCallbacks; | ||
/** | ||
* Get the value corresponding to a key. Return `defaultValue` if key is not found. | ||
*/ | ||
get<T>(key: StateKey<T>, defaultValue: T): T; | ||
/** | ||
* Set the value corresponding to a key. | ||
*/ | ||
set<T>(key: StateKey<T>, value: T): void; | ||
/** | ||
* Remove a key from the store. | ||
*/ | ||
remove<T>(key: StateKey<T>): void; | ||
/** | ||
* Test whether a key exists in the store. | ||
*/ | ||
hasKey<T>(key: StateKey<T>): boolean; | ||
/** | ||
* Indicates whether the state is empty. | ||
*/ | ||
get isEmpty(): boolean; | ||
/** | ||
* Register a callback to provide the value for a key when `toJson` is called. | ||
*/ | ||
onSerialize<T>(key: StateKey<T>, callback: () => T): void; | ||
/** | ||
* Serialize the current state of the store to JSON. | ||
*/ | ||
toJson(): string; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<TransferState, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<TransferState>; | ||
} | ||
export declare type TransferState = TransferState_2; | ||
export declare const TransferState: { | ||
new (): TransferState_2; | ||
}; | ||
/** | ||
@@ -804,2 +835,44 @@ * @publicApi | ||
/** | ||
* Disables DOM nodes reuse during hydration. Effectively makes | ||
* Angular re-render an application from scratch on the client. | ||
* | ||
* When this option is enabled, make sure that the initial navigation | ||
* option is configured for the Router as `enabledBlocking` by using the | ||
* `withEnabledBlockingInitialNavigation` in the `provideRouter` call: | ||
* | ||
* ``` | ||
* bootstrapApplication(RootComponent, { | ||
* providers: [ | ||
* provideRouter( | ||
* // ... other features ... | ||
* withEnabledBlockingInitialNavigation() | ||
* ), | ||
* provideClientHydration(withNoDomReuse()) | ||
* ] | ||
* }); | ||
* ``` | ||
* | ||
* This would ensure that the application is rerendered after all async | ||
* operations in the Router (such as lazy-loading of components, | ||
* waiting for async guards and resolvers) are completed to avoid | ||
* clearing the DOM on the client too soon, thus causing content flicker. | ||
* | ||
* @see {@link provideRouter} | ||
* @see {@link withEnabledBlockingInitialNavigation} | ||
* | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
export declare function withNoDomReuse(): HydrationFeature<HydrationFeatureKind.NoDomReuseFeature>; | ||
/** | ||
* Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the | ||
* server and other one on the browser. | ||
* | ||
* @publicApi | ||
* @developerPreview | ||
*/ | ||
export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>; | ||
/** | ||
* A `DomAdapter` powered by full browser DOM APIs. | ||
@@ -842,12 +915,18 @@ * | ||
export declare class ɵDomRendererFactory2 implements RendererFactory2 { | ||
private eventManager; | ||
private sharedStylesHost; | ||
private appId; | ||
private rendererByCompId; | ||
private defaultRenderer; | ||
constructor(eventManager: EventManager, sharedStylesHost: ɵDomSharedStylesHost, appId: string); | ||
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 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); | ||
createRenderer(element: any, type: RendererType2 | null): Renderer2; | ||
begin(): void; | ||
end(): void; | ||
private getOrCreateRenderer; | ||
ngOnDestroy(): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomRendererFactory2, never>; | ||
@@ -870,19 +949,2 @@ static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomRendererFactory2>; | ||
export declare class ɵDomSharedStylesHost extends ɵSharedStylesHost implements OnDestroy { | ||
private _doc; | ||
private _hostNodes; | ||
constructor(_doc: any); | ||
private _addStylesToHost; | ||
addHost(hostNode: Node): void; | ||
removeHost(hostNode: Node): void; | ||
onStylesAdded(additions: Set<string>): void; | ||
ngOnDestroy(): void; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomSharedStylesHost, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomSharedStylesHost>; | ||
} | ||
export declare function ɵescapeHtml(text: string): string; | ||
export declare function ɵflattenStyles(compId: string, styles: Array<any | any[]>, target: string[]): string[]; | ||
export { ɵgetDOM } | ||
@@ -973,24 +1035,29 @@ | ||
export declare const ɵNAMESPACE_URIS: { | ||
[ns: string]: string; | ||
}; | ||
export declare class ɵSharedStylesHost { | ||
export declare class ɵSharedStylesHost implements OnDestroy { | ||
private readonly doc; | ||
private readonly appId; | ||
private nonce?; | ||
readonly platformId: object; | ||
private readonly styleRef; | ||
private readonly hostNodes; | ||
private readonly styleNodesInDOM; | ||
private readonly platformIsServer; | ||
constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object); | ||
addStyles(styles: string[]): void; | ||
onStylesAdded(additions: Set<string>): void; | ||
getAllStyles(): string[]; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵSharedStylesHost, never>; | ||
removeStyles(styles: string[]): void; | ||
ngOnDestroy(): void; | ||
addHost(hostNode: Node): void; | ||
removeHost(hostNode: Node): void; | ||
private getAllStyles; | ||
private onStyleAdded; | ||
private onStyleRemoved; | ||
private collectServerRenderedStyles; | ||
private changeUsageCount; | ||
private getStyleElement; | ||
private addStyleToHost; | ||
private resetHostNodes; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ɵSharedStylesHost, [null, null, { optional: true; }, null]>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<ɵSharedStylesHost>; | ||
} | ||
export declare function ɵshimContentAttribute(componentShortId: string): string; | ||
export declare function ɵshimHostAttribute(componentShortId: string): string; | ||
/** | ||
* An id that identifies a particular application being bootstrapped, that should | ||
* match across the client/server boundary. | ||
*/ | ||
export declare const ɵTRANSITION_ID: InjectionToken<unknown>; | ||
export { } |
{ | ||
"name": "@angular/platform-browser", | ||
"version": "14.3.0", | ||
"version": "16.2.12", | ||
"description": "Angular - library for using Angular in a web browser", | ||
@@ -8,3 +8,3 @@ "author": "angular", | ||
"engines": { | ||
"node": "^14.15.0 || >=16.10.0" | ||
"node": "^16.14.0 || >=18.10.0" | ||
}, | ||
@@ -15,5 +15,5 @@ "dependencies": { | ||
"peerDependencies": { | ||
"@angular/animations": "14.3.0", | ||
"@angular/core": "14.3.0", | ||
"@angular/common": "14.3.0" | ||
"@angular/animations": "16.2.12", | ||
"@angular/core": "16.2.12", | ||
"@angular/common": "16.2.12" | ||
}, | ||
@@ -51,8 +51,4 @@ "peerDependenciesMeta": { | ||
"sideEffects": false, | ||
"fesm2020": "./fesm2020/platform-browser.mjs", | ||
"fesm2015": "./fesm2015/platform-browser.mjs", | ||
"esm2020": "./esm2020/platform-browser.mjs", | ||
"module": "./fesm2022/platform-browser.mjs", | ||
"typings": "./index.d.ts", | ||
"module": "./fesm2015/platform-browser.mjs", | ||
"es2020": "./fesm2020/platform-browser.mjs", | ||
"type": "module", | ||
@@ -65,25 +61,19 @@ "exports": { | ||
"types": "./index.d.ts", | ||
"esm2020": "./esm2020/platform-browser.mjs", | ||
"es2020": "./fesm2020/platform-browser.mjs", | ||
"es2015": "./fesm2015/platform-browser.mjs", | ||
"node": "./fesm2015/platform-browser.mjs", | ||
"default": "./fesm2020/platform-browser.mjs" | ||
"esm2022": "./esm2022/platform-browser.mjs", | ||
"esm": "./esm2022/platform-browser.mjs", | ||
"default": "./fesm2022/platform-browser.mjs" | ||
}, | ||
"./animations": { | ||
"types": "./animations/index.d.ts", | ||
"esm2020": "./esm2020/animations/animations.mjs", | ||
"es2020": "./fesm2020/animations.mjs", | ||
"es2015": "./fesm2015/animations.mjs", | ||
"node": "./fesm2015/animations.mjs", | ||
"default": "./fesm2020/animations.mjs" | ||
"esm2022": "./esm2022/animations/animations.mjs", | ||
"esm": "./esm2022/animations/animations.mjs", | ||
"default": "./fesm2022/animations.mjs" | ||
}, | ||
"./testing": { | ||
"types": "./testing/index.d.ts", | ||
"esm2020": "./esm2020/testing/testing.mjs", | ||
"es2020": "./fesm2020/testing.mjs", | ||
"es2015": "./fesm2015/testing.mjs", | ||
"node": "./fesm2015/testing.mjs", | ||
"default": "./fesm2020/testing.mjs" | ||
"esm2022": "./esm2022/testing/testing.mjs", | ||
"esm": "./esm2022/testing/testing.mjs", | ||
"default": "./fesm2022/testing.mjs" | ||
} | ||
} | ||
} |
/** | ||
* @license Angular v14.3.0 | ||
* @license Angular v16.2.12 | ||
* (c) 2010-2022 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18
780373
54
7190