@angular/common 14.0.0-next.14 → 14.0.0-next.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/http/src/client.mjs +3 -3
- package/esm2020/http/src/interceptor.mjs +3 -3
- package/esm2020/http/src/jsonp.mjs +6 -6
- package/esm2020/http/src/module.mjs +20 -22
- package/esm2020/http/src/xhr.mjs +3 -3
- package/esm2020/http/src/xsrf.mjs +6 -6
- package/esm2020/http/testing/src/backend.mjs +3 -3
- package/esm2020/http/testing/src/module.mjs +6 -8
- package/esm2020/src/common_module.mjs +4 -4
- package/esm2020/src/directives/ng_class.mjs +3 -3
- package/esm2020/src/directives/ng_component_outlet.mjs +3 -3
- package/esm2020/src/directives/ng_for_of.mjs +3 -3
- package/esm2020/src/directives/ng_if.mjs +3 -3
- package/esm2020/src/directives/ng_plural.mjs +6 -6
- package/esm2020/src/directives/ng_style.mjs +3 -3
- package/esm2020/src/directives/ng_switch.mjs +9 -9
- package/esm2020/src/directives/ng_template_outlet.mjs +3 -3
- package/esm2020/src/i18n/localization.mjs +6 -6
- package/esm2020/src/location/hash_location_strategy.mjs +7 -4
- package/esm2020/src/location/location.mjs +18 -21
- package/esm2020/src/location/location_strategy.mjs +11 -8
- package/esm2020/src/location/platform_location.mjs +6 -6
- package/esm2020/src/pipes/async_pipe.mjs +3 -3
- package/esm2020/src/pipes/case_conversion_pipes.mjs +9 -9
- package/esm2020/src/pipes/date_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_plural_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2020/src/pipes/json_pipe.mjs +3 -3
- package/esm2020/src/pipes/keyvalue_pipe.mjs +3 -3
- package/esm2020/src/pipes/number_pipe.mjs +9 -9
- package/esm2020/src/pipes/slice_pipe.mjs +3 -3
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/location_mock.mjs +5 -7
- package/esm2020/testing/src/mock_location_strategy.mjs +3 -3
- package/esm2020/testing/src/mock_platform_location.mjs +3 -3
- package/esm2020/upgrade/src/location_upgrade_module.mjs +5 -5
- package/fesm2015/common.mjs +123 -118
- package/fesm2015/common.mjs.map +1 -1
- package/fesm2015/http/testing.mjs +9 -11
- package/fesm2015/http/testing.mjs.map +1 -1
- package/fesm2015/http.mjs +41 -43
- package/fesm2015/http.mjs.map +1 -1
- package/fesm2015/testing.mjs +11 -13
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +5 -5
- package/fesm2015/upgrade.mjs.map +1 -1
- package/fesm2020/common.mjs +123 -118
- package/fesm2020/common.mjs.map +1 -1
- package/fesm2020/http/testing.mjs +9 -11
- package/fesm2020/http/testing.mjs.map +1 -1
- package/fesm2020/http.mjs +41 -43
- package/fesm2020/http.mjs.map +1 -1
- package/fesm2020/testing.mjs +11 -13
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +5 -5
- package/fesm2020/upgrade.mjs.map +1 -1
- package/http/{http.d.ts → index.d.ts} +4007 -4006
- package/http/testing/{testing.d.ts → index.d.ts} +177 -176
- package/{common.d.ts → index.d.ts} +2870 -2866
- package/package.json +8 -8
- package/testing/{testing.d.ts → index.d.ts} +121 -120
- package/upgrade/{upgrade.d.ts → index.d.ts} +445 -444
- package/http/package.json +0 -10
- package/http/testing/package.json +0 -9
- package/locales/package.json +0 -4
- package/testing/package.json +0 -9
- package/upgrade/package.json +0 -10
|
@@ -1,449 +1,450 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.15
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private $$
|
|
33
|
-
private $$
|
|
34
|
-
private $$
|
|
35
|
-
private $$
|
|
36
|
-
private $$
|
|
37
|
-
private $$
|
|
38
|
-
private $$
|
|
39
|
-
private $$
|
|
40
|
-
private $$
|
|
41
|
-
private $$
|
|
42
|
-
private
|
|
43
|
-
private
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
private
|
|
47
|
-
private
|
|
48
|
-
private
|
|
49
|
-
private
|
|
50
|
-
private
|
|
51
|
-
private
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
private
|
|
59
|
-
private
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @param
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* @param
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
private
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
url(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
path(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
hash(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
*
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
state(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
private
|
|
257
|
-
private
|
|
258
|
-
private
|
|
259
|
-
private
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
*
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
*
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
* and
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
normalize(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
*
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
static
|
|
357
|
-
static
|
|
358
|
-
static
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* @param
|
|
419
|
-
* @param
|
|
420
|
-
* @param
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
*
|
|
428
|
-
* @param
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
* @param
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
7
|
+
|
|
8
|
+
import * as i0 from '@angular/core';
|
|
9
|
+
import * as i1 from '@angular/common';
|
|
10
|
+
import { InjectionToken } from '@angular/core';
|
|
11
|
+
import { Location as Location_2 } from '@angular/common';
|
|
12
|
+
import { LocationStrategy } from '@angular/common';
|
|
13
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
14
|
+
import { PlatformLocation } from '@angular/common';
|
|
15
|
+
import { UpgradeModule } from '@angular/upgrade/static';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Location service that provides a drop-in replacement for the $location service
|
|
19
|
+
* provided in AngularJS.
|
|
20
|
+
*
|
|
21
|
+
* @see [Using the Angular Unified Location Service](guide/upgrade#using-the-unified-angular-location-service)
|
|
22
|
+
*
|
|
23
|
+
* @publicApi
|
|
24
|
+
*/
|
|
25
|
+
export declare class $locationShim {
|
|
26
|
+
private location;
|
|
27
|
+
private platformLocation;
|
|
28
|
+
private urlCodec;
|
|
29
|
+
private locationStrategy;
|
|
30
|
+
private initalizing;
|
|
31
|
+
private updateBrowser;
|
|
32
|
+
private $$absUrl;
|
|
33
|
+
private $$url;
|
|
34
|
+
private $$protocol;
|
|
35
|
+
private $$host;
|
|
36
|
+
private $$port;
|
|
37
|
+
private $$replace;
|
|
38
|
+
private $$path;
|
|
39
|
+
private $$search;
|
|
40
|
+
private $$hash;
|
|
41
|
+
private $$state;
|
|
42
|
+
private $$changeListeners;
|
|
43
|
+
private cachedState;
|
|
44
|
+
private urlChanges;
|
|
45
|
+
constructor($injector: any, location: Location_2, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy);
|
|
46
|
+
private initialize;
|
|
47
|
+
private resetBrowserUpdate;
|
|
48
|
+
private lastHistoryState;
|
|
49
|
+
private lastBrowserUrl;
|
|
50
|
+
private browserUrl;
|
|
51
|
+
private lastCachedState;
|
|
52
|
+
private cacheState;
|
|
53
|
+
/**
|
|
54
|
+
* This function emulates the $browser.state() function from AngularJS. It will cause
|
|
55
|
+
* history.state to be cached unless changed with deep equality check.
|
|
56
|
+
*/
|
|
57
|
+
private browserState;
|
|
58
|
+
private stripBaseUrl;
|
|
59
|
+
private getServerBase;
|
|
60
|
+
private parseAppUrl;
|
|
61
|
+
/**
|
|
62
|
+
* Registers listeners for URL changes. This API is used to catch updates performed by the
|
|
63
|
+
* AngularJS framework. These changes are a subset of the `$locationChangeStart` and
|
|
64
|
+
* `$locationChangeSuccess` events which fire when AngularJS updates its internally-referenced
|
|
65
|
+
* version of the browser URL.
|
|
66
|
+
*
|
|
67
|
+
* It's possible for `$locationChange` events to happen, but for the browser URL
|
|
68
|
+
* (window.location) to remain unchanged. This `onChange` callback will fire only when AngularJS
|
|
69
|
+
* actually updates the browser URL (window.location).
|
|
70
|
+
*
|
|
71
|
+
* @param fn The callback function that is triggered for the listener when the URL changes.
|
|
72
|
+
* @param err The callback function that is triggered when an error occurs.
|
|
73
|
+
*/
|
|
74
|
+
onChange(fn: (url: string, state: unknown, oldUrl: string, oldState: unknown) => void, err?: (e: Error) => void): void;
|
|
75
|
+
/**
|
|
76
|
+
* Parses the provided URL, and sets the current URL to the parsed result.
|
|
77
|
+
*
|
|
78
|
+
* @param url The URL string.
|
|
79
|
+
*/
|
|
80
|
+
$$parse(url: string): void;
|
|
81
|
+
/**
|
|
82
|
+
* Parses the provided URL and its relative URL.
|
|
83
|
+
*
|
|
84
|
+
* @param url The full URL string.
|
|
85
|
+
* @param relHref A URL string relative to the full URL string.
|
|
86
|
+
*/
|
|
87
|
+
$$parseLinkUrl(url: string, relHref?: string | null): boolean;
|
|
88
|
+
private setBrowserUrlWithFallback;
|
|
89
|
+
private composeUrls;
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves the full URL representation with all segments encoded according to
|
|
92
|
+
* rules specified in
|
|
93
|
+
* [RFC 3986](https://tools.ietf.org/html/rfc3986).
|
|
94
|
+
*
|
|
95
|
+
*
|
|
96
|
+
* ```js
|
|
97
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
|
|
98
|
+
* let absUrl = $location.absUrl();
|
|
99
|
+
* // => "http://example.com/#/some/path?foo=bar&baz=xoxo"
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
absUrl(): string;
|
|
103
|
+
/**
|
|
104
|
+
* Retrieves the current URL, or sets a new URL. When setting a URL,
|
|
105
|
+
* changes the path, search, and hash, and returns a reference to its own instance.
|
|
106
|
+
*
|
|
107
|
+
* ```js
|
|
108
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
|
|
109
|
+
* let url = $location.url();
|
|
110
|
+
* // => "/some/path?foo=bar&baz=xoxo"
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
url(): string;
|
|
114
|
+
url(url: string): this;
|
|
115
|
+
/**
|
|
116
|
+
* Retrieves the protocol of the current URL.
|
|
117
|
+
*
|
|
118
|
+
* ```js
|
|
119
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
|
|
120
|
+
* let protocol = $location.protocol();
|
|
121
|
+
* // => "http"
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
protocol(): string;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieves the protocol of the current URL.
|
|
127
|
+
*
|
|
128
|
+
* In contrast to the non-AngularJS version `location.host` which returns `hostname:port`, this
|
|
129
|
+
* returns the `hostname` portion only.
|
|
130
|
+
*
|
|
131
|
+
*
|
|
132
|
+
* ```js
|
|
133
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
|
|
134
|
+
* let host = $location.host();
|
|
135
|
+
* // => "example.com"
|
|
136
|
+
*
|
|
137
|
+
* // given URL http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo
|
|
138
|
+
* host = $location.host();
|
|
139
|
+
* // => "example.com"
|
|
140
|
+
* host = location.host;
|
|
141
|
+
* // => "example.com:8080"
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
host(): string;
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves the port of the current URL.
|
|
147
|
+
*
|
|
148
|
+
* ```js
|
|
149
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
|
|
150
|
+
* let port = $location.port();
|
|
151
|
+
* // => 80
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
port(): number | null;
|
|
155
|
+
/**
|
|
156
|
+
* Retrieves the path of the current URL, or changes the path and returns a reference to its own
|
|
157
|
+
* instance.
|
|
158
|
+
*
|
|
159
|
+
* Paths should always begin with forward slash (/). This method adds the forward slash
|
|
160
|
+
* if it is missing.
|
|
161
|
+
*
|
|
162
|
+
* ```js
|
|
163
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
|
|
164
|
+
* let path = $location.path();
|
|
165
|
+
* // => "/some/path"
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
path(): string;
|
|
169
|
+
path(path: string | number | null): this;
|
|
170
|
+
/**
|
|
171
|
+
* Retrieves a map of the search parameters of the current URL, or changes a search
|
|
172
|
+
* part and returns a reference to its own instance.
|
|
173
|
+
*
|
|
174
|
+
*
|
|
175
|
+
* ```js
|
|
176
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
|
|
177
|
+
* let searchObject = $location.search();
|
|
178
|
+
* // => {foo: 'bar', baz: 'xoxo'}
|
|
179
|
+
*
|
|
180
|
+
* // set foo to 'yipee'
|
|
181
|
+
* $location.search('foo', 'yipee');
|
|
182
|
+
* // $location.search() => {foo: 'yipee', baz: 'xoxo'}
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or
|
|
186
|
+
* hash object.
|
|
187
|
+
*
|
|
188
|
+
* When called with a single argument the method acts as a setter, setting the `search` component
|
|
189
|
+
* of `$location` to the specified value.
|
|
190
|
+
*
|
|
191
|
+
* If the argument is a hash object containing an array of values, these values will be encoded
|
|
192
|
+
* as duplicate search parameters in the URL.
|
|
193
|
+
*
|
|
194
|
+
* @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number,
|
|
195
|
+
* then `paramValue`
|
|
196
|
+
* will override only a single search property.
|
|
197
|
+
*
|
|
198
|
+
* If `paramValue` is an array, it will override the property of the `search` component of
|
|
199
|
+
* `$location` specified via the first argument.
|
|
200
|
+
*
|
|
201
|
+
* If `paramValue` is `null`, the property specified via the first argument will be deleted.
|
|
202
|
+
*
|
|
203
|
+
* If `paramValue` is `true`, the property specified via the first argument will be added with no
|
|
204
|
+
* value nor trailing equal sign.
|
|
205
|
+
*
|
|
206
|
+
* @return {Object} The parsed `search` object of the current URL, or the changed `search` object.
|
|
207
|
+
*/
|
|
208
|
+
search(): {
|
|
209
|
+
[key: string]: unknown;
|
|
210
|
+
};
|
|
211
|
+
search(search: string | number | {
|
|
212
|
+
[key: string]: unknown;
|
|
213
|
+
}): this;
|
|
214
|
+
search(search: string | number | {
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
}, paramValue: null | undefined | string | number | boolean | string[]): this;
|
|
217
|
+
/**
|
|
218
|
+
* Retrieves the current hash fragment, or changes the hash fragment and returns a reference to
|
|
219
|
+
* its own instance.
|
|
220
|
+
*
|
|
221
|
+
* ```js
|
|
222
|
+
* // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue
|
|
223
|
+
* let hash = $location.hash();
|
|
224
|
+
* // => "hashValue"
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
hash(): string;
|
|
228
|
+
hash(hash: string | number | null): this;
|
|
229
|
+
/**
|
|
230
|
+
* Changes to `$location` during the current `$digest` will replace the current
|
|
231
|
+
* history record, instead of adding a new one.
|
|
232
|
+
*/
|
|
233
|
+
replace(): this;
|
|
234
|
+
/**
|
|
235
|
+
* Retrieves the history state object when called without any parameter.
|
|
236
|
+
*
|
|
237
|
+
* Change the history state object when called with one parameter and return `$location`.
|
|
238
|
+
* The state object is later passed to `pushState` or `replaceState`.
|
|
239
|
+
*
|
|
240
|
+
* This method is supported only in HTML5 mode and only in browsers supporting
|
|
241
|
+
* the HTML5 History API methods such as `pushState` and `replaceState`. If you need to support
|
|
242
|
+
* older browsers (like Android < 4.0), don't use this method.
|
|
243
|
+
*
|
|
244
|
+
*/
|
|
245
|
+
state(): unknown;
|
|
246
|
+
state(state: unknown): this;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* The factory function used to create an instance of the `$locationShim` in Angular,
|
|
251
|
+
* and provides an API-compatiable `$locationProvider` for AngularJS.
|
|
252
|
+
*
|
|
253
|
+
* @publicApi
|
|
254
|
+
*/
|
|
255
|
+
export declare class $locationShimProvider {
|
|
256
|
+
private ngUpgrade;
|
|
257
|
+
private location;
|
|
258
|
+
private platformLocation;
|
|
259
|
+
private urlCodec;
|
|
260
|
+
private locationStrategy;
|
|
261
|
+
constructor(ngUpgrade: UpgradeModule, location: Location_2, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy);
|
|
262
|
+
/**
|
|
263
|
+
* Factory method that returns an instance of the $locationShim
|
|
264
|
+
*/
|
|
265
|
+
$get(): $locationShim;
|
|
266
|
+
/**
|
|
267
|
+
* Stub method used to keep API compatible with AngularJS. This setting is configured through
|
|
268
|
+
* the LocationUpgradeModule's `config` method in your Angular app.
|
|
269
|
+
*/
|
|
270
|
+
hashPrefix(prefix?: string): void;
|
|
271
|
+
/**
|
|
272
|
+
* Stub method used to keep API compatible with AngularJS. This setting is configured through
|
|
273
|
+
* the LocationUpgradeModule's `config` method in your Angular app.
|
|
274
|
+
*/
|
|
275
|
+
html5Mode(mode?: any): void;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* A `UrlCodec` that uses logic from AngularJS to serialize and parse URLs
|
|
280
|
+
* and URL parameters.
|
|
281
|
+
*
|
|
282
|
+
* @publicApi
|
|
283
|
+
*/
|
|
284
|
+
export declare class AngularJSUrlCodec implements UrlCodec {
|
|
285
|
+
encodePath(path: string): string;
|
|
286
|
+
encodeSearch(search: string | {
|
|
287
|
+
[k: string]: unknown;
|
|
288
|
+
}): string;
|
|
289
|
+
encodeHash(hash: string): string;
|
|
290
|
+
decodePath(path: string, html5Mode?: boolean): string;
|
|
291
|
+
decodeSearch(search: string): {
|
|
292
|
+
[k: string]: unknown;
|
|
293
|
+
};
|
|
294
|
+
decodeHash(hash: string): string;
|
|
295
|
+
normalize(href: string): string;
|
|
296
|
+
normalize(path: string, search: {
|
|
297
|
+
[k: string]: unknown;
|
|
298
|
+
}, hash: string, baseUrl?: string): string;
|
|
299
|
+
areEqual(valA: string, valB: string): boolean;
|
|
300
|
+
parse(url: string, base?: string): {
|
|
301
|
+
href: string;
|
|
302
|
+
protocol: string;
|
|
303
|
+
host: string;
|
|
304
|
+
search: string;
|
|
305
|
+
hash: string;
|
|
306
|
+
hostname: string;
|
|
307
|
+
port: string;
|
|
308
|
+
pathname: string;
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* A provider token used to configure the location upgrade module.
|
|
314
|
+
*
|
|
315
|
+
* @publicApi
|
|
316
|
+
*/
|
|
317
|
+
export declare const LOCATION_UPGRADE_CONFIGURATION: InjectionToken<LocationUpgradeConfig>;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Configuration options for LocationUpgrade.
|
|
321
|
+
*
|
|
322
|
+
* @publicApi
|
|
323
|
+
*/
|
|
324
|
+
export declare interface LocationUpgradeConfig {
|
|
325
|
+
/**
|
|
326
|
+
* Configures whether the location upgrade module should use the `HashLocationStrategy`
|
|
327
|
+
* or the `PathLocationStrategy`
|
|
328
|
+
*/
|
|
329
|
+
useHash?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Configures the hash prefix used in the URL when using the `HashLocationStrategy`
|
|
332
|
+
*/
|
|
333
|
+
hashPrefix?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Configures the URL codec for encoding and decoding URLs. Default is the `AngularJSCodec`
|
|
336
|
+
*/
|
|
337
|
+
urlCodec?: typeof UrlCodec;
|
|
338
|
+
/**
|
|
339
|
+
* Configures the base href when used in server-side rendered applications
|
|
340
|
+
*/
|
|
341
|
+
serverBaseHref?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Configures the base href when used in client-side rendered applications
|
|
344
|
+
*/
|
|
345
|
+
appBaseHref?: string;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* `NgModule` used for providing and configuring Angular's Unified Location Service for upgrading.
|
|
350
|
+
*
|
|
351
|
+
* @see [Using the Unified Angular Location Service](guide/upgrade#using-the-unified-angular-location-service)
|
|
352
|
+
*
|
|
353
|
+
* @publicApi
|
|
354
|
+
*/
|
|
355
|
+
export declare class LocationUpgradeModule {
|
|
356
|
+
static config(config?: LocationUpgradeConfig): ModuleWithProviders<LocationUpgradeModule>;
|
|
357
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocationUpgradeModule, never>;
|
|
358
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LocationUpgradeModule, never, [typeof i1.CommonModule], never>;
|
|
359
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<LocationUpgradeModule>;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* A codec for encoding and decoding URL parts.
|
|
365
|
+
*
|
|
366
|
+
* @publicApi
|
|
367
|
+
**/
|
|
368
|
+
export declare abstract class UrlCodec {
|
|
369
|
+
/**
|
|
370
|
+
* Encodes the path from the provided string
|
|
371
|
+
*
|
|
372
|
+
* @param path The path string
|
|
373
|
+
*/
|
|
374
|
+
abstract encodePath(path: string): string;
|
|
375
|
+
/**
|
|
376
|
+
* Decodes the path from the provided string
|
|
377
|
+
*
|
|
378
|
+
* @param path The path string
|
|
379
|
+
*/
|
|
380
|
+
abstract decodePath(path: string): string;
|
|
381
|
+
/**
|
|
382
|
+
* Encodes the search string from the provided string or object
|
|
383
|
+
*
|
|
384
|
+
* @param path The path string or object
|
|
385
|
+
*/
|
|
386
|
+
abstract encodeSearch(search: string | {
|
|
387
|
+
[k: string]: unknown;
|
|
388
|
+
}): string;
|
|
389
|
+
/**
|
|
390
|
+
* Decodes the search objects from the provided string
|
|
391
|
+
*
|
|
392
|
+
* @param path The path string
|
|
393
|
+
*/
|
|
394
|
+
abstract decodeSearch(search: string): {
|
|
395
|
+
[k: string]: unknown;
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* Encodes the hash from the provided string
|
|
399
|
+
*
|
|
400
|
+
* @param path The hash string
|
|
401
|
+
*/
|
|
402
|
+
abstract encodeHash(hash: string): string;
|
|
403
|
+
/**
|
|
404
|
+
* Decodes the hash from the provided string
|
|
405
|
+
*
|
|
406
|
+
* @param path The hash string
|
|
407
|
+
*/
|
|
408
|
+
abstract decodeHash(hash: string): string;
|
|
409
|
+
/**
|
|
410
|
+
* Normalizes the URL from the provided string
|
|
411
|
+
*
|
|
412
|
+
* @param path The URL string
|
|
413
|
+
*/
|
|
414
|
+
abstract normalize(href: string): string;
|
|
415
|
+
/**
|
|
416
|
+
* Normalizes the URL from the provided string, search, hash, and base URL parameters
|
|
417
|
+
*
|
|
418
|
+
* @param path The URL path
|
|
419
|
+
* @param search The search object
|
|
420
|
+
* @param hash The has string
|
|
421
|
+
* @param baseUrl The base URL for the URL
|
|
422
|
+
*/
|
|
423
|
+
abstract normalize(path: string, search: {
|
|
424
|
+
[k: string]: unknown;
|
|
425
|
+
}, hash: string, baseUrl?: string): string;
|
|
426
|
+
/**
|
|
427
|
+
* Checks whether the two strings are equal
|
|
428
|
+
* @param valA First string for comparison
|
|
429
|
+
* @param valB Second string for comparison
|
|
430
|
+
*/
|
|
431
|
+
abstract areEqual(valA: string, valB: string): boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Parses the URL string based on the base URL
|
|
434
|
+
*
|
|
435
|
+
* @param url The full URL string
|
|
436
|
+
* @param base The base for the URL
|
|
437
|
+
*/
|
|
438
|
+
abstract parse(url: string, base?: string): {
|
|
439
|
+
href: string;
|
|
440
|
+
protocol: string;
|
|
441
|
+
host: string;
|
|
442
|
+
search: string;
|
|
443
|
+
hash: string;
|
|
444
|
+
hostname: string;
|
|
445
|
+
port: string;
|
|
446
|
+
pathname: string;
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export { }
|