UNPKG

666 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.XKCD = void 0;
4const axios_1 = require("axios");
5const XKCDAPI_1 = require("./XKCDAPI");
6class XKCD {
7 constructor(options) {
8 this.options = Object.assign({ apiUrl: 'https://xkcd.com' }, options);
9 this.apiClient = axios_1.default.create({ baseURL: this.options.apiUrl });
10 this.api = new XKCDAPI_1.XKCDAPI(this.apiClient, this.options);
11 }
12 /**
13 * Set a new API URL.
14 * @param url The new API URL.
15 */
16 setApiUrl(newUrl) {
17 this.apiClient.defaults.baseURL = newUrl;
18 }
19}
20exports.XKCD = XKCD;
21//# sourceMappingURL=XKCD.js.map
\No newline at end of file