mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
We enabled a lint rule internally to require that multi-provided `InjectionToken`s have a `readonly` array type, the tokens in this PR do not follow this rule and are causing lint violations. Fixes #51124 PR Close #51125
67 lines
2 KiB
TypeScript
67 lines
2 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {InjectionToken} from '@angular/core';
|
|
|
|
/**
|
|
* Config object passed to initialize the platform.
|
|
*
|
|
* @publicApi
|
|
*/
|
|
export interface PlatformConfig {
|
|
/**
|
|
* The initial DOM to use to bootstrap the server application.
|
|
* @default create a new DOM using Domino
|
|
*/
|
|
document?: string;
|
|
/**
|
|
* The URL for the current application state. This is used for initializing
|
|
* the platform's location. `protocol`, `hostname`, and `port` will be
|
|
* overridden if `baseUrl` is set.
|
|
* @default none
|
|
*/
|
|
url?: string;
|
|
/**
|
|
* Note: this option has no effect and can be removed from the config.
|
|
*
|
|
* Whether to append the absolute URL to any relative HTTP requests. If set to
|
|
* true, this logic executes prior to any HTTP interceptors that may run later
|
|
* on in the request. `baseUrl` must be supplied if this flag is enabled.
|
|
*
|
|
* @deprecated This option is a noop.
|
|
* @default false
|
|
*/
|
|
useAbsoluteUrl?: boolean;
|
|
/**
|
|
* Note: this option has no effect and can be removed from the config.
|
|
*
|
|
* The base URL for resolving absolute URL for HTTP requests. It must be set
|
|
* if `useAbsoluteUrl` is true, and must consist of protocol, hostname,
|
|
* and optional port. This option has no effect if `useAbsoluteUrl` is not
|
|
* enabled.
|
|
*
|
|
* @deprecated This option is a noop.
|
|
*/
|
|
baseUrl?: string;
|
|
}
|
|
|
|
/**
|
|
* The DI token for setting the initial config for the platform.
|
|
*
|
|
* @publicApi
|
|
*/
|
|
export const INITIAL_CONFIG = new InjectionToken<PlatformConfig>('Server.INITIAL_CONFIG');
|
|
|
|
/**
|
|
* A function that will be executed when calling `renderApplication` or
|
|
* `renderModule` just before current platform state is rendered to string.
|
|
*
|
|
* @publicApi
|
|
*/
|
|
export const BEFORE_APP_SERIALIZED =
|
|
new InjectionToken<ReadonlyArray<() => void | Promise<void>>>('Server.RENDER_MODULE_HOOK');
|