/** * @license Angular v20.1.0 * (c) 2010-2025 Google LLC. https://angular.io/ * License: MIT */ import { SIGNAL, ValueEqualityFn as ValueEqualityFn$1 } from './graph.d.js'; import { Signal, WritableSignal, OutputRef, Provider, EnvironmentProviders, Type as Type$1, ModuleWithProviders, TypeProvider, ValueProvider, ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, ProviderToken, StaticProvider, Injector, ValueSansProvider, ExistingSansProvider, StaticClassSansProvider, ConstructorSansProvider, FactorySansProvider, ClassSansProvider, InjectionToken, InternalInjectFlags, InjectOptions, ValueEqualityFn, EventCallback, isSignal, enableProfiling as enableProfiling$1 } from './chrome_dev_tools_performance.d.js'; export { AbstractType, CreateSignalOptions, DestroyRef, DestroyableInjector, ImportedNgModuleProviders, OutputRefSubscription, signal, InternalEnvironmentProviders as ɵInternalEnvironmentProviders, JSACTION_EVENT_CONTRACT as ɵJSACTION_EVENT_CONTRACT, Writable as ɵWritable, isEnvironmentProviders as ɵisEnvironmentProviders, ɵunwrapWritableSignal } from './chrome_dev_tools_performance.d.js'; import { InputSignalNode, TypeDecorator, AfterRenderRef, EffectCleanupRegisterFn, SchemaMetadata, ComponentDef, DirectiveDef, CssSelectorList, DirectiveDefFeature, HostBindingsFunction, TAttributes, ContentQueriesFunction, ViewQueriesFunction, ComponentTemplate, TConstantsOrFactory, ComponentDefFeature, ViewEncapsulation as ViewEncapsulation$1, ChangeDetectionStrategy as ChangeDetectionStrategy$1, TypeOrFactory, DependencyTypeList, InputFlags, InputTransformFunction, EmbeddedViewRef, LView, ApplicationRef, ChangeDetectorRef, ComponentFactory as ComponentFactory$1, NgModuleRef as NgModuleRef$1, EnvironmentInjector, DirectiveWithBindings, Binding, ComponentRef as ComponentRef$1, ElementRef, ComponentFactoryResolver as ComponentFactoryResolver$1, InternalNgModuleRef, NgModuleFactory as NgModuleFactory$1, ViewRef as ViewRef$1, PlatformRef, NgZone, ChangeDetectionScheduler, NotificationSource, ɵɵFactoryDeclaration as __FactoryDeclaration, ɵɵInjectableDeclaration as __InjectableDeclaration, ɵɵNgModuleDeclaration as __NgModuleDeclaration, ɵɵInjectorDeclaration as __InjectorDeclaration, DeferBlockDependencyInterceptor, DeferBlockConfig, DeferBlockState, TNode, LContainer, TView, TDeferBlockDetails, RNode, Component, TrustedHTML, DehydratedDeferBlock, CompilerOptions, HostDirectiveConfig, ComponentType, NgModuleScopeInfoFromDecorator, DependencyResolverFn, TDeferDetailsFlags, SanitizerFn, LocalRefExtractor, OpaqueViewState, GlobalTargetResolver, ProjectionSlots, QueryFlags, QueryList, RElement, RawScopeInfoFromDecorator, ClassDebugInfo, Directive, NgModule, Pipe, TrustedScriptURL, TrustedScript, PipeType, DirectiveType } from './discovery.d.js'; export { APP_BOOTSTRAP_LISTENER, BootstrapOptions, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, Compiler, CompilerFactory, ComponentDecorator, CreateEffectOptions, DebugElement, DebugEventListener, DebugNode, DirectiveDecorator, EffectCleanupFn, EffectRef, EventEmitter, HostBinding, HostBindingDecorator, HostListener, HostListenerDecorator, InjectableType, InjectorType, Input, InputDecorator, ListenerOptions, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModuleDecorator, NgProbeToken, Output, OutputDecorator, PipeDecorator, Predicate, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, Sanitizer, SecurityContext, asNativeElements, defineInjectable, effect, getDebugNode, inputBinding, outputBinding, twoWayBinding, AfterRenderManager as ɵAfterRenderManager, AnimationRendererType as ɵAnimationRendererType, AttributeMarker as ɵAttributeMarker, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockDetails as ɵDeferBlockDetails, EffectScheduler as ɵEffectScheduler, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, NG_INJ_DEF as ɵNG_INJ_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NavigateEvent as ɵNavigateEvent, Navigation as ɵNavigation, NavigationCurrentEntryChangeEvent as ɵNavigationCurrentEntryChangeEvent, NavigationDestination as ɵNavigationDestination, NavigationHistoryEntry as ɵNavigationHistoryEntry, NavigationInterceptOptions as ɵNavigationInterceptOptions, NavigationNavigateOptions as ɵNavigationNavigateOptions, NavigationOptions as ɵNavigationOptions, NavigationReloadOptions as ɵNavigationReloadOptions, NavigationResult as ɵNavigationResult, NavigationTransition as ɵNavigationTransition, NavigationTypeString as ɵNavigationTypeString, NavigationUpdateCurrentEntryOptions as ɵNavigationUpdateCurrentEntryOptions, NoopNgZone as ɵNoopNgZone, PipeDef as ɵPipeDef, R3Injector as ɵR3Injector, RenderFlags as ɵRenderFlags, TracingAction as ɵTracingAction, TracingService as ɵTracingService, TracingSnapshot as ɵTracingSnapshot, ZONELESS_ENABLED as ɵZONELESS_ENABLED, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getInjectableDef as ɵgetInjectableDef, injectChangeDetectorRef as ɵinjectChangeDetectorRef, isBoundToModule as ɵisBoundToModule, isInjectable as ɵisInjectable, ɵɵComponentDeclaration, ɵɵDirectiveDeclaration, ɵɵInjectorDef, ɵɵPipeDeclaration, ɵɵdefineInjectable, ɵɵdefineInjector } from './discovery.d.js'; import { ResourceOptions, ResourceRef, ResourceStreamingLoader, ResourceStatus, WritableResource, Resource } from './api.d.js'; export { BaseResourceOptions, OutputEmitterRef, OutputOptions, PromiseResourceOptions, ResourceLoader, ResourceLoaderParams, ResourceStreamItem, StreamingResourceOptions, output, getOutputDestroyRef as ɵgetOutputDestroyRef } from './api.d.js'; import './event_dispatcher.d.js'; import { Observable, Subscribable } from 'rxjs'; export { setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl } from './weak_ref.d.js'; export { setCurrentInjector as ɵsetCurrentInjector } from './primitives/di/index.js'; import './signal.d.js'; import '@angular/core/primitives/di'; /** * @publicAPI * * Options for signal inputs. */ interface InputOptions { /** Optional public name for the input. By default, the class field name is used. */ alias?: string; /** * Optional transform that runs whenever a new value is bound. Can be used to * transform the input value before the input is updated. * * The transform function can widen the type of the input. For example, consider * an input for `disabled`. In practice, as the component author, you want to only * deal with a boolean, but users may want to bind a string if they just use the * attribute form to bind to the input via ``. A transform can then * handle such string values and convert them to `boolean`. See: {@link booleanAttribute}. */ transform?: (v: TransformT) => T; /** * A debug name for the input signal. Used in Angular DevTools to identify the signal. */ debugName?: string; } /** * Signal input options without the transform option. * * @publicApi 19.0 */ type InputOptionsWithoutTransform = Omit, 'transform'> & { transform?: undefined; }; /** * Signal input options with the transform option required. * * @publicAPI */ type InputOptionsWithTransform = Required, 'transform'>> & InputOptions; declare const ɵINPUT_SIGNAL_BRAND_READ_TYPE: unique symbol; declare const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE: unique symbol; /** * `InputSignalWithTransform` represents a special `Signal` for a * directive/component input with a `transform` function. * * Signal inputs with transforms capture an extra generic for their transform write * type. Transforms can expand the accepted bound values for an input while ensuring * value retrievals of the signal input are still matching the generic input type. * * ```ts * class MyDir { * disabled = input(false, { * transform: (v: string|boolean) => convertToBoolean(v), * }); // InputSignalWithTransform * * click() { * this.disabled() // always returns a `boolean`. * } * } * ``` * * @see {@link InputSignal} for additional information. * * @publicApi 19.0 */ interface InputSignalWithTransform extends Signal { [SIGNAL]: InputSignalNode; [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T; [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: TransformT; } /** * `InputSignal` represents a special `Signal` for a directive/component input. * * An input signal is similar to a non-writable signal except that it also * carries additional type-information for transforms, and that Angular internally * updates the signal whenever a new value is bound. * * @see {@link InputOptionsWithTransform} for inputs with transforms. * * @publicApi 19.0 */ interface InputSignal extends InputSignalWithTransform { } /** * The `input` function allows declaration of inputs in directives and * components. * * The function exposes an API for also declaring required inputs via the * `input.required` function. * * @publicAPI * @docsPrivate Ignored because `input` is the canonical API entry. */ interface InputFunction { /** * Initializes an input of type `T` with an initial value of `undefined`. * Angular will implicitly use `undefined` as initial value. */ (): InputSignal; /** Declares an input of type `T` with an explicit initial value. */ (initialValue: T, opts?: InputOptionsWithoutTransform): InputSignal; /** Declares an input of type `T|undefined` without an initial value, but with input options */ (initialValue: undefined, opts: InputOptionsWithoutTransform): InputSignal; /** * Declares an input of type `T` with an initial value and a transform * function. * * The input accepts values of type `TransformT` and the given * transform function will transform the value to type `T`. */ (initialValue: T, opts: InputOptionsWithTransform): InputSignalWithTransform; /** * Declares an input of type `T|undefined` without an initial value and with a transform * function. * * The input accepts values of type `TransformT` and the given * transform function will transform the value to type `T|undefined`. */ (initialValue: undefined, opts: InputOptionsWithTransform): InputSignalWithTransform; /** * Initializes a required input. * * Consumers of your directive/component need to bind to this * input. If unset, a compile time error will be reported. * * @publicAPI */ required: { /** Declares a required input of type `T`. */ (opts?: InputOptionsWithoutTransform): InputSignal; /** * Declares a required input of type `T` with a transform function. * * The input accepts values of type `TransformT` and the given * transform function will transform the value to type `T`. */ (opts: InputOptionsWithTransform): InputSignalWithTransform; }; } /** * The `input` function allows declaration of Angular inputs in directives * and components. * * There are two variants of inputs that can be declared: * * 1. **Optional inputs** with an initial value. * 2. **Required inputs** that consumers need to set. * * By default, the `input` function will declare optional inputs that * always have an initial value. Required inputs can be declared * using the `input.required()` function. * * Inputs are signals. The values of an input are exposed as a `Signal`. * The signal always holds the latest value of the input that is bound * from the parent. * * @usageNotes * To use signal-based inputs, import `input` from `@angular/core`. * * ```ts * import {input} from '@angular/core`; * ``` * * Inside your component, introduce a new class member and initialize * it with a call to `input` or `input.required`. * * ```ts * @Component({ * ... * }) * export class UserProfileComponent { * firstName = input(); // Signal * lastName = input.required(); // Signal * age = input(0) // Signal * } * ``` * * Inside your component template, you can display values of the inputs * by calling the signal. * * ```html * {{firstName()}} * ``` * * @publicAPI * @initializerApiFunction */ declare const input: InputFunction; /** Retrieves the write type of an `InputSignal` and `InputSignalWithTransform`. */ type ɵUnwrapInputSignalWriteType = Field extends InputSignalWithTransform ? WriteT : never; /** * Unwraps all `InputSignal`/`InputSignalWithTransform` class fields of * the given directive. */ type ɵUnwrapDirectiveSignalInputs = { [P in Fields]: ɵUnwrapInputSignalWriteType; }; /** * @publicAPI * * Options for model signals. */ interface ModelOptions { /** * Optional public name of the input side of the model. The output side will have the same * name as the input, but suffixed with `Change`. By default, the class field name is used. */ alias?: string; /** * A debug name for the model signal. Used in Angular DevTools to identify the signal. */ debugName?: string; } /** * `ModelSignal` represents a special `Signal` for a directive/component model field. * * A model signal is a writeable signal that can be exposed as an output. * Whenever its value is updated, it emits to the output. * * @publicAPI */ interface ModelSignal extends WritableSignal, InputSignal, OutputRef { [SIGNAL]: InputSignalNode; } /** * `model` declares a writeable signal that is exposed as an input/output pair on the containing * directive. The input name is taken either from the class member or from the `alias` option. * The output name is generated by taking the input name and appending `Change`. * * The function exposes an API for also declaring required models via the * `model.required` function. * * @publicAPI * @docsPrivate Ignored because `model` is the canonical API entry. */ interface ModelFunction { /** * Initializes a model of type `T` with an initial value of `undefined`. * Angular will implicitly use `undefined` as initial value. */ (): ModelSignal; /** Initializes a model of type `T` with the given initial value. */ (initialValue: T, opts?: ModelOptions): ModelSignal; required: { /** * Initializes a required model. * * Users of your directive/component need to bind to the input side of the model. * If unset, a compile time error will be reported. */ (opts?: ModelOptions): ModelSignal; }; } /** * `model` declares a writeable signal that is exposed as an input/output * pair on the containing directive. * * The input name is taken either from the class member or from the `alias` option. * The output name is generated by taking the input name and appending `Change`. * * @usageNotes * * To use `model()`, import the function from `@angular/core`. * * ```ts * import {model} from '@angular/core`; * ``` * * Inside your component, introduce a new class member and initialize * it with a call to `model` or `model.required`. * * ```ts * @Directive({ * ... * }) * export class MyDir { * firstName = model(); // ModelSignal * lastName = model.required(); // ModelSignal * age = model(0); // ModelSignal * } * ``` * * Inside your component template, you can display the value of a `model` * by calling the signal. * * ```html * {{firstName()}} * ``` * * Updating the `model` is equivalent to updating a writable signal. * * ```ts * updateName(newFirstName: string): void { * this.firstName.set(newFirstName); * } * ``` * * @publicApi 19.0 * @initializerApiFunction */ declare const model: ModelFunction; /** * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally * referenced in `@Component` in a component injector. * * @publicApi */ declare function makeEnvironmentProviders(providers: (Provider | EnvironmentProviders)[]): EnvironmentProviders; /** * @description * This function is used to provide initialization functions that will be executed upon construction * of an environment injector. * * Note that the provided initializer is run in the injection context. * * Previously, this was achieved using the `ENVIRONMENT_INITIALIZER` token which is now deprecated. * * @see {@link ENVIRONMENT_INITIALIZER} * * @usageNotes * The following example illustrates how to configure an initialization function using * `provideEnvironmentInitializer()` * ```ts * createEnvironmentInjector( * [ * provideEnvironmentInitializer(() => { * console.log('environment initialized'); * }), * ], * parentInjector * ); * ``` * * @publicApi */ declare function provideEnvironmentInitializer(initializerFn: () => void): EnvironmentProviders; /** * A source of providers for the `importProvidersFrom` function. * * @publicApi */ type ImportProvidersSource = Type$1 | ModuleWithProviders | Array; /** * Collects providers from all NgModules and standalone components, including transitively imported * ones. * * Providers extracted via `importProvidersFrom` are only usable in an application injector or * another environment injector (such as a route injector). They should not be used in component * providers. * * More information about standalone components can be found in [this * guide](guide/components/importing). * * @usageNotes * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call: * * ```ts * await bootstrapApplication(RootComponent, { * providers: [ * importProvidersFrom(NgModuleOne, NgModuleTwo) * ] * }); * ``` * * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a * standalone component is used: * * ```ts * export const ROUTES: Route[] = [ * { * path: 'foo', * providers: [ * importProvidersFrom(NgModuleOne, NgModuleTwo) * ], * component: YourStandaloneComponent * } * ]; * ``` * * @returns Collected providers from the specified list of types. * @publicApi */ declare function importProvidersFrom(...sources: ImportProvidersSource[]): EnvironmentProviders; /** * Internal type for a single provider in a deep provider array. */ type SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | StaticClassProvider; /** * Type of the `viewChild` function. The viewChild function creates a singular view query. * * It is a special function that also provides access to required query results via the `.required` * property. * * @publicApi * @docsPrivate Ignored because `viewChild` is the canonical API entry. */ interface ViewChildFunction { /** * Initializes a view child query. Consider using `viewChild.required` for queries that should * always match. * * @publicAPI */ (locator: ProviderToken | string, opts: { read: ProviderToken; debugName?: string; }): Signal; (locator: ProviderToken | string, opts?: { debugName?: string; }): Signal; /** * Initializes a view child query that is expected to always match an element. * * @publicAPI */ required: { (locator: ProviderToken | string, opts?: { debugName?: string; }): Signal; (locator: ProviderToken | string, opts: { read: ProviderToken; debugName?: string; }): Signal; }; } /** * Initializes a view child query. * * Consider using `viewChild.required` for queries that should always match. * * @usageNotes * Create a child query in your component by declaring a * class field and initializing it with the `viewChild()` function. * * ```angular-ts * @Component({template: '
'}) * export class TestComponent { * divEl = viewChild('el'); // Signal * divElRequired = viewChild.required('el'); // Signal * cmp = viewChild(MyComponent); // Signal * cmpRequired = viewChild.required(MyComponent); // Signal * } * ``` * * @publicApi 19.0 * @initializerApiFunction */ declare const viewChild: ViewChildFunction; declare function viewChildren(locator: ProviderToken | string, opts?: { debugName?: string; }): Signal>; declare function viewChildren(locator: ProviderToken | string, opts: { read: ProviderToken; debugName?: string; }): Signal>; /** * Type of the `contentChild` function. * * The contentChild function creates a singular content query. It is a special function that also * provides access to required query results via the `.required` property. * * @publicApi 19.0 * @docsPrivate Ignored because `contentChild` is the canonical API entry. */ interface ContentChildFunction { /** * Initializes a content child query. * * Consider using `contentChild.required` for queries that should always match. * @publicAPI */ (locator: ProviderToken | string, opts?: { descendants?: boolean; read?: undefined; debugName?: string; }): Signal; (locator: ProviderToken | string, opts: { descendants?: boolean; read: ProviderToken; debugName?: string; }): Signal; /** * Initializes a content child query that is always expected to match. */ required: { (locator: ProviderToken | string, opts?: { descendants?: boolean; read?: undefined; debugName?: string; }): Signal; (locator: ProviderToken | string, opts: { descendants?: boolean; read: ProviderToken; debugName?: string; }): Signal; }; } /** * Initializes a content child query. Consider using `contentChild.required` for queries that should * always match. * * @usageNotes * Create a child query in your component by declaring a * class field and initializing it with the `contentChild()` function. * * ```ts * @Component({...}) * export class TestComponent { * headerEl = contentChild('h'); // Signal * headerElElRequired = contentChild.required('h'); // Signal * header = contentChild(MyHeader); // Signal * headerRequired = contentChild.required(MyHeader); // Signal * } * ``` * * Note: By default `descendants` is `true` which means the query will traverse all descendants in the same template. * * @initializerApiFunction * @publicApi 19.0 */ declare const contentChild: ContentChildFunction; declare function contentChildren(locator: ProviderToken | string, opts?: { descendants?: boolean; read?: undefined; debugName?: string; }): Signal>; declare function contentChildren(locator: ProviderToken | string, opts: { descendants?: boolean; read: ProviderToken; debugName?: string; }): Signal>; /** * Type of the Attribute decorator / constructor function. * * @publicApi */ interface AttributeDecorator { /** * Parameter decorator for a directive constructor that designates * a host-element attribute whose value is injected as a constant string literal. * * @usageNotes * * Suppose we have an `` element and want to know its `type`. * * ```html * * ``` * * The following example uses the decorator to inject the string literal `text` in a directive. * * {@example core/ts/metadata/metadata.ts region='attributeMetadata'} * * The following example uses the decorator in a component constructor. * * {@example core/ts/metadata/metadata.ts region='attributeFactory'} * */ (name: string): any; new (name: string): Attribute; } /** * Type of the Attribute metadata. * * @publicApi */ interface Attribute { /** * The name of the attribute whose value can be injected. */ attributeName: string; } /** * Attribute decorator and metadata. * * @Annotation * @publicApi */ declare const Attribute: AttributeDecorator; /** * Represents a basic change from a previous to a new value for a single * property on a directive instance. Passed as a value in a * {@link SimpleChanges} object to the `ngOnChanges` hook. * * @see {@link OnChanges} * * @publicApi */ declare class SimpleChange { previousValue: any; currentValue: any; firstChange: boolean; constructor(previousValue: any, currentValue: any, firstChange: boolean); /** * Check whether the new value is the first value assigned. */ isFirstChange(): boolean; } /** * A hashtable of changes represented by {@link SimpleChange} objects stored * at the declared property name they belong to on a Directive or Component. This is * the type passed to the `ngOnChanges` hook. * * @see {@link OnChanges} * * @publicApi */ interface SimpleChanges { [propName: string]: SimpleChange; } /** * @description * A lifecycle hook that is called when any data-bound property of a directive changes. * Define an `ngOnChanges()` method to handle the changes. * * @see {@link DoCheck} * @see {@link OnInit} * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface to * define an on-changes handler for an input property. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnChanges'} * * @publicApi */ interface OnChanges { /** * A callback method that is invoked immediately after the * default change detector has checked data-bound properties * if at least one has changed, and before the view and content * children are checked. * @param changes The changed properties. */ ngOnChanges(changes: SimpleChanges): void; } /** * @description * A lifecycle hook that is called after Angular has initialized * all data-bound properties of a directive. * Define an `ngOnInit()` method to handle any additional initialization tasks. * * @see {@link AfterContentInit} * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface to * define its own initialization method. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnInit'} * * @publicApi */ interface OnInit { /** * A callback method that is invoked immediately after the * default change detector has checked the directive's * data-bound properties for the first time, * and before any of the view or content children have been checked. * It is invoked only once when the directive is instantiated. */ ngOnInit(): void; } /** * A lifecycle hook that invokes a custom change-detection function for a directive, * in addition to the check performed by the default change-detector. * * The default change-detection algorithm looks for differences by comparing * bound-property values by reference across change detection runs. You can use this * hook to check for and respond to changes by some other means. * * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied, * regardless of whether you perform additional change detection. * Typically, you should not use both `DoCheck` and `OnChanges` to respond to * changes on the same input. * * @see {@link OnChanges} * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface * to invoke it own change-detection cycle. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'} * * For a more complete example and discussion, see * [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection). * * @publicApi */ interface DoCheck { /** * A callback method that performs change-detection, invoked * after the default change-detector runs. * See `KeyValueDiffers` and `IterableDiffers` for implementing * custom change checking for collections. * */ ngDoCheck(): void; } /** * A lifecycle hook that is called when a directive, pipe, or service is destroyed. * Use for any custom cleanup that needs to occur when the * instance is destroyed. * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface * to define its own custom clean-up method. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnDestroy'} * * @publicApi */ interface OnDestroy { /** * A callback method that performs custom clean-up, invoked immediately * before a directive, pipe, or service instance is destroyed. */ ngOnDestroy(): void; } /** * @description * A lifecycle hook that is called after Angular has fully initialized * all content of a directive. It will run only once when the projected content is initialized. * Define an `ngAfterContentInit()` method to handle any additional initialization tasks. * * @see {@link OnInit} * @see {@link AfterViewInit} * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface to * define its own content initialization method. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentInit'} * * @publicApi */ interface AfterContentInit { /** * A callback method that is invoked immediately after * Angular has completed initialization of all of the directive's * content. * It is invoked only once when the directive is instantiated. */ ngAfterContentInit(): void; } /** * @description * A lifecycle hook that is called after the default change detector has * completed checking all content of a directive. It will run after the content * has been checked and most of the time it's during a change detection cycle. * * @see {@link AfterViewChecked} * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface to * define its own after-check functionality. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentChecked'} * * @publicApi */ interface AfterContentChecked { /** * A callback method that is invoked immediately after the * default change detector has completed checking all of the directive's * content. */ ngAfterContentChecked(): void; } /** * @description * A lifecycle hook that is called after Angular has fully initialized * a component's view. * Define an `ngAfterViewInit()` method to handle any additional initialization tasks. * * @see {@link OnInit} * @see {@link AfterContentInit} * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface to * define its own view initialization method. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewInit'} * * @publicApi */ interface AfterViewInit { /** * A callback method that is invoked immediately after * Angular has completed initialization of a component's view. * It is invoked only once when the view is instantiated. * */ ngAfterViewInit(): void; } /** * @description * A lifecycle hook that is called after the default change detector has * completed checking a component's view for changes. * * @see {@link AfterContentChecked} * @see [Lifecycle hooks guide](guide/components/lifecycle) * * @usageNotes * The following snippet shows how a component can implement this interface to * define its own after-check functionality. * * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewChecked'} * * @publicApi */ interface AfterViewChecked { /** * A callback method that is invoked immediately after the * default change detector has completed one change-check cycle * for a component's view. */ ngAfterViewChecked(): void; } /** * Type of the Query metadata. * * @publicApi */ interface Query { descendants: boolean; emitDistinctChangesOnly: boolean; first: boolean; read: any; isViewQuery: boolean; selector: any; static?: boolean; } /** * Base class for query metadata. * * @see {@link ContentChildren} * @see {@link ContentChild} * @see {@link ViewChildren} * @see {@link ViewChild} * * @publicApi */ declare abstract class Query { } /** * Type of the ContentChildren decorator / constructor function. * * @see {@link ContentChildren} * @publicApi */ interface ContentChildrenDecorator { /** * @description * Property decorator that configures a content query. * * Use to get the `QueryList` of elements or directives from the content DOM. * Any time a child element is added, removed, or moved, the query list will be * updated, and the changes observable of the query list will emit a new value. * * Content queries are set before the `ngAfterContentInit` callback is called. * * Does not retrieve elements or directives that are in other components' templates, * since a component's template is always a black box to its ancestors. * * **Metadata Properties**: * * * **selector** - The directive type or the name used for querying. * * **descendants** - If `true` include all descendants of the element. If `false` then only * query direct children of the element. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only * if the QueryList result has changed. When `false` the `changes` observable might emit even * if the QueryList has not changed. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and * removed in future versions of Angular. * * **read** - Used to read a different token from the queried elements. * * The following selectors are supported. * * Any class with the `@Component` or `@Directive` decorator * * A template reference variable as a string (e.g. query `` * with `@ContentChildren('cmp')`) * * Any provider defined in the child component tree of the current component (e.g. * `@ContentChildren(SomeService) someService: SomeService`) * * Any provider defined through a string token (e.g. `@ContentChildren('someToken') * someTokenVal: any`) * * A `TemplateRef` (e.g. query `` with * `@ContentChildren(TemplateRef) template;`) * * In addition, multiple string selectors can be separated with a comma (e.g. * `@ContentChildren('cmp1,cmp2')`) * * The following values are supported by `read`: * * Any class with the `@Component` or `@Directive` decorator * * Any provider defined on the injector of the component that is matched by the `selector` of * this query * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`) * * `TemplateRef`, `ElementRef`, and `ViewContainerRef` * * @usageNotes * * Here is a simple demonstration of how the `ContentChildren` decorator can be used. * * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'} * * ### Tab-pane example * * Here is a slightly more realistic example that shows how `ContentChildren` decorators * can be used to implement a tab pane component. * * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'} * * @Annotation */ (selector: ProviderToken | Function | string, opts?: { descendants?: boolean; emitDistinctChangesOnly?: boolean; read?: any; }): any; new (selector: ProviderToken | Function | string, opts?: { descendants?: boolean; emitDistinctChangesOnly?: boolean; read?: any; }): Query; } /** * Type of the ContentChildren metadata. * * * @Annotation * @publicApi */ type ContentChildren = Query; /** * ContentChildren decorator and metadata. * * * @Annotation * @publicApi */ declare const ContentChildren: ContentChildrenDecorator; /** * Type of the ContentChild decorator / constructor function. * * @publicApi */ interface ContentChildDecorator { /** * @description * Property decorator that configures a content query. * * Use to get the first element or the directive matching the selector from the content DOM. * If the content DOM changes, and a new child matches the selector, * the property will be updated. * * Does not retrieve elements or directives that are in other components' templates, * since a component's template is always a black box to its ancestors. * * **Metadata Properties**: * * * **selector** - The directive type or the name used for querying. * * **descendants** - If `true` (default) include all descendants of the element. If `false` then * only query direct children of the element. * * **read** - Used to read a different token from the queried element. * * **static** - True to resolve query results before change detection runs, * false to resolve after change detection. Defaults to false. * * The following selectors are supported. * * Any class with the `@Component` or `@Directive` decorator * * A template reference variable as a string (e.g. query `` * with `@ContentChild('cmp')`) * * Any provider defined in the child component tree of the current component (e.g. * `@ContentChild(SomeService) someService: SomeService`) * * Any provider defined through a string token (e.g. `@ContentChild('someToken') someTokenVal: * any`) * * A `TemplateRef` (e.g. query `` with `@ContentChild(TemplateRef) * template;`) * * The following values are supported by `read`: * * Any class with the `@Component` or `@Directive` decorator * * Any provider defined on the injector of the component that is matched by the `selector` of * this query * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`) * * `TemplateRef`, `ElementRef`, and `ViewContainerRef` * * Difference between dynamic and static queries: * * | Queries | Details | * |:--- |:--- | * | Dynamic queries \(`static: false`\) | The query resolves before the `ngAfterContentInit()` * callback is called. The result will be updated for changes to your view, such as changes to * `ngIf` and `ngFor` blocks. | | Static queries \(`static: true`\) | The query resolves once * the view has been created, but before change detection runs (before the `ngOnInit()` callback * is called). The result, though, will never be updated to reflect changes to your view, such as * changes to `ngIf` and `ngFor` blocks. | * * @usageNotes * * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'} * * ### Example * * {@example core/di/ts/contentChild/content_child_example.ts region='Component'} * * @Annotation */ (selector: ProviderToken | Function | string, opts?: { descendants?: boolean; read?: any; static?: boolean; }): any; new (selector: ProviderToken | Function | string, opts?: { descendants?: boolean; read?: any; static?: boolean; }): ContentChild; } /** * Type of the ContentChild metadata. * * @publicApi */ type ContentChild = Query; /** * ContentChild decorator and metadata. * * * @Annotation * * @publicApi */ declare const ContentChild: ContentChildDecorator; /** * Type of the ViewChildren decorator / constructor function. * * @see {@link ViewChildren} * * @publicApi */ interface ViewChildrenDecorator { /** * @description * Property decorator that configures a view query. * * Use to get the `QueryList` of elements or directives from the view DOM. * Any time a child element is added, removed, or moved, the query list will be updated, * and the changes observable of the query list will emit a new value. * * View queries are set before the `ngAfterViewInit` callback is called. * * **Metadata Properties**: * * * **selector** - The directive type or the name used for querying. * * **read** - Used to read a different token from the queried elements. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only * if the QueryList result has changed. When `false` the `changes` observable might emit even * if the QueryList has not changed. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and * removed in future versions of Angular. * * The following selectors are supported. * * Any class with the `@Component` or `@Directive` decorator * * A template reference variable as a string (e.g. query `` * with `@ViewChildren('cmp')`) * * Any provider defined in the child component tree of the current component (e.g. * `@ViewChildren(SomeService) someService!: SomeService`) * * Any provider defined through a string token (e.g. `@ViewChildren('someToken') * someTokenVal!: any`) * * A `TemplateRef` (e.g. query `` with `@ViewChildren(TemplateRef) * template;`) * * In addition, multiple string selectors can be separated with a comma (e.g. * `@ViewChildren('cmp1,cmp2')`) * * The following values are supported by `read`: * * Any class with the `@Component` or `@Directive` decorator * * Any provider defined on the injector of the component that is matched by the `selector` of * this query * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`) * * `TemplateRef`, `ElementRef`, and `ViewContainerRef` * * @usageNotes * * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'} * * ### Another example * * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'} * * @Annotation */ (selector: ProviderToken | Function | string, opts?: { read?: any; emitDistinctChangesOnly?: boolean; }): any; new (selector: ProviderToken | Function | string, opts?: { read?: any; emitDistinctChangesOnly?: boolean; }): ViewChildren; } /** * Type of the ViewChildren metadata. * * @publicApi */ type ViewChildren = Query; /** * ViewChildren decorator and metadata. * * @Annotation * @publicApi */ declare const ViewChildren: ViewChildrenDecorator; /** * Type of the ViewChild decorator / constructor function. * * @see {@link ViewChild} * @publicApi */ interface ViewChildDecorator { /** * @description * Property decorator that configures a view query. * The change detector looks for the first element or the directive matching the selector * in the view DOM. If the view DOM changes, and a new child matches the selector, * the property is updated. * * **Metadata Properties**: * * * **selector** - The directive type or the name used for querying. * * **read** - Used to read a different token from the queried elements. * * **static** - `true` to resolve query results before change detection runs, * `false` to resolve after change detection. Defaults to `false`. * * * The following selectors are supported. * * Any class with the `@Component` or `@Directive` decorator * * A template reference variable as a string (e.g. query `` * with `@ViewChild('cmp')`) * * Any provider defined in the child component tree of the current component (e.g. * `@ViewChild(SomeService) someService: SomeService`) * * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal: * any`) * * A `TemplateRef` (e.g. query `` with `@ViewChild(TemplateRef) * template;`) * * The following values are supported by `read`: * * Any class with the `@Component` or `@Directive` decorator * * Any provider defined on the injector of the component that is matched by the `selector` of * this query * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`) * * `TemplateRef`, `ElementRef`, and `ViewContainerRef` * * Difference between dynamic and static queries: * * Dynamic queries \(`static: false`\) - The query resolves before the `ngAfterViewInit()` * callback is called. The result will be updated for changes to your view, such as changes to * `ngIf` and `ngFor` blocks. * * Static queries \(`static: true`\) - The query resolves once * the view has been created, but before change detection runs (before the `ngOnInit()` callback * is called). The result, though, will never be updated to reflect changes to your view, such as * changes to `ngIf` and `ngFor` blocks. * * @usageNotes * * ### Example 1 * * {@example core/di/ts/viewChild/view_child_example.ts region='Component'} * * ### Example 2 * * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'} * * @Annotation */ (selector: ProviderToken | Function | string, opts?: { read?: any; static?: boolean; }): any; new (selector: ProviderToken | Function | string, opts?: { read?: any; static?: boolean; }): ViewChild; } /** * Type of the ViewChild metadata. * * @publicApi */ type ViewChild = Query; /** * ViewChild decorator and metadata. * * @Annotation * @publicApi */ declare const ViewChild: ViewChildDecorator; /** * A type describing supported iterable types. * * @publicApi */ type NgIterable = Array | Iterable; /** * A strategy for tracking changes over time to an iterable. Used by {@link /api/common/NgForOf NgForOf} to * respond to changes in an iterable by effecting equivalent changes in the DOM. * * @publicApi */ interface IterableDiffer { /** * Compute a difference between the previous state and the new `object` state. * * @param object containing the new value. * @returns an object describing the difference. The return value is only valid until the next * `diff()` invocation. */ diff(object: NgIterable | undefined | null): IterableChanges | null; } /** * An object describing the changes in the `Iterable` collection since last time * `IterableDiffer#diff()` was invoked. * * @publicApi */ interface IterableChanges { /** * Iterate over all changes. `IterableChangeRecord` will contain information about changes * to each item. */ forEachItem(fn: (record: IterableChangeRecord) => void): void; /** * Iterate over a set of operations which when applied to the original `Iterable` will produce the * new `Iterable`. * * NOTE: These are not necessarily the actual operations which were applied to the original * `Iterable`, rather these are a set of computed operations which may not be the same as the * ones applied. * * @param record A change which needs to be applied * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the * original `Iterable` location, where as `previousIndex` refers to the transient location * of the item, after applying the operations up to this point. * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the * original `Iterable` location, where as `currentIndex` refers to the transient location * of the item, after applying the operations up to this point. */ forEachOperation(fn: (record: IterableChangeRecord, previousIndex: number | null, currentIndex: number | null) => void): void; /** * Iterate over changes in the order of original `Iterable` showing where the original items * have moved. */ forEachPreviousItem(fn: (record: IterableChangeRecord) => void): void; /** Iterate over all added items. */ forEachAddedItem(fn: (record: IterableChangeRecord) => void): void; /** Iterate over all moved items. */ forEachMovedItem(fn: (record: IterableChangeRecord) => void): void; /** Iterate over all removed items. */ forEachRemovedItem(fn: (record: IterableChangeRecord) => void): void; /** * Iterate over all items which had their identity (as computed by the `TrackByFunction`) * changed. */ forEachIdentityChange(fn: (record: IterableChangeRecord) => void): void; } /** * Record representing the item change information. * * @publicApi */ interface IterableChangeRecord { /** Current index of the item in `Iterable` or null if removed. */ readonly currentIndex: number | null; /** Previous index of the item in `Iterable` or null if added. */ readonly previousIndex: number | null; /** The item. */ readonly item: V; /** Track by identity as computed by the `TrackByFunction`. */ readonly trackById: any; } /** * A function optionally passed into the `NgForOf` directive to customize how `NgForOf` uniquely * identifies items in an iterable. * * `NgForOf` needs to uniquely identify items in the iterable to correctly perform DOM updates * when items in the iterable are reordered, new items are added, or existing items are removed. * * * In all of these scenarios it is usually desirable to only update the DOM elements associated * with the items affected by the change. This behavior is important to: * * - preserve any DOM-specific UI state (like cursor position, focus, text selection) when the * iterable is modified * - enable animation of item addition, removal, and iterable reordering * - preserve the value of the ` * * `, * }) * class AppComponent { * live = true; * } * ``` */ reattach(): void; /** * Checks the view and its children. * * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement * local change detection checks. * * * * * @usageNotes * ### Example * * The following example defines a component with a large list of readonly data. * Imagine, the data changes constantly, many times per second. For performance reasons, * we want to check and update the list every five seconds. * * We can do that by detaching the component's change detector and doing a local change detection * check every five seconds. * * See {@link ChangeDetectorRef#detach} for more information. */ detectChanges(): void; /** * Checks the change detector and its children, and throws if any changes are detected. * * This is used in development mode to verify that running change detection doesn't * introduce other changes. */ checkNoChanges(): void; attachToViewContainerRef(): void; detachFromAppRef(): void; attachToAppRef(appRef: ApplicationRef): void; } /** * Reports whether the given view is considered dirty according to the different marking mechanisms. */ declare function isViewDirty(view: ViewRef): boolean; declare function markForRefresh(view: ViewRef): void; declare class ComponentFactoryResolver extends ComponentFactoryResolver$1 { private ngModule?; /** * @param ngModule The NgModuleRef to which all resolved factories are bound. */ constructor(ngModule?: NgModuleRef$1 | undefined); resolveComponentFactory(component: Type$1): ComponentFactory$1; } /** * ComponentFactory interface implementation. */ declare class ComponentFactory extends ComponentFactory$1 { private componentDef; private ngModule?; selector: string; componentType: Type$1; ngContentSelectors: string[]; isBoundToModule: boolean; private cachedInputs; private cachedOutputs; get inputs(): { propName: string; templateName: string; isSignal: boolean; transform?: (value: any) => any; }[]; get outputs(): { propName: string; templateName: string; }[]; /** * @param componentDef The component definition. * @param ngModule The NgModuleRef to which the factory is bound. */ constructor(componentDef: ComponentDef, ngModule?: NgModuleRef$1 | undefined); create(injector: Injector, projectableNodes?: any[][] | undefined, rootSelectorOrNode?: any, environmentInjector?: NgModuleRef$1 | EnvironmentInjector | undefined, directives?: (Type$1 | DirectiveWithBindings)[], componentBindings?: Binding[]): ComponentRef$1; } /** * Represents an instance of a Component created via a {@link ComponentFactory}. * * `ComponentRef` provides access to the Component Instance as well other objects related to this * Component Instance and allows you to destroy the Component Instance via the {@link #destroy} * method. * */ declare class ComponentRef extends ComponentRef$1 { private readonly _rootLView; private readonly _hasInputBindings; instance: T; hostView: ViewRef; changeDetectorRef: ChangeDetectorRef; componentType: Type$1; location: ElementRef; private previousInputValues; private _tNode; constructor(componentType: Type$1, _rootLView: LView, _hasInputBindings: boolean); setInput(name: string, value: unknown): void; get injector(): Injector; destroy(): void; onDestroy(callback: () => void): void; } /** * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided. * * @param ngModule NgModule class. * @param parentInjector Optional injector instance to use as a parent for the module injector. If * not provided, `NullInjector` will be used instead. * @returns NgModuleRef that represents an NgModule instance. * * @publicApi */ declare function createNgModule(ngModule: Type$1, parentInjector?: Injector): NgModuleRef$1; /** * The `createNgModule` function alias for backwards-compatibility. * Please avoid using it directly and use `createNgModule` instead. * * @deprecated Use `createNgModule` instead. */ declare const createNgModuleRef: typeof createNgModule; declare class NgModuleRef extends NgModuleRef$1 implements InternalNgModuleRef { private readonly ngModuleType; _parent: Injector | null; _bootstrapComponents: Type$1[]; private readonly _r3Injector; instance: T; destroyCbs: (() => void)[] | null; readonly componentFactoryResolver: ComponentFactoryResolver; constructor(ngModuleType: Type$1, _parent: Injector | null, additionalProviders: StaticProvider[], runInjectorInitializers?: boolean); resolveInjectorInitializers(): void; get injector(): EnvironmentInjector; destroy(): void; onDestroy(callback: () => void): void; } declare class NgModuleFactory extends NgModuleFactory$1 { moduleType: Type$1; constructor(moduleType: Type$1); create(parentInjector: Injector | null): NgModuleRef$1; } /** * Create a new environment injector. * * @param providers An array of providers. * @param parent A parent environment injector. * @param debugName An optional name for this injector instance, which will be used in error * messages. * * @publicApi */ declare function createEnvironmentInjector(providers: Array, parent: EnvironmentInjector, debugName?: string | null): EnvironmentInjector; /** * Convince closure compiler that the wrapped function has no side-effects. * * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to * allow us to execute a function but have closure compiler mark the call as no-side-effects. * It is important that the return value for the `noSideEffects` function be assigned * to something which is retained otherwise the call to `noSideEffects` will be removed by closure * compiler. */ declare function noSideEffects(fn: () => T): T; /** * @description * Hook for manual bootstrapping of the application instead of using `bootstrap` array in @NgModule * annotation. This hook is invoked only when the `bootstrap` array is empty or not provided. * * Reference to the current application is provided as a parameter. * * See ["Bootstrapping"](guide/ngmodules/bootstrapping). * * @usageNotes * The example below uses `ApplicationRef.bootstrap()` to render the * `AppComponent` on the page. * * ```ts * class AppModule implements DoBootstrap { * ngDoBootstrap(appRef: ApplicationRef) { * appRef.bootstrap(AppComponent); // Or some other component * } * } * ``` * * @publicApi */ interface DoBootstrap { ngDoBootstrap(appRef: ApplicationRef): void; } /** * @description Represents the version of Angular * * @publicApi */ declare class Version { full: string; readonly major: string; readonly minor: string; readonly patch: string; constructor(full: string); } /** * @publicApi */ declare const VERSION: Version; /** * Returns the NgModuleFactory with the given id (specified using [@NgModule.id * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found. * @publicApi * @deprecated Use `getNgModuleById` instead. */ declare function getModuleFactory(id: string): NgModuleFactory$1; /** * Returns the NgModule class with the given id (specified using [@NgModule.id * field](api/core/NgModule#id)), if it exists and has been loaded. Classes for NgModules that do * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found. * @publicApi */ declare function getNgModuleById(id: string): Type$1; /** * Represents an embedded template that can be used to instantiate embedded views. * To instantiate embedded views based on a template, use the `ViewContainerRef` * method `createEmbeddedView()`. * * Access a `TemplateRef` instance by placing a directive on an `` * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view * is injected into the constructor of the directive, * using the `TemplateRef` token. * * You can also use a `Query` to find a `TemplateRef` associated with * a component or a directive. * * @see {@link ViewContainerRef} * * @publicApi */ declare class TemplateRef { private _declarationLView; private _declarationTContainer; /** * The anchor element in the parent view for this embedded view. * * The data-binding and [injection contexts](guide/di/dependency-injection-context) of embedded * views created from this `TemplateRef` inherit from the contexts of this location. * * Typically new embedded views are attached to the view container of this location, but in * advanced use-cases, the view can be attached to a different container while keeping the * data-binding and injection context from the original location. * */ readonly elementRef: ElementRef; /** * Instantiates an unattached embedded view based on this template. * @param context The data-binding context of the embedded view, as declared * in the `` usage. * @param injector Injector to be used within the embedded view. * @returns The new embedded view object. */ createEmbeddedView(context: C, injector?: Injector): EmbeddedViewRef; } /** * Represents a container where one or more views can be attached to a component. * * Can contain *host views* (created by instantiating a * component with the `createComponent()` method), and *embedded views* * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method). * * A view container instance can contain other view containers, * creating a view hierarchy. * * @usageNotes * * The example below demonstrates how the `createComponent` function can be used * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef, * so that it gets included into change detection cycles. * * Note: the example uses standalone components, but the function can also be used for * non-standalone components (declared in an NgModule) as well. * * ```angular-ts * @Component({ * standalone: true, * selector: 'dynamic', * template: `This is a content of a dynamic component.`, * }) * class DynamicComponent { * vcr = inject(ViewContainerRef); * } * * @Component({ * standalone: true, * selector: 'app', * template: `
Hi! This is the main content.
`, * }) * class AppComponent { * vcr = inject(ViewContainerRef); * * ngAfterViewInit() { * const compRef = this.vcr.createComponent(DynamicComponent); * compRef.changeDetectorRef.detectChanges(); * } * } * ``` * * @see {@link ComponentRef} * @see {@link EmbeddedViewRef} * * @publicApi */ declare abstract class ViewContainerRef { /** * Anchor element that specifies the location of this container in the containing view. * Each view container can have only one anchor element, and each anchor element * can have only a single view container. * * Root elements of views attached to this container become siblings of the anchor element in * the rendered view. * * Access the `ViewContainerRef` of an element by placing a `Directive` injected * with `ViewContainerRef` on the element, or use a `ViewChild` query. * * */ abstract get element(): ElementRef; /** * The dependency injector for this view container. */ abstract get injector(): Injector; /** @deprecated No replacement */ abstract get parentInjector(): Injector; /** * Destroys all views in this container. */ abstract clear(): void; /** * Retrieves a view from this container. * @param index The 0-based index of the view to retrieve. * @returns The `ViewRef` instance, or null if the index is out of range. */ abstract get(index: number): ViewRef$1 | null; /** * Reports how many views are currently attached to this container. * @returns The number of views. */ abstract get length(): number; /** * Instantiates an embedded view and inserts it * into this container. * @param templateRef The HTML template that defines the view. * @param context The data-binding context of the embedded view, as declared * in the `` usage. * @param options Extra configuration for the created view. Includes: * * index: The 0-based index at which to insert the new view into this container. * If not specified, appends the new view as the last entry. * * injector: Injector to be used within the embedded view. * * @returns The `ViewRef` instance for the newly created view. */ abstract createEmbeddedView(templateRef: TemplateRef, context?: C, options?: { index?: number; injector?: Injector; }): EmbeddedViewRef; /** * Instantiates an embedded view and inserts it * into this container. * @param templateRef The HTML template that defines the view. * @param context The data-binding context of the embedded view, as declared * in the `` usage. * @param index The 0-based index at which to insert the new view into this container. * If not specified, appends the new view as the last entry. * * @returns The `ViewRef` instance for the newly created view. */ abstract createEmbeddedView(templateRef: TemplateRef, context?: C, index?: number): EmbeddedViewRef; /** * Instantiates a component and inserts its host view into this view container. * * @param componentType Component Type to use. * @param options An object that contains extra parameters: * * index: the index at which to insert the new component's host view into this container. * If not specified, appends the new view as the last entry. * * injector: the injector to use as the parent for the new component. * * ngModuleRef: an NgModuleRef of the component's NgModule, you should almost always provide * this to ensure that all expected providers are available for the component * instantiation. * * environmentInjector: an EnvironmentInjector which will provide the component's environment. * you should almost always provide this to ensure that all expected providers * are available for the component instantiation. This option is intended to * replace the `ngModuleRef` parameter. * * projectableNodes: list of DOM nodes that should be projected through * [``](api/core/ng-content) of the new component instance. * * directives: Directives that should be applied to the component. * * bindings: Bindings that should be applied to the component. * * @returns The new `ComponentRef` which contains the component instance and the host view. */ abstract createComponent(componentType: Type$1, options?: { index?: number; injector?: Injector; ngModuleRef?: NgModuleRef$1; environmentInjector?: EnvironmentInjector | NgModuleRef$1; projectableNodes?: Node[][]; directives?: (Type$1 | DirectiveWithBindings)[]; bindings?: Binding[]; }): ComponentRef$1; /** * Instantiates a single component and inserts its host view into this container. * * @param componentFactory Component factory to use. * @param index The index at which to insert the new component's host view into this container. * If not specified, appends the new view as the last entry. * @param injector The injector to use as the parent for the new component. * @param projectableNodes List of DOM nodes that should be projected through * [``](api/core/ng-content) of the new component instance. * @param ngModuleRef An instance of the NgModuleRef that represent an NgModule. * This information is used to retrieve corresponding NgModule injector. * @param directives Directives that should be applied to the component. * @param bindings Bindings that should be applied to the component. * * @returns The new `ComponentRef` which contains the component instance and the host view. * * @deprecated Angular no longer requires component factories to dynamically create components. * Use different signature of the `createComponent` method, which allows passing * Component class directly. */ abstract createComponent(componentFactory: ComponentFactory$1, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef$1, directives?: (Type$1 | DirectiveWithBindings)[], bindings?: Binding[]): ComponentRef$1; /** * Inserts a view into this container. * @param viewRef The view to insert. * @param index The 0-based index at which to insert the view. * If not specified, appends the new view as the last entry. * @returns The inserted `ViewRef` instance. * */ abstract insert(viewRef: ViewRef$1, index?: number): ViewRef$1; /** * Moves a view to a new location in this container. * @param viewRef The view to move. * @param index The 0-based index of the new location. * @returns The moved `ViewRef` instance. */ abstract move(viewRef: ViewRef$1, currentIndex: number): ViewRef$1; /** * Returns the index of a view within the current container. * @param viewRef The view to query. * @returns The 0-based index of the view's position in this container, * or `-1` if this container doesn't contain the view. */ abstract indexOf(viewRef: ViewRef$1): number; /** * Destroys a view attached to this container * @param index The 0-based index of the view to destroy. * If not specified, the last view in the container is removed. */ abstract remove(index?: number): void; /** * Detaches a view from this container without destroying it. * Use along with `insert()` to move a view within the current container. * @param index The 0-based index of the view to detach. * If not specified, the last view in the container is detached. */ abstract detach(index?: number): ViewRef$1 | null; } /** * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios. */ declare const ALLOW_MULTIPLE_PLATFORMS: InjectionToken; /** * Creates a platform. * Platforms must be created on launch using this function. * * @publicApi */ declare function createPlatform(injector: Injector): PlatformRef; /** * Creates a factory for a platform. Can be used to provide or override `Providers` specific to * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`. * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories * to build up configurations that might be required by different libraries or parts of the * application. * @param name Identifies the new platform factory. * @param providers A set of dependency providers for platforms created with the new factory. * * @publicApi */ declare function createPlatformFactory(parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null, name: string, providers?: StaticProvider[]): (extraProviders?: StaticProvider[]) => PlatformRef; /** * Checks that there is currently a platform that contains the given token as a provider. * * @publicApi */ declare function assertPlatform(requiredToken: any): PlatformRef; /** * Returns the current platform. * * @publicApi */ declare function getPlatform(): PlatformRef | null; /** * Destroys the current Angular platform and all Angular applications on the page. * Destroys all modules and listeners registered with the platform. * * @publicApi */ declare function destroyPlatform(): void; /** * The goal of this function is to bootstrap a platform injector, * but avoid referencing `PlatformRef` class. * This function is needed for bootstrapping a Standalone Component. */ declare function createOrReusePlatformInjector(providers?: StaticProvider[]): Injector; /** * @description * This function is used to provide initialization functions that will be executed upon * initialization of the platform injector. * * Note that the provided initializer is run in the injection context. * * Previously, this was achieved using the `PLATFORM_INITIALIZER` token which is now deprecated. * * @see {@link PLATFORM_INITIALIZER} * * @publicApi */ declare function providePlatformInitializer(initializerFn: () => void): EnvironmentProviders; /** * Internal token used to verify that `provideZoneChangeDetection` is not used * with the bootstrapModule API. */ declare const PROVIDED_NG_ZONE: InjectionToken; declare function internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone, scheduleInRootZone, }: { ngZoneFactory?: () => NgZone; ignoreChangesOutsideZone?: boolean; scheduleInRootZone?: boolean; }): StaticProvider[]; /** * Provides `NgZone`-based change detection for the application bootstrapped using * `bootstrapApplication`. * * `NgZone` is already provided in applications by default. This provider allows you to configure * options like `eventCoalescing` in the `NgZone`. * This provider is not available for `platformBrowser().bootstrapModule`, which uses * `BootstrapOptions` instead. * * @usageNotes * ```ts * bootstrapApplication(MyApp, {providers: [ * provideZoneChangeDetection({eventCoalescing: true}), * ]}); * ``` * * @publicApi * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication} * @see {@link NgZoneOptions} */ declare function provideZoneChangeDetection(options?: NgZoneOptions): EnvironmentProviders; /** * Used to configure event and run coalescing with `provideZoneChangeDetection`. * * @publicApi * * @see {@link provideZoneChangeDetection} */ interface NgZoneOptions { /** * Optionally specify coalescing event change detections or not. * Consider the following case. * * ```html *
* *
* ``` * * When button is clicked, because of the event bubbling, both * event handlers will be called and 2 change detections will be * triggered. We can coalesce such kind of events to trigger * change detection only once. * * By default, this option is set to false, meaning events will * not be coalesced, and change detection will be triggered multiple times. * If this option is set to true, change detection will be triggered * once in the scenario described above. */ eventCoalescing?: boolean; /** * Optionally specify if `NgZone#run()` method invocations should be coalesced * into a single change detection. * * Consider the following case. * ```ts * for (let i = 0; i < 10; i ++) { * ngZone.run(() => { * // do something * }); * } * ``` * * This case triggers the change detection multiple times. * With ngZoneRunCoalescing options, all change detections in an event loop trigger only once. * In addition, the change detection executes in requestAnimation. * */ runCoalescing?: boolean; /** * When false, change detection is scheduled when Angular receives * a clear indication that templates need to be refreshed. This includes: * * - calling `ChangeDetectorRef.markForCheck` * - calling `ComponentRef.setInput` * - updating a signal that is read in a template * - attaching a view that is marked dirty * - removing a view * - registering a render hook (templates are only refreshed if render hooks do one of the above) * * @deprecated This option was introduced out of caution as a way for developers to opt out of the * new behavior in v18 which schedule change detection for the above events when they occur * outside the Zone. After monitoring the results post-release, we have determined that this * feature is working as desired and do not believe it should ever be disabled by setting * this option to `true`. */ ignoreChangesOutsideZone?: boolean; } declare class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler { private readonly applicationErrorHandler; private readonly appRef; private readonly taskService; private readonly ngZone; private readonly zonelessEnabled; private readonly tracing; private readonly disableScheduling; private readonly zoneIsDefined; private readonly schedulerTickApplyArgs; private readonly subscriptions; private readonly angularZoneId; private readonly scheduleInRootZone; private cancelScheduledCallback; private useMicrotaskScheduler; runningTick: boolean; pendingRenderTaskId: number | null; constructor(); notify(source: NotificationSource): void; private shouldScheduleTick; /** * Calls ApplicationRef._tick inside the `NgZone`. * * Calling `tick` directly runs change detection and cancels any change detection that had been * scheduled previously. * * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to * render hooks when `false`. */ private tick; ngOnDestroy(): void; private cleanup; static ɵfac: __FactoryDeclaration; static ɵprov: __InjectableDeclaration; } /** * Provides change detection without ZoneJS for the application bootstrapped using * `bootstrapApplication`. * * This function allows you to configure the application to not use the state/state changes of * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present * on the page at all or if it exists because something else is using it (either another Angular * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS). * * This can also be added to the `TestBed` providers to configure the test environment to more * closely match production behavior. This will help give higher confidence that components are * compatible with zoneless change detection. * * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will * instead use Angular APIs to schedule change detection. These APIs include: * * - `ChangeDetectorRef.markForCheck` * - `ComponentRef.setInput` * - updating a signal that is read in a template * - when bound host or template listeners are triggered * - attaching a view that was marked dirty by one of the above * - removing a view * - registering a render hook (templates are only refreshed if render hooks do one of the above) * * @usageNotes * ```ts * bootstrapApplication(MyApp, {providers: [ * provideZonelessChangeDetection(), * ]}); * ``` * * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate * on the exact API based on the feedback and our understanding of the problem and solution space. * * @developerPreview 20.0 * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication} */ declare function provideZonelessChangeDetection(): EnvironmentProviders; /** * Internal implementation of the pending tasks service. */ declare class PendingTasksInternal implements OnDestroy { private taskId; private pendingTasks; private destroyed; private pendingTask; get hasPendingTasks(): boolean; /** * In case the service is about to be destroyed, return a self-completing observable. * Otherwise, return the observable that emits the current state of pending tasks. */ get hasPendingTasksObservable(): Observable; add(): number; has(taskId: number): boolean; remove(taskId: number): void; ngOnDestroy(): void; /** @nocollapse */ static ɵprov: unknown; } /** * Service that keeps track of pending tasks contributing to the stableness of Angular * application. While several existing Angular services (ex.: `HttpClient`) will internally manage * tasks influencing stability, this API gives control over stability to library and application * developers for specific cases not covered by Angular internals. * * The concept of stability comes into play in several important scenarios: * - SSR process needs to wait for the application stability before serializing and sending rendered * HTML; * - tests might want to delay assertions until the application becomes stable; * * @usageNotes * ```ts * const pendingTasks = inject(PendingTasks); * const taskCleanup = pendingTasks.add(); * // do work that should block application's stability and then: * taskCleanup(); * ``` * * @publicApi 20.0 */ declare class PendingTasks { private readonly internalPendingTasks; private readonly scheduler; private readonly errorHandler; /** * Adds a new task that should block application's stability. * @returns A cleanup function that removes a task when called. */ add(): () => void; /** * Runs an asynchronous function and blocks the application's stability until the function completes. * * ```ts * pendingTasks.run(async () => { * const userData = await fetch('/api/user'); * this.userData.set(userData); * }); * ``` * * @param fn The asynchronous function to execute * @developerPreview 19.0 */ run(fn: () => Promise): void; /** @nocollapse */ static ɵprov: unknown; } /** * Used to disable exhaustive checks when verifying no expressions changed after they were checked. * * This means that `OnPush` components that are not marked for check will not be checked. * This behavior is the current default behavior in Angular. When running change detection * on a view tree, views marked for check are refreshed and the flag to check it is removed. * When Angular checks views a second time to ensure nothing has changed, `OnPush` components * will no longer be marked and not be checked. * * @developerPreview 20.0 */ declare function provideCheckNoChangesConfig(options: { exhaustive: false; }): EnvironmentProviders; /** * - `interval` will periodically run `checkNoChanges` on application views. This can be useful * in zoneless applications to periodically ensure no changes have been made without notifying * Angular that templates need to be refreshed. * - The exhaustive option will treat all application views as if they were `ChangeDetectionStrategy.Default` when verifying * no expressions have changed. All views attached to `ApplicationRef` and all the descendants of * those views will be checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`). * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`. * This check is will surface any existing errors hidden by `OnPush` components. * * @developerPreview 20.0 */ declare function provideCheckNoChangesConfig(options: { interval?: number; exhaustive: true; }): EnvironmentProviders; /** * Returns whether Angular is in development mode. * * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the * application is built using the Angular CLI with the `optimization` option. * @see {@link /cli/build ng build} * * @publicApi */ declare function isDevMode(): boolean; /** * Disable Angular's development mode, which turns off assertions and other * checks within the framework. * * One important assertion this disables verifies that a change detection pass * does not result in additional changes to any bindings (also known as * unidirectional data flow). * * Using this method is discouraged as the Angular CLI will set production mode when using the * `optimization` option. * @see {@link /cli/build ng build} * * @publicApi */ declare function enableProdMode(): void; /** * A DI token representing a string ID, used * primarily for prefixing application attributes and CSS styles when * {@link ViewEncapsulation#Emulated} is being used. * * The token is needed in cases when multiple applications are bootstrapped on a page * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications * have different `APP_ID` value setup. For example: * * ```ts * bootstrapApplication(ComponentA, { * providers: [ * { provide: APP_ID, useValue: 'app-a' }, * // ... other providers ... * ] * }); * * bootstrapApplication(ComponentB, { * providers: [ * { provide: APP_ID, useValue: 'app-b' }, * // ... other providers ... * ] * }); * ``` * * By default, when there is only one application bootstrapped, you don't need to provide the * `APP_ID` token (the `ng` will be used as an app ID). * * @publicApi */ declare const APP_ID: InjectionToken; /** * A function that is executed when a platform is initialized. * * @deprecated from v19.0.0, use providePlatformInitializer instead * * @see {@link providePlatformInitializer} * * @publicApi */ declare const PLATFORM_INITIALIZER: InjectionToken void)[]>; /** * A token that indicates an opaque platform ID. * @publicApi */ declare const PLATFORM_ID: InjectionToken; /** * A DI token that indicates the root directory of * the application * @publicApi * @deprecated */ declare const PACKAGE_ROOT_URL: InjectionToken; /** * A [DI token](api/core/InjectionToken) that indicates which animations * module has been loaded. * @publicApi */ declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">; /** * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that * Angular will apply when inserting inline styles. If not provided, Angular will look up its value * from the `ngCspNonce` attribute of the application root node. * * @publicApi */ declare const CSP_NONCE: InjectionToken; /** * A configuration object for the image-related options. Contains: * - breakpoints: An array of integer breakpoints used to generate * srcsets for responsive images. * - disableImageSizeWarning: A boolean value. Setting this to true will * disable console warnings about oversized images. * - disableImageLazyLoadWarning: A boolean value. Setting this to true will * disable console warnings about LCP images configured with `loading="lazy"`. * Learn more about the responsive image configuration in [the NgOptimizedImage * guide](guide/image-optimization). * Learn more about image warning options in [the related error page](errors/NG0913). * @publicApi */ type ImageConfig = { breakpoints?: number[]; placeholderResolution?: number; disableImageSizeWarning?: boolean; disableImageLazyLoadWarning?: boolean; }; declare const IMAGE_CONFIG_DEFAULTS: ImageConfig; /** * Injection token that configures the image optimized image functionality. * See {@link ImageConfig} for additional information about parameters that * can be used. * * @see {@link NgOptimizedImage} * @see {@link ImageConfig} * @publicApi */ declare const IMAGE_CONFIG: InjectionToken; /** * A DI token that you can use to provide * one or more initialization functions. * * The provided functions are injected at application startup and executed during * app initialization. If any of these functions returns a Promise or an Observable, initialization * does not complete until the Promise is resolved or the Observable is completed. * * You can, for example, create a factory function that loads language data * or an external configuration, and provide that function to the `APP_INITIALIZER` token. * The function is executed during the application bootstrap process, * and the needed data is available on startup. * * Note that the provided initializer is run in the injection context. * * @deprecated from v19.0.0, use provideAppInitializer instead * * @see {@link ApplicationInitStatus} * @see {@link provideAppInitializer} * * @usageNotes * * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token * and a function returning a promise. * ### Example with NgModule-based application * ```ts * function initializeApp(): Promise { * const http = inject(HttpClient); * return firstValueFrom( * http * .get("https://someUrl.com/api/user") * .pipe(tap(user => { ... })) * ); * } * * @NgModule({ * imports: [BrowserModule], * declarations: [AppComponent], * bootstrap: [AppComponent], * providers: [{ * provide: APP_INITIALIZER, * useValue: initializeApp, * multi: true, * }] * }) * export class AppModule {} * ``` * * ### Example with standalone application * ```ts * function initializeApp() { * const http = inject(HttpClient); * return firstValueFrom( * http * .get("https://someUrl.com/api/user") * .pipe(tap(user => { ... })) * ); * } * * bootstrapApplication(App, { * providers: [ * provideHttpClient(), * { * provide: APP_INITIALIZER, * useValue: initializeApp, * multi: true, * }, * ], * }); * ``` * * * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function * returning an observable, see an example below. Note: the `HttpClient` in this example is used for * demo purposes to illustrate how the factory function can work with other providers available * through DI. * * ### Example with NgModule-based application * ```ts * function initializeApp() { * const http = inject(HttpClient); * return firstValueFrom( * http * .get("https://someUrl.com/api/user") * .pipe(tap(user => { ... })) * ); * } * * @NgModule({ * imports: [BrowserModule, HttpClientModule], * declarations: [AppComponent], * bootstrap: [AppComponent], * providers: [{ * provide: APP_INITIALIZER, * useValue: initializeApp, * multi: true, * }] * }) * export class AppModule {} * ``` * * ### Example with standalone application * ```ts * function initializeApp() { * const http = inject(HttpClient); * return firstValueFrom( * http * .get("https://someUrl.com/api/user") * .pipe(tap(user => { ... })) * ); * } * * bootstrapApplication(App, { * providers: [ * provideHttpClient(), * { * provide: APP_INITIALIZER, * useValue: initializeApp, * multi: true, * }, * ], * }); * ``` * * @publicApi */ declare const APP_INITIALIZER: InjectionToken Observable | Promise | void)[]>; /** * @description * The provided function is injected at application startup and executed during * app initialization. If the function returns a Promise or an Observable, initialization * does not complete until the Promise is resolved or the Observable is completed. * * You can, for example, create a function that loads language data * or an external configuration, and provide that function using `provideAppInitializer()`. * The function is executed during the application bootstrap process, * and the needed data is available on startup. * * Note that the provided initializer is run in the injection context. * * Previously, this was achieved using the `APP_INITIALIZER` token which is now deprecated. * * @see {@link APP_INITIALIZER} * * @usageNotes * The following example illustrates how to configure an initialization function using * `provideAppInitializer()` * ```ts * bootstrapApplication(App, { * providers: [ * provideAppInitializer(() => { * const http = inject(HttpClient); * return firstValueFrom( * http * .get("https://someUrl.com/api/user") * .pipe(tap(user => { ... })) * ); * }), * provideHttpClient(), * ], * }); * ``` * * @publicApi */ declare function provideAppInitializer(initializerFn: () => Observable | Promise | void): EnvironmentProviders; /** * A class that reflects the state of running {@link APP_INITIALIZER} functions. * * @publicApi */ declare class ApplicationInitStatus { private resolve; private reject; private initialized; readonly done = false; readonly donePromise: Promise; private readonly appInits; private readonly injector; constructor(); static ɵfac: __FactoryDeclaration; static ɵprov: __InjectableDeclaration; } /** * Testability API. * `declare` keyword causes tsickle to generate externs, so these methods are * not renamed by Closure Compiler. * @publicApi */ declare interface PublicTestability { isStable(): boolean; whenStable(callback: Function, timeout?: number, updateCallback?: Function): void; findProviders(using: any, provider: string, exactMatch: boolean): any[]; } /** * Internal injection token that can used to access an instance of a Testability class. * * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is * needed to ensure that there are no direct references to the `Testability` class, so it can be * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class * should be available, this token is used to add a provider that references the `Testability` * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not. */ declare const TESTABILITY: InjectionToken; /** * Internal injection token to retrieve Testability getter class instance. */ declare const TESTABILITY_GETTER: InjectionToken; /** * The Testability service provides testing hooks that can be accessed from * the browser. * * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also * instantiate Testability by default (in both development and production modes). * * For applications bootstrapped using the `bootstrapApplication` function, Testability is not * included by default. You can include it into your applications by getting the list of necessary * providers using the `provideProtractorTestingSupport()` function and adding them into the * `options.providers` array. Example: * * ```ts * import {provideProtractorTestingSupport} from '@angular/platform-browser'; * * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]); * ``` * * @publicApi */ declare class Testability implements PublicTestability { private _ngZone; private registry; private _isZoneStable; private _callbacks; private _taskTrackingZone; private _destroyRef?; constructor(_ngZone: NgZone, registry: TestabilityRegistry, testabilityGetter: GetTestability); private _watchAngularEvents; /** * Whether an associated application is stable */ isStable(): boolean; private _runCallbacksIfReady; private getPendingTasks; private addCallback; /** * Wait for the application to be stable with a timeout. If the timeout is reached before that * happens, the callback receives a list of the macro tasks that were pending, otherwise null. * * @param doneCb The callback to invoke when Angular is stable or the timeout expires * whichever comes first. * @param timeout Optional. The maximum time to wait for Angular to become stable. If not * specified, whenStable() will wait forever. * @param updateCb Optional. If specified, this callback will be invoked whenever the set of * pending macrotasks changes. If this callback returns true doneCb will not be invoked * and no further updates will be issued. */ whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void; /** * Find providers by name * @param using The root element to search from * @param provider The name of binding variable * @param exactMatch Whether using exactMatch */ findProviders(using: any, provider: string, exactMatch: boolean): any[]; static ɵfac: __FactoryDeclaration; static ɵprov: __InjectableDeclaration; } /** * A global registry of {@link Testability} instances for specific elements. * @publicApi */ declare class TestabilityRegistry { /** * Registers an application with a testability hook so that it can be tracked * @param token token of application, root element * @param testability Testability hook */ registerApplication(token: any, testability: Testability): void; /** * Unregisters an application. * @param token token of application, root element */ unregisterApplication(token: any): void; /** * Unregisters all applications */ unregisterAllApplications(): void; /** * Get a testability hook associated with the application * @param elem root element */ getTestability(elem: any): Testability | null; /** * Get all registered testabilities */ getAllTestabilities(): Testability[]; /** * Get all registered applications(root elements) */ getAllRootElements(): any[]; /** * Find testability of a node in the Tree * @param elem node * @param findInAncestors whether finding testability in ancestors if testability was not found in * current node */ findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null; static ɵfac: __FactoryDeclaration; static ɵprov: __InjectableDeclaration; } /** * Adapter interface for retrieving the `Testability` service associated for a * particular context. * * @publicApi */ interface GetTestability { addToWindow(registry: TestabilityRegistry): void; findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null; } /** * Set the {@link GetTestability} implementation used by the Angular testing framework. * @publicApi */ declare function setTestabilityGetter(getter: GetTestability): void; /** * This platform has to be included in any other platform * * @publicApi */ declare const platformCore: (extraProviders?: StaticProvider[] | undefined) => PlatformRef; /** * Provide this token to set the locale of your application. * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe, * DecimalPipe and PercentPipe) and by ICU expressions. * * See the [i18n guide](guide/i18n/locale-id) for more information. * * @usageNotes * ### Example * In standalone apps: * ```ts * import { LOCALE_ID, ApplicationConfig } from '@angular/core'; * import { AppModule } from './app/app.module'; * * const appConfig: ApplicationConfig = { * providers: [{provide: LOCALE_ID, useValue: 'en-US' }] * }; * ``` * * In module based apps: * ```ts * import { LOCALE_ID } from '@angular/core'; * import { platformBrowser } from '@angular/platform-browser'; * import { AppModule } from './app/app.module'; * * platformBrowser().bootstrapModule(AppModule, { * providers: [{provide: LOCALE_ID, useValue: 'en-US' }] * }); * ``` * * @publicApi */ declare const LOCALE_ID: InjectionToken; /** * Provide this token to set the default currency code your application uses for * CurrencyPipe when there is no currency code passed into it. This is only used by * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured. * * See the [i18n guide](guide/i18n/locale-id) for more information. * *
* * The default currency code is currently always `USD`. * * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in * your application `NgModule`: * * ```ts * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'} * ``` * *
* * @usageNotes * ### Example * In standalone apps: * ```ts * import { LOCALE_ID, ApplicationConfig } from '@angular/core'; * * const appConfig: ApplicationConfig = { * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }] * }; * ``` * * In module based apps: * ```ts * import { platformBrowser } from '@angular/platform-browser'; * import { AppModule } from './app/app.module'; * * platformBrowser().bootstrapModule(AppModule, { * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }] * }); * ``` * * @publicApi */ declare const DEFAULT_CURRENCY_CODE: InjectionToken; /** * Use this token at bootstrap to provide the content of your translation file (`xtb`, * `xlf` or `xlf2`) when you want to translate your application in another language. * * See the [i18n guide](guide/i18n/merge) for more information. * * @usageNotes * ### Example * In standalone apps: * ```ts * import { LOCALE_ID, ApplicationConfig } from '@angular/core'; * * const appConfig: ApplicationConfig = { * providers: [{provide: TRANSLATIONS, useValue: translations }] * }; * ``` * * In module based apps: * ```ts * import { TRANSLATIONS } from '@angular/core'; * import { platformBrowser } from '@angular/platform-browser'; * import { AppModule } from './app/app.module'; * * // content of your translation file * const translations = '....'; * * platformBrowser().bootstrapModule(AppModule, { * providers: [{provide: TRANSLATIONS, useValue: translations }] * }); * ``` * * @publicApi */ declare const TRANSLATIONS: InjectionToken; /** * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`, * `xlf` or `xlf2`. * * See the [i18n guide](guide/i18n/merge) for more information. * * @usageNotes * ### Example * In standalone apps: * ```ts * import { LOCALE_ID, ApplicationConfig } from '@angular/core'; * * const appConfig: ApplicationConfig = { * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }] * }; * ``` * * In module based apps: * * ```ts * import { TRANSLATIONS_FORMAT } from '@angular/core'; * import { platformBrowser } from '@angular/platform-browser'; * import { AppModule } from './app/app.module'; * * platformBrowser().bootstrapModule(AppModule, { * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }] * }); * ``` * * @publicApi */ declare const TRANSLATIONS_FORMAT: InjectionToken; /** * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy * that the compiler should use in case of missing translations: * - Error: throw if you have missing translations. * - Warning (default): show a warning in the console and/or shell. * - Ignore: do nothing. * * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information. * * @usageNotes * ### Example * ```ts * import { MissingTranslationStrategy } from '@angular/core'; * import { platformBrowser } from '@angular/platform-browser'; * import { AppModule } from './app/app.module'; * * platformBrowser().bootstrapModule(AppModule, { * missingTranslation: MissingTranslationStrategy.Error * }); * ``` * * @publicApi */ declare enum MissingTranslationStrategy { Error = 0, Warning = 1, Ignore = 2 } /** * Re-exported by `BrowserModule`, which is included automatically in the root * `AppModule` when you create a new app with the CLI `new` command. Eagerly injects * `ApplicationRef` to instantiate it. * * @publicApi */ declare class ApplicationModule { constructor(appRef: ApplicationRef); static ɵfac: __FactoryDeclaration; static ɵmod: __NgModuleDeclaration; static ɵinj: __InjectorDeclaration; } /** * Provides a hook for centralized exception handling. * * The default implementation of `ErrorHandler` prints error messages to the `console`. To * intercept error handling, write a custom exception handler that replaces this default as * appropriate for your app. * * @usageNotes * ### Example * * ```ts * class MyErrorHandler implements ErrorHandler { * handleError(error) { * // do something with the exception * } * } * * // Provide in standalone apps * bootstrapApplication(AppComponent, { * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}] * }) * * // Provide in module-based apps * @NgModule({ * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}] * }) * class MyModule {} * ``` * * @publicApi */ declare class ErrorHandler { handleError(error: any): void; } /** * `InjectionToken` used to configure how to call the `ErrorHandler`. */ declare const INTERNAL_APPLICATION_ERROR_HANDLER: InjectionToken<(e: any) => void>; /** * Provides an environment initializer which forwards unhandled errors to the ErrorHandler. * * The listeners added are for the window's 'unhandledrejection' and 'error' events. * * @publicApi */ declare function provideBrowserGlobalErrorListeners(): EnvironmentProviders; /** * Internal create application API that implements the core application creation logic and optional * bootstrap logic. * * Platforms (such as `platform-browser`) may require different set of application and platform * providers for an application to function correctly. As a result, platforms may use this function * internally and supply the necessary providers during the bootstrap, while exposing * platform-specific APIs as a part of their public API. * * @returns A promise that returns an `ApplicationRef` instance once resolved. */ declare function internalCreateApplication(config: { rootComponent?: Type$1; appProviders?: Array; platformProviders?: Provider[]; }): Promise; declare class Console { log(message: string): void; warn(message: string): void; static ɵfac: __FactoryDeclaration; static ɵprov: __InjectableDeclaration; } /** * **INTERNAL**, avoid referencing it in application code. * * * Injector token that allows to provide `DeferBlockDependencyInterceptor` class * implementation. * * This token is only injected in devMode */ declare const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR: InjectionToken; /** * **INTERNAL**, token used for configuring defer block behavior. */ declare const DEFER_BLOCK_CONFIG: InjectionToken; /** Rendering Helpers */ /** * Transitions a defer block to the new state. Updates the necessary * data structures and renders corresponding block. * * @param newState New state that should be applied to the defer block. * @param tNode TNode that represents a defer block. * @param lContainer Represents an instance of a defer block. * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block * should be rendered immediately, even if they have `after` or `minimum` config * options setup. This flag to needed for testing APIs to transition defer block * between states via `DeferFixture.render` method. */ declare function renderDeferBlockState(newState: DeferBlockState, tNode: TNode, lContainer: LContainer, skipTimerScheduling?: boolean): void; /** * Enables timer-related scheduling if `after` or `minimum` parameters are setup * on the `@loading` or `@placeholder` blocks. */ declare function ɵɵdeferEnableTimerScheduling(tView: TView, tDetails: TDeferBlockDetails, placeholderConfigIndex?: number | null, loadingConfigIndex?: number | null): void; /** * Trigger loading of defer block dependencies if the process hasn't started yet. * * @param tDetails Static information about this defer block. * @param lView LView of a host view. */ declare function triggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView, tNode: TNode): Promise; /** * Tell ivy what the `document` is for this platform. * * It is only necessary to call this if the current platform is not a browser. * * @param document The object representing the global `document` in this environment. */ declare function setDocument(document: Document | undefined): void; /** * Access the object that represents the `document` for this platform. * * Ivy calls this whenever it needs to access the `document` object. * For example to create the renderer or to do sanitization. */ declare function getDocument(): Document; /** * URL for the XSS security documentation. */ declare const XSS_SECURITY_URL = "https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss"; /** * The list of error codes used in runtime code of the `core` package. * Reserved error code range: 100-999. * * Note: the minus sign denotes the fact that a particular code has a detailed guide on * angular.io. This extra annotation is needed to avoid introducing a separate set to store * error codes which have guides, which might leak into runtime code. * * Full list of available error guides can be found at https://angular.dev/errors. * * Error code ranges per package: * - core (this package): 100-999 * - forms: 1000-1999 * - common: 2000-2999 * - animations: 3000-3999 * - router: 4000-4999 * - platform-browser: 5000-5500 */ declare const enum RuntimeErrorCode { EXPRESSION_CHANGED_AFTER_CHECKED = -100, RECURSIVE_APPLICATION_REF_TICK = 101, INFINITE_CHANGE_DETECTION = 103, CYCLIC_DI_DEPENDENCY = -200, PROVIDER_NOT_FOUND = -201, INVALID_FACTORY_DEPENDENCY = 202, MISSING_INJECTION_CONTEXT = -203, INVALID_INJECTION_TOKEN = 204, INJECTOR_ALREADY_DESTROYED = 205, PROVIDER_IN_WRONG_CONTEXT = 207, MISSING_INJECTION_TOKEN = 208, INVALID_MULTI_PROVIDER = -209, MISSING_DOCUMENT = 210, MULTIPLE_COMPONENTS_MATCH = -300, EXPORT_NOT_FOUND = -301, PIPE_NOT_FOUND = -302, UNKNOWN_BINDING = 303, UNKNOWN_ELEMENT = 304, TEMPLATE_STRUCTURE_ERROR = 305, INVALID_EVENT_BINDING = 306, HOST_DIRECTIVE_UNRESOLVABLE = 307, HOST_DIRECTIVE_NOT_STANDALONE = 308, DUPLICATE_DIRECTIVE = 309, HOST_DIRECTIVE_COMPONENT = 310, HOST_DIRECTIVE_UNDEFINED_BINDING = 311, HOST_DIRECTIVE_CONFLICTING_ALIAS = 312, MULTIPLE_MATCHING_PIPES = 313, UNINITIALIZED_LET_ACCESS = 314, NO_BINDING_TARGET = 315, INVALID_BINDING_TARGET = 316, INVALID_SET_INPUT_CALL = 317, MULTIPLE_PLATFORMS = 400, PLATFORM_NOT_FOUND = 401, MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP = 402, BOOTSTRAP_COMPONENTS_NOT_FOUND = -403, PLATFORM_ALREADY_DESTROYED = 404, ASYNC_INITIALIZERS_STILL_RUNNING = 405, APPLICATION_REF_ALREADY_DESTROYED = 406, RENDERER_NOT_FOUND = 407, PROVIDED_BOTH_ZONE_AND_ZONELESS = 408, HYDRATION_NODE_MISMATCH = -500, HYDRATION_MISSING_SIBLINGS = -501, HYDRATION_MISSING_NODE = -502, UNSUPPORTED_PROJECTION_DOM_NODES = -503, INVALID_SKIP_HYDRATION_HOST = -504, MISSING_HYDRATION_ANNOTATIONS = -505, HYDRATION_STABLE_TIMEDOUT = -506, MISSING_SSR_CONTENT_INTEGRITY_MARKER = -507, MISCONFIGURED_INCREMENTAL_HYDRATION = 508, SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT = 600, REQUIRE_SYNC_WITHOUT_SYNC_EMIT = 601, ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT = -602, INVALID_I18N_STRUCTURE = 700, MISSING_LOCALE_DATA = 701, DEFER_LOADING_FAILED = -750, DEFER_IN_HMR_MODE = -751, IMPORT_PROVIDERS_FROM_STANDALONE = 800, INVALID_DIFFER_INPUT = 900, NO_SUPPORTING_DIFFER_FACTORY = 901, VIEW_ALREADY_ATTACHED = 902, INVALID_INHERITANCE = 903, UNSAFE_VALUE_IN_RESOURCE_URL = 904, UNSAFE_VALUE_IN_SCRIPT = 905, MISSING_GENERATED_DEF = 906, TYPE_IS_NOT_STANDALONE = 907, MISSING_ZONEJS = 908, UNEXPECTED_ZONE_STATE = 909, UNSAFE_IFRAME_ATTRS = -910, VIEW_ALREADY_DESTROYED = 911, COMPONENT_ID_COLLISION = -912, IMAGE_PERFORMANCE_WARNING = -913, UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE = 914, MISSING_NG_MODULE_DEFINITION = 915, MISSING_DIRECTIVE_DEFINITION = 916, NO_COMPONENT_FACTORY_FOUND = 917, REQUIRED_INPUT_NO_VALUE = -950, REQUIRED_QUERY_NO_VALUE = -951, REQUIRED_MODEL_NO_VALUE = 952, OUTPUT_REF_DESTROYED = 953, LOOP_TRACK_DUPLICATE_KEYS = -955, LOOP_TRACK_RECREATE = -956, RUNTIME_DEPS_INVALID_IMPORTED_TYPE = 980, RUNTIME_DEPS_ORPHAN_COMPONENT = 981, MUST_PROVIDE_STREAM_OPTION = 990, RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE = 991 } /** * Class that represents a runtime error. * Formats and outputs the error message in a consistent way. * * Example: * ```ts * throw new RuntimeError( * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED, * ngDevMode && 'Injector has already been destroyed.'); * ``` * * Note: the `message` argument contains a descriptive error message as a string in development * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the * `message` argument becomes `false`, thus we account for it in the typings and the runtime * logic. */ declare class RuntimeError extends Error { code: T; constructor(code: T, message: null | false | string); } /** * Called to format a runtime error. * See additional info on the `message` argument type in the `RuntimeError` class description. */ declare function formatRuntimeError(code: T, message: null | false | string): string; /** * A type-safe key to use with `TransferState`. * * Example: * * ```ts * const COUNTER_KEY = makeStateKey('counter'); * let value = 10; * * transferState.set(COUNTER_KEY, value); * ``` * * @publicApi */ type StateKey = string & { __not_a_string: never; __value_type?: T; }; /** * Create a `StateKey` that can be used to store value of type T with `TransferState`. * * Example: * * ```ts * const COUNTER_KEY = makeStateKey('counter'); * let value = 10; * * transferState.set(COUNTER_KEY, value); * ``` * * @publicApi */ declare function makeStateKey(key: string): StateKey; /** * A key value store that is transferred from the application on the server side to the application * on the client side. * * The `TransferState` is available as an injectable token. * On the client, just inject this token using DI and use it, it will be lazily initialized. * On the server it's already included if `renderApplication` function is used. Otherwise, import * the `ServerTransferStateModule` module to make the `TransferState` available. * * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only * boolean, number, string, null and non-class objects will be serialized and deserialized in a * non-lossy manner. * * @publicApi */ declare class TransferState { /** @nocollapse */ static ɵprov: unknown; private onSerializeCallbacks; /** * Get the value corresponding to a key. Return `defaultValue` if key is not found. */ get(key: StateKey, defaultValue: T): T; /** * Set the value corresponding to a key. */ set(key: StateKey, value: T): void; /** * Remove a key from the store. */ remove(key: StateKey): void; /** * Test whether a key exists in the store. */ hasKey(key: StateKey): boolean; /** * Indicates whether the state is empty. */ get isEmpty(): boolean; /** * Register a callback to provide the value for a key when `toJson` is called. */ onSerialize(key: StateKey, callback: () => T): void; /** * Serialize the current state of the store to JSON. */ toJson(): string; } /** * Marker used in a comment node to ensure hydration content integrity */ declare const SSR_CONTENT_INTEGRITY_MARKER = "nghm"; /** * Internal type that represents a claimed node. * Only used in dev mode. */ declare enum HydrationStatus { Hydrated = "hydrated", Skipped = "skipped", Mismatched = "mismatched" } type HydrationInfo = { status: HydrationStatus.Hydrated | HydrationStatus.Skipped; } | { status: HydrationStatus.Mismatched; actualNodeDetails: string | null; expectedNodeDetails: string | null; }; declare const HYDRATION_INFO_KEY = "__ngDebugHydrationInfo__"; type HydratedNode = { [HYDRATION_INFO_KEY]?: HydrationInfo; } & Element; declare function readHydrationInfo(node: RNode): HydrationInfo | null; /** * Annotates all components bootstrapped in a given ApplicationRef * with info needed for hydration. * * @param appRef An instance of an ApplicationRef. * @param doc A reference to the current Document instance. * @return event types that need to be replayed */ declare function annotateForHydration(appRef: ApplicationRef, doc: Document): { regular: Set; capture: Set; }; /** * Defines a name of an attribute that is added to the tag * in the `index.html` file in case a given route was configured * with `RenderMode.Client`. 'cm' is an abbreviation for "Client Mode". */ declare const CLIENT_RENDER_MODE_FLAG = "ngcm"; /** * Returns a set of providers required to setup hydration support * for an application that is server side rendered. This function is * included into the `provideClientHydration` public API function from * the `platform-browser` package. * * The function sets up an internal flag that would be recognized during * the server side rendering time as well, so there is no need to * configure or change anything in NgUniversal to enable the feature. */ declare function withDomHydration(): EnvironmentProviders; /** * Returns a set of providers required to setup support for i18n hydration. * Requires hydration to be enabled separately. */ declare function withI18nSupport(): Provider[]; /** * Returns a set of providers required to setup support for incremental hydration. * Requires hydration to be enabled separately. * Enabling incremental hydration also enables event replay for the entire app. */ declare function withIncrementalHydration(): Provider[]; /** * Returns a set of providers required to setup support for event replay. * Requires hydration to be enabled separately. */ declare function withEventReplay(): Provider[]; /** * Internal token that specifies whether DOM reuse logic * during hydration is enabled. */ declare const IS_HYDRATION_DOM_REUSE_ENABLED: InjectionToken; /** * Internal token that indicates whether incremental hydration support * is enabled. */ declare const IS_INCREMENTAL_HYDRATION_ENABLED: InjectionToken; /** * A map of DOM elements with `jsaction` attributes grouped by action names. */ declare const JSACTION_BLOCK_ELEMENT_MAP: InjectionToken>>; /** * Register locale data to be used internally by Angular. See the * ["I18n guide"](guide/i18n/format-data-locale) to know how to import additional locale * data. * * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1 */ declare function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void; /** * Finds the locale data for a given locale. * * @param locale The locale code. * @returns The locale data. * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) */ declare function findLocaleData(locale: string): any; /** * Retrieves the default currency code for the given locale. * * The default is defined as the first currency which is still in use. * * @param locale The code of the locale whose currency code we want. * @returns The code of the default currency for the given locale. * */ declare function getLocaleCurrencyCode(locale: string): string | null; /** * Retrieves the plural function used by ICU expressions to determine the plural case to use * for a given locale. * @param locale A locale code for the locale format rules to use. * @returns The plural function for the locale. * @see {@link NgPlural} * @see [Internationalization (i18n) Guide](guide/i18n) */ declare function getLocalePluralCase(locale: string): (value: number) => number; /** * Helper function to remove all the locale data from `LOCALE_DATA`. */ declare function unregisterAllLocaleData(): void; /** * Index of each type of locale data from the locale data array */ declare enum LocaleDataIndex { LocaleId = 0, DayPeriodsFormat = 1, DayPeriodsStandalone = 2, DaysFormat = 3, DaysStandalone = 4, MonthsFormat = 5, MonthsStandalone = 6, Eras = 7, FirstDayOfWeek = 8, WeekendRange = 9, DateFormat = 10, TimeFormat = 11, DateTimeFormat = 12, NumberSymbols = 13, NumberFormats = 14, CurrencyCode = 15, CurrencySymbol = 16, CurrencyName = 17, Currencies = 18, Directionality = 19, PluralCase = 20, ExtraData = 21 } /** * Index of each type of locale data from the extra locale data array */ declare const enum ExtraLocaleDataIndex { ExtraDayPeriodFormats = 0, ExtraDayPeriodStandalone = 1, ExtraDayPeriodsRules = 2 } /** * Index of each value in currency data (used to describe CURRENCIES_EN in currencies.ts) */ declare const enum CurrencyIndex { Symbol = 0, SymbolNarrow = 1, NbOfDigits = 2 } /** * The locale id that the application is using by default (for translations and ICU expressions). */ declare const DEFAULT_LOCALE_ID = "en-US"; /** * Used to resolve resource URLs on `@Component` when used with JIT compilation. * * Example: * ```ts * @Component({ * selector: 'my-comp', * templateUrl: 'my-comp.html', // This requires asynchronous resolution * }) * class MyComponent{ * } * * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously. * * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner. * * // Use browser's `fetch()` function as the default resource resolution strategy. * resolveComponentResources(fetch).then(() => { * // After resolution all URLs have been converted into `template` strings. * renderComponent(MyComponent); * }); * * ``` * * NOTE: In AOT the resolution happens during compilation, and so there should be no need * to call this method outside JIT mode. * * @param resourceResolver a function which is responsible for returning a `Promise` to the * contents of the resolved URL. Browser's `fetch()` method is a good default implementation. */ declare function resolveComponentResources(resourceResolver: (url: string) => Promise; }>): Promise; declare function isComponentDefPendingResolution(type: Type$1): boolean; declare function clearResolutionOfComponentResourcesQueue(): Map, Component>; declare function restoreComponentResolutionQueue(queue: Map, Component>): void; /** * InjectionToken to control root component bootstrap behavior. * * This token is primarily used in Angular's server-side rendering (SSR) scenarios, * particularly by the `@angular/ssr` package, to manage whether the root component * should be bootstrapped during the application initialization process. * * ## Purpose: * During SSR route extraction, setting this token to `false` prevents Angular from * bootstrapping the root component. This avoids unnecessary component rendering, * enabling route extraction without requiring additional APIs or triggering * component logic. * * ## Behavior: * - **`false`**: Prevents the root component from being bootstrapped. * - **`true`** (default): Proceeds with the normal root component bootstrap process. * * This mechanism ensures SSR can efficiently separate route extraction logic * from component rendering. */ declare const ENABLE_ROOT_COMPONENT_BOOTSTRAP: InjectionToken; interface PlatformReflectionCapabilities { factory(type: Type$1): Function; hasLifecycleHook(type: any, lcProperty: string): boolean; /** * Return a list of annotations/types for constructor parameters */ parameters(type: Type$1): any[][]; /** * Return a list of annotations declared on the class */ annotations(type: Type$1): any[]; /** * Return a object literal which describes the annotations on Class fields/properties. */ propMetadata(typeOrFunc: Type$1): { [key: string]: any[]; }; } declare class ReflectionCapabilities implements PlatformReflectionCapabilities { private _reflect; constructor(reflect?: any); factory(t: Type$1): (args: any[]) => T; private _ownParameters; parameters(type: Type$1): any[][]; private _ownAnnotations; annotations(typeOrFunc: Type$1): any[]; private _ownPropMetadata; propMetadata(typeOrFunc: any): { [key: string]: any[]; }; ownPropMetadata(typeOrFunc: any): { [key: string]: any[]; }; hasLifecycleHook(type: any, lcProperty: string): boolean; } /** * An object that defines an injection context for the injector profiler. */ interface InjectorProfilerContext { /** * The Injector that service is being injected into. * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB * then inject(ServiceB) in ServiceA has ModuleA as an injector context */ injector: Injector; /** * The class where the constructor that is calling `inject` is located * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB * then inject(ServiceB) in ServiceA has ServiceA as a construction context */ token: Type$1 | null; } /** * An object that contains information about a provider that has been configured * * TODO: rename to indicate that it is a debug structure eg. ProviderDebugInfo. */ interface ProviderRecord { /** * DI token that this provider is configuring */ token: Type$1 | InjectionToken; /** * Determines if provider is configured as view provider. */ isViewProvider: boolean; /** * The raw provider associated with this ProviderRecord. */ provider: SingleProvider; /** * The path of DI containers that were followed to import this provider */ importPath?: Type$1[]; } /** * An object that contains information a service that has been injected within an * InjectorProfilerContext */ interface InjectedService { /** * DI token of the Service that is injected */ token?: Type$1 | InjectionToken; /** * Value of the injected service */ value: unknown; /** * Flags that this service was injected with */ flags?: InternalInjectFlags | InjectOptions; /** * Injector that this service was provided in. */ providedIn?: Injector; /** * In NodeInjectors, the LView and TNode that serviced this injection. */ injectedIn?: { lView: LView; tNode: TNode; }; } declare function setInjectorProfilerContext(context: InjectorProfilerContext): InjectorProfilerContext; declare const enum BypassType { Url = "URL", Html = "HTML", ResourceUrl = "ResourceURL", Script = "Script", Style = "Style" } /** * Marker interface for a value that's safe to use in a particular context. * * @publicApi */ interface SafeValue { } /** * Marker interface for a value that's safe to use as HTML. * * @publicApi */ interface SafeHtml extends SafeValue { } /** * Marker interface for a value that's safe to use as style (CSS). * * @publicApi */ interface SafeStyle extends SafeValue { } /** * Marker interface for a value that's safe to use as JavaScript. * * @publicApi */ interface SafeScript extends SafeValue { } /** * Marker interface for a value that's safe to use as a URL linking to a document. * * @publicApi */ interface SafeUrl extends SafeValue { } /** * Marker interface for a value that's safe to use as a URL to load executable code from. * * @publicApi */ interface SafeResourceUrl extends SafeValue { } declare function unwrapSafeValue(value: SafeValue): string; declare function unwrapSafeValue(value: T): T; declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Html): value is SafeHtml; declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.ResourceUrl): value is SafeResourceUrl; declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Script): value is SafeScript; declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Style): value is SafeStyle; declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Url): value is SafeUrl; declare function allowSanitizationBypassAndThrow(value: any, type: BypassType): boolean; declare function getSanitizationBypassType(value: any): BypassType | null; /** * Mark `html` string as trusted. * * This function wraps the trusted string in `String` and brands it in a way which makes it * recognizable to {@link htmlSanitizer} to be trusted implicitly. * * @param trustedHtml `html` string which needs to be implicitly trusted. * @returns a `html` which has been branded to be implicitly trusted. */ declare function bypassSanitizationTrustHtml(trustedHtml: string): SafeHtml; /** * Mark `style` string as trusted. * * This function wraps the trusted string in `String` and brands it in a way which makes it * recognizable to {@link styleSanitizer} to be trusted implicitly. * * @param trustedStyle `style` string which needs to be implicitly trusted. * @returns a `style` hich has been branded to be implicitly trusted. */ declare function bypassSanitizationTrustStyle(trustedStyle: string): SafeStyle; /** * Mark `script` string as trusted. * * This function wraps the trusted string in `String` and brands it in a way which makes it * recognizable to {@link scriptSanitizer} to be trusted implicitly. * * @param trustedScript `script` string which needs to be implicitly trusted. * @returns a `script` which has been branded to be implicitly trusted. */ declare function bypassSanitizationTrustScript(trustedScript: string): SafeScript; /** * Mark `url` string as trusted. * * This function wraps the trusted string in `String` and brands it in a way which makes it * recognizable to {@link urlSanitizer} to be trusted implicitly. * * @param trustedUrl `url` string which needs to be implicitly trusted. * @returns a `url` which has been branded to be implicitly trusted. */ declare function bypassSanitizationTrustUrl(trustedUrl: string): SafeUrl; /** * Mark `url` string as trusted. * * This function wraps the trusted string in `String` and brands it in a way which makes it * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly. * * @param trustedResourceUrl `url` string which needs to be implicitly trusted. * @returns a `url` which has been branded to be implicitly trusted. */ declare function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string): SafeResourceUrl; /** * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to * the DOM in a browser environment. */ declare function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): TrustedHTML | string; declare function _sanitizeUrl(url: string): string; /** * Transforms a value (typically a string) to a boolean. * Intended to be used as a transform function of an input. * * @usageNotes * ```ts * status = input({ transform: booleanAttribute }); * ``` * @param value Value to be transformed. * * @publicApi */ declare function booleanAttribute(value: unknown): boolean; /** * Transforms a value (typically a string) to a number. * Intended to be used as a transform function of an input. * @param value Value to be transformed. * @param fallbackValue Value to use if the provided value can't be parsed as a number. * * @usageNotes * ```ts * status = input({ transform: numberAttribute }); * ``` * * @publicApi */ declare function numberAttribute(value: unknown, fallbackValue?: number): number; declare const _global: any; /** * Determine if the argument is shaped like a Promise */ declare function isPromise(obj: any): obj is Promise; /** * Determine if the argument is a Subscribable */ declare function isSubscribable(obj: any | Subscribable): obj is Subscribable; /** * A guarded `performance.mark` for feature marking. * * This method exists because while all supported browser and node.js version supported by Angular * support performance.mark API. This is not the case for other environments such as JSDOM and * Cloudflare workers. */ declare function performanceMarkFeature(feature: string): void; declare function stringify(token: any): string; /** * Ellipses the string in the middle when longer than the max length * * @param string * @param maxLength of the output string * @returns ellipsed string with ... in the middle */ declare function truncateMiddle(str: string, maxLength?: number): string; declare const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR: {}; declare const PERFORMANCE_MARK_PREFIX = "\uD83C\uDD70\uFE0F"; /** * Function that will start measuring against the performance API * Should be used in pair with stopMeasuring */ declare function startMeasuring(label: string): void; /** * Function that will stop measuring against the performance API * Should be used in pair with startMeasuring */ declare function stopMeasuring(label: string): void; /** * This enables an internal performance profiler * * It should not be imported in application code */ declare function enableProfiling(): void; declare function disableProfiling(): void; /** * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by * a loader function, which exposes the result of the loading operation via signals. * * Note that `resource` is intended for _read_ operations, not operations which perform mutations. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new * request object becomes available, which could prematurely abort mutations. * * @experimental 19.0 */ declare function resource(options: ResourceOptions & { defaultValue: NoInfer; }): ResourceRef; /** * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by * a loader function, which exposes the result of the loading operation via signals. * * Note that `resource` is intended for _read_ operations, not operations which perform mutations. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new * request object becomes available, which could prematurely abort mutations. * * @experimental 19.0 */ declare function resource(options: ResourceOptions): ResourceRef; type WrappedRequest = { request: unknown; reload: number; }; /** * Base class which implements `.value` as a `WritableSignal` by delegating `.set` and `.update`. */ declare abstract class BaseWritableResource implements WritableResource { readonly value: WritableSignal; abstract readonly status: Signal; abstract readonly error: Signal; abstract reload(): boolean; constructor(value: Signal); abstract set(value: T): void; private readonly isError; update(updateFn: (value: T) => T): void; readonly isLoading: Signal; hasValue(): this is ResourceRef>; asReadonly(): Resource; } /** * Implementation for `resource()` which uses a `linkedSignal` to manage the resource's state. */ declare class ResourceImpl extends BaseWritableResource implements ResourceRef { private readonly loaderFn; private readonly equal; private readonly pendingTasks; /** * The current state of the resource. Status, value, and error are derived from this. */ private readonly state; /** * Combines the current request with a reload counter which allows the resource to be reloaded on * imperative command. */ protected readonly extRequest: WritableSignal; private readonly effectRef; private pendingController; private resolvePendingTask; private destroyed; private unregisterOnDestroy; constructor(request: () => R, loaderFn: ResourceStreamingLoader, defaultValue: T, equal: ValueEqualityFn$1 | undefined, injector: Injector, throwErrorsFromValue?: boolean); readonly status: Signal; readonly error: Signal; /** * Called either directly via `WritableResource.set` or via `.value.set()`. */ set(value: T): void; reload(): boolean; destroy(): void; private loadEffect; private abortInProgressLoad; } declare function encapsulateResourceError(error: unknown): Error; /*! * @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.dev/license */ /** * Gets the class name of the closest component to a node. * Warning! this function will return minified names if the name of the component is minified. The * consumer of the function is responsible for resolving the minified name to its original name. * @param node Node from which to start the search. */ declare function getClosestComponentName(node: Node): string | null; /** * The following getter methods retrieve the definition from the type. Currently the retrieval * honors inheritance, but in the future we may change the rule to require that definitions are * explicit. This would require some sort of migration strategy. */ declare function getComponentDef(type: any): ComponentDef | null; /** * Checks whether a given Component, Directive or Pipe is marked as standalone. * This will return false if passed anything other than a Component, Directive, or Pipe class * See [this guide](guide/components/importing) for additional information: * * @param type A reference to a Component, Directive or Pipe. * @publicApi */ declare function isStandalone(type: Type$1): boolean; /** * TODO(incremental-hydration): Remove this file entirely once PromiseWithResolvers lands in stable * node / TS. */ interface PromiseWithResolvers { promise: Promise; resolve: (value: T | PromiseLike) => void; reject: (reason?: any) => void; } /** * An internal injection token to reference `DehydratedBlockRegistry` implementation * in a tree-shakable way. */ declare const DEHYDRATED_BLOCK_REGISTRY: InjectionToken; /** * The DehydratedBlockRegistry is used for incremental hydration purposes. It keeps * track of the Defer Blocks that need hydration so we can effectively * navigate up to the top dehydrated defer block and fire appropriate cleanup * functions post hydration. */ declare class DehydratedBlockRegistry { private registry; private cleanupFns; private jsActionMap; private contract; add(blockId: string, info: DehydratedDeferBlock): void; get(blockId: string): DehydratedDeferBlock | null; has(blockId: string): boolean; cleanup(hydratedBlocks: string[]): void; get size(): number; addCleanupFn(blockId: string, fn: Function): void; invokeTriggerCleanupFns(blockId: string): void; hydrating: Map>; private awaitingCallbacks; awaitParentBlock(topmostParentBlock: string, callback: Function): void; /** @nocollapse */ static ɵprov: unknown; } /** * Helper service to schedule `setTimeout`s for batches of defer blocks, * to avoid calling `setTimeout` for each defer block (e.g. if defer blocks * are created inside a for loop). */ declare class TimerScheduler { executingCallbacks: boolean; timeoutId: number | null; invokeTimerAt: number | null; current: Array; deferred: Array; add(delay: number, callback: VoidFunction, ngZone: NgZone): void; remove(callback: VoidFunction): void; private addToQueue; private removeFromQueue; private scheduleTimer; private clearTimeout; ngOnDestroy(): void; /** @nocollapse */ static ɵprov: unknown; } declare function compileNgModuleFactory(injector: Injector, options: CompilerOptions, moduleType: Type$1): Promise>; /** * Create a new `Injector` which is configured using a `defType` of `InjectorType`s. */ declare function createInjector(defType: any, parent?: Injector | null, additionalProviders?: Array | null, name?: string): Injector; /** * Adds the given NgModule type to Angular's NgModule registry. * * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be * fully resolved when it's registered. * * @codeGenApi */ declare function registerNgModuleType(ngModuleType: NgModuleType, id: string): void; /** * Control whether the NgModule registration system enforces that each NgModule type registered has * a unique id. * * This is useful for testing as the NgModule registry cannot be properly reset between tests with * Angular's current API. */ declare function setAllowDuplicateNgModuleIdsForTest(allowDuplicates: boolean): void; /** * The internal view context which is specific to a given DOM element, directive or * component instance. Each value in here (besides the LView and element node details) * can be present, null or undefined. If undefined then it implies the value has not been * looked up yet, otherwise, if null, then a lookup was executed and nothing was found. * * Each value will get filled when the respective value is examined within the getContext * function. The component, element and each directive instance will share the same instance * of the context. */ declare class LContext { /** * ID of the component's parent view data. */ private lViewId; /** * The index instance of the node. */ nodeIndex: number; /** * The instance of the DOM node that is attached to the lNode. */ native: RNode; /** * The instance of the Component node. */ component: {} | null | undefined; /** * The list of active directives that exist on this element. */ directives: any[] | null | undefined; /** * The map of local references (local reference name => element or directive instance) that * exist on this element. */ localRefs: { [key: string]: any; } | null | undefined; /** Component's parent view data. */ get lView(): LView | null; constructor( /** * ID of the component's parent view data. */ lViewId: number, /** * The index instance of the node. */ nodeIndex: number, /** * The instance of the DOM node that is attached to the lNode. */ native: RNode); } /** * Returns the matching `LContext` data for a given DOM node, directive or component instance. * * This function will examine the provided DOM element, component, or directive instance\'s * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched * value will be that of the newly created `LContext`. * * If the monkey-patched value is the `LView` instance then the context value for that * target will be created and the monkey-patch reference will be updated. Therefore when this * function is called it may mutate the provided element\'s, component\'s or any of the associated * directive\'s monkey-patch values. * * If the monkey-patch value is not detected then the code will walk up the DOM until an element * is found which contains a monkey-patch reference. When that occurs then the provided element * will be updated with a new context (which is then returned). If the monkey-patch value is not * detected for a component/directive instance then it will throw an error (all components and * directives should be automatically monkey-patched by ivy). * * @param target Component, Directive or DOM Node. */ declare function getLContext(target: any): LContext | null; declare const NG_COMP_DEF: string; declare const NG_DIR_DEF: string; declare const NG_PIPE_DEF: string; declare const NG_MOD_DEF: string; /** * If a directive is diPublic, bloomAdd sets a property on the type with this constant as * the key and the directive's unique ID as the value. This allows us to map directives to their * bloom filter bit for DI. */ declare const NG_ELEMENT_ID: string; /** * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a * definition. * * This exists primarily to support ngcc migration of an existing View Engine pattern, where an * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it * generates a skeleton definition on the child class, and applies this feature. * * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition, * including things like the component template function. * * @param definition The definition of a child class which inherits from a parent class with its * own definition. * * @codeGenApi */ declare function ɵɵCopyDefinitionFeature(definition: DirectiveDef | ComponentDef): void; /** * This feature adds the host directives behavior to a directive definition by patching a * function onto it. The expectation is that the runtime will invoke the function during * directive matching. * * For example: * ```ts * class ComponentWithHostDirective { * static ɵcmp = defineComponent({ * type: ComponentWithHostDirective, * features: [ɵɵHostDirectivesFeature([ * SimpleHostDirective, * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']}, * ])] * }); * } * ``` * * @codeGenApi */ declare function ɵɵHostDirectivesFeature(rawHostDirectives: HostDirectiveConfig[] | (() => HostDirectiveConfig[])): DirectiveDefFeature; /** * Merges the definition from a super class to a sub class. * @param definition The definition that is a SubClass of another directive of component * * @codeGenApi */ declare function ɵɵInheritDefinitionFeature(definition: DirectiveDef | ComponentDef): void; /** * The NgOnChangesFeature decorates a component with support for the ngOnChanges * lifecycle hook, so it should be included in any component that implements * that hook. * * If the component or directive uses inheritance, the NgOnChangesFeature MUST * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise * inherited properties will not be propagated to the ngOnChanges lifecycle * hook. * * Example usage: * * ```ts * static ɵcmp = defineComponent({ * ... * inputs: {name: 'publicName'}, * features: [NgOnChangesFeature] * }); * ``` * * @codeGenApi */ declare const ɵɵNgOnChangesFeature: () => DirectiveDefFeature; /** * This feature resolves the providers of a directive (or component), * and publish them into the DI system, making it visible to others for injection. * * For example: * ```ts * class ComponentWithProviders { * constructor(private greeter: GreeterDE) {} * * static ɵcmp = defineComponent({ * type: ComponentWithProviders, * selectors: [['component-with-providers']], * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)), * decls: 1, * vars: 1, * template: function(fs: RenderFlags, ctx: ComponentWithProviders) { * if (fs & RenderFlags.Create) { * ɵɵtext(0); * } * if (fs & RenderFlags.Update) { * ɵɵtextInterpolate(ctx.greeter.greet()); * } * }, * features: [ɵɵProvidersFeature([GreeterDE])] * }); * } * ``` * * @param definition * * @codeGenApi */ declare function ɵɵProvidersFeature(providers: Provider[], viewProviders?: Provider[]): (definition: DirectiveDef) => void; /** * A feature that adds support for external runtime styles for a component. * An external runtime style is a URL to a CSS stylesheet that contains the styles * for a given component. For browsers, this URL will be used in an appended `link` element * when the component is rendered. This feature is typically used for Hot Module Replacement * (HMR) of component stylesheets by leveraging preexisting global stylesheet HMR available * in most development servers. * * @codeGenApi */ declare function ɵɵExternalStylesFeature(styleUrls: string[]): ComponentDefFeature; /** * Generated next to NgModules to monkey-patch directive and pipe references onto a component's * definition, when generating a direct reference in the component file would otherwise create an * import cycle. * * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details. * * @codeGenApi */ declare function ɵɵsetComponentScope(type: ComponentType, directives: Type$1[] | (() => Type$1[]), pipes: Type$1[] | (() => Type$1[])): void; /** * Adds the module metadata that is necessary to compute the module's transitive scope to an * existing module definition. * * Scope metadata of modules is not used in production builds, so calls to this function can be * marked pure to tree-shake it from the bundle, allowing for all referenced declarations * to become eligible for tree-shaking as well. * * @codeGenApi */ declare function ɵɵsetNgModuleScope(type: any, scope: NgModuleScopeInfoFromDecorator): unknown; /** * Retrieves the component instance associated with a given DOM element. * * @usageNotes * Given the following DOM structure: * * ```html * *
* *
*
* ``` * * Calling `getComponent` on `` will return the instance of `ChildComponent` * associated with this DOM element. * * Calling the function on `` will return the `MyApp` instance. * * * @param element DOM element from which the component should be retrieved. * @returns Component instance associated with the element or `null` if there * is no component associated with it. * * @publicApi */ declare function getComponent(element: Element): T | null; /** * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded * view that the element is part of. Otherwise retrieves the instance of the component whose view * owns the element (in this case, the result is the same as calling `getOwningComponent`). * * @param element Element for which to get the surrounding component instance. * @returns Instance of the component that is around the element or null if the element isn't * inside any component. * * @publicApi */ declare function getContext(element: Element): T | null; /** * Retrieves the component instance whose view contains the DOM element. * * For example, if `` is used in the template of `` * (i.e. a `ViewChild` of ``), calling `getOwningComponent` on `` * would return ``. * * @param elementOrDir DOM element, component or directive instance * for which to retrieve the root components. * @returns Component instance whose view owns the DOM element or null if the element is not * part of a component view. * * @publicApi */ declare function getOwningComponent(elementOrDir: Element | {}): T | null; /** * Retrieves all root components associated with a DOM element, directive or component instance. * Root components are those which have been bootstrapped by Angular. * * @param elementOrDir DOM element, component or directive instance * for which to retrieve the root components. * @returns Root components associated with the target object. * * @publicApi */ declare function getRootComponents(elementOrDir: Element | {}): {}[]; /** * Retrieves an `Injector` associated with an element, component or directive instance. * * @param elementOrDir DOM element, component or directive instance for which to * retrieve the injector. * @returns Injector associated with the element, component or directive instance. * * @publicApi */ declare function getInjector(elementOrDir: Element | {}): Injector; /** * Retrieves directive instances associated with a given DOM node. Does not include * component instances. * * @usageNotes * Given the following DOM structure: * * ```html * * * * * ``` * * Calling `getDirectives` on `