@angular/common 20.0.0-next.4 → 20.0.0-next.6

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.
@@ -0,0 +1,926 @@
1
+ /**
2
+ * @license Angular v20.0.0-next.6
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
+ * License: MIT
5
+ */
6
+
7
+ import * as i0 from '@angular/core';
8
+ import { ModuleWithProviders } from '@angular/core';
9
+
10
+ /**
11
+ * A token used to manipulate and access values stored in `HttpContext`.
12
+ *
13
+ * @publicApi
14
+ */
15
+ declare class HttpContextToken<T> {
16
+ readonly defaultValue: () => T;
17
+ constructor(defaultValue: () => T);
18
+ }
19
+ /**
20
+ * Http context stores arbitrary user defined values and ensures type safety without
21
+ * actually knowing the types. It is backed by a `Map` and guarantees that keys do not clash.
22
+ *
23
+ * This context is mutable and is shared between cloned requests unless explicitly specified.
24
+ *
25
+ * @usageNotes
26
+ *
27
+ * ### Usage Example
28
+ *
29
+ * ```ts
30
+ * // inside cache.interceptors.ts
31
+ * export const IS_CACHE_ENABLED = new HttpContextToken<boolean>(() => false);
32
+ *
33
+ * export class CacheInterceptor implements HttpInterceptor {
34
+ *
35
+ * intercept(req: HttpRequest<any>, delegate: HttpHandler): Observable<HttpEvent<any>> {
36
+ * if (req.context.get(IS_CACHE_ENABLED) === true) {
37
+ * return ...;
38
+ * }
39
+ * return delegate.handle(req);
40
+ * }
41
+ * }
42
+ *
43
+ * // inside a service
44
+ *
45
+ * this.httpClient.get('/api/weather', {
46
+ * context: new HttpContext().set(IS_CACHE_ENABLED, true)
47
+ * }).subscribe(...);
48
+ * ```
49
+ *
50
+ * @publicApi
51
+ */
52
+ declare class HttpContext {
53
+ private readonly map;
54
+ /**
55
+ * Store a value in the context. If a value is already present it will be overwritten.
56
+ *
57
+ * @param token The reference to an instance of `HttpContextToken`.
58
+ * @param value The value to store.
59
+ *
60
+ * @returns A reference to itself for easy chaining.
61
+ */
62
+ set<T>(token: HttpContextToken<T>, value: T): HttpContext;
63
+ /**
64
+ * Retrieve the value associated with the given token.
65
+ *
66
+ * @param token The reference to an instance of `HttpContextToken`.
67
+ *
68
+ * @returns The stored value or default if one is defined.
69
+ */
70
+ get<T>(token: HttpContextToken<T>): T;
71
+ /**
72
+ * Delete the value associated with the given token.
73
+ *
74
+ * @param token The reference to an instance of `HttpContextToken`.
75
+ *
76
+ * @returns A reference to itself for easy chaining.
77
+ */
78
+ delete(token: HttpContextToken<unknown>): HttpContext;
79
+ /**
80
+ * Checks for existence of a given token.
81
+ *
82
+ * @param token The reference to an instance of `HttpContextToken`.
83
+ *
84
+ * @returns True if the token exists, false otherwise.
85
+ */
86
+ has(token: HttpContextToken<unknown>): boolean;
87
+ /**
88
+ * @returns a list of tokens currently stored in the context.
89
+ */
90
+ keys(): IterableIterator<HttpContextToken<unknown>>;
91
+ }
92
+
93
+ /**
94
+ * Represents the header configuration options for an HTTP request.
95
+ * Instances are immutable. Modifying methods return a cloned
96
+ * instance with the change. The original object is never changed.
97
+ *
98
+ * @publicApi
99
+ */
100
+ declare class HttpHeaders {
101
+ /**
102
+ * Internal map of lowercase header names to values.
103
+ */
104
+ private headers;
105
+ /**
106
+ * Internal map of lowercased header names to the normalized
107
+ * form of the name (the form seen first).
108
+ */
109
+ private normalizedNames;
110
+ /**
111
+ * Complete the lazy initialization of this object (needed before reading).
112
+ */
113
+ private lazyInit;
114
+ /**
115
+ * Queued updates to be materialized the next initialization.
116
+ */
117
+ private lazyUpdate;
118
+ /** Constructs a new HTTP header object with the given values.*/
119
+ constructor(headers?: string | {
120
+ [name: string]: string | number | (string | number)[];
121
+ } | Headers);
122
+ /**
123
+ * Checks for existence of a given header.
124
+ *
125
+ * @param name The header name to check for existence.
126
+ *
127
+ * @returns True if the header exists, false otherwise.
128
+ */
129
+ has(name: string): boolean;
130
+ /**
131
+ * Retrieves the first value of a given header.
132
+ *
133
+ * @param name The header name.
134
+ *
135
+ * @returns The value string if the header exists, null otherwise
136
+ */
137
+ get(name: string): string | null;
138
+ /**
139
+ * Retrieves the names of the headers.
140
+ *
141
+ * @returns A list of header names.
142
+ */
143
+ keys(): string[];
144
+ /**
145
+ * Retrieves a list of values for a given header.
146
+ *
147
+ * @param name The header name from which to retrieve values.
148
+ *
149
+ * @returns A string of values if the header exists, null otherwise.
150
+ */
151
+ getAll(name: string): string[] | null;
152
+ /**
153
+ * Appends a new value to the existing set of values for a header
154
+ * and returns them in a clone of the original instance.
155
+ *
156
+ * @param name The header name for which to append the values.
157
+ * @param value The value to append.
158
+ *
159
+ * @returns A clone of the HTTP headers object with the value appended to the given header.
160
+ */
161
+ append(name: string, value: string | string[]): HttpHeaders;
162
+ /**
163
+ * Sets or modifies a value for a given header in a clone of the original instance.
164
+ * If the header already exists, its value is replaced with the given value
165
+ * in the returned object.
166
+ *
167
+ * @param name The header name.
168
+ * @param value The value or values to set or override for the given header.
169
+ *
170
+ * @returns A clone of the HTTP headers object with the newly set header value.
171
+ */
172
+ set(name: string, value: string | string[]): HttpHeaders;
173
+ /**
174
+ * Deletes values for a given header in a clone of the original instance.
175
+ *
176
+ * @param name The header name.
177
+ * @param value The value or values to delete for the given header.
178
+ *
179
+ * @returns A clone of the HTTP headers object with the given value deleted.
180
+ */
181
+ delete(name: string, value?: string | string[]): HttpHeaders;
182
+ private maybeSetNormalizedName;
183
+ private init;
184
+ private copyFrom;
185
+ private clone;
186
+ private applyUpdate;
187
+ private addHeaderEntry;
188
+ private setHeaderEntries;
189
+ }
190
+
191
+ /**
192
+ * A codec for encoding and decoding parameters in URLs.
193
+ *
194
+ * Used by `HttpParams`.
195
+ *
196
+ * @publicApi
197
+ **/
198
+ interface HttpParameterCodec {
199
+ encodeKey(key: string): string;
200
+ encodeValue(value: string): string;
201
+ decodeKey(key: string): string;
202
+ decodeValue(value: string): string;
203
+ }
204
+ /**
205
+ * Provides encoding and decoding of URL parameter and query-string values.
206
+ *
207
+ * Serializes and parses URL parameter keys and values to encode and decode them.
208
+ * If you pass URL query parameters without encoding,
209
+ * the query parameters can be misinterpreted at the receiving end.
210
+ *
211
+ *
212
+ * @publicApi
213
+ */
214
+ declare class HttpUrlEncodingCodec implements HttpParameterCodec {
215
+ /**
216
+ * Encodes a key name for a URL parameter or query-string.
217
+ * @param key The key name.
218
+ * @returns The encoded key name.
219
+ */
220
+ encodeKey(key: string): string;
221
+ /**
222
+ * Encodes the value of a URL parameter or query-string.
223
+ * @param value The value.
224
+ * @returns The encoded value.
225
+ */
226
+ encodeValue(value: string): string;
227
+ /**
228
+ * Decodes an encoded URL parameter or query-string key.
229
+ * @param key The encoded key name.
230
+ * @returns The decoded key name.
231
+ */
232
+ decodeKey(key: string): string;
233
+ /**
234
+ * Decodes an encoded URL parameter or query-string value.
235
+ * @param value The encoded value.
236
+ * @returns The decoded value.
237
+ */
238
+ decodeValue(value: string): string;
239
+ }
240
+ /**
241
+ * Options used to construct an `HttpParams` instance.
242
+ *
243
+ * @publicApi
244
+ */
245
+ interface HttpParamsOptions {
246
+ /**
247
+ * String representation of the HTTP parameters in URL-query-string format.
248
+ * Mutually exclusive with `fromObject`.
249
+ */
250
+ fromString?: string;
251
+ /** Object map of the HTTP parameters. Mutually exclusive with `fromString`. */
252
+ fromObject?: {
253
+ [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
254
+ };
255
+ /** Encoding codec used to parse and serialize the parameters. */
256
+ encoder?: HttpParameterCodec;
257
+ }
258
+ /**
259
+ * An HTTP request/response body that represents serialized parameters,
260
+ * per the MIME type `application/x-www-form-urlencoded`.
261
+ *
262
+ * This class is immutable; all mutation operations return a new instance.
263
+ *
264
+ * @publicApi
265
+ */
266
+ declare class HttpParams {
267
+ private map;
268
+ private encoder;
269
+ private updates;
270
+ private cloneFrom;
271
+ constructor(options?: HttpParamsOptions);
272
+ /**
273
+ * Reports whether the body includes one or more values for a given parameter.
274
+ * @param param The parameter name.
275
+ * @returns True if the parameter has one or more values,
276
+ * false if it has no value or is not present.
277
+ */
278
+ has(param: string): boolean;
279
+ /**
280
+ * Retrieves the first value for a parameter.
281
+ * @param param The parameter name.
282
+ * @returns The first value of the given parameter,
283
+ * or `null` if the parameter is not present.
284
+ */
285
+ get(param: string): string | null;
286
+ /**
287
+ * Retrieves all values for a parameter.
288
+ * @param param The parameter name.
289
+ * @returns All values in a string array,
290
+ * or `null` if the parameter not present.
291
+ */
292
+ getAll(param: string): string[] | null;
293
+ /**
294
+ * Retrieves all the parameters for this body.
295
+ * @returns The parameter names in a string array.
296
+ */
297
+ keys(): string[];
298
+ /**
299
+ * Appends a new value to existing values for a parameter.
300
+ * @param param The parameter name.
301
+ * @param value The new value to add.
302
+ * @return A new body with the appended value.
303
+ */
304
+ append(param: string, value: string | number | boolean): HttpParams;
305
+ /**
306
+ * Constructs a new body with appended values for the given parameter name.
307
+ * @param params parameters and values
308
+ * @return A new body with the new value.
309
+ */
310
+ appendAll(params: {
311
+ [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
312
+ }): HttpParams;
313
+ /**
314
+ * Replaces the value for a parameter.
315
+ * @param param The parameter name.
316
+ * @param value The new value.
317
+ * @return A new body with the new value.
318
+ */
319
+ set(param: string, value: string | number | boolean): HttpParams;
320
+ /**
321
+ * Removes a given value or all values from a parameter.
322
+ * @param param The parameter name.
323
+ * @param value The value to remove, if provided.
324
+ * @return A new body with the given value removed, or with all values
325
+ * removed if no value is specified.
326
+ */
327
+ delete(param: string, value?: string | number | boolean): HttpParams;
328
+ /**
329
+ * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are
330
+ * separated by `&`s.
331
+ */
332
+ toString(): string;
333
+ private clone;
334
+ private init;
335
+ }
336
+
337
+ /**
338
+ * An outgoing HTTP request with an optional typed body.
339
+ *
340
+ * `HttpRequest` represents an outgoing request, including URL, method,
341
+ * headers, body, and other request configuration options. Instances should be
342
+ * assumed to be immutable. To modify a `HttpRequest`, the `clone`
343
+ * method should be used.
344
+ *
345
+ * @publicApi
346
+ */
347
+ declare class HttpRequest<T> {
348
+ readonly url: string;
349
+ /**
350
+ * The request body, or `null` if one isn't set.
351
+ *
352
+ * Bodies are not enforced to be immutable, as they can include a reference to any
353
+ * user-defined data type. However, interceptors should take care to preserve
354
+ * idempotence by treating them as such.
355
+ */
356
+ readonly body: T | null;
357
+ /**
358
+ * Outgoing headers for this request.
359
+ */
360
+ readonly headers: HttpHeaders;
361
+ /**
362
+ * Shared and mutable context that can be used by interceptors
363
+ */
364
+ readonly context: HttpContext;
365
+ /**
366
+ * Whether this request should be made in a way that exposes progress events.
367
+ *
368
+ * Progress events are expensive (change detection runs on each event) and so
369
+ * they should only be requested if the consumer intends to monitor them.
370
+ *
371
+ * Note: The `FetchBackend` doesn't support progress report on uploads.
372
+ */
373
+ readonly reportProgress: boolean;
374
+ /**
375
+ * Whether this request should be sent with outgoing credentials (cookies).
376
+ */
377
+ readonly withCredentials: boolean;
378
+ /**
379
+ * The expected response type of the server.
380
+ *
381
+ * This is used to parse the response appropriately before returning it to
382
+ * the requestee.
383
+ */
384
+ readonly responseType: 'arraybuffer' | 'blob' | 'json' | 'text';
385
+ /**
386
+ * The outgoing HTTP request method.
387
+ */
388
+ readonly method: string;
389
+ /**
390
+ * Outgoing URL parameters.
391
+ *
392
+ * To pass a string representation of HTTP parameters in the URL-query-string format,
393
+ * the `HttpParamsOptions`' `fromString` may be used. For example:
394
+ *
395
+ * ```ts
396
+ * new HttpParams({fromString: 'angular=awesome'})
397
+ * ```
398
+ */
399
+ readonly params: HttpParams;
400
+ /**
401
+ * The outgoing URL with all URL parameters set.
402
+ */
403
+ readonly urlWithParams: string;
404
+ /**
405
+ * The HttpTransferCache option for the request
406
+ */
407
+ readonly transferCache?: {
408
+ includeHeaders?: string[];
409
+ } | boolean;
410
+ constructor(method: 'GET' | 'HEAD', url: string, init?: {
411
+ headers?: HttpHeaders;
412
+ context?: HttpContext;
413
+ reportProgress?: boolean;
414
+ params?: HttpParams;
415
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
416
+ withCredentials?: boolean;
417
+ /**
418
+ * This property accepts either a boolean to enable/disable transferring cache for eligible
419
+ * requests performed using `HttpClient`, or an object, which allows to configure cache
420
+ * parameters, such as which headers should be included (no headers are included by default).
421
+ *
422
+ * Setting this property will override the options passed to `provideClientHydration()` for this
423
+ * particular request
424
+ */
425
+ transferCache?: {
426
+ includeHeaders?: string[];
427
+ } | boolean;
428
+ });
429
+ constructor(method: 'DELETE' | 'JSONP' | 'OPTIONS', url: string, init?: {
430
+ headers?: HttpHeaders;
431
+ context?: HttpContext;
432
+ reportProgress?: boolean;
433
+ params?: HttpParams;
434
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
435
+ withCredentials?: boolean;
436
+ });
437
+ constructor(method: 'POST', url: string, body: T | null, init?: {
438
+ headers?: HttpHeaders;
439
+ context?: HttpContext;
440
+ reportProgress?: boolean;
441
+ params?: HttpParams;
442
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
443
+ withCredentials?: boolean;
444
+ /**
445
+ * This property accepts either a boolean to enable/disable transferring cache for eligible
446
+ * requests performed using `HttpClient`, or an object, which allows to configure cache
447
+ * parameters, such as which headers should be included (no headers are included by default).
448
+ *
449
+ * Setting this property will override the options passed to `provideClientHydration()` for this
450
+ * particular request
451
+ */
452
+ transferCache?: {
453
+ includeHeaders?: string[];
454
+ } | boolean;
455
+ });
456
+ constructor(method: 'PUT' | 'PATCH', url: string, body: T | null, init?: {
457
+ headers?: HttpHeaders;
458
+ context?: HttpContext;
459
+ reportProgress?: boolean;
460
+ params?: HttpParams;
461
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
462
+ withCredentials?: boolean;
463
+ });
464
+ constructor(method: string, url: string, body: T | null, init?: {
465
+ headers?: HttpHeaders;
466
+ context?: HttpContext;
467
+ reportProgress?: boolean;
468
+ params?: HttpParams;
469
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
470
+ withCredentials?: boolean;
471
+ /**
472
+ * This property accepts either a boolean to enable/disable transferring cache for eligible
473
+ * requests performed using `HttpClient`, or an object, which allows to configure cache
474
+ * parameters, such as which headers should be included (no headers are included by default).
475
+ *
476
+ * Setting this property will override the options passed to `provideClientHydration()` for this
477
+ * particular request
478
+ */
479
+ transferCache?: {
480
+ includeHeaders?: string[];
481
+ } | boolean;
482
+ });
483
+ /**
484
+ * Transform the free-form body into a serialized format suitable for
485
+ * transmission to the server.
486
+ */
487
+ serializeBody(): ArrayBuffer | Blob | FormData | URLSearchParams | string | null;
488
+ /**
489
+ * Examine the body and attempt to infer an appropriate MIME type
490
+ * for it.
491
+ *
492
+ * If no such type can be inferred, this method will return `null`.
493
+ */
494
+ detectContentTypeHeader(): string | null;
495
+ clone(): HttpRequest<T>;
496
+ clone(update: {
497
+ headers?: HttpHeaders;
498
+ context?: HttpContext;
499
+ reportProgress?: boolean;
500
+ params?: HttpParams;
501
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
502
+ withCredentials?: boolean;
503
+ transferCache?: {
504
+ includeHeaders?: string[];
505
+ } | boolean;
506
+ body?: T | null;
507
+ method?: string;
508
+ url?: string;
509
+ setHeaders?: {
510
+ [name: string]: string | string[];
511
+ };
512
+ setParams?: {
513
+ [param: string]: string;
514
+ };
515
+ }): HttpRequest<T>;
516
+ clone<V>(update: {
517
+ headers?: HttpHeaders;
518
+ context?: HttpContext;
519
+ reportProgress?: boolean;
520
+ params?: HttpParams;
521
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
522
+ withCredentials?: boolean;
523
+ transferCache?: {
524
+ includeHeaders?: string[];
525
+ } | boolean;
526
+ body?: V | null;
527
+ method?: string;
528
+ url?: string;
529
+ setHeaders?: {
530
+ [name: string]: string | string[];
531
+ };
532
+ setParams?: {
533
+ [param: string]: string;
534
+ };
535
+ }): HttpRequest<V>;
536
+ }
537
+
538
+ /**
539
+ * Type enumeration for the different kinds of `HttpEvent`.
540
+ *
541
+ * @publicApi
542
+ */
543
+ declare enum HttpEventType {
544
+ /**
545
+ * The request was sent out over the wire.
546
+ */
547
+ Sent = 0,
548
+ /**
549
+ * An upload progress event was received.
550
+ *
551
+ * Note: The `FetchBackend` doesn't support progress report on uploads.
552
+ */
553
+ UploadProgress = 1,
554
+ /**
555
+ * The response status code and headers were received.
556
+ */
557
+ ResponseHeader = 2,
558
+ /**
559
+ * A download progress event was received.
560
+ */
561
+ DownloadProgress = 3,
562
+ /**
563
+ * The full response including the body was received.
564
+ */
565
+ Response = 4,
566
+ /**
567
+ * A custom event from an interceptor or a backend.
568
+ */
569
+ User = 5
570
+ }
571
+ /**
572
+ * Base interface for progress events.
573
+ *
574
+ * @publicApi
575
+ */
576
+ interface HttpProgressEvent {
577
+ /**
578
+ * Progress event type is either upload or download.
579
+ */
580
+ type: HttpEventType.DownloadProgress | HttpEventType.UploadProgress;
581
+ /**
582
+ * Number of bytes uploaded or downloaded.
583
+ */
584
+ loaded: number;
585
+ /**
586
+ * Total number of bytes to upload or download. Depending on the request or
587
+ * response, this may not be computable and thus may not be present.
588
+ */
589
+ total?: number;
590
+ }
591
+ /**
592
+ * A download progress event.
593
+ *
594
+ * @publicApi
595
+ */
596
+ interface HttpDownloadProgressEvent extends HttpProgressEvent {
597
+ type: HttpEventType.DownloadProgress;
598
+ /**
599
+ * The partial response body as downloaded so far.
600
+ *
601
+ * Only present if the responseType was `text`.
602
+ */
603
+ partialText?: string;
604
+ }
605
+ /**
606
+ * An upload progress event.
607
+ *
608
+ * Note: The `FetchBackend` doesn't support progress report on uploads.
609
+ *
610
+ * @publicApi
611
+ */
612
+ interface HttpUploadProgressEvent extends HttpProgressEvent {
613
+ type: HttpEventType.UploadProgress;
614
+ }
615
+ /**
616
+ * An event indicating that the request was sent to the server. Useful
617
+ * when a request may be retried multiple times, to distinguish between
618
+ * retries on the final event stream.
619
+ *
620
+ * @publicApi
621
+ */
622
+ interface HttpSentEvent {
623
+ type: HttpEventType.Sent;
624
+ }
625
+ /**
626
+ * A user-defined event.
627
+ *
628
+ * Grouping all custom events under this type ensures they will be handled
629
+ * and forwarded by all implementations of interceptors.
630
+ *
631
+ * @publicApi
632
+ */
633
+ interface HttpUserEvent<T> {
634
+ type: HttpEventType.User;
635
+ }
636
+ /**
637
+ * Union type for all possible events on the response stream.
638
+ *
639
+ * Typed according to the expected type of the response.
640
+ *
641
+ * @publicApi
642
+ */
643
+ type HttpEvent<T> = HttpSentEvent | HttpHeaderResponse | HttpResponse<T> | HttpProgressEvent | HttpUserEvent<T>;
644
+ /**
645
+ * Base class for both `HttpResponse` and `HttpHeaderResponse`.
646
+ *
647
+ * @publicApi
648
+ */
649
+ declare abstract class HttpResponseBase {
650
+ /**
651
+ * All response headers.
652
+ */
653
+ readonly headers: HttpHeaders;
654
+ /**
655
+ * Response status code.
656
+ */
657
+ readonly status: number;
658
+ /**
659
+ * Textual description of response status code, defaults to OK.
660
+ *
661
+ * Do not depend on this.
662
+ */
663
+ readonly statusText: string;
664
+ /**
665
+ * URL of the resource retrieved, or null if not available.
666
+ */
667
+ readonly url: string | null;
668
+ /**
669
+ * Whether the status code falls in the 2xx range.
670
+ */
671
+ readonly ok: boolean;
672
+ /**
673
+ * Type of the response, narrowed to either the full response or the header.
674
+ */
675
+ readonly type: HttpEventType.Response | HttpEventType.ResponseHeader;
676
+ /**
677
+ * Super-constructor for all responses.
678
+ *
679
+ * The single parameter accepted is an initialization hash. Any properties
680
+ * of the response passed there will override the default values.
681
+ */
682
+ constructor(init: {
683
+ headers?: HttpHeaders;
684
+ status?: number;
685
+ statusText?: string;
686
+ url?: string;
687
+ }, defaultStatus?: number, defaultStatusText?: string);
688
+ }
689
+ /**
690
+ * A partial HTTP response which only includes the status and header data,
691
+ * but no response body.
692
+ *
693
+ * `HttpHeaderResponse` is a `HttpEvent` available on the response
694
+ * event stream, only when progress events are requested.
695
+ *
696
+ * @publicApi
697
+ */
698
+ declare class HttpHeaderResponse extends HttpResponseBase {
699
+ /**
700
+ * Create a new `HttpHeaderResponse` with the given parameters.
701
+ */
702
+ constructor(init?: {
703
+ headers?: HttpHeaders;
704
+ status?: number;
705
+ statusText?: string;
706
+ url?: string;
707
+ });
708
+ readonly type: HttpEventType.ResponseHeader;
709
+ /**
710
+ * Copy this `HttpHeaderResponse`, overriding its contents with the
711
+ * given parameter hash.
712
+ */
713
+ clone(update?: {
714
+ headers?: HttpHeaders;
715
+ status?: number;
716
+ statusText?: string;
717
+ url?: string;
718
+ }): HttpHeaderResponse;
719
+ }
720
+ /**
721
+ * A full HTTP response, including a typed response body (which may be `null`
722
+ * if one was not returned).
723
+ *
724
+ * `HttpResponse` is a `HttpEvent` available on the response event
725
+ * stream.
726
+ *
727
+ * @publicApi
728
+ */
729
+ declare class HttpResponse<T> extends HttpResponseBase {
730
+ /**
731
+ * The response body, or `null` if one was not returned.
732
+ */
733
+ readonly body: T | null;
734
+ /**
735
+ * Construct a new `HttpResponse`.
736
+ */
737
+ constructor(init?: {
738
+ body?: T | null;
739
+ headers?: HttpHeaders;
740
+ status?: number;
741
+ statusText?: string;
742
+ url?: string;
743
+ });
744
+ readonly type: HttpEventType.Response;
745
+ clone(): HttpResponse<T>;
746
+ clone(update: {
747
+ headers?: HttpHeaders;
748
+ status?: number;
749
+ statusText?: string;
750
+ url?: string;
751
+ }): HttpResponse<T>;
752
+ clone<V>(update: {
753
+ body?: V | null;
754
+ headers?: HttpHeaders;
755
+ status?: number;
756
+ statusText?: string;
757
+ url?: string;
758
+ }): HttpResponse<V>;
759
+ }
760
+ /**
761
+ * A response that represents an error or failure, either from a
762
+ * non-successful HTTP status, an error while executing the request,
763
+ * or some other failure which occurred during the parsing of the response.
764
+ *
765
+ * Any error returned on the `Observable` response stream will be
766
+ * wrapped in an `HttpErrorResponse` to provide additional context about
767
+ * the state of the HTTP layer when the error occurred. The error property
768
+ * will contain either a wrapped Error object or the error response returned
769
+ * from the server.
770
+ *
771
+ * @publicApi
772
+ */
773
+ declare class HttpErrorResponse extends HttpResponseBase implements Error {
774
+ readonly name = "HttpErrorResponse";
775
+ readonly message: string;
776
+ readonly error: any | null;
777
+ /**
778
+ * Errors are never okay, even when the status code is in the 2xx success range.
779
+ */
780
+ readonly ok = false;
781
+ constructor(init: {
782
+ error?: any;
783
+ headers?: HttpHeaders;
784
+ status?: number;
785
+ statusText?: string;
786
+ url?: string;
787
+ });
788
+ }
789
+ /**
790
+ * Http status codes.
791
+ * As per https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
792
+ * @publicApi
793
+ */
794
+ declare enum HttpStatusCode {
795
+ Continue = 100,
796
+ SwitchingProtocols = 101,
797
+ Processing = 102,
798
+ EarlyHints = 103,
799
+ Ok = 200,
800
+ Created = 201,
801
+ Accepted = 202,
802
+ NonAuthoritativeInformation = 203,
803
+ NoContent = 204,
804
+ ResetContent = 205,
805
+ PartialContent = 206,
806
+ MultiStatus = 207,
807
+ AlreadyReported = 208,
808
+ ImUsed = 226,
809
+ MultipleChoices = 300,
810
+ MovedPermanently = 301,
811
+ Found = 302,
812
+ SeeOther = 303,
813
+ NotModified = 304,
814
+ UseProxy = 305,
815
+ Unused = 306,
816
+ TemporaryRedirect = 307,
817
+ PermanentRedirect = 308,
818
+ BadRequest = 400,
819
+ Unauthorized = 401,
820
+ PaymentRequired = 402,
821
+ Forbidden = 403,
822
+ NotFound = 404,
823
+ MethodNotAllowed = 405,
824
+ NotAcceptable = 406,
825
+ ProxyAuthenticationRequired = 407,
826
+ RequestTimeout = 408,
827
+ Conflict = 409,
828
+ Gone = 410,
829
+ LengthRequired = 411,
830
+ PreconditionFailed = 412,
831
+ PayloadTooLarge = 413,
832
+ UriTooLong = 414,
833
+ UnsupportedMediaType = 415,
834
+ RangeNotSatisfiable = 416,
835
+ ExpectationFailed = 417,
836
+ ImATeapot = 418,
837
+ MisdirectedRequest = 421,
838
+ UnprocessableEntity = 422,
839
+ Locked = 423,
840
+ FailedDependency = 424,
841
+ TooEarly = 425,
842
+ UpgradeRequired = 426,
843
+ PreconditionRequired = 428,
844
+ TooManyRequests = 429,
845
+ RequestHeaderFieldsTooLarge = 431,
846
+ UnavailableForLegalReasons = 451,
847
+ InternalServerError = 500,
848
+ NotImplemented = 501,
849
+ BadGateway = 502,
850
+ ServiceUnavailable = 503,
851
+ GatewayTimeout = 504,
852
+ HttpVersionNotSupported = 505,
853
+ VariantAlsoNegotiates = 506,
854
+ InsufficientStorage = 507,
855
+ LoopDetected = 508,
856
+ NotExtended = 510,
857
+ NetworkAuthenticationRequired = 511
858
+ }
859
+
860
+ /**
861
+ * Configures XSRF protection support for outgoing requests.
862
+ *
863
+ * For a server that supports a cookie-based XSRF protection system,
864
+ * use directly to configure XSRF protection with the correct
865
+ * cookie and header names.
866
+ *
867
+ * If no names are supplied, the default cookie name is `XSRF-TOKEN`
868
+ * and the default header name is `X-XSRF-TOKEN`.
869
+ *
870
+ * @publicApi
871
+ * @deprecated Use withXsrfConfiguration({cookieName: 'XSRF-TOKEN', headerName: 'X-XSRF-TOKEN'}) as
872
+ * providers instead or `withNoXsrfProtection` if you want to disabled XSRF protection.
873
+ */
874
+ declare class HttpClientXsrfModule {
875
+ /**
876
+ * Disable the default XSRF protection.
877
+ */
878
+ static disable(): ModuleWithProviders<HttpClientXsrfModule>;
879
+ /**
880
+ * Configure XSRF protection.
881
+ * @param options An object that can specify either or both
882
+ * cookie name or header name.
883
+ * - Cookie name default is `XSRF-TOKEN`.
884
+ * - Header name default is `X-XSRF-TOKEN`.
885
+ *
886
+ */
887
+ static withOptions(options?: {
888
+ cookieName?: string;
889
+ headerName?: string;
890
+ }): ModuleWithProviders<HttpClientXsrfModule>;
891
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientXsrfModule, never>;
892
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HttpClientXsrfModule, never, never, never>;
893
+ static ɵinj: i0.ɵɵInjectorDeclaration<HttpClientXsrfModule>;
894
+ }
895
+ /**
896
+ * Configures the dependency injector for `HttpClient`
897
+ * with supporting services for XSRF. Automatically imported by `HttpClientModule`.
898
+ *
899
+ * You can add interceptors to the chain behind `HttpClient` by binding them to the
900
+ * multiprovider for built-in DI token `HTTP_INTERCEPTORS`.
901
+ *
902
+ * @publicApi
903
+ * @deprecated use `provideHttpClient(withInterceptorsFromDi())` as providers instead
904
+ */
905
+ declare class HttpClientModule {
906
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientModule, never>;
907
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HttpClientModule, never, never, never>;
908
+ static ɵinj: i0.ɵɵInjectorDeclaration<HttpClientModule>;
909
+ }
910
+ /**
911
+ * Configures the dependency injector for `HttpClient`
912
+ * with supporting services for JSONP.
913
+ * Without this module, Jsonp requests reach the backend
914
+ * with method JSONP, where they are rejected.
915
+ *
916
+ * @publicApi
917
+ * @deprecated `withJsonpSupport()` as providers instead
918
+ */
919
+ declare class HttpClientJsonpModule {
920
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientJsonpModule, never>;
921
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HttpClientJsonpModule, never, never, never>;
922
+ static ɵinj: i0.ɵɵInjectorDeclaration<HttpClientJsonpModule>;
923
+ }
924
+
925
+ export { HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec };
926
+ export type { HttpDownloadProgressEvent, HttpEvent, HttpParameterCodec, HttpParamsOptions, HttpProgressEvent, HttpSentEvent, HttpUploadProgressEvent, HttpUserEvent };