angular/goldens/public-api/platform-server/index.api.md
Alan Agius 378284fa08 refactor(core): introduce ngServerMode as global (#58386)
This commit adds the `ngServerMode` as global, which allows for the tree-shaking of server-only code from the bundles. When this flag is unset at runtime, server-specific code will be excluded by Closure, optimizing bundle size.

**Internal Angular Flag:** This is an internal Angular flag (not a public API), avoid relying on it in application code.

PR Close #58386
2024-10-30 10:13:28 -07:00

2.3 KiB

API Report File for "@angular/platform-server"

Do not edit this file. It is a report generated by API Extractor.


import { ApplicationRef } from '@angular/core';
import { EnvironmentProviders } from '@angular/core';
import * as i0 from '@angular/core';
import * as i1 from '@angular/platform-browser/animations';
import * as i2 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';

// @public
export const BEFORE_APP_SERIALIZED: InjectionToken<readonly (() => void | Promise<void>)[]>;

// @public
export const INITIAL_CONFIG: InjectionToken<PlatformConfig>;

// @public
export interface PlatformConfig {
    document?: string;
    url?: string;
}

// @public (undocumented)
export function platformServer(extraProviders?: StaticProvider[] | undefined): PlatformRef;

// @public
export class PlatformState {
    constructor(_doc: any);
    getDocument(): any;
    renderToString(): string;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>;
    // (undocumented)
    static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
}

// @public
export function provideServerRendering(): EnvironmentProviders;

// @public
export function renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: {
    document?: string | Document;
    url?: string;
    platformProviders?: Provider[];
}): Promise<string>;

// @public
export function renderModule<T>(moduleType: Type<T>, options: {
    document?: string | Document;
    url?: string;
    extraProviders?: StaticProvider[];
}): Promise<string>;

// @public
export class ServerModule {
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;
    // (undocumented)
    static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;
    // (undocumented)
    static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, [typeof i1.NoopAnimationsModule], [typeof i2.BrowserModule]>;
}

// @public (undocumented)
export const VERSION: Version;

// (No @packageDocumentation comment for this package)