Skip to content

Commit

Permalink
Export BatchResponseBody interface type (#531)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
henhal authored Nov 19, 2021
1 parent c462815 commit 5183690
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

export { BatchRequestStep, BatchRequestData, BatchRequestContent, RequestData, BatchRequestBody } from "../content/BatchRequestContent";
export { BatchResponseContent } from "../content/BatchResponseContent";
export { BatchResponseBody, BatchResponseContent } from "../content/BatchResponseContent";

export { AuthenticationHandler } from "../middleware/AuthenticationHandler";
export { HTTPMessageHandler } from "../middleware/HTTPMessageHandler";
Expand Down
2 changes: 1 addition & 1 deletion src/content/BatchResponseContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface KeyValuePairObject {
* @property {KeyValuePairObject[]} responses - An array of key value pair representing response object for every request
* @property {string} [@odata.nextLink] - The nextLink value to get next set of responses in case of asynchronous batch requests
*/
interface BatchResponseBody {
export interface BatchResponseBody {
responses: KeyValuePairObject[];
"@odata.nextLink"?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

export { BatchRequestBody, RequestData, BatchRequestContent, BatchRequestData, BatchRequestStep } from "./content/BatchRequestContent";
export { BatchResponseContent } from "./content/BatchResponseContent";
export { BatchResponseBody, BatchResponseContent } from "./content/BatchResponseContent";

export { AuthenticationHandler } from "./middleware/AuthenticationHandler";
export { HTTPMessageHandler } from "./middleware/HTTPMessageHandler";
Expand Down

0 comments on commit 5183690

Please sign in to comment.