UNPKG

profile-pics

Version:

61 lines 2.57 kB
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); }; import { Shape } from 'lincd/shapes/Shape'; import { linkedShape } from '../package.js'; import { profilePics } from '../ontologies/profile-pics.js'; import { ImageObject } from 'lincd-schema/shapes/ImageObject'; import { objectProperty } from 'lincd/utils/ShapeDecorators'; let ProfilePicture = class ProfilePicture extends Shape { get image() { return this.getOneAs(profilePics.image, ImageObject); } set image(val) { this.overwrite(profilePics.image, val.node); } get cropped() { return this.getOneAs(profilePics.crop, ImageObject); } set cropped(val) { this.overwrite(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(); } }; ProfilePicture.targetClass = profilePics.ProfilePicture; __decorate([ objectProperty({ path: profilePics.image, shape: ImageObject, }), __metadata("design:type", ImageObject), __metadata("design:paramtypes", [ImageObject]) ], ProfilePicture.prototype, "image", null); __decorate([ objectProperty({ path: profilePics.crop, shape: ImageObject, }), __metadata("design:type", ImageObject), __metadata("design:paramtypes", [ImageObject]) ], ProfilePicture.prototype, "cropped", null); ProfilePicture = __decorate([ linkedShape ], ProfilePicture); export { ProfilePicture }; //# sourceMappingURL=ProfilePicture.js.map