@iiif/3d-manifesto-dev
Version:
IIIF Presentation API utility library for client and server with 3D extension
24 lines • 830 B
JavaScript
import { TreeNodeType, Utils } from "./internal";
var TreeNode = /** @class */ (function () {
function TreeNode(label, data) {
this.label = label;
this.data = data || {};
this.nodes = [];
}
TreeNode.prototype.addNode = function (node) {
this.nodes.push(node);
node.parentNode = this;
};
TreeNode.prototype.isCollection = function () {
return this.data.type === Utils.normaliseType(TreeNodeType.COLLECTION);
};
TreeNode.prototype.isManifest = function () {
return this.data.type === Utils.normaliseType(TreeNodeType.MANIFEST);
};
TreeNode.prototype.isRange = function () {
return this.data.type === Utils.normaliseType(TreeNodeType.RANGE);
};
return TreeNode;
}());
export { TreeNode };
//# sourceMappingURL=TreeNode.js.map