UNPKG

core-cde

Version:

39 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SortInfo = void 0; const Data_module_1 = require("../Data.module"); class SortInfo { /** * Конструктор. Не предназначено для использования внешним кодом. * Следует использовать SortInfo.createNew() */ constructor() { this.direction = Data_module_1.SortDirection.Asc; } static createNew(name, direction) { const res = new SortInfo(); res.columnName = name; if (typeof direction === 'undefined') { direction = Data_module_1.SortDirection.Asc; } res.direction = direction; return res; } static fromJSON(json) { if (typeof json === 'string') { return SortInfo.fromJSON(JSON.parse(json)); } else { const si = new SortInfo(); return Object.assign(si, json, {}); } } toJSON() { return Object.assign({}, null, { columnName: this.columnName, direction: this.direction }); } } exports.SortInfo = SortInfo; //# sourceMappingURL=SortInfo.js.map