UNPKG

stackexchange-api

Version:
33 lines (32 loc) 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const OriginalQuestion_1 = require("./OriginalQuestion"); const ShallowUser_1 = require("./ShallowUser"); /** * The equivalent of [Type closed_details](https://api.stackexchange.com/docs/types/closed-details).<br> * This object represents details about a [[Question]] closure. * This object is mostly analogous "gray box" that appears below closed and on hold [[Question|Questions]]. */ class ClosedDetails { constructor(closed_details) { var _a, _b, _c, _d, _e, _f, _g, _h; if (typeof ((_a = closed_details) === null || _a === void 0 ? void 0 : _a.by_users) === 'undefined') { this.byUsers = null; } else { this.byUsers = closed_details.by_users .map((shallow_user) => new ShallowUser_1.ShallowUser(shallow_user)); } this.description = (_c = (_b = closed_details) === null || _b === void 0 ? void 0 : _b.description, (_c !== null && _c !== void 0 ? _c : null)); this.onHold = (_e = (_d = closed_details) === null || _d === void 0 ? void 0 : _d.on_hold, (_e !== null && _e !== void 0 ? _e : null)); if (typeof ((_f = closed_details) === null || _f === void 0 ? void 0 : _f.original_questions) === 'undefined') { this.originalQuestions = null; } else { this.originalQuestions = closed_details.original_questions .map((original_question) => new OriginalQuestion_1.OriginalQuestion(original_question)); } this.reason = (_h = (_g = closed_details) === null || _g === void 0 ? void 0 : _g.reason, (_h !== null && _h !== void 0 ? _h : null)); } } exports.ClosedDetails = ClosedDetails;