UNPKG

25.5 kBTypeScriptView Raw
1/**
2 * @license Angular v0.0.0
3 * (c) 2010-2024 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7
8import { BehaviorSubject } from 'rxjs';
9import { HttpBackend } from '@angular/common/http';
10import { HttpEvent } from '@angular/common/http';
11import { HttpHeaders } from '@angular/common/http';
12import { HttpRequest } from '@angular/common/http';
13import { HttpResponse } from '@angular/common/http';
14import { HttpXhrBackend } from '@angular/common/http';
15import * as i0 from '@angular/core';
16import { ModuleWithProviders } from '@angular/core';
17import { Observable } from 'rxjs';
18import { Type } from '@angular/core';
19import { XhrFactory } from '@angular/common';
20
21/**
22 * Base class for in-memory web api back-ends
23 * Simulate the behavior of a RESTy web api
24 * backed by the simple in-memory data store provided by the injected `InMemoryDbService` service.
25 * Conforms mostly to behavior described here:
26 * http://www.restapitutorial.com/lessons/httpmethods.html
27 */
28export declare abstract class BackendService {
29 protected inMemDbService: InMemoryDbService;
30 protected config: InMemoryBackendConfigArgs;
31 protected db: {
32 [key: string]: any;
33 };
34 protected dbReadySubject: BehaviorSubject<boolean> | undefined;
35 private passThruBackend;
36 protected requestInfoUtils: RequestInfoUtilities;
37 constructor(inMemDbService: InMemoryDbService, config?: InMemoryBackendConfigArgs);
38 protected get dbReady(): Observable<boolean>;
39 /**
40 * Process Request and return an Observable of Http Response object
41 * in the manner of a RESTy web api.
42 *
43 * Expect URI pattern in the form :base/:collectionName/:id?
44 * Examples:
45 * // for store with a 'customers' collection
46 * GET api/customers // all customers
47 * GET api/customers/42 // the character with id=42
48 * GET api/customers?name=^j // 'j' is a regex; returns customers whose name starts with 'j' or
49 * 'J' GET api/customers.json/42 // ignores the ".json"
50 *
51 * Also accepts direct commands to the service in which the last segment of the apiBase is the
52 * word "commands" Examples: POST commands/resetDb, GET/POST commands/config - get or (re)set the
53 * config
54 *
55 * HTTP overrides:
56 * If the injected inMemDbService defines an HTTP method (lowercase)
57 * The request is forwarded to that method as in
58 * `inMemDbService.get(requestInfo)`
59 * which must return either an Observable of the response type
60 * for this http library or null|undefined (which means "keep processing").
61 */
62 protected handleRequest(req: RequestCore): Observable<any>;
63 protected handleRequest_(req: RequestCore): Observable<any>;
64 /**
65 * Add configured delay to response observable unless delay === 0
66 */
67 protected addDelay(response: Observable<any>): Observable<any>;
68 /**
69 * Apply query/search parameters as a filter over the collection
70 * This impl only supports RegExp queries on string properties of the collection
71 * ANDs the conditions together
72 */
73 protected applyQuery(collection: any[], query: Map<string, string[]>): any[];
74 /**
75 * Get a method from the `InMemoryDbService` (if it exists), bound to that service
76 */
77 protected bind<T extends Function>(methodName: string): T | undefined;
78 protected bodify(data: any): any;
79 protected clone(data: any): any;
80 protected collectionHandler(reqInfo: RequestInfo_2): ResponseOptions;
81 /**
82 * Commands reconfigure the in-memory web api service or extract information from it.
83 * Commands ignore the latency delay and respond ASAP.
84 *
85 * When the last segment of the `apiBase` path is "commands",
86 * the `collectionName` is the command.
87 *
88 * Example URLs:
89 * commands/resetdb (POST) // Reset the "database" to its original state
90 * commands/config (GET) // Return this service's config object
91 * commands/config (POST) // Update the config (e.g. the delay)
92 *
93 * Usage:
94 * http.post('commands/resetdb', undefined);
95 * http.get('commands/config');
96 * http.post('commands/config', '{"delay":1000}');
97 */
98 protected commands(reqInfo: RequestInfo_2): Observable<any>;
99 protected createErrorResponseOptions(url: string, status: number, message: string): ResponseOptions;
100 /**
101 * Create standard HTTP headers object from hash map of header strings
102 * @param headers
103 */
104 protected abstract createHeaders(headers: {
105 [index: string]: string;
106 }): HttpHeaders;
107 /**
108 * create the function that passes unhandled requests through to the "real" backend.
109 */
110 protected abstract createPassThruBackend(): PassThruBackend;
111 /**
112 * return a search map from a location query/search string
113 */
114 protected abstract createQueryMap(search: string): Map<string, string[]>;
115 /**
116 * Create a cold response Observable from a factory for ResponseOptions
117 * @param resOptionsFactory - creates ResponseOptions when observable is subscribed
118 * @param withDelay - if true (default), add simulated latency delay from configuration
119 */
120 protected createResponse$(resOptionsFactory: () => ResponseOptions, withDelay?: boolean): Observable<any>;
121 /**
122 * Create a Response observable from ResponseOptions observable.
123 */
124 protected abstract createResponse$fromResponseOptions$(resOptions$: Observable<ResponseOptions>): Observable<any>;
125 /**
126 * Create a cold Observable of ResponseOptions.
127 * @param resOptionsFactory - creates ResponseOptions when observable is subscribed
128 */
129 protected createResponseOptions$(resOptionsFactory: () => ResponseOptions): Observable<ResponseOptions>;
130 protected delete({ collection, collectionName, headers, id, url }: RequestInfo_2): ResponseOptions;
131 /**
132 * Find first instance of item in collection by `item.id`
133 * @param collection
134 * @param id
135 */
136 protected findById<T extends {
137 id: any;
138 }>(collection: T[], id: any): T | undefined;
139 /**
140 * Generate the next available id for item in this collection
141 * Use method from `inMemDbService` if it exists and returns a value,
142 * else delegates to `genIdDefault`.
143 * @param collection - collection of items with `id` key property
144 */
145 protected genId<T extends {
146 id: any;
147 }>(collection: T[], collectionName: string): any;
148 /**
149 * Default generator of the next available id for item in this collection
150 * This default implementation works only for numeric ids.
151 * @param collection - collection of items with `id` key property
152 * @param collectionName - name of the collection
153 */
154 protected genIdDefault<T extends {
155 id: any;
156 }>(collection: T[], collectionName: string): any;
157 protected get({ collection, collectionName, headers, id, query, url, }: RequestInfo_2): ResponseOptions;
158 /** Get JSON body from the request object */
159 protected abstract getJsonBody(req: any): any;
160 /**
161 * Get location info from a url, even on server where `document` is not defined
162 */
163 protected getLocation(url: string): UriInfo;
164 /**
165 * get or create the function that passes unhandled requests
166 * through to the "real" backend.
167 */
168 protected getPassThruBackend(): PassThruBackend;
169 /**
170 * Get utility methods from this service instance.
171 * Useful within an HTTP method override
172 */
173 protected getRequestInfoUtils(): RequestInfoUtilities;
174 /**
175 * return canonical HTTP method name (lowercase) from the request object
176 * e.g. (req.method || 'get').toLowerCase();
177 * @param req - request object from the http call
178 *
179 */
180 protected abstract getRequestMethod(req: any): string;
181 protected indexOf(collection: any[], id: number): number;
182 /** Parse the id as a number. Return original value if not a number. */
183 protected parseId(collection: any[], collectionName: string, id: string): any;
184 /**
185 * return true if can determine that the collection's `item.id` is a number
186 * This implementation can't tell if the collection is empty so it assumes NO
187 * */
188 protected isCollectionIdNumeric<T extends {
189 id: any;
190 }>(collection: T[], collectionName: string): boolean;
191 /**
192 * Parses the request URL into a `ParsedRequestUrl` object.
193 * Parsing depends upon certain values of `config`: `apiBase`, `host`, and `urlRoot`.
194 *
195 * Configuring the `apiBase` yields the most interesting changes to `parseRequestUrl` behavior:
196 * When apiBase=undefined and url='http://localhost/api/collection/42'
197 * {base: 'api/', collectionName: 'collection', id: '42', ...}
198 * When apiBase='some/api/root/' and url='http://localhost/some/api/root/collection'
199 * {base: 'some/api/root/', collectionName: 'collection', id: undefined, ...}
200 * When apiBase='/' and url='http://localhost/collection'
201 * {base: '/', collectionName: 'collection', id: undefined, ...}
202 *
203 * The actual api base segment values are ignored. Only the number of segments matters.
204 * The following api base strings are considered identical: 'a/b' ~ 'some/api/' ~ `two/segments'
205 *
206 * To replace this default method, assign your alternative to your
207 * InMemDbService['parseRequestUrl']
208 */
209 protected parseRequestUrl(url: string): ParsedRequestUrl;
210 protected post({ collection, collectionName, headers, id, req, resourceUrl, url, }: RequestInfo_2): ResponseOptions;
211 protected put({ collection, collectionName, headers, id, req, url }: RequestInfo_2): ResponseOptions;
212 protected removeById(collection: any[], id: number): boolean;
213 /**
214 * Tell your in-mem "database" to reset.
215 * returns Observable of the database because resetting it could be async
216 */
217 protected resetDb(reqInfo?: RequestInfo_2): Observable<boolean>;
218}
219
220/**
221 * get the status text from StatusCode
222 */
223export declare function getStatusText(code: number): string;
224
225/**
226 * For Angular `HttpClient` simulate the behavior of a RESTy web api
227 * backed by the simple in-memory data store provided by the injected `InMemoryDbService`.
228 * Conforms mostly to behavior described here:
229 * https://www.restapitutorial.com/lessons/httpmethods.html
230 *
231 * ### Usage
232 *
233 * Create an in-memory data store class that implements `InMemoryDbService`.
234 * Call `config` static method with this service class and optional configuration object:
235 * ```
236 * // other imports
237 * import { HttpClientModule } from '@angular/common/http';
238 * import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';
239 *
240 * import { InMemHeroService, inMemConfig } from '../api/in-memory-hero.service';
241 * @NgModule({
242 * imports: [
243 * HttpModule,
244 * HttpClientInMemoryWebApiModule.forRoot(InMemHeroService, inMemConfig),
245 * ...
246 * ],
247 * ...
248 * })
249 * export class AppModule { ... }
250 * ```
251 */
252export declare class HttpClientBackendService extends BackendService implements HttpBackend {
253 private xhrFactory;
254 constructor(inMemDbService: InMemoryDbService, config: InMemoryBackendConfigArgs, xhrFactory: XhrFactory);
255 handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
256 protected getJsonBody(req: HttpRequest<any>): any;
257 protected getRequestMethod(req: HttpRequest<any>): string;
258 protected createHeaders(headers: {
259 [index: string]: string;
260 }): HttpHeaders;
261 protected createQueryMap(search: string): Map<string, string[]>;
262 protected createResponse$fromResponseOptions$(resOptions$: Observable<ResponseOptions>): Observable<HttpResponse<any>>;
263 protected createPassThruBackend(): HttpXhrBackend;
264 static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientBackendService, [null, { optional: true; }, null]>;
265 static ɵprov: i0.ɵɵInjectableDeclaration<HttpClientBackendService>;
266}
267
268export declare function httpClientInMemBackendServiceFactory(dbService: InMemoryDbService, options: InMemoryBackendConfig, xhrFactory: XhrFactory): HttpBackend;
269
270export declare class HttpClientInMemoryWebApiModule {
271 /**
272 * Redirect the Angular `HttpClient` XHR calls
273 * to in-memory data store that implements `InMemoryDbService`.
274 * with class that implements InMemoryDbService and creates an in-memory database.
275 *
276 * Usually imported in the root application module.
277 * Can import in a lazy feature module too, which will shadow modules loaded earlier
278 *
279 * Note: If you use the `FetchBackend`, make sure forRoot is invoked after in the providers list
280 *
281 * @param dbCreator - Class that creates seed data for in-memory database. Must implement
282 * InMemoryDbService.
283 * @param [options]
284 *
285 * @example
286 * HttpInMemoryWebApiModule.forRoot(dbCreator);
287 * HttpInMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}});
288 */
289 static forRoot(dbCreator: Type<InMemoryDbService>, options?: InMemoryBackendConfigArgs): ModuleWithProviders<HttpClientInMemoryWebApiModule>;
290 /**
291 *
292 * Enable and configure the in-memory web api in a lazy-loaded feature module.
293 * Same as `forRoot`.
294 * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules.
295 */
296 static forFeature(dbCreator: Type<InMemoryDbService>, options?: InMemoryBackendConfigArgs): ModuleWithProviders<HttpClientInMemoryWebApiModule>;
297 static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientInMemoryWebApiModule, never>;
298 static ɵmod: i0.ɵɵNgModuleDeclaration<HttpClientInMemoryWebApiModule, never, never, never>;
299 static ɵinj: i0.ɵɵInjectorDeclaration<HttpClientInMemoryWebApiModule>;
300}
301
302/**
303 * InMemoryBackendService configuration options
304 * Usage:
305 * InMemoryWebApiModule.forRoot(InMemHeroService, {delay: 600})
306 *
307 * or if providing separately:
308 * provide(InMemoryBackendConfig, {useValue: {delay: 600}}),
309 */
310export declare class InMemoryBackendConfig implements InMemoryBackendConfigArgs {
311 constructor(config?: InMemoryBackendConfigArgs);
312 static ɵfac: i0.ɵɵFactoryDeclaration<InMemoryBackendConfig, never>;
313 static ɵprov: i0.ɵɵInjectableDeclaration<InMemoryBackendConfig>;
314}
315
316/**
317 * Interface for InMemoryBackend configuration options
318 */
319export declare abstract class InMemoryBackendConfigArgs {
320 /**
321 * The base path to the api, e.g, 'api/'.
322 * If not specified than `parseRequestUrl` assumes it is the first path segment in the request.
323 */
324 apiBase?: string;
325 /**
326 * false (default) if search match should be case insensitive
327 */
328 caseSensitiveSearch?: boolean;
329 /**
330 * false (default) put content directly inside the response body.
331 * true: encapsulate content in a `data` property inside the response body, `{ data: ... }`.
332 */
333 dataEncapsulation?: boolean;
334 /**
335 * delay (in ms) to simulate latency
336 */
337 delay?: number;
338 /**
339 * false (default) should 204 when object-to-delete not found; true: 404
340 */
341 delete404?: boolean;
342 /**
343 * host for this service, e.g., 'localhost'
344 */
345 host?: string;
346 /**
347 * true, should pass unrecognized request URL through to original backend; false (default): 404
348 */
349 passThruUnknownUrl?: boolean;
350 /**
351 * true (default) should NOT return the item (204) after a POST. false: return the item (200).
352 */
353 post204?: boolean;
354 /**
355 * false (default) should NOT update existing item with POST. false: OK to update.
356 */
357 post409?: boolean;
358 /**
359 * true (default) should NOT return the item (204) after a POST. false: return the item (200).
360 */
361 put204?: boolean;
362 /**
363 * false (default) if item not found, create as new item; false: should 404.
364 */
365 put404?: boolean;
366 /**
367 * root path _before_ any API call, e.g., ''
368 */
369 rootPath?: string;
370}
371
372/**
373 * Interface for a class that creates an in-memory database
374 *
375 * Its `createDb` method creates a hash of named collections that represents the database
376 *
377 * For maximum flexibility, the service may define HTTP method overrides.
378 * Such methods must match the spelling of an HTTP method in lower case (e.g, "get").
379 * If a request has a matching method, it will be called as in
380 * `get(info: requestInfo, db: {})` where `db` is the database object described above.
381 */
382export declare abstract class InMemoryDbService {
383 /**
384 * Creates an in-memory "database" hash whose keys are collection names
385 * and whose values are arrays of collection objects to return or update.
386 *
387 * returns Observable of the database because could have to create it asynchronously.
388 *
389 * This method must be safe to call repeatedly.
390 * Each time it should return a new object with new arrays containing new item objects.
391 * This condition allows the in-memory backend service to mutate the collections
392 * and their items without touching the original source data.
393 *
394 * The in-mem backend service calls this method without a value the first time.
395 * The service calls it with the `RequestInfo` when it receives a POST `commands/resetDb` request.
396 * Your InMemoryDbService can adjust its behavior accordingly.
397 */
398 abstract createDb(reqInfo?: RequestInfo_2): {} | Observable<{}> | Promise<{}>;
399}
400
401export declare class InMemoryWebApiModule {
402 /**
403 * Redirect BOTH Angular `Http` and `HttpClient` XHR calls
404 * to in-memory data store that implements `InMemoryDbService`.
405 * with class that implements InMemoryDbService and creates an in-memory database.
406 *
407 * Usually imported in the root application module.
408 * Can import in a lazy feature module too, which will shadow modules loaded earlier
409 *
410 * Note: If you use the `FetchBackend`, make sure forRoot is invoked after in the providers list
411 *
412 * @param dbCreator - Class that creates seed data for in-memory database. Must implement
413 * InMemoryDbService.
414 * @param [options]
415 *
416 * @example
417 * InMemoryWebApiModule.forRoot(dbCreator);
418 * InMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}});
419 */
420 static forRoot(dbCreator: Type<InMemoryDbService>, options?: InMemoryBackendConfigArgs): ModuleWithProviders<InMemoryWebApiModule>;
421 /**
422 *
423 * Enable and configure the in-memory web api in a lazy-loaded feature module.
424 * Same as `forRoot`.
425 * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules.
426 */
427 static forFeature(dbCreator: Type<InMemoryDbService>, options?: InMemoryBackendConfigArgs): ModuleWithProviders<InMemoryWebApiModule>;
428 static ɵfac: i0.ɵɵFactoryDeclaration<InMemoryWebApiModule, never>;
429 static ɵmod: i0.ɵɵNgModuleDeclaration<InMemoryWebApiModule, never, never, never>;
430 static ɵinj: i0.ɵɵInjectorDeclaration<InMemoryWebApiModule>;
431}
432
433/**
434 * Returns true if the Http Status Code is 200-299 (success)
435 */
436export declare function isSuccess(status: number): boolean;
437
438/**
439 *
440 * Interface for the result of the `parseRequestUrl` method:
441 * Given URL "http://localhost:8080/api/customers/42?foo=1 the default implementation returns
442 * base: 'api/'
443 * collectionName: 'customers'
444 * id: '42'
445 * query: this.createQuery('foo=1')
446 * resourceUrl: 'http://localhost/api/customers/'
447 */
448export declare interface ParsedRequestUrl {
449 apiBase: string;
450 collectionName: string;
451 id: string;
452 query: Map<string, string[]>;
453 resourceUrl: string;
454}
455
456/** Return information (UriInfo) about a URI */
457export declare function parseUri(str: string): UriInfo;
458
459export declare interface PassThruBackend {
460 /**
461 * Handle an HTTP request and return an Observable of HTTP response
462 * Both the request type and the response type are determined by the supporting HTTP library.
463 */
464 handle(req: any): Observable<any>;
465}
466
467export declare function removeTrailingSlash(path: string): string;
468
469/**
470 * Minimum definition needed by base class
471 */
472export declare interface RequestCore {
473 url: string;
474 urlWithParams?: string;
475}
476
477/**
478 * Interface for object w/ info about the current request url
479 * extracted from an Http Request.
480 * Also holds utility methods and configuration data from this service
481 */
482declare interface RequestInfo_2 {
483 req: RequestCore;
484 apiBase: string;
485 collectionName: string;
486 collection: any;
487 headers: HttpHeaders;
488 method: string;
489 id: any;
490 query: Map<string, string[]>;
491 resourceUrl: string;
492 url: string;
493 utils: RequestInfoUtilities;
494}
495export { RequestInfo_2 as RequestInfo }
496
497/**
498 * Interface for utility methods from this service instance.
499 * Useful within an HTTP method override
500 */
501export declare interface RequestInfoUtilities {
502 /**
503 * Create a cold response Observable from a factory for ResponseOptions
504 * the same way that the in-mem backend service does.
505 * @param resOptionsFactory - creates ResponseOptions when observable is subscribed
506 * @param withDelay - if true (default), add simulated latency delay from configuration
507 */
508 createResponse$: (resOptionsFactory: () => ResponseOptions) => Observable<any>;
509 /**
510 * Find first instance of item in collection by `item.id`
511 * @param collection
512 * @param id
513 */
514 findById<T extends {
515 id: any;
516 }>(collection: T[], id: any): T | undefined;
517 /** return the current, active configuration which is a blend of defaults and overrides */
518 getConfig(): InMemoryBackendConfigArgs;
519 /** Get the in-mem service's copy of the "database" */
520 getDb(): {};
521 /** Get JSON body from the request object */
522 getJsonBody(req: any): any;
523 /** Get location info from a url, even on server where `document` is not defined */
524 getLocation(url: string): UriInfo;
525 /** Get (or create) the "real" backend */
526 getPassThruBackend(): PassThruBackend;
527 /**
528 * return true if can determine that the collection's `item.id` is a number
529 * */
530 isCollectionIdNumeric<T extends {
531 id: any;
532 }>(collection: T[], collectionName: string): boolean;
533 /**
534 * Parses the request URL into a `ParsedRequestUrl` object.
535 * Parsing depends upon certain values of `config`: `apiBase`, `host`, and `urlRoot`.
536 */
537 parseRequestUrl(url: string): ParsedRequestUrl;
538}
539
540/**
541 * Provide a `responseInterceptor` method of this type in your `inMemDbService` to
542 * morph the response options created in the `collectionHandler`.
543 */
544export declare type ResponseInterceptor = (res: ResponseOptions, ri: RequestInfo_2) => ResponseOptions;
545
546export declare interface ResponseOptions {
547 /**
548 * String, Object, ArrayBuffer or Blob representing the body of the {@link Response}.
549 */
550 body?: string | Object | ArrayBuffer | Blob;
551 /**
552 * Response headers
553 */
554 headers?: HttpHeaders;
555 /**
556 * Http {@link https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html status code}
557 * associated with the response.
558 */
559 status?: number;
560 /**
561 * Status text for the status code
562 */
563 statusText?: string;
564 /**
565 * request url
566 */
567 url?: string;
568}
569
570
571export declare const STATUS: {
572 CONTINUE: number;
573 SWITCHING_PROTOCOLS: number;
574 OK: number;
575 CREATED: number;
576 ACCEPTED: number;
577 NON_AUTHORITATIVE_INFORMATION: number;
578 NO_CONTENT: number;
579 RESET_CONTENT: number;
580 PARTIAL_CONTENT: number;
581 MULTIPLE_CHOICES: number;
582 MOVED_PERMANTENTLY: number;
583 FOUND: number;
584 SEE_OTHER: number;
585 NOT_MODIFIED: number;
586 USE_PROXY: number;
587 TEMPORARY_REDIRECT: number;
588 BAD_REQUEST: number;
589 UNAUTHORIZED: number;
590 PAYMENT_REQUIRED: number;
591 FORBIDDEN: number;
592 NOT_FOUND: number;
593 METHOD_NOT_ALLOWED: number;
594 NOT_ACCEPTABLE: number;
595 PROXY_AUTHENTICATION_REQUIRED: number;
596 REQUEST_TIMEOUT: number;
597 CONFLICT: number;
598 GONE: number;
599 LENGTH_REQUIRED: number;
600 PRECONDITION_FAILED: number;
601 PAYLOAD_TO_LARGE: number;
602 URI_TOO_LONG: number;
603 UNSUPPORTED_MEDIA_TYPE: number;
604 RANGE_NOT_SATISFIABLE: number;
605 EXPECTATION_FAILED: number;
606 IM_A_TEAPOT: number;
607 UPGRADE_REQUIRED: number;
608 INTERNAL_SERVER_ERROR: number;
609 NOT_IMPLEMENTED: number;
610 BAD_GATEWAY: number;
611 SERVICE_UNAVAILABLE: number;
612 GATEWAY_TIMEOUT: number;
613 HTTP_VERSION_NOT_SUPPORTED: number;
614 PROCESSING: number;
615 MULTI_STATUS: number;
616 IM_USED: number;
617 PERMANENT_REDIRECT: number;
618 UNPROCESSABLE_ENTRY: number;
619 LOCKED: number;
620 FAILED_DEPENDENCY: number;
621 PRECONDITION_REQUIRED: number;
622 TOO_MANY_REQUESTS: number;
623 REQUEST_HEADER_FIELDS_TOO_LARGE: number;
624 UNAVAILABLE_FOR_LEGAL_REASONS: number;
625 VARIANT_ALSO_NEGOTIATES: number;
626 INSUFFICIENT_STORAGE: number;
627 NETWORK_AUTHENTICATION_REQUIRED: number;
628};
629
630export declare const STATUS_CODE_INFO: {
631 [key: string]: {
632 code: number;
633 text: string;
634 description: string;
635 spec_title: string;
636 spec_href: string;
637 };
638};
639
640/** Interface of information about a Uri */
641export declare interface UriInfo {
642 source: string;
643 protocol: string;
644 authority: string;
645 userInfo: string;
646 user: string;
647 password: string;
648 host: string;
649 port: string;
650 relative: string;
651 path: string;
652 directory: string;
653 file: string;
654 query: string;
655 anchor: string;
656}
657
658export { }