@angular/core 19.2.0-rc.0 → 19.2.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/fesm2022/core.mjs +461 -269
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +696 -5
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +195 -19
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/{apply_import_manager-a930fcf1.js → apply_import_manager-a4e62ded.js} +2 -2
- package/schematics/bundles/checker-2eecc677.js +2 -2
- package/schematics/bundles/cleanup-unused-imports.js +4 -4
- package/schematics/bundles/{compiler_host-c280a924.js → compiler_host-f313eac9.js} +1 -1
- package/schematics/bundles/control-flow-migration.js +2 -2
- package/schematics/bundles/explicit-standalone-flag.js +4 -4
- package/schematics/bundles/{imports-abe29092.js → imports-31a38653.js} +1 -1
- package/schematics/bundles/index-3891dd55.js +2 -2
- package/schematics/bundles/{index-24a2ad1e.js → index-afc3f749.js} +2 -2
- package/schematics/bundles/inject-migration.js +6 -6
- package/schematics/bundles/{leading_space-d190b83b.js → leading_space-6e7a8ec6.js} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-71b3a951.js → migrate_ts_type_references-1abf1f5f.js} +4 -4
- package/schematics/bundles/{ng_decorators-e699c081.js → ng_decorators-6878e227.js} +2 -2
- package/schematics/bundles/{nodes-a535b2be.js → nodes-ffdce442.js} +1 -1
- package/schematics/bundles/output-migration.js +5 -5
- package/schematics/bundles/pending-tasks.js +4 -4
- package/schematics/bundles/program-24da9092.js +10 -10
- package/schematics/bundles/{project_paths-b073c4d6.js → project_paths-64bc3947.js} +1 -1
- package/schematics/bundles/{project_tsconfig_paths-e9ccccbf.js → project_tsconfig_paths-6c9cde78.js} +1 -1
- package/schematics/bundles/{property_name-7c8433f5.js → property_name-42030525.js} +1 -1
- package/schematics/bundles/provide-initializer.js +4 -4
- package/schematics/bundles/route-lazy-loading.js +4 -4
- package/schematics/bundles/self-closing-tags-migration.js +6 -6
- package/schematics/bundles/signal-input-migration.js +7 -7
- package/schematics/bundles/signal-queries-migration.js +7 -7
- package/schematics/bundles/signals.js +7 -7
- package/schematics/bundles/standalone-migration.js +6 -6
- package/testing/index.d.ts +297 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -1011,7 +1011,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
1011
1011
|
function compileDeclareClassMetadata(metadata) {
|
|
1012
1012
|
const definitionMap = new checker.DefinitionMap();
|
|
1013
1013
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
1014
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1014
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1015
1015
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1016
1016
|
definitionMap.set('type', metadata.type);
|
|
1017
1017
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -1029,7 +1029,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
1029
1029
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
|
|
1030
1030
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
|
|
1031
1031
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
1032
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1032
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1033
1033
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1034
1034
|
definitionMap.set('type', metadata.type);
|
|
1035
1035
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -1124,7 +1124,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
1124
1124
|
const definitionMap = new checker.DefinitionMap();
|
|
1125
1125
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
1126
1126
|
definitionMap.set('minVersion', checker.literal(minVersion));
|
|
1127
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1127
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1128
1128
|
// e.g. `type: MyDirective`
|
|
1129
1129
|
definitionMap.set('type', meta.type.value);
|
|
1130
1130
|
if (meta.isStandalone !== undefined) {
|
|
@@ -1540,7 +1540,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
1540
1540
|
function compileDeclareFactoryFunction(meta) {
|
|
1541
1541
|
const definitionMap = new checker.DefinitionMap();
|
|
1542
1542
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
1543
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1543
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1544
1544
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1545
1545
|
definitionMap.set('type', meta.type.value);
|
|
1546
1546
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -1575,7 +1575,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
1575
1575
|
function createInjectableDefinitionMap(meta) {
|
|
1576
1576
|
const definitionMap = new checker.DefinitionMap();
|
|
1577
1577
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
1578
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1578
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1579
1579
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1580
1580
|
definitionMap.set('type', meta.type.value);
|
|
1581
1581
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -1626,7 +1626,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
1626
1626
|
function createInjectorDefinitionMap(meta) {
|
|
1627
1627
|
const definitionMap = new checker.DefinitionMap();
|
|
1628
1628
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
1629
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1629
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1630
1630
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1631
1631
|
definitionMap.set('type', meta.type.value);
|
|
1632
1632
|
definitionMap.set('providers', meta.providers);
|
|
@@ -1659,7 +1659,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
1659
1659
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
1660
1660
|
}
|
|
1661
1661
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
1662
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1662
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1663
1663
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1664
1664
|
definitionMap.set('type', meta.type.value);
|
|
1665
1665
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -1710,7 +1710,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
1710
1710
|
function createPipeDefinitionMap(meta) {
|
|
1711
1711
|
const definitionMap = new checker.DefinitionMap();
|
|
1712
1712
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
1713
|
-
definitionMap.set('version', checker.literal('19.2.0
|
|
1713
|
+
definitionMap.set('version', checker.literal('19.2.0'));
|
|
1714
1714
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1715
1715
|
// e.g. `type: MyPipe`
|
|
1716
1716
|
definitionMap.set('type', meta.type.value);
|
|
@@ -20389,7 +20389,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
|
|
|
20389
20389
|
* @param minVersion Minimum required version for the feature.
|
|
20390
20390
|
*/
|
|
20391
20391
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
20392
|
-
// A version of `19.2.0
|
|
20392
|
+
// A version of `19.2.0` usually means that core is at head so it supports
|
|
20393
20393
|
// all features. Use string interpolation prevent the placeholder from being replaced
|
|
20394
20394
|
// with the current version during build time.
|
|
20395
20395
|
if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,10 +10,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
14
|
+
var compiler_host = require('./compiler_host-f313eac9.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var imports = require('./imports-
|
|
16
|
+
var imports = require('./imports-31a38653.js');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
18
|
require('./checker-2eecc677.js');
|
|
19
19
|
require('os');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var p = require('path');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
15
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
+
var compiler_host = require('./compiler_host-f313eac9.js');
|
|
15
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
16
16
|
var ts = require('typescript');
|
|
17
17
|
var checker = require('./checker-2eecc677.js');
|
|
18
|
-
var property_name = require('./property_name-
|
|
18
|
+
var property_name = require('./property_name-42030525.js');
|
|
19
19
|
require('os');
|
|
20
20
|
require('@angular-devkit/core');
|
|
21
21
|
require('module');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
13
|
-
var project_paths = require('./project_paths-
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
13
|
+
var project_paths = require('./project_paths-64bc3947.js');
|
|
14
14
|
require('os');
|
|
15
15
|
var ts = require('typescript');
|
|
16
16
|
var checker = require('./checker-2eecc677.js');
|
|
17
17
|
require('./program-24da9092.js');
|
|
18
18
|
require('path');
|
|
19
|
-
var ng_decorators = require('./ng_decorators-
|
|
20
|
-
var property_name = require('./property_name-
|
|
19
|
+
var ng_decorators = require('./ng_decorators-6878e227.js');
|
|
20
|
+
var property_name = require('./property_name-42030525.js');
|
|
21
21
|
require('@angular-devkit/core');
|
|
22
22
|
require('node:path/posix');
|
|
23
23
|
require('fs');
|
|
24
24
|
require('module');
|
|
25
25
|
require('url');
|
|
26
|
-
require('./imports-
|
|
26
|
+
require('./imports-31a38653.js');
|
|
27
27
|
|
|
28
28
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
29
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
12
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-1abf1f5f.js');
|
|
13
13
|
var ts = require('typescript');
|
|
14
14
|
require('os');
|
|
15
15
|
var checker = require('./checker-2eecc677.js');
|
|
16
16
|
var program = require('./program-24da9092.js');
|
|
17
17
|
require('path');
|
|
18
|
-
var project_paths = require('./project_paths-
|
|
19
|
-
var index = require('./index-
|
|
18
|
+
var project_paths = require('./project_paths-64bc3947.js');
|
|
19
|
+
var index = require('./index-afc3f749.js');
|
|
20
20
|
var assert = require('assert');
|
|
21
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
22
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
23
|
-
require('./leading_space-
|
|
21
|
+
var apply_import_manager = require('./apply_import_manager-a4e62ded.js');
|
|
22
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
23
|
+
require('./leading_space-6e7a8ec6.js');
|
|
24
24
|
require('fs');
|
|
25
25
|
require('module');
|
|
26
26
|
require('url');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
13
|
-
var project_paths = require('./project_paths-
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
13
|
+
var project_paths = require('./project_paths-64bc3947.js');
|
|
14
14
|
require('os');
|
|
15
15
|
var ts = require('typescript');
|
|
16
16
|
var checker = require('./checker-2eecc677.js');
|
|
17
17
|
var program = require('./program-24da9092.js');
|
|
18
18
|
require('path');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
20
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
19
|
+
var apply_import_manager = require('./apply_import_manager-a4e62ded.js');
|
|
20
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-1abf1f5f.js');
|
|
21
21
|
var assert = require('assert');
|
|
22
|
-
var index = require('./index-
|
|
22
|
+
var index = require('./index-afc3f749.js');
|
|
23
23
|
require('@angular-devkit/core');
|
|
24
24
|
require('node:path/posix');
|
|
25
25
|
require('fs');
|
|
26
26
|
require('module');
|
|
27
27
|
require('url');
|
|
28
|
-
require('./leading_space-
|
|
28
|
+
require('./leading_space-6e7a8ec6.js');
|
|
29
29
|
|
|
30
30
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
31
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -12,9 +12,9 @@ var schematics = require('@angular-devkit/schematics');
|
|
|
12
12
|
var signalQueriesMigration = require('./signal-queries-migration.js');
|
|
13
13
|
var signalInputMigration = require('./signal-input-migration.js');
|
|
14
14
|
var outputMigration = require('./output-migration.js');
|
|
15
|
-
require('./project_tsconfig_paths-
|
|
15
|
+
require('./project_tsconfig_paths-6c9cde78.js');
|
|
16
16
|
require('@angular-devkit/core');
|
|
17
|
-
require('./project_paths-
|
|
17
|
+
require('./project_paths-64bc3947.js');
|
|
18
18
|
require('node:path/posix');
|
|
19
19
|
require('os');
|
|
20
20
|
require('typescript');
|
|
@@ -24,11 +24,11 @@ require('module');
|
|
|
24
24
|
require('path');
|
|
25
25
|
require('url');
|
|
26
26
|
require('./program-24da9092.js');
|
|
27
|
-
require('./apply_import_manager-
|
|
28
|
-
require('./migrate_ts_type_references-
|
|
27
|
+
require('./apply_import_manager-a4e62ded.js');
|
|
28
|
+
require('./migrate_ts_type_references-1abf1f5f.js');
|
|
29
29
|
require('assert');
|
|
30
|
-
require('./index-
|
|
31
|
-
require('./leading_space-
|
|
30
|
+
require('./index-afc3f749.js');
|
|
31
|
+
require('./leading_space-6e7a8ec6.js');
|
|
32
32
|
|
|
33
33
|
function migrate(options) {
|
|
34
34
|
// The migrations are independent so we can run them in any order, but we sort them here
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0
|
|
3
|
+
* @license Angular v19.2.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -13,11 +13,11 @@ require('./index-3891dd55.js');
|
|
|
13
13
|
var fs = require('fs');
|
|
14
14
|
var p = require('path');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var compiler_host = require('./compiler_host-
|
|
17
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
18
|
-
var ng_decorators = require('./ng_decorators-
|
|
19
|
-
var nodes = require('./nodes-
|
|
20
|
-
var imports = require('./imports-
|
|
16
|
+
var compiler_host = require('./compiler_host-f313eac9.js');
|
|
17
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
18
|
+
var ng_decorators = require('./ng_decorators-6878e227.js');
|
|
19
|
+
var nodes = require('./nodes-ffdce442.js');
|
|
20
|
+
var imports = require('./imports-31a38653.js');
|
|
21
21
|
var checker = require('./checker-2eecc677.js');
|
|
22
22
|
require('os');
|
|
23
23
|
var program = require('./program-24da9092.js');
|
package/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.2.0
|
|
2
|
+
* @license Angular v19.2.0
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -191,6 +191,42 @@ export declare function fakeAsync(fn: Function, options?: {
|
|
|
191
191
|
flush?: boolean;
|
|
192
192
|
}): (...args: any[]) => any;
|
|
193
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Fake equivalent of `NavigationHistoryEntry`.
|
|
196
|
+
*/
|
|
197
|
+
declare class FakeNavigationHistoryEntry implements NavigationHistoryEntry {
|
|
198
|
+
readonly url: string | null;
|
|
199
|
+
readonly sameDocument: boolean;
|
|
200
|
+
readonly id: string;
|
|
201
|
+
readonly key: string;
|
|
202
|
+
readonly index: number;
|
|
203
|
+
private readonly state;
|
|
204
|
+
private readonly historyState;
|
|
205
|
+
ondispose: ((this: NavigationHistoryEntry, ev: Event) => any) | null;
|
|
206
|
+
constructor(url: string | null, { id, key, index, sameDocument, state, historyState, }: {
|
|
207
|
+
id: string;
|
|
208
|
+
key: string;
|
|
209
|
+
index: number;
|
|
210
|
+
sameDocument: boolean;
|
|
211
|
+
historyState: unknown;
|
|
212
|
+
state?: unknown;
|
|
213
|
+
});
|
|
214
|
+
getState(): unknown;
|
|
215
|
+
getHistoryState(): unknown;
|
|
216
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
|
|
217
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
|
|
218
|
+
dispatchEvent(event: Event): boolean;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Fake equivalent of the `NavigationResult` interface with
|
|
223
|
+
* `FakeNavigationHistoryEntry`.
|
|
224
|
+
*/
|
|
225
|
+
declare interface FakeNavigationResult extends NavigationResult {
|
|
226
|
+
readonly committed: Promise<FakeNavigationHistoryEntry>;
|
|
227
|
+
readonly finished: Promise<FakeNavigationHistoryEntry>;
|
|
228
|
+
}
|
|
229
|
+
|
|
194
230
|
/**
|
|
195
231
|
* Flushes any pending microtasks and simulates the asynchronous passage of time for the timers in
|
|
196
232
|
* the `fakeAsync` zone by
|
|
@@ -275,6 +311,137 @@ export declare interface ModuleTeardownOptions {
|
|
|
275
311
|
rethrowErrors?: boolean;
|
|
276
312
|
}
|
|
277
313
|
|
|
314
|
+
declare class NavigateEvent extends Event {
|
|
315
|
+
constructor(type: string, eventInit?: NavigateEventInit);
|
|
316
|
+
readonly navigationType: NavigationTypeString;
|
|
317
|
+
readonly canIntercept: boolean;
|
|
318
|
+
readonly userInitiated: boolean;
|
|
319
|
+
readonly hashChange: boolean;
|
|
320
|
+
readonly destination: NavigationDestination;
|
|
321
|
+
readonly signal: AbortSignal;
|
|
322
|
+
readonly formData: FormData | null;
|
|
323
|
+
readonly downloadRequest: string | null;
|
|
324
|
+
readonly info?: unknown;
|
|
325
|
+
intercept(options?: NavigationInterceptOptions): void;
|
|
326
|
+
scroll(): void;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare interface NavigateEventInit extends EventInit {
|
|
330
|
+
navigationType?: NavigationTypeString;
|
|
331
|
+
canIntercept?: boolean;
|
|
332
|
+
userInitiated?: boolean;
|
|
333
|
+
hashChange?: boolean;
|
|
334
|
+
destination: NavigationDestination;
|
|
335
|
+
signal: AbortSignal;
|
|
336
|
+
formData?: FormData | null;
|
|
337
|
+
downloadRequest?: string | null;
|
|
338
|
+
info?: unknown;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
declare class Navigation extends EventTarget {
|
|
342
|
+
entries(): NavigationHistoryEntry[];
|
|
343
|
+
readonly currentEntry: NavigationHistoryEntry | null;
|
|
344
|
+
updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void;
|
|
345
|
+
readonly transition: NavigationTransition | null;
|
|
346
|
+
readonly canGoBack: boolean;
|
|
347
|
+
readonly canGoForward: boolean;
|
|
348
|
+
navigate(url: string, options?: NavigationNavigateOptions): NavigationResult;
|
|
349
|
+
reload(options?: NavigationReloadOptions): NavigationResult;
|
|
350
|
+
traverseTo(key: string, options?: NavigationOptions): NavigationResult;
|
|
351
|
+
back(options?: NavigationOptions): NavigationResult;
|
|
352
|
+
forward(options?: NavigationOptions): NavigationResult;
|
|
353
|
+
onnavigate: ((this: Navigation, ev: NavigateEvent) => any) | null;
|
|
354
|
+
onnavigatesuccess: ((this: Navigation, ev: Event) => any) | null;
|
|
355
|
+
onnavigateerror: ((this: Navigation, ev: ErrorEvent) => any) | null;
|
|
356
|
+
oncurrententrychange: ((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any) | null;
|
|
357
|
+
addEventListener<K extends keyof NavigationEventMap>(type: K, listener: (this: Navigation, ev: NavigationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
358
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
359
|
+
removeEventListener<K extends keyof NavigationEventMap>(type: K, listener: (this: Navigation, ev: NavigationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
360
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
declare class NavigationCurrentEntryChangeEvent extends Event {
|
|
364
|
+
constructor(type: string, eventInit?: NavigationCurrentEntryChangeEventInit);
|
|
365
|
+
readonly navigationType: NavigationTypeString | null;
|
|
366
|
+
readonly from: NavigationHistoryEntry;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
declare interface NavigationCurrentEntryChangeEventInit extends EventInit {
|
|
370
|
+
navigationType?: NavigationTypeString | null;
|
|
371
|
+
from: NavigationHistoryEntry;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
declare class NavigationDestination {
|
|
375
|
+
readonly url: string;
|
|
376
|
+
readonly key: string | null;
|
|
377
|
+
readonly id: string | null;
|
|
378
|
+
readonly index: number;
|
|
379
|
+
readonly sameDocument: boolean;
|
|
380
|
+
getState(): unknown;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
declare interface NavigationEventMap {
|
|
385
|
+
navigate: NavigateEvent;
|
|
386
|
+
navigatesuccess: Event;
|
|
387
|
+
navigateerror: ErrorEvent;
|
|
388
|
+
currententrychange: NavigationCurrentEntryChangeEvent;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
declare class NavigationHistoryEntry extends EventTarget {
|
|
392
|
+
readonly key: string;
|
|
393
|
+
readonly id: string;
|
|
394
|
+
readonly url: string | null;
|
|
395
|
+
readonly index: number;
|
|
396
|
+
readonly sameDocument: boolean;
|
|
397
|
+
getState(): unknown;
|
|
398
|
+
ondispose: ((this: NavigationHistoryEntry, ev: Event) => any) | null;
|
|
399
|
+
addEventListener<K extends keyof NavigationHistoryEntryEventMap>(type: K, listener: (this: NavigationHistoryEntry, ev: NavigationHistoryEntryEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
400
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
401
|
+
removeEventListener<K extends keyof NavigationHistoryEntryEventMap>(type: K, listener: (this: NavigationHistoryEntry, ev: NavigationHistoryEntryEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
402
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
declare interface NavigationHistoryEntryEventMap {
|
|
406
|
+
dispose: Event;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare interface NavigationInterceptOptions {
|
|
410
|
+
handler?: () => Promise<void>;
|
|
411
|
+
focusReset?: 'after-transition' | 'manual';
|
|
412
|
+
scroll?: 'after-transition' | 'manual';
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
declare interface NavigationNavigateOptions extends NavigationOptions {
|
|
416
|
+
state?: unknown;
|
|
417
|
+
history?: 'auto' | 'push' | 'replace';
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
declare interface NavigationOptions {
|
|
421
|
+
info?: unknown;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare interface NavigationReloadOptions extends NavigationOptions {
|
|
425
|
+
state?: unknown;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
declare interface NavigationResult {
|
|
429
|
+
committed: Promise<NavigationHistoryEntry>;
|
|
430
|
+
finished: Promise<NavigationHistoryEntry>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
declare class NavigationTransition {
|
|
434
|
+
readonly navigationType: NavigationTypeString;
|
|
435
|
+
readonly from: NavigationHistoryEntry;
|
|
436
|
+
readonly finished: Promise<void>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
declare type NavigationTypeString = 'reload' | 'push' | 'replace' | 'traverse';
|
|
440
|
+
|
|
441
|
+
declare interface NavigationUpdateCurrentEntryOptions {
|
|
442
|
+
state: unknown;
|
|
443
|
+
}
|
|
444
|
+
|
|
278
445
|
/**
|
|
279
446
|
* Clears out the shared fake async zone for a test.
|
|
280
447
|
* To be called in a global `beforeEach`.
|
|
@@ -557,6 +724,135 @@ export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWr
|
|
|
557
724
|
|
|
558
725
|
export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
|
|
559
726
|
|
|
727
|
+
/**
|
|
728
|
+
* Fake implementation of user agent history and navigation behavior. This is a
|
|
729
|
+
* high-fidelity implementation of browser behavior that attempts to emulate
|
|
730
|
+
* things like traversal delay.
|
|
731
|
+
*/
|
|
732
|
+
export declare class ɵFakeNavigation implements Navigation {
|
|
733
|
+
private readonly window;
|
|
734
|
+
/**
|
|
735
|
+
* The fake implementation of an entries array. Only same-document entries
|
|
736
|
+
* allowed.
|
|
737
|
+
*/
|
|
738
|
+
private readonly entriesArr;
|
|
739
|
+
/**
|
|
740
|
+
* The current active entry index into `entriesArr`.
|
|
741
|
+
*/
|
|
742
|
+
private currentEntryIndex;
|
|
743
|
+
/**
|
|
744
|
+
* The current navigate event.
|
|
745
|
+
*/
|
|
746
|
+
private navigateEvent;
|
|
747
|
+
/**
|
|
748
|
+
* A Map of pending traversals, so that traversals to the same entry can be
|
|
749
|
+
* re-used.
|
|
750
|
+
*/
|
|
751
|
+
private readonly traversalQueue;
|
|
752
|
+
/**
|
|
753
|
+
* A Promise that resolves when the previous traversals have finished. Used to
|
|
754
|
+
* simulate the cross-process communication necessary for traversals.
|
|
755
|
+
*/
|
|
756
|
+
private nextTraversal;
|
|
757
|
+
/**
|
|
758
|
+
* A prospective current active entry index, which includes unresolved
|
|
759
|
+
* traversals. Used by `go` to determine where navigations are intended to go.
|
|
760
|
+
*/
|
|
761
|
+
private prospectiveEntryIndex;
|
|
762
|
+
/**
|
|
763
|
+
* A test-only option to make traversals synchronous, rather than emulate
|
|
764
|
+
* cross-process communication.
|
|
765
|
+
*/
|
|
766
|
+
private synchronousTraversals;
|
|
767
|
+
/** Whether to allow a call to setInitialEntryForTesting. */
|
|
768
|
+
private canSetInitialEntry;
|
|
769
|
+
/** `EventTarget` to dispatch events. */
|
|
770
|
+
private eventTarget;
|
|
771
|
+
/** The next unique id for created entries. Replace recreates this id. */
|
|
772
|
+
private nextId;
|
|
773
|
+
/** The next unique key for created entries. Replace inherits this id. */
|
|
774
|
+
private nextKey;
|
|
775
|
+
/** Whether this fake is disposed. */
|
|
776
|
+
private disposed;
|
|
777
|
+
/** Equivalent to `navigation.currentEntry`. */
|
|
778
|
+
get currentEntry(): FakeNavigationHistoryEntry;
|
|
779
|
+
get canGoBack(): boolean;
|
|
780
|
+
get canGoForward(): boolean;
|
|
781
|
+
constructor(window: Window, startURL: `http${string}`);
|
|
782
|
+
/**
|
|
783
|
+
* Sets the initial entry.
|
|
784
|
+
*/
|
|
785
|
+
setInitialEntryForTesting(url: `http${string}`, options?: {
|
|
786
|
+
historyState: unknown;
|
|
787
|
+
state?: unknown;
|
|
788
|
+
}): void;
|
|
789
|
+
/** Returns whether the initial entry is still eligible to be set. */
|
|
790
|
+
canSetInitialEntryForTesting(): boolean;
|
|
791
|
+
/**
|
|
792
|
+
* Sets whether to emulate traversals as synchronous rather than
|
|
793
|
+
* asynchronous.
|
|
794
|
+
*/
|
|
795
|
+
setSynchronousTraversalsForTesting(synchronousTraversals: boolean): void;
|
|
796
|
+
/** Equivalent to `navigation.entries()`. */
|
|
797
|
+
entries(): FakeNavigationHistoryEntry[];
|
|
798
|
+
/** Equivalent to `navigation.navigate()`. */
|
|
799
|
+
navigate(url: string, options?: NavigationNavigateOptions): FakeNavigationResult;
|
|
800
|
+
/** Equivalent to `history.pushState()`. */
|
|
801
|
+
pushState(data: unknown, title: string, url?: string): void;
|
|
802
|
+
/** Equivalent to `history.replaceState()`. */
|
|
803
|
+
replaceState(data: unknown, title: string, url?: string): void;
|
|
804
|
+
private pushOrReplaceState;
|
|
805
|
+
/** Equivalent to `navigation.traverseTo()`. */
|
|
806
|
+
traverseTo(key: string, options?: NavigationOptions): FakeNavigationResult;
|
|
807
|
+
/** Equivalent to `navigation.back()`. */
|
|
808
|
+
back(options?: NavigationOptions): FakeNavigationResult;
|
|
809
|
+
/** Equivalent to `navigation.forward()`. */
|
|
810
|
+
forward(options?: NavigationOptions): FakeNavigationResult;
|
|
811
|
+
/**
|
|
812
|
+
* Equivalent to `history.go()`.
|
|
813
|
+
* Note that this method does not actually work precisely to how Chrome
|
|
814
|
+
* does, instead choosing a simpler model with less unexpected behavior.
|
|
815
|
+
* Chrome has a few edge case optimizations, for instance with repeated
|
|
816
|
+
* `back(); forward()` chains it collapses certain traversals.
|
|
817
|
+
*/
|
|
818
|
+
go(direction: number): void;
|
|
819
|
+
/** Runs a traversal synchronously or asynchronously */
|
|
820
|
+
private runTraversal;
|
|
821
|
+
/** Equivalent to `navigation.addEventListener()`. */
|
|
822
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
|
|
823
|
+
/** Equivalent to `navigation.removeEventListener()`. */
|
|
824
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
|
|
825
|
+
/** Equivalent to `navigation.dispatchEvent()` */
|
|
826
|
+
dispatchEvent(event: Event): boolean;
|
|
827
|
+
/** Cleans up resources. */
|
|
828
|
+
dispose(): void;
|
|
829
|
+
/** Returns whether this fake is disposed. */
|
|
830
|
+
isDisposed(): boolean;
|
|
831
|
+
/** Implementation for all navigations and traversals. */
|
|
832
|
+
private userAgentNavigate;
|
|
833
|
+
/** Implementation to commit a navigation. */
|
|
834
|
+
private userAgentCommit;
|
|
835
|
+
/** Implementation for a push or replace navigation. */
|
|
836
|
+
private userAgentPushOrReplace;
|
|
837
|
+
/** Implementation for a traverse navigation. */
|
|
838
|
+
private userAgentTraverse;
|
|
839
|
+
/** Utility method for finding entries with the given `key`. */
|
|
840
|
+
private findEntry;
|
|
841
|
+
set onnavigate(_handler: ((this: Navigation, ev: NavigateEvent) => any) | null);
|
|
842
|
+
get onnavigate(): ((this: Navigation, ev: NavigateEvent) => any) | null;
|
|
843
|
+
set oncurrententrychange(_handler: // tslint:disable-next-line:no-any
|
|
844
|
+
((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any) | null);
|
|
845
|
+
get oncurrententrychange(): // tslint:disable-next-line:no-any
|
|
846
|
+
((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any) | null;
|
|
847
|
+
set onnavigatesuccess(_handler: ((this: Navigation, ev: Event) => any) | null);
|
|
848
|
+
get onnavigatesuccess(): ((this: Navigation, ev: Event) => any) | null;
|
|
849
|
+
set onnavigateerror(_handler: ((this: Navigation, ev: ErrorEvent) => any) | null);
|
|
850
|
+
get onnavigateerror(): ((this: Navigation, ev: ErrorEvent) => any) | null;
|
|
851
|
+
get transition(): NavigationTransition | null;
|
|
852
|
+
updateCurrentEntry(_options: NavigationUpdateCurrentEntryOptions): void;
|
|
853
|
+
reload(_options?: NavigationReloadOptions): NavigationResult;
|
|
854
|
+
}
|
|
855
|
+
|
|
560
856
|
export declare class ɵMetadataOverrider {
|
|
561
857
|
private _references;
|
|
562
858
|
/**
|