X-Git-Url: https://git.kianting.info/?a=blobdiff_plain;f=src%2Flibclo%2Findex.js;fp=src%2Flibclo%2Findex.js;h=5bcc3f1347e0783647066875446686bf9def5988;hb=d8b33fabf7ffab673f4cd6a8201aadacf3624b41;hp=0000000000000000000000000000000000000000;hpb=a59e1673073b613ea12bd8a0cfa7800826d50dce;p=clo diff --git a/src/libclo/index.js b/src/libclo/index.js new file mode 100644 index 0000000..5bcc3f1 --- /dev/null +++ b/src/libclo/index.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = exports.Clo = void 0; +function foo(arr) { + for (let i = 0; i < arr.length; i++) { + } + if (Array.isArray(arr)) { + arr.push("balabala"); + } + return arr; +} +class Clo { + constructor() { + this.preprocessors = []; + this.mainStream = []; + this.attributes = { "page": [793.7, 1122.5] }; + this.preprocessorRegister(foo); + } + /** + * register a function of preprocessor + * @param f a function + */ + preprocessorRegister(f) { + this.preprocessors.push(f); + } + generatePdf() { + // preprocessed + var prepro = this.mainStream; + for (var i = 0; i < this.preprocessors.length; i++) { + prepro = this.preprocessors[i](prepro); + } + // TODO + console.log("test" + prepro); + } +} +exports.Clo = Clo; +exports.a = new Clo(); +exports.default = exports.a;