EmptyNodeHttpClient.js 1.4 KB

123456789101112131415161718192021222324252627
  1. // Copyright (c) .NET Foundation. All rights reserved.
  2. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  3. var __extends = (this && this.__extends) || (function () {
  4. var extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7. return function (d, b) {
  8. extendStatics(d, b);
  9. function __() { this.constructor = d; }
  10. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  11. };
  12. })();
  13. // This is an empty implementation of the NodeHttpClient that will be included in browser builds so the output file will be smaller
  14. import { HttpClient } from "./HttpClient";
  15. var NodeHttpClient = /** @class */ (function (_super) {
  16. __extends(NodeHttpClient, _super);
  17. // @ts-ignore: Need ILogger to compile, but unused variables generate errors
  18. function NodeHttpClient(logger) {
  19. return _super.call(this) || this;
  20. }
  21. NodeHttpClient.prototype.send = function () {
  22. return Promise.reject(new Error("If using Node either provide an XmlHttpRequest polyfill or consume the cjs or esm script instead of the browser/signalr.js one."));
  23. };
  24. return NodeHttpClient;
  25. }(HttpClient));
  26. export { NodeHttpClient };
  27. //# sourceMappingURL=EmptyNodeHttpClient.js.map