@angular/ssr
Advanced tools
Comparing version 19.1.4 to 19.1.5
108
index.d.ts
import type { ApplicationRef } from '@angular/core'; | ||
import { default as default_2 } from 'beasties'; | ||
import { DefaultExport } from '@angular/router'; | ||
import { EnvironmentProviders } from '@angular/core'; | ||
import type { Type } from '@angular/core'; | ||
import { Provider } from '@angular/core'; | ||
import { Type } from '@angular/core'; | ||
@@ -536,2 +538,4 @@ /** | ||
* @see {@link ServerRoutesConfigOptions} | ||
* @see {@link provideServerRouting} | ||
* @deprecated use `provideServerRouting`. This will be removed in version 20. | ||
* @developerPreview | ||
@@ -542,4 +546,20 @@ */ | ||
/** | ||
* Sets up the necessary providers for configuring server routes. | ||
* This function accepts an array of server routes and optional configuration | ||
* options, returning an `EnvironmentProviders` object that encapsulates | ||
* the server routes and configuration settings. | ||
* | ||
* @param routes - An array of server routes to be provided. | ||
* @param features - (Optional) server routes features. | ||
* @returns An `EnvironmentProviders` instance with the server routes configuration. | ||
* | ||
* @see {@link ServerRoute} | ||
* @see {@link withAppShell} | ||
* @developerPreview | ||
*/ | ||
export declare function provideServerRouting(routes: ServerRoute[], ...features: ServerRoutesFeature<ServerRoutesFeatureKind>[]): EnvironmentProviders; | ||
/** | ||
* Different rendering modes for server routes. | ||
* @see {@link provideServerRoutesConfig} | ||
* @see {@link provideServerRouting} | ||
* @see {@link ServerRoute} | ||
@@ -582,8 +602,2 @@ * @developerPreview | ||
/** | ||
* A counter that tracks the order of route insertion. | ||
* This ensures that routes are matched in the order they were defined, | ||
* with earlier routes taking precedence. | ||
*/ | ||
private insertionIndexCounter; | ||
/** | ||
* Inserts a new route into the route tree. | ||
@@ -647,4 +661,6 @@ * The route is broken down into segments, and each segment is added to the tree. | ||
* | ||
* @param remainingSegments - The remaining segments of the route path to match. | ||
* @param node - The current node in the route tree to start traversal from. | ||
* @param segments - The array of route path segments to match against the route tree. | ||
* @param node - The current node in the route tree to start traversal from. Defaults to the root node. | ||
* @param currentIndex - The index of the segment in `remainingSegments` currently being matched. | ||
* Defaults to `0` (the first segment). | ||
* | ||
@@ -655,15 +671,5 @@ * @returns The node that best matches the remaining segments or `undefined` if no match is found. | ||
/** | ||
* Compares two nodes and returns the node with higher priority based on insertion index. | ||
* A node with a lower insertion index is prioritized as it was defined earlier. | ||
* | ||
* @param currentBestMatchNode - The current best match node. | ||
* @param candidateNode - The node being evaluated for higher priority based on insertion index. | ||
* @returns The node with higher priority (i.e., lower insertion index). If one of the nodes is `undefined`, the other node is returned. | ||
*/ | ||
private getHigherPriorityNode; | ||
/** | ||
* Creates an empty route tree node with the specified segment. | ||
* Creates an empty route tree node. | ||
* This helper function is used during the tree construction. | ||
* | ||
* @param segment - The route segment that this node represents. | ||
* @returns A new, empty route tree node. | ||
@@ -681,15 +687,2 @@ */ | ||
/** | ||
* The segment value associated with this node. | ||
* A segment is a single part of a route path, typically delimited by slashes (`/`). | ||
* For example, in the route `/users/:id/profile`, the segments are `users`, `:id`, and `profile`. | ||
* Segments can also be wildcards (`*`), which match any segment in that position of the route. | ||
*/ | ||
segment: string; | ||
/** | ||
* The index indicating the order in which the route was inserted into the tree. | ||
* This index helps determine the priority of routes during matching, with lower indexes | ||
* indicating earlier inserted routes. | ||
*/ | ||
insertionIndex: number; | ||
/** | ||
* A map of child nodes, keyed by their corresponding route segment or wildcard. | ||
@@ -784,3 +777,3 @@ */ | ||
* Server route configuration. | ||
* @see {@link provideServerRoutesConfig} | ||
* @see {@link provideServerRouting} | ||
* @developerPreview | ||
@@ -877,4 +870,5 @@ */ | ||
* | ||
* @see {@link provideServerRoutesConfig} | ||
* @developerPreview | ||
* | ||
* @see {@link provideServerRouting} | ||
* @deprecated use `provideServerRouting`. This will be removed in version 20. | ||
*/ | ||
@@ -886,4 +880,2 @@ export declare interface ServerRoutesConfigOptions { | ||
* of the application shell for requests that do not match any specific server route. | ||
* | ||
* @see {@link https://angular.dev/ecosystem/service-workers/app-shell | App shell pattern on Angular.dev} | ||
*/ | ||
@@ -904,2 +896,40 @@ appShellRoute?: string; | ||
/** | ||
* Helper type to represent a server routes feature. | ||
* @see {@link ServerRoutesFeatureKind} | ||
* @developerPreview | ||
*/ | ||
declare interface ServerRoutesFeature<FeatureKind extends ServerRoutesFeatureKind> { | ||
ɵkind: FeatureKind; | ||
ɵproviders: Provider[]; | ||
} | ||
/** | ||
* Identifies a particular kind of `ServerRoutesFeatureKind`. | ||
* @see {@link ServerRoutesFeature} | ||
* @developerPreview | ||
*/ | ||
declare enum ServerRoutesFeatureKind { | ||
AppShell = 0 | ||
} | ||
/** | ||
* Configures the app shell route with the provided component. | ||
* | ||
* The app shell serves as the main entry point for the application and is commonly used | ||
* to enable server-side rendering (SSR) of the application shell. It handles requests | ||
* that do not match any specific server route, providing a fallback mechanism and improving | ||
* perceived performance during navigation. | ||
* | ||
* This configuration is particularly useful in applications leveraging Progressive Web App (PWA) | ||
* patterns, such as service workers, to deliver a seamless user experience. | ||
* | ||
* @param component The Angular component to render for the app shell route. | ||
* @returns A server routes feature configuration for the app shell. | ||
* | ||
* @see {@link provideServerRouting} | ||
* @see {@link https://angular.dev/ecosystem/service-workers/app-shell | App shell pattern on Angular.dev} | ||
*/ | ||
export declare function withAppShell(component: Type<unknown> | (() => Promise<Type<unknown> | DefaultExport<Type<unknown>>>)): ServerRoutesFeature<ServerRoutesFeatureKind.AppShell>; | ||
/** | ||
* Destroys the existing `AngularServerApp` instance, releasing associated resources and resetting the | ||
@@ -906,0 +936,0 @@ * reference to `undefined`. |
{ | ||
"name": "@angular/ssr", | ||
"version": "19.1.4", | ||
"version": "19.1.5", | ||
"description": "Angular server side rendering utilities", | ||
"type": "module", | ||
"license": "MIT", | ||
@@ -46,3 +47,2 @@ "homepage": "https://github.com/angular/angular-cli", | ||
"typings": "./index.d.ts", | ||
"type": "module", | ||
"exports": { | ||
@@ -49,0 +49,0 @@ "./package.json": { |
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
1695702
15429