@angular/common 17.0.0-next.7 → 17.0.0-rc.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.
Files changed (63) hide show
  1. package/esm2022/http/public_api.mjs +1 -1
  2. package/esm2022/http/src/client.mjs +6 -4
  3. package/esm2022/http/src/errors.mjs +1 -1
  4. package/esm2022/http/src/fetch.mjs +4 -5
  5. package/esm2022/http/src/interceptor.mjs +27 -5
  6. package/esm2022/http/src/jsonp.mjs +6 -6
  7. package/esm2022/http/src/module.mjs +12 -12
  8. package/esm2022/http/src/provider.mjs +14 -2
  9. package/esm2022/http/src/request.mjs +3 -1
  10. package/esm2022/http/src/transfer_cache.mjs +73 -18
  11. package/esm2022/http/src/xhr.mjs +3 -3
  12. package/esm2022/http/src/xsrf.mjs +6 -6
  13. package/esm2022/http/testing/src/backend.mjs +3 -3
  14. package/esm2022/http/testing/src/module.mjs +4 -4
  15. package/esm2022/src/common_module.mjs +4 -4
  16. package/esm2022/src/directives/ng_class.mjs +3 -3
  17. package/esm2022/src/directives/ng_component_outlet.mjs +3 -3
  18. package/esm2022/src/directives/ng_for_of.mjs +3 -3
  19. package/esm2022/src/directives/ng_if.mjs +3 -3
  20. package/esm2022/src/directives/ng_optimized_image/index.mjs +3 -2
  21. package/esm2022/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
  22. package/esm2022/src/directives/ng_optimized_image/ng_optimized_image.mjs +6 -16
  23. package/esm2022/src/directives/ng_optimized_image/preconnect_link_checker.mjs +3 -3
  24. package/esm2022/src/directives/ng_optimized_image/preload-link-creator.mjs +3 -3
  25. package/esm2022/src/directives/ng_plural.mjs +6 -6
  26. package/esm2022/src/directives/ng_style.mjs +3 -3
  27. package/esm2022/src/directives/ng_switch.mjs +21 -12
  28. package/esm2022/src/directives/ng_switch_equality.mjs +13 -0
  29. package/esm2022/src/directives/ng_template_outlet.mjs +3 -3
  30. package/esm2022/src/errors.mjs +1 -1
  31. package/esm2022/src/i18n/localization.mjs +6 -6
  32. package/esm2022/src/location/hash_location_strategy.mjs +3 -3
  33. package/esm2022/src/location/location.mjs +3 -3
  34. package/esm2022/src/location/location_strategy.mjs +6 -6
  35. package/esm2022/src/location/platform_location.mjs +6 -6
  36. package/esm2022/src/pipes/async_pipe.mjs +3 -3
  37. package/esm2022/src/pipes/case_conversion_pipes.mjs +9 -9
  38. package/esm2022/src/pipes/date_pipe.mjs +3 -3
  39. package/esm2022/src/pipes/date_pipe_config.mjs +1 -1
  40. package/esm2022/src/pipes/i18n_plural_pipe.mjs +3 -3
  41. package/esm2022/src/pipes/i18n_select_pipe.mjs +3 -3
  42. package/esm2022/src/pipes/json_pipe.mjs +3 -3
  43. package/esm2022/src/pipes/keyvalue_pipe.mjs +3 -3
  44. package/esm2022/src/pipes/number_pipe.mjs +9 -9
  45. package/esm2022/src/pipes/slice_pipe.mjs +3 -3
  46. package/esm2022/src/version.mjs +1 -1
  47. package/esm2022/testing/src/location_mock.mjs +3 -3
  48. package/esm2022/testing/src/mock_location_strategy.mjs +3 -3
  49. package/esm2022/testing/src/mock_platform_location.mjs +3 -3
  50. package/esm2022/upgrade/src/location_upgrade_module.mjs +4 -4
  51. package/fesm2022/common.mjs +134 -131
  52. package/fesm2022/common.mjs.map +1 -1
  53. package/fesm2022/http/testing.mjs +8 -8
  54. package/fesm2022/http.mjs +147 -57
  55. package/fesm2022/http.mjs.map +1 -1
  56. package/fesm2022/testing.mjs +10 -10
  57. package/fesm2022/upgrade.mjs +5 -5
  58. package/http/index.d.ts +271 -6
  59. package/http/testing/index.d.ts +1 -1
  60. package/index.d.ts +7 -22
  61. package/package.json +3 -2
  62. package/testing/index.d.ts +1 -1
  63. package/upgrade/index.d.ts +1 -1
package/http/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.7
2
+ * @license Angular v17.0.0-rc.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -24,7 +24,6 @@ import { XhrFactory } from '@angular/common';
24
24
  * @see {@link HttpHandler}
25
25
  *
26
26
  * @publicApi
27
- * @developerPreview
28
27
  */
