profile-pics
Version:
66 lines • 3.04 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProfilePicture = void 0;
const Shape_1 = require("lincd/shapes/Shape");
const package_js_1 = require("../package.js");
const profile_pics_js_1 = require("../ontologies/profile-pics.js");
const ImageObject_1 = require("lincd-schema/shapes/ImageObject");
const SHACL_1 = require("lincd/shapes/SHACL");
let ProfilePicture = class ProfilePicture extends Shape_1.Shape {
get image() {
return this.getOneAs(profile_pics_js_1.profilePics.image, ImageObject_1.ImageObject);
}
set image(val) {
this.overwrite(profile_pics_js_1.profilePics.image, val.node);
}
get cropped() {
return this.getOneAs(profile_pics_js_1.profilePics.crop, ImageObject_1.ImageObject);
}
set cropped(val) {
this.overwrite(profile_pics_js_1.profilePics.crop, val.node);
}
getDataQuads(includeImplicit) {
return super
.getDataQuads(includeImplicit)
.concat(this.image ? this.image.getDataQuads(includeImplicit) : [], this.cropped ? this.cropped.getDataQuads(includeImplicit) : []);
}
remove() {
var _a, _b;
(_a = this.image) === null || _a === void 0 ? void 0 : _a.remove();
(_b = this.cropped) === null || _b === void 0 ? void 0 : _b.remove();
super.remove();
}
};
exports.ProfilePicture = ProfilePicture;
ProfilePicture.targetClass = profile_pics_js_1.profilePics.ProfilePicture;
__decorate([
(0, SHACL_1.objectProperty)({
path: profile_pics_js_1.profilePics.image,
shape: ImageObject_1.ImageObject,
maxCount: 1,
}),
__metadata("design:type", ImageObject_1.ImageObject),
__metadata("design:paramtypes", [ImageObject_1.ImageObject])
], ProfilePicture.prototype, "image", null);
__decorate([
(0, SHACL_1.objectProperty)({
path: profile_pics_js_1.profilePics.crop,
maxCount: 1,
shape: ImageObject_1.ImageObject,
}),
__metadata("design:type", ImageObject_1.ImageObject),
__metadata("design:paramtypes", [ImageObject_1.ImageObject])
], ProfilePicture.prototype, "cropped", null);
exports.ProfilePicture = ProfilePicture = __decorate([
package_js_1.linkedShape
], ProfilePicture);
//# sourceMappingURL=ProfilePicture.js.map