Skip to content

Commit 5183690

Browse files
authored
Export BatchResponseBody interface type (#531)
* Export BatchResponseBody interface type The BatchResponseBody interface is needed as parameter to several public methods, in particular the constructor for BatchResponseContent, but is not exported. This makes it harder to write type-safe code that makes a batch request and passes the body from the response JSON to BatchResponseContent without relying on implicit "any" typing. * Export BatchResponseBody from index.ts and browser/index.ts
1 parent c462815 commit 5183690

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/browser/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
export { BatchRequestStep, BatchRequestData, BatchRequestContent, RequestData, BatchRequestBody } from "../content/BatchRequestContent";
9-
export { BatchResponseContent } from "../content/BatchResponseContent";
9+
export { BatchResponseBody, BatchResponseContent } from "../content/BatchResponseContent";
1010

1111
export { AuthenticationHandler } from "../middleware/AuthenticationHandler";
1212
export { HTTPMessageHandler } from "../middleware/HTTPMessageHandler";

src/content/BatchResponseContent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface KeyValuePairObject {
2323
* @property {KeyValuePairObject[]} responses - An array of key value pair representing response object for every request
2424
* @property {string} [@odata.nextLink] - The nextLink value to get next set of responses in case of asynchronous batch requests
2525
*/
26-
interface BatchResponseBody {
26+
export interface BatchResponseBody {
2727
responses: KeyValuePairObject[];
2828
"@odata.nextLink"?: string;
2929
}

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
export { BatchRequestBody, RequestData, BatchRequestContent, BatchRequestData, BatchRequestStep } from "./content/BatchRequestContent";
9-
export { BatchResponseContent } from "./content/BatchResponseContent";
9+
export { BatchResponseBody, BatchResponseContent } from "./content/BatchResponseContent";
1010

1111
export { AuthenticationHandler } from "./middleware/AuthenticationHandler";
1212
export { HTTPMessageHandler } from "./middleware/HTTPMessageHandler";

0 commit comments

Comments
 (0)