29
28
  export declare class FetchBackend implements HttpBackend {
30
29
  private readonly fetchImpl;
@@ -148,6 +147,9 @@ export declare class HttpClient {
148
147
  reportProgress?: boolean;
149
148
  responseType: 'arraybuffer';
150
149
  withCredentials?: boolean;
150
+ transferCache?: {
151
+ includeHeaders?: string[];
152
+ } | boolean;
151
153
  }): Observable<ArrayBuffer>;
152
154
  /**
153
155
  * Constructs a request that interprets the body as a blob and returns
@@ -172,6 +174,9 @@ export declare class HttpClient {
172
174
  reportProgress?: boolean;
173
175
  responseType: 'blob';
174
176
  withCredentials?: boolean;
177
+ transferCache?: {
178
+ includeHeaders?: string[];
179
+ } | boolean;
175
180
  }): Observable<Blob>;
176
181
  /**
177
182
  * Constructs a request that interprets the body as a text string and
@@ -196,6 +201,9 @@ export declare class HttpClient {
196
201
  reportProgress?: boolean;
197
202
  responseType: 'text';
198
203
  withCredentials?: boolean;
204
+ transferCache?: {
205
+ includeHeaders?: string[];
206
+ } | boolean;
199
207
  }): Observable<string>;
200
208
  /**
201
209
  * Constructs a request that interprets the body as an `ArrayBuffer` and returns the
@@ -221,6 +229,9 @@ export declare class HttpClient {
221
229
  reportProgress?: boolean;
222
230
  responseType: 'arraybuffer';
223
231
  withCredentials?: boolean;
232
+ transferCache?: {
233
+ includeHeaders?: string[];
234
+ } | boolean;
224
235
  }): Observable<HttpEvent<ArrayBuffer>>;
225
236
  /**
226
237
  * Constructs a request that interprets the body as a `Blob` and returns
@@ -246,6 +257,9 @@ export declare class HttpClient {
246
257
  reportProgress?: boolean;
247
258
  responseType: 'blob';
248
259
  withCredentials?: boolean;
260
+ transferCache?: {
261
+ includeHeaders?: string[];
262
+ } | boolean;
249
263
  }): Observable<HttpEvent<Blob>>;
250
264
  /**
251
265
  * Constructs a request which interprets the body as a text string and returns the full event
@@ -271,6 +285,9 @@ export declare class HttpClient {
271
285
  reportProgress?: boolean;
272
286
  responseType: 'text';
273
287
  withCredentials?: boolean;
288
+ transferCache?: {
289
+ includeHeaders?: string[];
290
+ } | boolean;
274
291
  }): Observable<HttpEvent<string>>;
275
292
  /**
276
293
  * Constructs a request which interprets the body as a JavaScript object and returns the full
@@ -296,6 +313,9 @@ export declare class HttpClient {
296
313
  };
297
314
  responseType?: 'json';
298
315
  withCredentials?: boolean;
316
+ transferCache?: {
317
+ includeHeaders?: string[];
318
+ } | boolean;
299
319
  }): Observable<HttpEvent<any>>;
300
320
  /**
301
321
  * Constructs a request which interprets the body as a JavaScript object and returns the full
@@ -321,6 +341,9 @@ export declare class HttpClient {
321
341
  };
322
342
  responseType?: 'json';
323
343
  withCredentials?: boolean;
344
+ transferCache?: {
345
+ includeHeaders?: string[];
346
+ } | boolean;
324
347
  }): Observable<HttpEvent<R>>;
325
348
  /**
326
349
  * Constructs a request which interprets the body as an `ArrayBuffer`
@@ -345,6 +368,9 @@ export declare class HttpClient {
345
368
  reportProgress?: boolean;
346
369
  responseType: 'arraybuffer';
347
370
  withCredentials?: boolean;
371
+ transferCache?: {
372
+ includeHeaders?: string[];
373
+ } | boolean;
348
374
  }): Observable<HttpResponse<ArrayBuffer>>;
349
375
  /**
350
376
  * Constructs a request which interprets the body as a `Blob` and returns the full `HttpResponse`.
@@ -368,6 +394,9 @@ export declare class HttpClient {
368
394
  reportProgress?: boolean;
369
395
  responseType: 'blob';
370
396
  withCredentials?: boolean;
397
+ transferCache?: {
398
+ includeHeaders?: string[];
399
+ } | boolean;
371
400
  }): Observable<HttpResponse<Blob>>;
372
401
  /**
373
402
  * Constructs a request which interprets the body as a text stream and returns the full
@@ -392,6 +421,9 @@ export declare class HttpClient {
392
421
  reportProgress?: boolean;
393
422
  responseType: 'text';
394
423
  withCredentials?: boolean;
424
+ transferCache?: {
425
+ includeHeaders?: string[];
426
+ } | boolean;
395
427
  }): Observable<HttpResponse<string>>;
396
428
  /**
397
429
  * Constructs a request which interprets the body as a JavaScript object and returns the full
@@ -441,6 +473,9 @@ export declare class HttpClient {
441
473
  };
442
474
  responseType?: 'json';
443
475
  withCredentials?: boolean;
476
+ transferCache?: {
477
+ includeHeaders?: string[];
478
+ } | boolean;
444
479
  }): Observable<HttpResponse<R>>;
445
480
  /**
446
481
  * Constructs a request which interprets the body as a JavaScript object and returns the full
@@ -465,6 +500,9 @@ export declare class HttpClient {
465
500
  responseType?: 'json';
466
501
  reportProgress?: boolean;
467
502
  withCredentials?: boolean;
503
+ transferCache?: {
504
+ includeHeaders?: string[];
505
+ } | boolean;
468
506
  }): Observable<Object>;
469
507
  /**
470
508
  * Constructs a request which interprets the body as a JavaScript object
@@ -489,6 +527,9 @@ export declare class HttpClient {
489
527
  responseType?: 'json';
490
528
  reportProgress?: boolean;
491
529
  withCredentials?: boolean;
530
+ transferCache?: {
531
+ includeHeaders?: string[];
532
+ } | boolean;
492
533
  }): Observable<R>;
493
534
  /**
494
535
  * Constructs a request where response type and requested observable are not known statically.
@@ -512,6 +553,9 @@ export declare class HttpClient {
512
553
  reportProgress?: boolean;
513
554
  responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
514
555
  withCredentials?: boolean;
556
+ transferCache?: {
557
+ includeHeaders?: string[];
558
+ } | boolean;
515
559
  }): Observable<any>;
516
560
  /**
517
561
  * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer`
@@ -885,6 +929,9 @@ export declare class HttpClient {
885
929
  reportProgress?: boolean;
886
930
  responseType: 'arraybuffer';
887
931
  withCredentials?: boolean;
932
+ transferCache?: {
933
+ includeHeaders?: string[];
934
+ } | boolean;
888
935
  }): Observable<ArrayBuffer>;
889
936
  /**
890
937
  * Constructs a `GET` request that interprets the body as a `Blob`
@@ -907,6 +954,9 @@ export declare class HttpClient {
907
954
  reportProgress?: boolean;
908
955
  responseType: 'blob';
909
956
  withCredentials?: boolean;
957
+ transferCache?: {
958
+ includeHeaders?: string[];
959
+ } | boolean;
910
960
  }): Observable<Blob>;
911
961
  /**
912
962
  * Constructs a `GET` request that interprets the body as a text string
@@ -929,6 +979,9 @@ export declare class HttpClient {
929
979
  reportProgress?: boolean;
930
980
  responseType: 'text';
931
981
  withCredentials?: boolean;
982
+ transferCache?: {
983
+ includeHeaders?: string[];
984
+ } | boolean;
932
985
  }): Observable<string>;
933
986
  /**
934
987
  * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns
@@ -952,6 +1005,9 @@ export declare class HttpClient {
952
1005
  reportProgress?: boolean;
953
1006
  responseType: 'arraybuffer';
954
1007
  withCredentials?: boolean;
1008
+ transferCache?: {
1009
+ includeHeaders?: string[];
1010
+ } | boolean;
955
1011
  }): Observable<HttpEvent<ArrayBuffer>>;
956
1012
  /**
957
1013
  * Constructs a `GET` request that interprets the body as a `Blob` and
@@ -974,6 +1030,9 @@ export declare class HttpClient {
974
1030
  reportProgress?: boolean;
975
1031
  responseType: 'blob';
976
1032
  withCredentials?: boolean;
1033
+ transferCache?: {
1034
+ includeHeaders?: string[];
1035
+ } | boolean;
977
1036
  }): Observable<HttpEvent<Blob>>;
978
1037
  /**
979
1038
  * Constructs a `GET` request that interprets the body as a text string and returns
@@ -996,6 +1055,9 @@ export declare class HttpClient {
996
1055
  reportProgress?: boolean;
997
1056
  responseType: 'text';
998
1057
  withCredentials?: boolean;
1058
+ transferCache?: {
1059
+ includeHeaders?: string[];
1060
+ } | boolean;
999
1061
  }): Observable<HttpEvent<string>>;
1000
1062
  /**
1001
1063
  * Constructs a `GET` request that interprets the body as JSON
@@ -1018,6 +1080,9 @@ export declare class HttpClient {
1018
1080
  reportProgress?: boolean;
1019
1081
  responseType?: 'json';
1020
1082
  withCredentials?: boolean;
1083
+ transferCache?: {
1084
+ includeHeaders?: string[];
1085
+ } | boolean;
1021
1086
  }): Observable<HttpEvent<Object>>;
1022
1087
  /**
1023
1088
  * Constructs a `GET` request that interprets the body as JSON and returns the full
@@ -1040,6 +1105,9 @@ export declare class HttpClient {
1040
1105
  reportProgress?: boolean;
1041
1106
  responseType?: 'json';
1042
1107
  withCredentials?: boolean;
1108
+ transferCache?: {
1109
+ includeHeaders?: string[];
1110
+ } | boolean;
1043
1111
  }): Observable<HttpEvent<T>>;
1044
1112
  /**
1045
1113
  * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and
@@ -1063,6 +1131,9 @@ export declare class HttpClient {
1063
1131
  reportProgress?: boolean;
1064
1132
  responseType: 'arraybuffer';
1065
1133
  withCredentials?: boolean;
1134
+ transferCache?: {
1135
+ includeHeaders?: string[];
1136
+ } | boolean;
1066
1137
  }): Observable<HttpResponse<ArrayBuffer>>;
1067
1138
  /**
1068
1139
  * Constructs a `GET` request that interprets the body as a `Blob` and
@@ -1086,6 +1157,9 @@ export declare class HttpClient {
1086
1157
  reportProgress?: boolean;
1087
1158
  responseType: 'blob';
1088
1159
  withCredentials?: boolean;
1160
+ transferCache?: {
1161
+ includeHeaders?: string[];
1162
+ } | boolean;
1089
1163
  }): Observable<HttpResponse<Blob>>;
1090
1164
  /**
1091
1165
  * Constructs a `GET` request that interprets the body as a text stream and
@@ -1109,6 +1183,9 @@ export declare class HttpClient {
1109
1183
  reportProgress?: boolean;
1110
1184
  responseType: 'text';
1111
1185
  withCredentials?: boolean;
1186
+ transferCache?: {
1187
+ includeHeaders?: string[];
1188
+ } | boolean;
1112
1189
  }): Observable<HttpResponse<string>>;
1113
1190
  /**
1114
1191
  * Constructs a `GET` request that interprets the body as JSON and
@@ -1132,6 +1209,9 @@ export declare class HttpClient {
1132
1209
  reportProgress?: boolean;
1133
1210
  responseType?: 'json';
1134
1211
  withCredentials?: boolean;
1212
+ transferCache?: {
1213
+ includeHeaders?: string[];
1214
+ } | boolean;
1135
1215
  }): Observable<HttpResponse<Object>>;
1136
1216
  /**
1137
1217
  * Constructs a `GET` request that interprets the body as JSON and
@@ -1155,6 +1235,9 @@ export declare class HttpClient {
1155
1235
  reportProgress?: boolean;
1156
1236
  responseType?: 'json';
1157
1237
  withCredentials?: boolean;
1238
+ transferCache?: {
1239
+ includeHeaders?: string[];
1240
+ } | boolean;
1158
1241
  }): Observable<HttpResponse<T>>;
1159
1242
  /**
1160
1243
  * Constructs a `GET` request that interprets the body as JSON and
@@ -1178,6 +1261,9 @@ export declare class HttpClient {
1178
1261
  reportProgress?: boolean;
1179
1262
  responseType?: 'json';
1180
1263
  withCredentials?: boolean;
1264
+ transferCache?: {
1265
+ includeHeaders?: string[];
1266
+ } | boolean;
1181
1267
  }): Observable<Object>;
1182
1268
  /**
1183
1269
  * Constructs a `GET` request that interprets the body as JSON and returns
@@ -1200,6 +1286,9 @@ export declare class HttpClient {
1200
1286
  reportProgress?: boolean;
1201
1287
  responseType?: 'json';
1202
1288
  withCredentials?: boolean;
1289
+ transferCache?: {
1290
+ includeHeaders?: string[];
1291
+ } | boolean;
1203
1292
  }): Observable<T>;
1204
1293
  /**
1205
1294
  * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` and
@@ -1222,6 +1311,9 @@ export declare class HttpClient {
1222
1311
  reportProgress?: boolean;
1223
1312
  responseType: 'arraybuffer';
1224
1313
  withCredentials?: boolean;
1314
+ transferCache?: {
1315
+ includeHeaders?: string[];
1316
+ } | boolean;
1225
1317
  }): Observable<ArrayBuffer>;
1226
1318
  /**
1227
1319
  * Constructs a `HEAD` request that interprets the body as a `Blob` and returns
@@ -1244,6 +1336,9 @@ export declare class HttpClient {
1244
1336
  reportProgress?: boolean;
1245
1337
  responseType: 'blob';
1246
1338
  withCredentials?: boolean;
1339
+ transferCache?: {
1340
+ includeHeaders?: string[];
1341
+ } | boolean;
1247
1342
  }): Observable<Blob>;
1248
1343
  /**
1249
1344
  * Constructs a `HEAD` request that interprets the body as a text string and returns the response
@@ -1266,6 +1361,9 @@ export declare class HttpClient {
1266
1361
  reportProgress?: boolean;
1267
1362
  responseType: 'text';
1268
1363
  withCredentials?: boolean;
1364
+ transferCache?: {
1365
+ includeHeaders?: string[];
1366
+ } | boolean;
1269
1367
  }): Observable<string>;
1270
1368
  /**
1271
1369
  * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`
@@ -1289,6 +1387,9 @@ export declare class HttpClient {
1289
1387
  reportProgress?: boolean;
1290
1388
  responseType: 'arraybuffer';
1291
1389
  withCredentials?: boolean;
1390
+ transferCache?: {
1391
+ includeHeaders?: string[];
1392
+ } | boolean;
1292
1393
  }): Observable<HttpEvent<ArrayBuffer>>;
1293
1394
  /**
1294
1395
  * Constructs a `HEAD` request that interprets the body as a `Blob` and
@@ -1312,6 +1413,9 @@ export declare class HttpClient {
1312
1413
  reportProgress?: boolean;
1313
1414
  responseType: 'blob';
1314
1415
  withCredentials?: boolean;
1416
+ transferCache?: {
1417
+ includeHeaders?: string[];
1418
+ } | boolean;
1315
1419
  }): Observable<HttpEvent<Blob>>;
1316
1420
  /**
1317
1421
  * Constructs a `HEAD` request that interprets the body as a text string
@@ -1335,6 +1439,9 @@ export declare class HttpClient {
1335
1439
  reportProgress?: boolean;
1336
1440
  responseType: 'text';
1337
1441
  withCredentials?: boolean;
1442
+ transferCache?: {
1443
+ includeHeaders?: string[];
1444
+ } | boolean;
1338
1445
  }): Observable<HttpEvent<string>>;
1339
1446
  /**
1340
1447
  * Constructs a `HEAD` request that interprets the body as JSON
@@ -1358,6 +1465,9 @@ export declare class HttpClient {
1358
1465
  reportProgress?: boolean;
1359
1466
  responseType?: 'json';
1360
1467
  withCredentials?: boolean;
1468
+ transferCache?: {
1469
+ includeHeaders?: string[];
1470
+ } | boolean;
1361
1471
  }): Observable<HttpEvent<Object>>;
1362
1472
  /**
1363
1473
  * Constructs a `HEAD` request that interprets the body as JSON and
@@ -1381,6 +1491,9 @@ export declare class HttpClient {
1381
1491
  reportProgress?: boolean;
1382
1492
  responseType?: 'json';
1383
1493
  withCredentials?: boolean;
1494
+ transferCache?: {
1495
+ includeHeaders?: string[];
1496
+ } | boolean;
1384
1497
  }): Observable<HttpEvent<T>>;
1385
1498
  /**
1386
1499
  * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`
@@ -1404,6 +1517,9 @@ export declare class HttpClient {
1404
1517
  reportProgress?: boolean;
1405
1518
  responseType: 'arraybuffer';
1406
1519
  withCredentials?: boolean;
1520
+ transferCache?: {
1521
+ includeHeaders?: string[];
1522
+ } | boolean;
1407
1523
  }): Observable<HttpResponse<ArrayBuffer>>;
1408
1524
  /**
1409
1525
  * Constructs a `HEAD` request that interprets the body as a `Blob` and returns
@@ -1427,6 +1543,9 @@ export declare class HttpClient {
1427
1543
  reportProgress?: boolean;
1428
1544
  responseType: 'blob';
1429
1545
  withCredentials?: boolean;
1546
+ transferCache?: {
1547
+ includeHeaders?: string[];
1548
+ } | boolean;
1430
1549
  }): Observable<HttpResponse<Blob>>;
1431
1550
  /**
1432
1551
  * Constructs a `HEAD` request that interprets the body as text stream
@@ -1450,6 +1569,9 @@ export declare class HttpClient {
1450
1569
  reportProgress?: boolean;
1451
1570
  responseType: 'text';
1452
1571
  withCredentials?: boolean;
1572
+ transferCache?: {
1573
+ includeHeaders?: string[];
1574
+ } | boolean;
1453
1575
  }): Observable<HttpResponse<string>>;
1454
1576
  /**
1455
1577
  * Constructs a `HEAD` request that interprets the body as JSON and
@@ -1473,6 +1595,9 @@ export declare class HttpClient {
1473
1595
  reportProgress?: boolean;
1474
1596
  responseType?: 'json';
1475
1597
  withCredentials?: boolean;
1598
+ transferCache?: {
1599
+ includeHeaders?: string[];
1600
+ } | boolean;
1476
1601
  }): Observable<HttpResponse<Object>>;
1477
1602
  /**
1478
1603
  * Constructs a `HEAD` request that interprets the body as JSON
@@ -1496,6 +1621,9 @@ export declare class HttpClient {
1496
1621
  reportProgress?: boolean;
1497
1622
  responseType?: 'json';
1498
1623
  withCredentials?: boolean;
1624
+ transferCache?: {
1625
+ includeHeaders?: string[];
1626
+ } | boolean;
1499
1627
  }): Observable<HttpResponse<T>>;
1500
1628
  /**
1501
1629
 
@@ -1519,6 +1647,9 @@ export declare class HttpClient {
1519
1647
  reportProgress?: boolean;
1520
1648
  responseType?: 'json';
1521
1649
  withCredentials?: boolean;
1650
+ transferCache?: {
1651
+ includeHeaders?: string[];
1652
+ } | boolean;
1522
1653
  }): Observable<Object>;
1523
1654
  /**
1524
1655
  * Constructs a `HEAD` request that interprets the body as JSON and returns
@@ -1542,6 +1673,9 @@ export declare class HttpClient {
1542
1673
  reportProgress?: boolean;
1543
1674
  responseType?: 'json';
1544
1675
  withCredentials?: boolean;
1676
+ transferCache?: {
1677
+ includeHeaders?: string[];
1678
+ } | boolean;
1545
1679
  }): Observable<T>;
1546
1680
  /**
1547
1681
  * Constructs a `JSONP` request for the given URL and name of the callback parameter.
@@ -2285,6 +2419,9 @@ export declare class HttpClient {
2285
2419
  reportProgress?: boolean;
2286
2420
  responseType: 'arraybuffer';
2287
2421
  withCredentials?: boolean;
2422
+ transferCache?: {
2423
+ includeHeaders?: string[];
2424
+ } | boolean;
2288
2425
  }): Observable<ArrayBuffer>;
2289
2426
  /**
2290
2427
  * Constructs a `POST` request that interprets the body as a `Blob` and returns the
@@ -2308,6 +2445,9 @@ export declare class HttpClient {
2308
2445
  reportProgress?: boolean;
2309
2446
  responseType: 'blob';
2310
2447
  withCredentials?: boolean;
2448
+ transferCache?: {
2449
+ includeHeaders?: string[];
2450
+ } | boolean;
2311
2451
  }): Observable<Blob>;
2312
2452
  /**
2313
2453
  * Constructs a `POST` request that interprets the body as a text string and
@@ -2331,6 +2471,9 @@ export declare class HttpClient {
2331
2471
  reportProgress?: boolean;
2332
2472
  responseType: 'text';
2333
2473
  withCredentials?: boolean;
2474
+ transferCache?: {
2475
+ includeHeaders?: string[];
2476
+ } | boolean;
2334
2477
  }): Observable<string>;
2335
2478
  /**
2336
2479
  * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and
@@ -2355,6 +2498,9 @@ export declare class HttpClient {
2355
2498
  reportProgress?: boolean;
2356
2499
  responseType: 'arraybuffer';
2357
2500
  withCredentials?: boolean;
2501
+ transferCache?: {
2502
+ includeHeaders?: string[];
2503
+ } | boolean;
2358
2504
  }): Observable<HttpEvent<ArrayBuffer>>;
2359
2505
  /**
2360
2506
  * Constructs a `POST` request that interprets the body as a `Blob`
@@ -2378,6 +2524,9 @@ export declare class HttpClient {
2378
2524
  reportProgress?: boolean;
2379
2525
  responseType: 'blob';
2380
2526
  withCredentials?: boolean;
2527
+ transferCache?: {
2528
+ includeHeaders?: string[];
2529
+ } | boolean;
2381
2530
  }): Observable<HttpEvent<Blob>>;
2382
2531
  /**
2383
2532
  * Constructs a `POST` request that interprets the body as a text string and returns the full
@@ -2402,6 +2551,9 @@ export declare class HttpClient {
2402
2551
  reportProgress?: boolean;
2403
2552
  responseType: 'text';
2404
2553
  withCredentials?: boolean;
2554
+ transferCache?: {
2555
+ includeHeaders?: string[];
2556
+ } | boolean;
2405
2557
  }): Observable<HttpEvent<string>>;
2406
2558
  /**
2407
2559
  * Constructs a POST request that interprets the body as JSON and returns the full
@@ -2426,6 +2578,9 @@ export declare class HttpClient {
2426
2578
  reportProgress?: boolean;
2427
2579
  responseType?: 'json';
2428
2580
  withCredentials?: boolean;
2581
+ transferCache?: {
2582
+ includeHeaders?: string[];
2583
+ } | boolean;
2429
2584
  }): Observable<HttpEvent<Object>>;
2430
2585
  /**
2431
2586
  * Constructs a POST request that interprets the body as JSON and returns the full
@@ -2450,6 +2605,9 @@ export declare class HttpClient {
2450
2605
  reportProgress?: boolean;
2451
2606
  responseType?: 'json';
2452
2607
  withCredentials?: boolean;
2608
+ transferCache?: {
2609
+ includeHeaders?: string[];
2610
+ } | boolean;
2453
2611
  }): Observable<HttpEvent<T>>;
2454
2612
  /**
2455
2613
  * Constructs a POST request that interprets the body as an `ArrayBuffer`
@@ -2474,6 +2632,9 @@ export declare class HttpClient {
2474
2632
  reportProgress?: boolean;
2475
2633
  responseType: 'arraybuffer';
2476
2634
  withCredentials?: boolean;
2635
+ transferCache?: {
2636
+ includeHeaders?: string[];
2637
+ } | boolean;
2477
2638
  }): Observable<HttpResponse<ArrayBuffer>>;
2478
2639
  /**
2479
2640
  * Constructs a `POST` request that interprets the body as a `Blob` and returns the full
@@ -2498,6 +2659,9 @@ export declare class HttpClient {
2498
2659
  reportProgress?: boolean;
2499
2660
  responseType: 'blob';
2500
2661
  withCredentials?: boolean;
2662
+ transferCache?: {
2663
+ includeHeaders?: string[];
2664
+ } | boolean;
2501
2665
  }): Observable<HttpResponse<Blob>>;
2502
2666
  /**
2503
2667
  * Constructs a `POST` request that interprets the body as a text stream and returns
@@ -2522,6 +2686,9 @@ export declare class HttpClient {
2522
2686
  reportProgress?: boolean;
2523
2687
  responseType: 'text';
2524
2688
  withCredentials?: boolean;
2689
+ transferCache?: {
2690
+ includeHeaders?: string[];
2691
+ } | boolean;
2525
2692
  }): Observable<HttpResponse<string>>;
2526
2693
  /**
2527
2694
  * Constructs a `POST` request that interprets the body as JSON
@@ -2546,6 +2713,9 @@ export declare class HttpClient {
2546
2713
  reportProgress?: boolean;
2547
2714
  responseType?: 'json';
2548
2715
  withCredentials?: boolean;
2716
+ transferCache?: {
2717
+ includeHeaders?: string[];
2718
+ } | boolean;
2549
2719
  }): Observable<HttpResponse<Object>>;
2550
2720
  /**
2551
2721
  * Constructs a `POST` request that interprets the body as JSON and returns the
@@ -2571,6 +2741,9 @@ export declare class HttpClient {
2571
2741
  reportProgress?: boolean;
2572
2742
  responseType?: 'json';
2573
2743
  withCredentials?: boolean;
2744
+ transferCache?: {
2745
+ includeHeaders?: string[];
2746
+ } | boolean;
2574
2747
  }): Observable<HttpResponse<T>>;
2575
2748
  /**
2576
2749
  * Constructs a `POST` request that interprets the body as JSON
@@ -2594,6 +2767,9 @@ export declare class HttpClient {
2594
2767
  reportProgress?: boolean;
2595
2768
  responseType?: 'json';
2596
2769
  withCredentials?: boolean;
2770
+ transferCache?: {
2771
+ includeHeaders?: string[];
2772
+ } | boolean;
2597
2773
  }): Observable<Object>;
2598
2774
  /**
2599
2775
  * Constructs a `POST` request that interprets the body as JSON
@@ -2618,6 +2794,9 @@ export declare class HttpClient {
2618
2794
  reportProgress?: boolean;
2619
2795
  responseType?: 'json';
2620
2796
  withCredentials?: boolean;
2797
+ transferCache?: {
2798
+ includeHeaders?: string[];
2799
+ } | boolean;
2621
2800
  }): Observable<T>;
2622
2801
  /**
2623
2802
  * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and returns the
@@ -3703,15 +3882,59 @@ export declare class HttpRequest<T> {
3703
3882
  * The outgoing URL with all URL parameters set.
3704
3883
  */
