@ffflorian/xkcdjs
Version:
An xkcd API client with a CLI.
32 lines • 1.11 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var api_client_1 = require("@ffflorian/api-client");
var XKCDAPI_1 = require("./XKCDAPI");
var XKCD = /** @class */ (function () {
function XKCD(options) {
this.options = __assign({ apiUrl: 'https://xkcd.com' }, options);
this.apiClient = new api_client_1.APIClient(this.options.apiUrl);
this.api = new XKCDAPI_1.XKCDAPI(this.apiClient, this.options);
}
/**
* Set a new API URL.
* @param url The new API URL.
*/
XKCD.prototype.setApiUrl = function (newUrl) {
this.apiClient.requestService.setApiUrl(newUrl);
};
return XKCD;
}());
exports.XKCD = XKCD;
//# sourceMappingURL=XKCD.js.map