Files
angular__angular/goldens/public-api/platform-server/index.api.md
T
Andrew Scott dfe7be4d2a refactor(compiler): emit any as type argument for ɵɵInjectableDeclaration
The static `ɵprov` field emitted on `@Injectable()` classes uses `ɵɵInjectableDeclaration<T>`.
When a subclass extends a generic `@Injectable()` base class with contravariant parameters
(such as callback/transformer methods depending on generic type parameters), TypeScript's
static side inheritance check (`typeof Sub extends typeof Super`) fails with `TS2417` because
`ɵɵInjectableDeclaration<Sub>` is not assignable to `ɵɵInjectableDeclaration<Super<any>>`.

Using `any` (`o.DYNAMIC_TYPE`) in `createInjectableType` avoids strict variance checks on
static inheritance for internal Ivy definitions and aligns with other Ivy declaration types.

(cherry picked from commit caeab598c9)
2026-09-04 07:05:28 -07:00

100 lines
2.8 KiB
Markdown

## API Report File for "@angular/platform-server"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { ApplicationRef } from '@angular/core';
import { BootstrapContext } from '@angular/platform-browser';
import { EnvironmentProviders } from '@angular/core';
import * as i0 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';
// @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
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<any>;
}
// @public
export function provideServerRendering(options?: {
maxResponseBodySize: number;
}): EnvironmentProviders;
// @public
export function renderApplication(bootstrap: (context: BootstrapContext) => Promise<ApplicationRef>, options: {
document?: string | Document;
url?: string;
platformProviders?: Provider[];
allowedHosts?: Readonly<string>[];
}): Promise<string>;
// @public
export function renderModule<T>(moduleType: Type<T>, options: {
document?: string | Document;
url?: string;
extraProviders?: StaticProvider[];
allowedHosts?: Readonly<string>[];
}): Promise<string>;
// @public
export const enum RuntimeErrorCode {
// (undocumented)
DISABLED_DOM_EMULATION_IN_NON_BROWSER = 5704,
// (undocumented)
GET_COOKIE_NOT_IMPLEMENTED = 5700,
// (undocumented)
HOST_NOT_ALLOWED = 5706,
// (undocumented)
INVALID_URL = 5701,
// (undocumented)
PROTOCOL_RELATIVE_URL_NOT_ALLOWED = 5702,
// (undocumented)
SUSPICIOUS_URL_CHANGE_ORIGIN = -5703,
// (undocumented)
XHR_NOT_LOADED = 5705
}
// @public
export class ServerModule {
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;
// (undocumented)
static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;
// (undocumented)
static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, never, [typeof i1.BrowserModule]>;
}
// @public (undocumented)
export const VERSION: Version;
// (No @packageDocumentation comment for this package)
```