angular-toolbox 0.11.0 → 0.11.2

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.
@@ -27,4 +27,10 @@ export interface RouteMockConfig {
27
27
  * The list of URI parameters associated with the current HTTP call.
28
28
  */
29
29
  parameters: HttpMockParameters | null;
30
+ /**
31
+ * @private
32
+ *
33
+ * The list of URI search parameters associated with the current HTTP call.
34
+ */
35
+ searchParams: URLSearchParams;
30
36
  }
@@ -19,7 +19,7 @@ export declare class DataStorageBuilder {
19
19
  * @param httpResponse The `HttpResponseMock` to be stored by the framework.
20
20
  * @param data The data of the HTTP response to be stored by the framework.
21
21
  *
22
- * @returns A new `DataStorage` objects.
22
+ * @returns A new `DataStorage` object.
23
23
  */
24
24
  static buildDataStorage(httpResponse: HttpResponseMock, data: any): DataStorage;
25
25
  }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @license
3
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be found in
6
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
+ */
8
+ /**
9
+ * Defines the possible values for the `responseType` property of the
10
+ * `FetchClientBuilder.buildFetchClient()` method.
11
+ */
12
+ export declare enum FetchClientResponseType {
13
+ /**
14
+ * Allows to return the response as a promise that resolves with an `ArrayBuffer`.
15
+ */
16
+ ARRAY_BUFFER = "arrayBuffer",
17
+ /**
18
+ * Allows to return the response as a promise that resolves with a `Blob`.
19
+ */
20
+ BLOB = "blob",
21
+ /**
22
+ * Allows to return the response as a promise that resolves with a `FormData` object.
23
+ */
24
+ FORM_DATA = "formData",
25
+ /**
26
+ * Allows to return the response as a promise which resolves with the result of parsing the body text as JSON.
27
+ */
28
+ JSON = "json",
29
+ /**
30
+ * Allows to return the response as a promise that resolves with a `String`.
31
+ * The response is always decoded using UTF-8.
32
+ */
33
+ TEXT = "text",
34
+ /**
35
+ * Allows to return the response as a promise that resolves with a `Response` object.
36
+ */
37
+ RESPONSE = "response"
38
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be found in
6
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
+ */
8
+ import { FetchClient } from "../../../../model";
9
+ import { FetchClientResponseType } from "./fetch-client-response-type.enum";
10
+ /**
11
+ * A static utility class for building `FetchClient` objects.
12
+ */
13
+ export declare class FetchClientBuilder {
14
+ /**
15
+ * Builds and returns a new `FetchClient` object.
16
+ *
17
+ * @param input The definition of the resource to fetch.
18
+ * @param init The object containing options to configure the request.
19
+ * @param responseType Specifies the type of response for the resource to fetch.
20
+ *
21
+ * @returns A new `FetchClient` object.
22
+ */
23
+ static buildFetchClient(input: RequestInfo | URL, init?: RequestInit | null, responseType?: FetchClientResponseType): FetchClient;
24
+ /**
25
+ * @private
26
+ */
27
+ private static buildResponseStrategy;
28
+ }
@@ -1,2 +1,4 @@
1
1
  export * from './http-mock-response.builder';
2
2
  export * from './http-headers-mock.builder';
3
+ export * from './fetch-client.builder';
4
+ export * from './fetch-client-response-type.enum';
@@ -200,4 +200,8 @@ export declare class DelegateXhr extends XhrBase implements XhrProxy {
200
200
  * @private
201
201
  */
202
202
  private setDataStorage;
203
+ /**
204
+ * @private
205
+ */
206
+ private buildHttpRequest;
203
207
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be found in
6
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
+ */
8
+ import { Observable } from "rxjs";
9
+ /**
10
+ * The markup interface for `Observable` object built from the Fetch API.
11
+ */
12
+ export interface FetchClient extends Observable<any> {
13
+ }
@@ -5,3 +5,4 @@ export * from './http-mock-endpoint';
5
5
  export * from './http-mock-interceptor';
6
6
  export * from './http-mock-error';
7
7
  export * from './xhr-proxy';
8
+ export * from './fetch-client';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-toolbox",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^18.0.0",