UNPKG

@umbraco/json-models-builders

Version:
46 lines 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MediaValueDataBuilder = void 0; class MediaValueDataBuilder { parentBuilder; temporaryFileId; src; crops; focalPoint; constructor(parentBuilder) { this.parentBuilder = parentBuilder; } withTemporaryFileId(temporaryFileId) { this.temporaryFileId = temporaryFileId; return this; } withSrc(src) { this.src = src; return this; } withCrop(crop) { this.crops.push(crop); return this; } withFocalPoint(focalPoint) { this.focalPoint = focalPoint; return this; } done() { return this.parentBuilder; } getValue() { let value = {}; value.crops = this.crops || []; if (this.focalPoint !== undefined) { value.focalPoint = this.focalPoint; } if (this.src !== undefined) { value.src = this.src; } value.temporaryFileId = this.temporaryFileId || ""; return value; } } exports.MediaValueDataBuilder = MediaValueDataBuilder; //# sourceMappingURL=mediaValueDataBuilder.js.map