@angular/core 14.1.0-next.3 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/application_ref.mjs +10 -6
- package/esm2020/src/change_detection/change_detector_ref.mjs +1 -1
- package/esm2020/src/core.mjs +3 -2
- package/esm2020/src/core_render3_private_export.mjs +2 -2
- package/esm2020/src/debug/debug_node.mjs +3 -4
- package/esm2020/src/di/index.mjs +1 -1
- package/esm2020/src/di/injector_compatibility.mjs +11 -1
- package/esm2020/src/di/injector_token.mjs +2 -2
- package/esm2020/src/di/interface/injector.mjs +2 -1
- package/esm2020/src/di/r3_injector.mjs +19 -1
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/linker/component_factory.mjs +1 -1
- package/esm2020/src/linker/component_factory_resolver.mjs +1 -1
- package/esm2020/src/linker/ng_module_factory.mjs +2 -2
- package/esm2020/src/linker/view_container_ref.mjs +2 -2
- package/esm2020/src/metadata/di.mjs +1 -1
- package/esm2020/src/render/api.mjs +2 -11
- package/esm2020/src/render3/component.mjs +117 -179
- package/esm2020/src/render3/component_ref.mjs +171 -11
- package/esm2020/src/render3/errors.mjs +9 -5
- package/esm2020/src/render3/features/standalone_feature.mjs +2 -2
- package/esm2020/src/render3/index.mjs +4 -4
- package/esm2020/src/render3/instructions/change_detection.mjs +2 -20
- package/esm2020/src/render3/instructions/element_validation.mjs +4 -1
- package/esm2020/src/render3/instructions/listener.mjs +34 -44
- package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
- package/esm2020/src/render3/instructions/property_interpolation.mjs +2 -2
- package/esm2020/src/render3/instructions/shared.mjs +22 -59
- package/esm2020/src/render3/instructions/styling.mjs +2 -2
- package/esm2020/src/render3/interfaces/i18n.mjs +2 -2
- package/esm2020/src/render3/interfaces/renderer.mjs +1 -26
- package/esm2020/src/render3/interfaces/styling.mjs +1 -1
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/ng_module_ref.mjs +15 -12
- package/esm2020/src/render3/node_manipulation.mjs +24 -87
- package/esm2020/src/render3/node_manipulation_i18n.mjs +1 -1
- package/esm2020/src/render3/util/attrs_utils.mjs +4 -12
- package/esm2020/src/render3/util/view_utils.mjs +3 -6
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/src/zone/ng_zone.mjs +5 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/test_bed_common.mjs +1 -1
- package/fesm2015/core.mjs +6932 -6947
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +13388 -13640
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +8040 -8055
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +13388 -13640
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +312 -141
- package/package.json +1 -1
- package/schematics/migrations/typed-forms/util.js +2 -2
- package/schematics/utils/typescript/symbol.js +2 -2
- package/testing/index.d.ts +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.1.0
|
|
2
|
+
* @license Angular v14.1.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -426,6 +426,10 @@ export declare class ApplicationRef {
|
|
|
426
426
|
* @see [Usage notes](#is-stable-examples) for examples and caveats when using this API.
|
|
427
427
|
*/
|
|
428
428
|
readonly isStable: Observable<boolean>;
|
|
429
|
+
/**
|
|
430
|
+
* The `EnvironmentInjector` used to create this application.
|
|
431
|
+
*/
|
|
432
|
+
get injector(): EnvironmentInjector;
|
|
429
433
|
/**
|
|
430
434
|
* Bootstrap a component onto the element identified by its selector or, optionally, to a
|
|
431
435
|
* specified element.
|
|
@@ -529,7 +533,7 @@ export declare class ApplicationRef {
|
|
|
529
533
|
private _loadComponent;
|
|
530
534
|
/**
|
|
531
535
|
* Destroys an Angular application represented by this `ApplicationRef`. Calling this function
|
|
532
|
-
* will destroy the associated
|
|
536
|
+
* will destroy the associated environment injectors as well as all the bootstrapped components
|
|
533
537
|
* with their views.
|
|
534
538
|
*/
|
|
535
539
|
destroy(): void;
|
|
@@ -607,9 +611,11 @@ export declare interface AttributeDecorator {
|
|
|
607
611
|
}
|
|
608
612
|
|
|
609
613
|
/**
|
|
610
|
-
* Provides additional options to the
|
|
614
|
+
* Provides additional options to the bootstrapping process.
|
|
615
|
+
*
|
|
616
|
+
* @publicApi
|
|
611
617
|
*/
|
|
612
|
-
declare interface BootstrapOptions {
|
|
618
|
+
export declare interface BootstrapOptions {
|
|
613
619
|
/**
|
|
614
620
|
* Optionally specify which `NgZone` should be used.
|
|
615
621
|
*
|
|
@@ -628,7 +634,7 @@ declare interface BootstrapOptions {
|
|
|
628
634
|
*
|
|
629
635
|
* When button is clicked, because of the event bubbling, both
|
|
630
636
|
* event handlers will be called and 2 change detections will be
|
|
631
|
-
* triggered. We can
|
|
637
|
+
* triggered. We can coalesce such kind of events to only trigger
|
|
632
638
|
* change detection only once.
|
|
633
639
|
*
|
|
634
640
|
* By default, this option will be false. So the events will not be
|
|
@@ -737,7 +743,7 @@ export declare abstract class ChangeDetectorRef {
|
|
|
737
743
|
*
|
|
738
744
|
* Components are normally marked as dirty (in need of rerendering) when inputs
|
|
739
745
|
* have changed or events have fired in the view. Call this method to ensure that
|
|
740
|
-
* a component is checked even if these triggers have not
|
|
746
|
+
* a component is checked even if these triggers have not occurred.
|
|
741
747
|
*
|
|
742
748
|
* <!-- TODO: Add a link to a chapter on OnPush components -->
|
|
743
749
|
*
|
|
@@ -1312,6 +1318,46 @@ declare class ComponentFactoryResolver_2 extends ComponentFactoryResolver {
|
|
|
1312
1318
|
|
|
1313
1319
|
declare type ComponentInstance = {};
|
|
1314
1320
|
|
|
1321
|
+
/**
|
|
1322
|
+
* An interface that describes the subset of component metadata
|
|
1323
|
+
* that can be retrieved using the `reflectComponentType` function.
|
|
1324
|
+
*
|
|
1325
|
+
* @publicApi
|
|
1326
|
+
*/
|
|
1327
|
+
export declare interface ComponentMirror<C> {
|
|
1328
|
+
/**
|
|
1329
|
+
* The component's HTML selector.
|
|
1330
|
+
*/
|
|
1331
|
+
get selector(): string;
|
|
1332
|
+
/**
|
|
1333
|
+
* The type of component the factory will create.
|
|
1334
|
+
*/
|
|
1335
|
+
get type(): Type<C>;
|
|
1336
|
+
/**
|
|
1337
|
+
* The inputs of the component.
|
|
1338
|
+
*/
|
|
1339
|
+
get inputs(): ReadonlyArray<{
|
|
1340
|
+
readonly propName: string;
|
|
1341
|
+
readonly templateName: string;
|
|
1342
|
+
}>;
|
|
1343
|
+
/**
|
|
1344
|
+
* The outputs of the component.
|
|
1345
|
+
*/
|
|
1346
|
+
get outputs(): ReadonlyArray<{
|
|
1347
|
+
readonly propName: string;
|
|
1348
|
+
readonly templateName: string;
|
|
1349
|
+
}>;
|
|
1350
|
+
/**
|
|
1351
|
+
* Selector for all <ng-content> elements in the component.
|
|
1352
|
+
*/
|
|
1353
|
+
get ngContentSelectors(): ReadonlyArray<string>;
|
|
1354
|
+
/**
|
|
1355
|
+
* Whether this component is marked as standalone.
|
|
1356
|
+
* Note: an extra flag, not present in `ComponentFactory`.
|
|
1357
|
+
*/
|
|
1358
|
+
get isStandalone(): boolean;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1315
1361
|
/**
|
|
1316
1362
|
* Represents a component created by a `ComponentFactory`.
|
|
1317
1363
|
* Provides access to the component instance and related objects,
|
|
@@ -1320,6 +1366,15 @@ declare type ComponentInstance = {};
|
|
|
1320
1366
|
* @publicApi
|
|
1321
1367
|
*/
|
|
1322
1368
|
export declare abstract class ComponentRef<C> {
|
|
1369
|
+
/**
|
|
1370
|
+
* Updates a specified input name to a new value. Using this method will properly mark for check
|
|
1371
|
+
* component using the `OnPush` change detection strategy. It will also assure that the
|
|
1372
|
+
* `OnChanges` lifecycle hook runs when a dynamically created component is change-detected.
|
|
1373
|
+
*
|
|
1374
|
+
* @param name The name of an input.
|
|
1375
|
+
* @param value The new value of an input.
|
|
1376
|
+
*/
|
|
1377
|
+
abstract setInput(name: string, value: unknown): void;
|
|
1323
1378
|
/**
|
|
1324
1379
|
* The host or anchor [element](guide/glossary#element) for this component instance.
|
|
1325
1380
|
*/
|
|
@@ -1452,6 +1507,8 @@ export declare interface ContentChildDecorator {
|
|
|
1452
1507
|
* **Metadata Properties**:
|
|
1453
1508
|
*
|
|
1454
1509
|
* * **selector** - The directive type or the name used for querying.
|
|
1510
|
+
* * **descendants** - If `true` (default) include all descendants of the element. If `false` then
|
|
1511
|
+
* only query direct children of the element.
|
|
1455
1512
|
* * **read** - Used to read a different token from the queried element.
|
|
1456
1513
|
* * **static** - True to resolve query results before change detection runs,
|
|
1457
1514
|
* false to resolve after change detection. Defaults to false.
|
|
@@ -1485,10 +1542,12 @@ export declare interface ContentChildDecorator {
|
|
|
1485
1542
|
* @Annotation
|
|
1486
1543
|
*/
|
|
1487
1544
|
(selector: ProviderToken<unknown> | Function | string, opts?: {
|
|
1545
|
+
descendants?: boolean;
|
|
1488
1546
|
read?: any;
|
|
1489
1547
|
static?: boolean;
|
|
1490
1548
|
}): any;
|
|
1491
1549
|
new (selector: ProviderToken<unknown> | Function | string, opts?: {
|
|
1550
|
+
descendants?: boolean;
|
|
1492
1551
|
read?: any;
|
|
1493
1552
|
static?: boolean;
|
|
1494
1553
|
}): ContentChild;
|
|
@@ -1599,48 +1658,71 @@ declare type ContentQueriesFunction<T> = <U extends T>(rf: ɵRenderFlags, ctx: U
|
|
|
1599
1658
|
|
|
1600
1659
|
declare const CONTEXT = 8;
|
|
1601
1660
|
|
|
1602
|
-
/**
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1661
|
+
/**
|
|
1662
|
+
* Creates a `ComponentRef` instance based on provided component type and a set of options.
|
|
1663
|
+
*
|
|
1664
|
+
* @usageNotes
|
|
1665
|
+
*
|
|
1666
|
+
* The example below demonstrates how the `createComponent` function can be used
|
|
1667
|
+
* to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
|
|
1668
|
+
* so that it gets included into change detection cycles.
|
|
1669
|
+
*
|
|
1670
|
+
* Note: the example uses standalone components, but the function can also be used for
|
|
1671
|
+
* non-standalone components (declared in an NgModule) as well.
|
|
1672
|
+
*
|
|
1673
|
+
* ```typescript
|
|
1674
|
+
* @Component({
|
|
1675
|
+
* standalone: true,
|
|
1676
|
+
* template: `Hello {{ name }}!`
|
|
1677
|
+
* })
|
|
1678
|
+
* class HelloComponent {
|
|
1679
|
+
* name = 'Angular';
|
|
1680
|
+
* }
|
|
1681
|
+
*
|
|
1682
|
+
* @Component({
|
|
1683
|
+
* standalone: true,
|
|
1684
|
+
* template: `<div id="hello-component-host"></div>`
|
|
1685
|
+
* })
|
|
1686
|
+
* class RootComponent {}
|
|
1687
|
+
*
|
|
1688
|
+
* // Bootstrap an application.
|
|
1689
|
+
* const applicationRef = await bootstrapApplication(RootComponent);
|
|
1690
|
+
*
|
|
1691
|
+
* // Locate a DOM node that would be used as a host.
|
|
1692
|
+
* const host = document.getElementById('hello-component-host');
|
|
1693
|
+
*
|
|
1694
|
+
* // Get an `EnvironmentInjector` instance from the `ApplicationRef`.
|
|
1695
|
+
* const environmentInjector = applicationRef.injector;
|
|
1696
|
+
*
|
|
1697
|
+
* // We can now create a `ComponentRef` instance.
|
|
1698
|
+
* const componentRef = createComponent(HelloComponent, {host, environmentInjector});
|
|
1699
|
+
*
|
|
1700
|
+
* // Last step is to register the newly created ref using the `ApplicationRef` instance
|
|
1701
|
+
* // to include the component view into change detection cycles.
|
|
1702
|
+
* applicationRef.attachView(componentRef.hostView);
|
|
1703
|
+
* ```
|
|
1704
|
+
*
|
|
1705
|
+
* @param component Component class reference.
|
|
1706
|
+
* @param options Set of options to use:
|
|
1707
|
+
* * `environmentInjector`: An `EnvironmentInjector` instance to be used for the component, see
|
|
1708
|
+
* additional info about it at https://angular.io/guide/standalone-components#environment-injectors.
|
|
1709
|
+
* * `hostElement` (optional): A DOM node that should act as a host node for the component. If not
|
|
1710
|
+
* provided, Angular creates one based on the tag name used in the component selector (and falls
|
|
1711
|
+
* back to using `div` if selector doesn't have tag name info).
|
|
1712
|
+
* * `elementInjector` (optional): An `ElementInjector` instance, see additional info about it at
|
|
1713
|
+
* https://angular.io/guide/hierarchical-dependency-injection#elementinjector.
|
|
1714
|
+
* * `projectableNodes` (optional): A list of DOM nodes that should be projected through
|
|
1715
|
+
* [`<ng-content>`](api/core/ng-content) of the new component instance.
|
|
1716
|
+
* @returns ComponentRef instance that represents a given Component.
|
|
1717
|
+
*
|
|
1718
|
+
* @publicApi
|
|
1719
|
+
*/
|
|
1720
|
+
export declare function createComponent<C>(component: Type<C>, options: {
|
|
1721
|
+
environmentInjector: EnvironmentInjector;
|
|
1722
|
+
hostElement?: Element;
|
|
1723
|
+
elementInjector?: Injector;
|
|
1724
|
+
projectableNodes?: Node[][];
|
|
1725
|
+
}): ComponentRef<C>;
|
|
1644
1726
|
|
|
1645
1727
|
/**
|
|
1646
1728
|
* Create a new environment injector.
|
|
@@ -1660,12 +1742,23 @@ export declare function createEnvironmentInjector(providers: Array<Provider | Im
|
|
|
1660
1742
|
|
|
1661
1743
|
/**
|
|
1662
1744
|
* Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
|
|
1745
|
+
*
|
|
1663
1746
|
* @param ngModule NgModule class.
|
|
1664
1747
|
* @param parentInjector Optional injector instance to use as a parent for the module injector. If
|
|
1665
1748
|
* not provided, `NullInjector` will be used instead.
|
|
1749
|
+
* @returns NgModuleRef that represents an NgModule instance.
|
|
1750
|
+
*
|
|
1666
1751
|
* @publicApi
|
|
1667
1752
|
*/
|
|
1668
|
-
export declare function
|
|
1753
|
+
export declare function createNgModule<T>(ngModule: Type<T>, parentInjector?: Injector): NgModuleRef<T>;
|
|
1754
|
+
|
|
1755
|
+
/**
|
|
1756
|
+
* The `createNgModule` function alias for backwards-compatibility.
|
|
1757
|
+
* Please avoid using it directly and use `createNgModule` instead.
|
|
1758
|
+
*
|
|
1759
|
+
* @deprecated Use `createNgModule` instead.
|
|
1760
|
+
*/
|
|
1761
|
+
export declare const createNgModuleRef: typeof createNgModule;
|
|
1669
1762
|
|
|
1670
1763
|
/**
|
|
1671
1764
|
* Creates a platform.
|
|
@@ -2639,6 +2732,17 @@ export declare abstract class EnvironmentInjector implements Injector {
|
|
|
2639
2732
|
* @suppress {duplicate}
|
|
2640
2733
|
*/
|
|
2641
2734
|
abstract get(token: any, notFoundValue?: any): any;
|
|
2735
|
+
/**
|
|
2736
|
+
* Runs the given function in the context of this `EnvironmentInjector`.
|
|
2737
|
+
*
|
|
2738
|
+
* Within the function's stack frame, `inject` can be used to inject dependencies from this
|
|
2739
|
+
* injector. Note that `inject` is only usable synchronously, and cannot be used in any
|
|
2740
|
+
* asynchronous callbacks or after any `await` points.
|
|
2741
|
+
*
|
|
2742
|
+
* @param fn the closure to be run in the context of this injector
|
|
2743
|
+
* @returns the return value of the function, if any
|
|
2744
|
+
*/
|
|
2745
|
+
abstract runInContext<ReturnT>(fn: () => ReturnT): ReturnT;
|
|
2642
2746
|
abstract destroy(): void;
|
|
2643
2747
|
}
|
|
2644
2748
|
|
|
@@ -2944,6 +3048,14 @@ export declare interface GetTestability {
|
|
|
2944
3048
|
findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
|
|
2945
3049
|
}
|
|
2946
3050
|
|
|
3051
|
+
/**
|
|
3052
|
+
* The goal here is to make sure that the browser DOM API is the Renderer.
|
|
3053
|
+
* We do this by defining a subset of DOM API to be the renderer and then
|
|
3054
|
+
* use that at runtime for rendering.
|
|
3055
|
+
*
|
|
3056
|
+
* At runtime we can then use the DOM api directly, in server or web-worker
|
|
3057
|
+
* it will be easy to implement such API.
|
|
3058
|
+
*/
|
|
2947
3059
|
declare type GlobalTargetName = 'document' | 'window' | 'body';
|
|
2948
3060
|
|
|
2949
3061
|
declare type GlobalTargetResolver = (element: any) => EventTarget;
|
|
@@ -3148,9 +3260,6 @@ export declare interface HostDecorator {
|
|
|
3148
3260
|
new (): Host;
|
|
3149
3261
|
}
|
|
3150
3262
|
|
|
3151
|
-
/** See CreateComponentOptions.hostFeatures */
|
|
3152
|
-
declare type HostFeature = (<T>(component: T, componentDef: ɵComponentDef<T>) => void);
|
|
3153
|
-
|
|
3154
3263
|
/**
|
|
3155
3264
|
* Type of the HostListener metadata.
|
|
3156
3265
|
*
|
|
@@ -3614,9 +3723,38 @@ export declare function inject<T>(token: ProviderToken<T>): T;
|
|
|
3614
3723
|
* @throws if called outside of a supported context.
|
|
3615
3724
|
*
|
|
3616
3725
|
* @publicApi
|
|
3726
|
+
* @deprecated prefer an options object instead of `InjectFlags`
|
|
3617
3727
|
*/
|
|
3618
3728
|
export declare function inject<T>(token: ProviderToken<T>, flags?: InjectFlags): T | null;
|
|
3619
3729
|
|
|
3730
|
+
/**
|
|
3731
|
+
* @param token A token that represents a dependency that should be injected.
|
|
3732
|
+
* @param options Control how injection is executed. Options correspond to injection strategies
|
|
3733
|
+
* that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
|
|
3734
|
+
* `@Optional`.
|
|
3735
|
+
* @returns the injected value if operation is successful.
|
|
3736
|
+
* @throws if called outside of a supported context, or if the token is not found.
|
|
3737
|
+
*
|
|
3738
|
+
* @publicApi
|
|
3739
|
+
*/
|
|
3740
|
+
export declare function inject<T>(token: ProviderToken<T>, options: InjectOptions & {
|
|
3741
|
+
optional?: false;
|
|
3742
|
+
}): T;
|
|
3743
|
+
|
|
3744
|
+
/**
|
|
3745
|
+
* @param token A token that represents a dependency that should be injected.
|
|
3746
|
+
* @param options Control how injection is executed. Options correspond to injection strategies
|
|
3747
|
+
* that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
|
|
3748
|
+
* `@Optional`.
|
|
3749
|
+
* @returns the injected value if operation is successful, `null` if the token is not
|
|
3750
|
+
* found and optional injection has been requested.
|
|
3751
|
+
* @throws if called outside of a supported context, or if the token is not found and optional
|
|
3752
|
+
* injection was not requested.
|
|
3753
|
+
*
|
|
3754
|
+
* @publicApi
|
|
3755
|
+
*/
|
|
3756
|
+
export declare function inject<T>(token: ProviderToken<T>, options: InjectOptions): T | null;
|
|
3757
|
+
|
|
3620
3758
|
/**
|
|
3621
3759
|
* Type of the Injectable metadata.
|
|
3622
3760
|
*
|
|
@@ -3740,6 +3878,7 @@ export declare interface InjectDecorator {
|
|
|
3740
3878
|
* Injection flags for DI.
|
|
3741
3879
|
*
|
|
3742
3880
|
* @publicApi
|
|
3881
|
+
* @deprecated use an options object for `inject` instead.
|
|
3743
3882
|
*/
|
|
3744
3883
|
export declare enum InjectFlags {
|
|
3745
3884
|
/** Check self and check parent injector if needed */
|
|
@@ -3814,6 +3953,32 @@ export declare class InjectionToken<T> {
|
|
|
3814
3953
|
toString(): string;
|
|
3815
3954
|
}
|
|
3816
3955
|
|
|
3956
|
+
/**
|
|
3957
|
+
* Type of the options argument to `inject`.
|
|
3958
|
+
*
|
|
3959
|
+
* @publicApi
|
|
3960
|
+
*/
|
|
3961
|
+
export declare interface InjectOptions {
|
|
3962
|
+
/**
|
|
3963
|
+
* Use optional injection, and return `null` if the requested token is not found.
|
|
3964
|
+
*/
|
|
3965
|
+
optional?: boolean;
|
|
3966
|
+
/**
|
|
3967
|
+
* Start injection at the parent of the current injector.
|
|
3968
|
+
*/
|
|
3969
|
+
skipSelf?: boolean;
|
|
3970
|
+
/**
|
|
3971
|
+
* Only query the current injector for the token, and don't fall back to the parent injector if
|
|
3972
|
+
* it's not found.
|
|
3973
|
+
*/
|
|
3974
|
+
self?: boolean;
|
|
3975
|
+
/**
|
|
3976
|
+
* Stop injection at the host component's injector. Only relevant when injecting from an element
|
|
3977
|
+
* injector, and a no-op for environment injectors.
|
|
3978
|
+
*/
|
|
3979
|
+
host?: boolean;
|
|
3980
|
+
}
|
|
3981
|
+
|
|
3817
3982
|
/**
|
|
3818
3983
|
* An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.
|
|
3819
3984
|
*
|
|
@@ -4573,8 +4738,8 @@ declare interface LView<T = unknown> extends Array<any> {
|
|
|
4573
4738
|
* TView.cleanup saves an index to the necessary context in this array.
|
|
4574
4739
|
*
|
|
4575
4740
|
* After `LView` is created it is possible to attach additional instance specific functions at the
|
|
4576
|
-
* end of the `lView[
|
|
4577
|
-
*
|
|
4741
|
+
* end of the `lView[CLEANUP]` because we know that no more `T` level cleanup functions will be
|
|
4742
|
+
* added here.
|
|
4578
4743
|
*/
|
|
4579
4744
|
[CLEANUP]: any[] | null;
|
|
4580
4745
|
/**
|
|
@@ -4588,9 +4753,9 @@ declare interface LView<T = unknown> extends Array<any> {
|
|
|
4588
4753
|
/** An optional Module Injector to be used as fall back after Element Injectors are consulted. */
|
|
4589
4754
|
readonly [INJECTOR_2]: Injector | null;
|
|
4590
4755
|
/** Factory to be used for creating Renderer. */
|
|
4591
|
-
[RENDERER_FACTORY]:
|
|
4756
|
+
[RENDERER_FACTORY]: RendererFactory;
|
|
4592
4757
|
/** Renderer to be used for this view. */
|
|
4593
|
-
[RENDERER]:
|
|
4758
|
+
[RENDERER]: Renderer;
|
|
4594
4759
|
/** An optional custom sanitizer. */
|
|
4595
4760
|
[SANITIZER]: Sanitizer | null;
|
|
4596
4761
|
/**
|
|
@@ -5190,7 +5355,7 @@ export declare interface NgModuleDecorator {
|
|
|
5190
5355
|
* JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)
|
|
5191
5356
|
* for additional context. Angular provides APIs that accept NgModule classes directly (such as
|
|
5192
5357
|
* [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
|
|
5193
|
-
* [
|
|
5358
|
+
* [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of
|
|
5194
5359
|
* using factory-based ones.
|
|
5195
5360
|
*/
|
|
5196
5361
|
export declare abstract class NgModuleFactory<T> {
|
|
@@ -5435,21 +5600,6 @@ declare interface NodeInjectorDebug {
|
|
|
5435
5600
|
parentInjectorIndex: number;
|
|
5436
5601
|
}
|
|
5437
5602
|
|
|
5438
|
-
/**
|
|
5439
|
-
* Object Oriented style of API needed to create elements and text nodes.
|
|
5440
|
-
*
|
|
5441
|
-
* This is the native browser API style, e.g. operations are methods on individual objects
|
|
5442
|
-
* like HTMLElement. With this style, no additional code is needed as a facade
|
|
5443
|
-
* (reducing payload size).
|
|
5444
|
-
* */
|
|
5445
|
-
declare interface ObjectOrientedRenderer3 {
|
|
5446
|
-
createComment(data: string): RComment;
|
|
5447
|
-
createElement(tagName: string): RElement;
|
|
5448
|
-
createElementNS(namespace: string, tagName: string): RElement;
|
|
5449
|
-
createTextNode(data: string): RText;
|
|
5450
|
-
querySelector(selectors: string): RElement | null;
|
|
5451
|
-
}
|
|
5452
|
-
|
|
5453
5603
|
/**
|
|
5454
5604
|
* @description
|
|
5455
5605
|
* A lifecycle hook that is called when any data-bound property of a directive changes.
|
|
@@ -5874,41 +6024,6 @@ declare const enum PreOrderHookFlags {
|
|
|
5874
6024
|
NumberOfInitHooksCalledMask = 4294901760
|
|
5875
6025
|
}
|
|
5876
6026
|
|
|
5877
|
-
/**
|
|
5878
|
-
* Procedural style of API needed to create elements and text nodes.
|
|
5879
|
-
*
|
|
5880
|
-
* In non-native browser environments (e.g. platforms such as web-workers), this is the
|
|
5881
|
-
* facade that enables element manipulation. This also facilitates backwards compatibility
|
|
5882
|
-
* with Renderer2.
|
|
5883
|
-
*/
|
|
5884
|
-
declare interface ProceduralRenderer3 {
|
|
5885
|
-
destroy(): void;
|
|
5886
|
-
createComment(value: string): RComment;
|
|
5887
|
-
createElement(name: string, namespace?: string | null): RElement;
|
|
5888
|
-
createText(value: string): RText;
|
|
5889
|
-
/**
|
|
5890
|
-
* This property is allowed to be null / undefined,
|
|
5891
|
-
* in which case the view engine won't call it.
|
|
5892
|
-
* This is used as a performance optimization for production mode.
|
|
5893
|
-
*/
|
|
5894
|
-
destroyNode?: ((node: RNode) => void) | null;
|
|
5895
|
-
appendChild(parent: RElement, newChild: RNode): void;
|
|
5896
|
-
insertBefore(parent: RNode, newChild: RNode, refChild: RNode | null, isMove?: boolean): void;
|
|
5897
|
-
removeChild(parent: RElement, oldChild: RNode, isHostElement?: boolean): void;
|
|
5898
|
-
selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): RElement;
|
|
5899
|
-
parentNode(node: RNode): RElement | null;
|
|
5900
|
-
nextSibling(node: RNode): RNode | null;
|
|
5901
|
-
setAttribute(el: RElement, name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL, namespace?: string | null): void;
|
|
5902
|
-
removeAttribute(el: RElement, name: string, namespace?: string | null): void;
|
|
5903
|
-
addClass(el: RElement, name: string): void;
|
|
5904
|
-
removeClass(el: RElement, name: string): void;
|
|
5905
|
-
setStyle(el: RElement, style: string, value: any, flags?: RendererStyleFlags2 | RendererStyleFlags3): void;
|
|
5906
|
-
removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2 | RendererStyleFlags3): void;
|
|
5907
|
-
setProperty(el: RElement, name: string, value: any): void;
|
|
5908
|
-
setValue(node: RText | RComment, value: string): void;
|
|
5909
|
-
listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void): () => void;
|
|
5910
|
-
}
|
|
5911
|
-
|
|
5912
6027
|
/**
|
|
5913
6028
|
* Describes a function that is used to process provider lists (such as provider
|
|
5914
6029
|
* overrides).
|
|
@@ -6307,6 +6422,7 @@ declare class R3Injector extends EnvironmentInjector {
|
|
|
6307
6422
|
*/
|
|
6308
6423
|
destroy(): void;
|
|
6309
6424
|
onDestroy(callback: () => void): void;
|
|
6425
|
+
runInContext<ReturnT>(fn: () => ReturnT): ReturnT;
|
|
6310
6426
|
get<T>(token: ProviderToken<T>, notFoundValue?: any, flags?: InjectFlags): T;
|
|
6311
6427
|
toString(): string;
|
|
6312
6428
|
private assertNotDestroyed;
|
|
@@ -6332,6 +6448,47 @@ declare interface RDomTokenList {
|
|
|
6332
6448
|
remove(token: string): void;
|
|
6333
6449
|
}
|
|
6334
6450
|
|
|
6451
|
+
/**
|
|
6452
|
+
* Creates an object that allows to retrieve component metadata.
|
|
6453
|
+
*
|
|
6454
|
+
* @usageNotes
|
|
6455
|
+
*
|
|
6456
|
+
* The example below demonstrates how to use the function and how the fields
|
|
6457
|
+
* of the returned object map to the component metadata.
|
|
6458
|
+
*
|
|
6459
|
+
* ```typescript
|
|
6460
|
+
* @Component({
|
|
6461
|
+
* standalone: true,
|
|
6462
|
+
* selector: 'foo-component',
|
|
6463
|
+
* template: `
|
|
6464
|
+
* <ng-content></ng-content>
|
|
6465
|
+
* <ng-content select="content-selector-a"></ng-content>
|
|
6466
|
+
* `,
|
|
6467
|
+
* })
|
|
6468
|
+
* class FooComponent {
|
|
6469
|
+
* @Input('inputName') inputPropName: string;
|
|
6470
|
+
* @Output('outputName') outputPropName = new EventEmitter<void>();
|
|
6471
|
+
* }
|
|
6472
|
+
*
|
|
6473
|
+
* const mirror = reflectComponentType(FooComponent);
|
|
6474
|
+
* expect(mirror.type).toBe(FooComponent);
|
|
6475
|
+
* expect(mirror.selector).toBe('foo-component');
|
|
6476
|
+
* expect(mirror.isStandalone).toBe(true);
|
|
6477
|
+
* expect(mirror.inputs).toEqual([{propName: 'inputName', templateName: 'inputPropName'}]);
|
|
6478
|
+
* expect(mirror.outputs).toEqual([{propName: 'outputName', templateName: 'outputPropName'}]);
|
|
6479
|
+
* expect(mirror.ngContentSelectors).toEqual([
|
|
6480
|
+
* '*', // first `<ng-content>` in a template, the selector defaults to `*`
|
|
6481
|
+
* 'content-selector-a' // second `<ng-content>` in a template
|
|
6482
|
+
* ]);
|
|
6483
|
+
* ```
|
|
6484
|
+
*
|
|
6485
|
+
* @param component Component class reference.
|
|
6486
|
+
* @returns An object that allows to retrieve component metadata.
|
|
6487
|
+
*
|
|
6488
|
+
* @publicApi
|
|
6489
|
+
*/
|
|
6490
|
+
export declare function reflectComponentType<C>(component: Type<C>): ComponentMirror<C> | null;
|
|
6491
|
+
|
|
6335
6492
|
/**
|
|
6336
6493
|
* `Dependency` is used by the framework to extend DI.
|
|
6337
6494
|
* This is internal to Angular and should not be used directly.
|
|
@@ -6637,6 +6794,40 @@ declare interface RElement extends RNode {
|
|
|
6637
6794
|
|
|
6638
6795
|
declare const RENDERER = 11;
|
|
6639
6796
|
|
|
6797
|
+
/**
|
|
6798
|
+
* Procedural style of API needed to create elements and text nodes.
|
|
6799
|
+
*
|
|
6800
|
+
* In non-native browser environments (e.g. platforms such as web-workers), this is the
|
|
6801
|
+
* facade that enables element manipulation. In practice, this is implemented by `Renderer2`.
|
|
6802
|
+
*/
|
|
6803
|
+
declare interface Renderer {
|
|
6804
|
+
destroy(): void;
|
|
6805
|
+
createComment(value: string): RComment;
|
|
6806
|
+
createElement(name: string, namespace?: string | null): RElement;
|
|
6807
|
+
createText(value: string): RText;
|
|
6808
|
+
/**
|
|
6809
|
+
* This property is allowed to be null / undefined,
|
|
6810
|
+
* in which case the view engine won't call it.
|
|
6811
|
+
* This is used as a performance optimization for production mode.
|
|
6812
|
+
*/
|
|
6813
|
+
destroyNode?: ((node: RNode) => void) | null;
|
|
6814
|
+
appendChild(parent: RElement, newChild: RNode): void;
|
|
6815
|
+
insertBefore(parent: RNode, newChild: RNode, refChild: RNode | null, isMove?: boolean): void;
|
|
6816
|
+
removeChild(parent: RElement, oldChild: RNode, isHostElement?: boolean): void;
|
|
6817
|
+
selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): RElement;
|
|
6818
|
+
parentNode(node: RNode): RElement | null;
|
|
6819
|
+
nextSibling(node: RNode): RNode | null;
|
|
6820
|
+
setAttribute(el: RElement, name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL, namespace?: string | null): void;
|
|
6821
|
+
removeAttribute(el: RElement, name: string, namespace?: string | null): void;
|
|
6822
|
+
addClass(el: RElement, name: string): void;
|
|
6823
|
+
removeClass(el: RElement, name: string): void;
|
|
6824
|
+
setStyle(el: RElement, style: string, value: any, flags?: RendererStyleFlags2): void;
|
|
6825
|
+
removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2): void;
|
|
6826
|
+
setProperty(el: RElement, name: string, value: any): void;
|
|
6827
|
+
setValue(node: RText | RComment, value: string): void;
|
|
6828
|
+
listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void): () => void;
|
|
6829
|
+
}
|
|
6830
|
+
|
|
6640
6831
|
/**
|
|
6641
6832
|
* Extend this base class to implement custom rendering. By default, Angular
|
|
6642
6833
|
* renders a template into DOM. You can use custom rendering to intercept
|
|
@@ -6813,10 +7004,14 @@ export declare abstract class Renderer2 {
|
|
|
6813
7004
|
abstract listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => boolean | void): () => void;
|
|
6814
7005
|
}
|
|
6815
7006
|
|
|
6816
|
-
declare type Renderer3 = ObjectOrientedRenderer3 | ProceduralRenderer3;
|
|
6817
|
-
|
|
6818
7007
|
declare const RENDERER_FACTORY = 10;
|
|
6819
7008
|
|
|
7009
|
+
declare interface RendererFactory {
|
|
7010
|
+
createRenderer(hostElement: RElement | null, rendererType: RendererType2 | null): Renderer;
|
|
7011
|
+
begin?(): void;
|
|
7012
|
+
end?(): void;
|
|
7013
|
+
}
|
|
7014
|
+
|
|
6820
7015
|
/**
|
|
6821
7016
|
* Creates and initializes a custom renderer that implements the `Renderer2` base class.
|
|
6822
7017
|
*
|
|
@@ -6845,12 +7040,6 @@ export declare abstract class RendererFactory2 {
|
|
|
6845
7040
|
abstract whenRenderingDone?(): Promise<any>;
|
|
6846
7041
|
}
|
|
6847
7042
|
|
|
6848
|
-
declare interface RendererFactory3 {
|
|
6849
|
-
createRenderer(hostElement: RElement | null, rendererType: RendererType2 | null): Renderer3;
|
|
6850
|
-
begin?(): void;
|
|
6851
|
-
end?(): void;
|
|
6852
|
-
}
|
|
6853
|
-
|
|
6854
7043
|
/**
|
|
6855
7044
|
* Flags for renderer-specific style modifiers.
|
|
6856
7045
|
* @publicApi
|
|
@@ -6866,11 +7055,6 @@ export declare enum RendererStyleFlags2 {
|
|
|
6866
7055
|
DashCase = 2
|
|
6867
7056
|
}
|
|
6868
7057
|
|
|
6869
|
-
declare enum RendererStyleFlags3 {
|
|
6870
|
-
Important = 1,
|
|
6871
|
-
DashCase = 2
|
|
6872
|
-
}
|
|
6873
|
-
|
|
6874
7058
|
/**
|
|
6875
7059
|
* Used by `RendererFactory2` to associate custom rendering data and styles
|
|
6876
7060
|
* with a rendering implementation.
|
|
@@ -7046,6 +7230,7 @@ declare const enum RuntimeErrorCode {
|
|
|
7046
7230
|
INJECTOR_ALREADY_DESTROYED = 205,
|
|
7047
7231
|
PROVIDER_IN_WRONG_CONTEXT = 207,
|
|
7048
7232
|
MISSING_INJECTION_TOKEN = 208,
|
|
7233
|
+
INVALID_MULTI_PROVIDER = 209,
|
|
7049
7234
|
MULTIPLE_COMPONENTS_MATCH = -300,
|
|
7050
7235
|
EXPORT_NOT_FOUND = -301,
|
|
7051
7236
|
PIPE_NOT_FOUND = -302,
|
|
@@ -7060,6 +7245,7 @@ declare const enum RuntimeErrorCode {
|
|
|
7060
7245
|
PLATFORM_ALREADY_DESTROYED = 404,
|
|
7061
7246
|
ASYNC_INITIALIZERS_STILL_RUNNING = 405,
|
|
7062
7247
|
APPLICATION_REF_ALREADY_DESTROYED = 406,
|
|
7248
|
+
RENDERER_NOT_FOUND = 407,
|
|
7063
7249
|
INVALID_I18N_STRUCTURE = 700,
|
|
7064
7250
|
MISSING_LOCALE_DATA = 701,
|
|
7065
7251
|
IMPORT_PROVIDERS_FROM_STANDALONE = 800,
|
|
@@ -8837,7 +9023,7 @@ declare const enum TViewType {
|
|
|
8837
9023
|
Component = 1,
|
|
8838
9024
|
/**
|
|
8839
9025
|
* `TView` associated with a template. Such as `*ngIf`, `<ng-template>` etc... A `Component`
|
|
8840
|
-
* can have zero or more `
|
|
9026
|
+
* can have zero or more `Embedded` `TView`s.
|
|
8841
9027
|
*/
|
|
8842
9028
|
Embedded = 2
|
|
8843
9029
|
}
|
|
@@ -10678,40 +10864,25 @@ export declare class ɵRender3ComponentRef<T> extends ComponentRef<T> {
|
|
|
10678
10864
|
changeDetectorRef: ChangeDetectorRef;
|
|
10679
10865
|
componentType: Type<T>;
|
|
10680
10866
|
constructor(componentType: Type<T>, instance: T, location: ElementRef, _rootLView: LView, _tNode: TElementNode | TContainerNode | TElementContainerNode);
|
|
10867
|
+
setInput(name: string, value: unknown): void;
|
|
10681
10868
|
get injector(): Injector;
|
|
10682
10869
|
destroy(): void;
|
|
10683
10870
|
onDestroy(callback: () => void): void;
|
|
10684
10871
|
}
|
|
10685
10872
|
|
|
10686
|
-
export declare class ɵRender3NgModuleRef<T> extends NgModuleRef<T> implements InternalNgModuleRef<T
|
|
10873
|
+
export declare class ɵRender3NgModuleRef<T> extends NgModuleRef<T> implements InternalNgModuleRef<T> {
|
|
10687
10874
|
_parent: Injector | null;
|
|
10688
10875
|
_bootstrapComponents: Type<any>[];
|
|
10689
10876
|
_r3Injector: R3Injector;
|
|
10690
|
-
injector: EnvironmentInjector;
|
|
10691
10877
|
instance: T;
|
|
10692
10878
|
destroyCbs: (() => void)[] | null;
|
|
10693
10879
|
readonly componentFactoryResolver: ComponentFactoryResolver_2;
|
|
10694
10880
|
constructor(ngModuleType: Type<T>, _parent: Injector | null);
|
|
10695
|
-
get(
|
|
10881
|
+
get injector(): EnvironmentInjector;
|
|
10696
10882
|
destroy(): void;
|
|
10697
10883
|
onDestroy(callback: () => void): void;
|
|
10698
10884
|
}
|
|
10699
10885
|
|
|
10700
|
-
/**
|
|
10701
|
-
* Bootstraps a Component into an existing host element and returns an instance
|
|
10702
|
-
* of the component.
|
|
10703
|
-
*
|
|
10704
|
-
* Use this function to bootstrap a component into the DOM tree. Each invocation
|
|
10705
|
-
* of this function will create a separate tree of components, injectors and
|
|
10706
|
-
* change detection cycles and lifetimes. To dynamically insert a new component
|
|
10707
|
-
* into an existing tree such that it shares the same injection, change detection
|
|
10708
|
-
* and object lifetime, use {@link ViewContainer#createComponent}.
|
|
10709
|
-
*
|
|
10710
|
-
* @param componentType Component to bootstrap
|
|
10711
|
-
* @param options Optional parameters which control bootstrapping
|
|
10712
|
-
*/
|
|
10713
|
-
export declare function ɵrenderComponent<T>(componentType: ɵComponentType<T> | Type<T>, opts?: CreateComponentOptions): T;
|
|
10714
|
-
|
|
10715
10886
|
/**
|
|
10716
10887
|
* Flags passed into template functions to determine which blocks (i.e. creation, update)
|
|
10717
10888
|
* should be executed.
|
|
@@ -13428,7 +13599,7 @@ export declare function ɵɵpropertyInterpolate8(propName: string, prefix: strin
|
|
|
13428
13599
|
* be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
|
|
13429
13600
|
*
|
|
13430
13601
|
* @param propName The name of the property to update.
|
|
13431
|
-
* @param values The collection of values and the strings
|
|
13602
|
+
* @param values The collection of values and the strings in between those values, beginning with a
|
|
13432
13603
|
* string prefix and ending with a string suffix.
|
|
13433
13604
|
* (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
|
|
13434
13605
|
* @param sanitizer An optional sanitizer function
|
|
@@ -13867,7 +14038,7 @@ export declare function ɵɵsetNgModuleScope(type: any, scope: {
|
|
|
13867
14038
|
/**
|
|
13868
14039
|
* A feature that acts as a setup code for the {@link StandaloneService}.
|
|
13869
14040
|
*
|
|
13870
|
-
* The most important
|
|
14041
|
+
* The most important responsibility of this feature is to expose the "getStandaloneInjector"
|
|
13871
14042
|
* function (an entry points to a standalone injector creation) on a component definition object. We
|
|
13872
14043
|
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
13873
14044
|
* is tree-shakable and not included in applications that don't use standalone components.
|