3705
3884
  readonly urlWithParams: string;
3706
- constructor(method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS', url: string, init?: {
3885
+ /**
3886
+ * The HttpTransferCache option for the request
3887
+ */
3888
+ readonly transferCache?: {
3889
+ includeHeaders?: string[];
3890
+ } | boolean;
3891
+ constructor(method: 'GET' | 'HEAD', url: string, init?: {
3892
+ headers?: HttpHeaders;
3893
+ context?: HttpContext;
3894
+ reportProgress?: boolean;
3895
+ params?: HttpParams;
3896
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3897
+ withCredentials?: boolean;
3898
+ /**
3899
+ * This property accepts either a boolean to enable/disable transferring cache for eligible
3900
+ * requests performed using `HttpClient`, or an object, which allows to configure cache
3901
+ * parameters, such as which headers should be included (no headers are included by default).
3902
+ *
3903
+ * Setting this property will override the options passed to `provideClientHydration()` for this
3904
+ * particular request
3905
+ */
3906
+ transferCache?: {
3907
+ includeHeaders?: string[];
3908
+ } | boolean;
3909
+ });
3910
+ constructor(method: 'DELETE' | 'JSONP' | 'OPTIONS', url: string, init?: {
3911
+ headers?: HttpHeaders;
3912
+ context?: HttpContext;
3913
+ reportProgress?: boolean;
3914
+ params?: HttpParams;
3915
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3916
+ withCredentials?: boolean;
3917
+ });
3918
+ constructor(method: 'POST', url: string, body: T | null, init?: {
3707
3919
  headers?: HttpHeaders;
3708
3920
  context?: HttpContext;
3709
3921
  reportProgress?: boolean;
3710
3922
  params?: HttpParams;
3711
3923
  responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3712
3924
  withCredentials?: boolean;
3925
+ /**
3926
+ * This property accepts either a boolean to enable/disable transferring cache for eligible
3927
+ * requests performed using `HttpClient`, or an object, which allows to configure cache
3928
+ * parameters, such as which headers should be included (no headers are included by default).
3929
+ *
3930
+ * Setting this property will override the options passed to `provideClientHydration()` for this
3931
+ * particular request
3932
+ */
3933
+ transferCache?: {
3934
+ includeHeaders?: string[];
3935
+ } | boolean;
3713
3936
  });
3714
- constructor(method: 'POST' | 'PUT' | 'PATCH', url: string, body: T | null, init?: {
3937
+ constructor(method: 'PUT' | 'PATCH', url: string, body: T | null, init?: {
3715
3938
  headers?: HttpHeaders;
3716
3939
  context?: HttpContext;
3717
3940
  reportProgress?: boolean;
@@ -3726,6 +3949,17 @@ export declare class HttpRequest<T> {
3726
3949
  params?: HttpParams;
3727
3950
  responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3728
3951
  withCredentials?: boolean;
3952
+ /**
3953
+ * This property accepts either a boolean to enable/disable transferring cache for eligible
3954
+ * requests performed using `HttpClient`, or an object, which allows to configure cache
3955
+ * parameters, such as which headers should be included (no headers are included by default).
3956
+ *
3957
+ * Setting this property will override the options passed to `provideClientHydration()` for this
3958
+ * particular request
3959
+ */
3960
+ transferCache?: {
3961
+ includeHeaders?: string[];
3962
+ } | boolean;
3729
3963
  });
3730
3964
  /**
3731
3965
  * Transform the free-form body into a serialized format suitable for
@@ -3945,6 +4179,25 @@ export declare const enum HttpStatusCode {
3945
4179
  NetworkAuthenticationRequired = 511
3946
4180
  }
3947
4181
 
4182
+ /**
4183
+ * Options to configure how TransferCache should be used to cache requests made via HttpClient.
4184
+ *
4185
+ * @param includeHeaders Specifies which headers should be included into cached responses. No
4186
+ * headers are included by default.
4187
+ * @param filter A function that receives a request as an argument and returns a boolean to indicate
4188
+ * whether a request should be included into the cache.
4189
+ * @param includePostRequests Enables caching for POST requests. By default, only GET and HEAD
4190
+ * requests are cached. This option can be enabled if POST requests are used to retrieve data
4191
+ * (for example using GraphQL).
4192
+ *
4193
+ * @publicApi
4194
+ */
4195
+ export declare type HttpTransferCacheOptions = {
4196
+ includeHeaders?: string[];
4197
+ filter?: (req: HttpRequest<unknown>) => boolean;
4198
+ includePostRequests?: boolean;
4199
+ };
4200
+
3948
4201
  /**
3949
4202
  * An upload progress event.
3950
4203
  *
@@ -4113,6 +4366,19 @@ export declare class JsonpInterceptor {
4113
4366
  * feature functions to `provideHttpClient`. For example, HTTP interceptors can be added using the
4114
4367
  * `withInterceptors(...)` feature.
4115
4368
  *
4369
+ * <div class="alert is-helpful">
4370
+ *
4371
+ * It's strongly recommended to enable
4372
+ * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) for applications that use
4373
+ * Server-Side Rendering for better performance and compatibility. To enable `fetch`, add
4374
+ * `withFetch()` feature to the `provideHttpClient()` call at the root of the application:
4375
+ *
4376
+ * ```
4377
+ * provideHttpClient(withFetch());
4378
+ * ```
4379
+ *
4380
+ * </div>
4381
+ *
4116
4382
  * @see {@link withInterceptors}
4117
4383
  * @see {@link withInterceptorsFromDi}
4118
4384
  * @see {@link withXsrfConfiguration}
@@ -4132,7 +4398,6 @@ export declare function provideHttpClient(...features: HttpFeature<HttpFeatureKi
4132
4398
  * Note: The Fetch API doesn't support progress report on uploads.
4133
4399
  *
4134
4400
  * @publicApi
4135
- * @developerPreview
4136
4401
  */
4137
4402
  export declare function withFetch(): HttpFeature<HttpFeatureKind.Fetch>;
4138
4403
 
@@ -4220,6 +4485,6 @@ export declare function withXsrfConfiguration({ cookieName, headerName }: {
4220
4485
  * load time.
4221
4486
  *
4222
4487
  */
4223
- export declare function ɵwithHttpTransferCache(): Provider[];
4488
+ export declare function ɵwithHttpTransferCache(cacheOptions: HttpTransferCacheOptions): Provider[];
4224
4489
 
4225
4490
  export { }