@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
73 lines • 3.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Blacken = void 0;
class Blacken {
constructor(data) {
let collisionRatioDefault = 30;
this.collisionRatio = typeof (data === null || data === void 0 ? void 0 : data.collisionRatio) !== "undefined" ? data === null || data === void 0 ? void 0 : data.collisionRatio : collisionRatioDefault;
let redactAnnotationsDefault = true;
this.redactAnnotations = typeof (data === null || data === void 0 ? void 0 : data.redactAnnotations) !== "undefined" ? data === null || data === void 0 ? void 0 : data.redactAnnotations : redactAnnotationsDefault;
let redactImagesDefault = true;
this.redactImages = typeof (data === null || data === void 0 ? void 0 : data.redactImages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.redactImages : redactImagesDefault;
let redactPathsDefault = true;
this.redactPaths = typeof (data === null || data === void 0 ? void 0 : data.redactPaths) !== "undefined" ? data === null || data === void 0 ? void 0 : data.redactPaths : redactPathsDefault;
let redactTextsDefault = true;
this.redactTexts = typeof (data === null || data === void 0 ? void 0 : data.redactTexts) !== "undefined" ? data === null || data === void 0 ? void 0 : data.redactTexts : redactTextsDefault;
}
static getCollisionRatioDefault() {
return 30;
}
static getCollisionRatioDescription() {
return "Specifies a percentage value by which a letter must be obscured at least to be considered blackened and thus removed.";
}
static getCollisionRatioMin() {
return 0;
}
static getCollisionRatioMax() {
return 100;
}
static getRedactAnnotationsDefault() {
return true;
}
static getRedactAnnotationsDescription() {
return "If this value is set to \"true\", all blackened annotations will be removed. Annotations are removed completely even if they are only truncated.";
}
static getRedactImagesDefault() {
return true;
}
static getRedactImagesDescription() {
return "If this value is set to true, all blackened image data will be removed. For images, the entire image is not removed, but the obscured area is replaced by the redaction.";
}
static getRedactPathsDefault() {
return true;
}
static getRedactPathsDescription() {
return "If this value is set to true, all blackened character paths are removed. The paths are adjusted so that the blackened section is removed from the path construction.";
}
static getRedactTextsDefault() {
return true;
}
static getRedactTextsDescription() {
return "If this value is set to \"true\", all texts are blackened letter by letter.";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new Blacken(data);
}
toJson() {
return {
'collisionRatio': this.collisionRatio,
'redactAnnotations': this.redactAnnotations,
'redactImages': this.redactImages,
'redactPaths': this.redactPaths,
'redactTexts': this.redactTexts,
};
}
clone() {
return Blacken.fromJson(this.toJson());
}
}
exports.Blacken = Blacken;
//# sourceMappingURL=Blacken.js.map