@angular/platform-server
Advanced tools
Comparing version
166
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,30 +7,61 @@ * License: MIT | ||
import { ApplicationRef } from '@angular/core'; | ||
import { EnvironmentProviders } from '@angular/core'; | ||
import * as i0 from '@angular/core'; | ||
import { EnvironmentProviders, StaticProvider, PlatformRef, Provider, InjectionToken, ApplicationRef, Type, Version } from '@angular/core'; | ||
import * as i1 from '@angular/platform-browser'; | ||
import { InjectionToken } from '@angular/core'; | ||
import { PlatformRef } from '@angular/core'; | ||
import { Provider } from '@angular/core'; | ||
import { StaticProvider } from '@angular/core'; | ||
import { Type } from '@angular/core'; | ||
import { Version } from '@angular/core'; | ||
/** | ||
* A function that will be executed when calling `renderApplication` or | ||
* `renderModule` just before current platform state is rendered to string. | ||
* Representation of the current platform state. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare const BEFORE_APP_SERIALIZED: InjectionToken<readonly (() => void | Promise<void>)[]>; | ||
declare class PlatformState { | ||
private _doc; | ||
constructor(_doc: any); | ||
/** | ||
* Renders the current state of the platform to string. | ||
*/ | ||
renderToString(): string; | ||
/** | ||
* Returns the current DOM state. | ||
*/ | ||
getDocument(): any; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>; | ||
} | ||
/** | ||
* The DI token for setting the initial config for the platform. | ||
* Sets up providers necessary to enable server rendering functionality for the application. | ||
* | ||
* @usageNotes | ||
* | ||
* Basic example of how you can add server support to your application: | ||
* ```ts | ||
* bootstrapApplication(AppComponent, { | ||
* providers: [provideServerRendering()] | ||
* }); | ||
* ``` | ||
* | ||
* @publicApi | ||
* @returns A set of providers to setup the server. | ||
*/ | ||
export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>; | ||
declare function provideServerRendering(): EnvironmentProviders; | ||
declare const INTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[]; | ||
declare const SERVER_RENDER_PROVIDERS: Provider[]; | ||
/** | ||
* The ng module for the server. | ||
* | ||
* @publicApi | ||
*/ | ||
declare class ServerModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>; | ||
static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, never, [typeof i1.BrowserModule]>; | ||
static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>; | ||
} | ||
/** | ||
* @publicApi | ||
*/ | ||
declare function platformServer(extraProviders?: StaticProvider[] | undefined): PlatformRef; | ||
/** | ||
* Config object passed to initialize the platform. | ||
@@ -40,3 +71,3 @@ * | ||
*/ | ||
export declare interface PlatformConfig { | ||
interface PlatformConfig { | ||
/** | ||
@@ -55,45 +86,40 @@ * The initial DOM to use to bootstrap the server application. | ||
} | ||
/** | ||
* The DI token for setting the initial config for the platform. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare function platformServer(extraProviders?: StaticProvider[] | undefined): PlatformRef; | ||
declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>; | ||
/** | ||
* Representation of the current platform state. | ||
* A function that will be executed when calling `renderApplication` or | ||
* `renderModule` just before current platform state is rendered to string. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare class PlatformState { | ||
private _doc; | ||
constructor(_doc: any); | ||
/** | ||
* Renders the current state of the platform to string. | ||
*/ | ||
renderToString(): string; | ||
/** | ||
* Returns the current DOM state. | ||
*/ | ||
getDocument(): any; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>; | ||
static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>; | ||
} | ||
declare const BEFORE_APP_SERIALIZED: InjectionToken<readonly (() => void | Promise<void>)[]>; | ||
declare const ENABLE_DOM_EMULATION: InjectionToken<boolean>; | ||
/** | ||
* Sets up providers necessary to enable server rendering functionality for the application. | ||
* An internal token that allows providing extra information about the server context | ||
* (e.g. whether SSR or SSG was used). The value is a string and characters other | ||
* than [a-zA-Z0-9\-] are removed. See the default value in `DEFAULT_SERVER_CONTEXT` const. | ||
*/ | ||
declare const SERVER_CONTEXT: InjectionToken<string>; | ||
/** | ||
* Bootstraps an application using provided NgModule and serializes the page content to string. | ||
* | ||
* @usageNotes | ||
* @param moduleType A reference to an NgModule that should be used for bootstrap. | ||
* @param options Additional configuration for the render operation: | ||
* - `document` - the document of the page to render, either as an HTML string or | ||
* as a reference to the `document` instance. | ||
* - `url` - the URL for the current render request. | ||
* - `extraProviders` - set of platform level providers for the current render request. | ||
* | ||
* Basic example of how you can add server support to your application: | ||
* ```ts | ||
* bootstrapApplication(AppComponent, { | ||
* providers: [provideServerRendering()] | ||
* }); | ||
* ``` | ||
* | ||
* @publicApi | ||
* @returns A set of providers to setup the server. | ||
*/ | ||
export declare function provideServerRendering(): EnvironmentProviders; | ||
declare function renderModule<T>(moduleType: Type<T>, options: { | ||
document?: string | Document; | ||
url?: string; | ||
extraProviders?: StaticProvider[]; | ||
}): Promise<string>; | ||
/** | ||
@@ -119,3 +145,3 @@ * Bootstraps an instance of an Angular application and renders it to a string. | ||
*/ | ||
export declare function renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: { | ||
declare function renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: { | ||
document?: string | Document; | ||
@@ -127,48 +153,12 @@ url?: string; | ||
/** | ||
* Bootstraps an application using provided NgModule and serializes the page content to string. | ||
* | ||
* @param moduleType A reference to an NgModule that should be used for bootstrap. | ||
* @param options Additional configuration for the render operation: | ||
* - `document` - the document of the page to render, either as an HTML string or | ||
* as a reference to the `document` instance. | ||
* - `url` - the URL for the current render request. | ||
* - `extraProviders` - set of platform level providers for the current render request. | ||
* | ||
* @publicApi | ||
* @module | ||
* @description | ||
* Entry point for all public APIs of the platform-server package. | ||
*/ | ||
export declare function renderModule<T>(moduleType: Type<T>, options: { | ||
document?: string | Document; | ||
url?: string; | ||
extraProviders?: StaticProvider[]; | ||
}): Promise<string>; | ||
/** | ||
* The ng module for the server. | ||
* | ||
* @publicApi | ||
*/ | ||
export declare class ServerModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>; | ||
static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, never, [typeof i1.BrowserModule]>; | ||
static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>; | ||
} | ||
declare const VERSION: Version; | ||
/** | ||
* @publicApi | ||
*/ | ||
export declare const VERSION: Version; | ||
export declare const ɵENABLE_DOM_EMULATION: InjectionToken<boolean>; | ||
export declare const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[]; | ||
/** | ||
* An internal token that allows providing extra information about the server context | ||
* (e.g. whether SSR or SSG was used). The value is a string and characters other | ||
* than [a-zA-Z0-9\-] are removed. See the default value in `DEFAULT_SERVER_CONTEXT` const. | ||
*/ | ||
export declare const ɵSERVER_CONTEXT: InjectionToken<string>; | ||
export declare const ɵSERVER_RENDER_PROVIDERS: Provider[]; | ||
export { } | ||
export { BEFORE_APP_SERIALIZED, INITIAL_CONFIG, type PlatformConfig, PlatformState, ServerModule, VERSION, platformServer, provideServerRendering, renderApplication, renderModule, ENABLE_DOM_EMULATION as ɵENABLE_DOM_EMULATION, INTERNAL_SERVER_PLATFORM_PROVIDERS as ɵINTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_CONTEXT as ɵSERVER_CONTEXT, SERVER_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS }; |
/** | ||
* @license Angular v20.0.0-next.1 | ||
* @license Angular v20.0.0-next.2 | ||
* (c) 2010-2025 Google LLC. https://angular.io/ | ||
@@ -7,3 +7,4 @@ * License: MIT | ||
declare const ɵɵmoduleMarker = true; | ||
export { } | ||
export { ɵɵmoduleMarker }; |
{ | ||
"name": "@angular/platform-server", | ||
"version": "20.0.0-next.1", | ||
"version": "20.0.0-next.2", | ||
"description": "Angular - library for using Angular in Node.js", | ||
@@ -11,6 +11,7 @@ "author": "angular", | ||
"peerDependencies": { | ||
"@angular/common": "20.0.0-next.1", | ||
"@angular/compiler": "20.0.0-next.1", | ||
"@angular/core": "20.0.0-next.1", | ||
"@angular/platform-browser": "20.0.0-next.1" | ||
"@angular/common": "20.0.0-next.2", | ||
"@angular/compiler": "20.0.0-next.2", | ||
"@angular/core": "20.0.0-next.2", | ||
"@angular/platform-browser": "20.0.0-next.2", | ||
"rxjs": "^6.5.3 || ^7.4.0" | ||
}, | ||
@@ -17,0 +18,0 @@ "dependencies": { |
/** | ||
* @license Angular v20.0.0-next.1 | ||
* @license Angular v20.0.0-next.2 | ||
* (c) 2010-2025 Google LLC. https://angular.io/ | ||
@@ -7,7 +7,4 @@ * License: MIT | ||
import * as i0 from '@angular/core'; | ||
import * as i1 from '@angular/platform-browser-dynamic/testing'; | ||
import { PlatformRef } from '@angular/core'; | ||
import { StaticProvider } from '@angular/core'; | ||
@@ -19,4 +16,3 @@ /** | ||
*/ | ||
export declare const platformServerTesting: (extraProviders?: StaticProvider[]) => PlatformRef; | ||
declare const platformServerTesting: (extraProviders?: i0.StaticProvider[]) => i0.PlatformRef; | ||
/** | ||
@@ -27,3 +23,3 @@ * NgModule for testing. | ||
*/ | ||
export declare class ServerTestingModule { | ||
declare class ServerTestingModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<ServerTestingModule, never>; | ||
@@ -34,2 +30,2 @@ static ɵmod: i0.ɵɵNgModuleDeclaration<ServerTestingModule, never, never, [typeof i1.BrowserDynamicTestingModule]>; | ||
export { } | ||
export { ServerTestingModule, platformServerTesting }; |
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
3124236
-3%7
16.67%33050
-0.63%