mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-02-08 05:49:29 +01:00
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import ParseResult from '../ParseResult.jsx';
|
|
|
|
// A transformation from an PdfPage to an PdfPage
|
|
export default class Transformation {
|
|
|
|
constructor(name, itemType) {
|
|
if (this.constructor === Transformation) {
|
|
throw new TypeError("Can not construct abstract class.");
|
|
}
|
|
if (this.transform === Transformation.prototype.transform) {
|
|
throw new TypeError("Please implement abstract method 'transform()'.");
|
|
}
|
|
this.name = name;
|
|
this.itemType = itemType;
|
|
}
|
|
|
|
showModificationCheckbox() {
|
|
return false;
|
|
}
|
|
|
|
createPageView(page, modificationsOnly) { // eslint-disable-line no-unused-vars
|
|
throw new TypeError("Do not call abstract method foo from child.");
|
|
}
|
|
|
|
// Transform an incoming ParseResult into an outgoing ParseResult
|
|
transform(parseResult: ParseResult) { // eslint-disable-line no-unused-vars
|
|
throw new TypeError("Do not call abstract method foo from child.");
|
|
}
|
|
|
|
// Sometimes the transform() does only visualize a change. This methods then does the actual change.
|
|
completeTransform(parseResult: ParseResult) { // eslint-disable-line no-unused-vars
|
|
parseResult.messages = [];
|
|
return parseResult;
|
|
}
|
|
|
|
|
|
} |