mirror of
https://github.com/tbluemel/rtf.js.git
synced 2026-11-30 16:47:59 +01:00
Reduce exported api surface and fix ISelectedStyle type declaration
This commit is contained in:
+16
-61
@@ -145,7 +145,6 @@ SOFTWARE.
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Renderer", function() { return Renderer; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EMF", function() { return EMF; });
|
||||
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
||||
/* harmony import */ var _Blob__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
||||
/* harmony import */ var _EMFRecords__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
|
||||
@@ -236,7 +235,6 @@ var EMF = /** @class */ (function () {
|
||||
}());
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 2 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
@@ -1059,7 +1057,6 @@ var Helper = /** @class */ (function () {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmfHeader", function() { return EmfHeader; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EMFRecords", function() { return EMFRecords; });
|
||||
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
||||
/* harmony import */ var _Primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
||||
@@ -1164,7 +1161,6 @@ var EmfHeader = /** @class */ (function () {
|
||||
};
|
||||
return EmfHeader;
|
||||
}());
|
||||
|
||||
var EMFRecords = /** @class */ (function () {
|
||||
function EMFRecords(reader, first) {
|
||||
this._records = [];
|
||||
@@ -2502,9 +2498,6 @@ var Pen = /** @class */ (function (_super) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapBase", function() { return BitmapBase; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapCoreHeader", function() { return BitmapCoreHeader; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapInfoHeader", function() { return BitmapInfoHeader; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapInfo", function() { return BitmapInfo; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DIBitmap", function() { return DIBitmap; });
|
||||
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
||||
@@ -2534,31 +2527,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
*/
|
||||
var __extends = (undefined && undefined.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
|
||||
var BitmapBase = /** @class */ (function () {
|
||||
function BitmapBase() {
|
||||
}
|
||||
BitmapBase.prototype.getWidth = function () {
|
||||
throw new _Helper__WEBPACK_IMPORTED_MODULE_0__["EMFJSError"]("getWidth not implemented");
|
||||
};
|
||||
BitmapBase.prototype.getHeight = function () {
|
||||
throw new _Helper__WEBPACK_IMPORTED_MODULE_0__["EMFJSError"]("getHeight not implemented");
|
||||
};
|
||||
return BitmapBase;
|
||||
}());
|
||||
|
||||
var BitmapCoreHeader = /** @class */ (function () {
|
||||
function BitmapCoreHeader(reader, skipsize) {
|
||||
@@ -2575,7 +2543,6 @@ var BitmapCoreHeader = /** @class */ (function () {
|
||||
};
|
||||
return BitmapCoreHeader;
|
||||
}());
|
||||
|
||||
var BitmapInfoHeader = /** @class */ (function () {
|
||||
function BitmapInfoHeader(reader, skipsize) {
|
||||
if (skipsize) {
|
||||
@@ -2602,28 +2569,24 @@ var BitmapInfoHeader = /** @class */ (function () {
|
||||
};
|
||||
return BitmapInfoHeader;
|
||||
}());
|
||||
|
||||
var BitmapInfo = /** @class */ (function (_super) {
|
||||
__extends(BitmapInfo, _super);
|
||||
var BitmapInfo = /** @class */ (function () {
|
||||
function BitmapInfo(reader, usergb) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this._usergb = usergb;
|
||||
this._usergb = usergb;
|
||||
var hdrsize = reader.readUint32();
|
||||
_this._infosize = hdrsize;
|
||||
this._infosize = hdrsize;
|
||||
if (hdrsize === _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPCOREHEADER_SIZE) {
|
||||
_this._header = new BitmapCoreHeader(reader, false);
|
||||
_this._infosize += _this._header.colors() * (usergb ? 3 : 2);
|
||||
this._header = new BitmapCoreHeader(reader, false);
|
||||
this._infosize += this._header.colors() * (usergb ? 3 : 2);
|
||||
}
|
||||
else {
|
||||
_this._header = new BitmapInfoHeader(reader, false);
|
||||
var masks = _this._header.compression
|
||||
this._header = new BitmapInfoHeader(reader, false);
|
||||
var masks = this._header.compression
|
||||
=== _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BitmapCompression.BI_BITFIELDS ? 3 : 0;
|
||||
if (hdrsize <= _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPINFOHEADER_SIZE + (masks * 4)) {
|
||||
_this._infosize = _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPINFOHEADER_SIZE + (masks * 4);
|
||||
this._infosize = _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPINFOHEADER_SIZE + (masks * 4);
|
||||
}
|
||||
_this._infosize += _this._header.colors() * (usergb ? 4 : 2);
|
||||
this._infosize += this._header.colors() * (usergb ? 4 : 2);
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
BitmapInfo.prototype.getWidth = function () {
|
||||
return this._header.width;
|
||||
@@ -2638,17 +2601,14 @@ var BitmapInfo = /** @class */ (function (_super) {
|
||||
return this._header;
|
||||
};
|
||||
return BitmapInfo;
|
||||
}(BitmapBase));
|
||||
}());
|
||||
|
||||
var DIBitmap = /** @class */ (function (_super) {
|
||||
__extends(DIBitmap, _super);
|
||||
var DIBitmap = /** @class */ (function () {
|
||||
function DIBitmap(reader, bitmapInfo) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this._reader = reader;
|
||||
_this._offset = reader.pos;
|
||||
_this._location = bitmapInfo;
|
||||
_this._info = new BitmapInfo(reader, true);
|
||||
return _this;
|
||||
this._reader = reader;
|
||||
this._offset = reader.pos;
|
||||
this._location = bitmapInfo;
|
||||
this._info = new BitmapInfo(reader, true);
|
||||
}
|
||||
DIBitmap.prototype.getWidth = function () {
|
||||
return this._info.getWidth();
|
||||
@@ -2704,7 +2664,7 @@ var DIBitmap = /** @class */ (function (_super) {
|
||||
return ref;
|
||||
};
|
||||
return DIBitmap;
|
||||
}(BitmapBase));
|
||||
}());
|
||||
|
||||
|
||||
|
||||
@@ -2714,9 +2674,6 @@ var DIBitmap = /** @class */ (function (_super) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Path", function() { return Path; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_StockObjects", function() { return _StockObjects; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GDIContextState", function() { return GDIContextState; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GDIContext", function() { return GDIContext; });
|
||||
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
||||
/* harmony import */ var _Primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
||||
@@ -2785,7 +2742,6 @@ var Path = /** @class */ (function (_super) {
|
||||
};
|
||||
return Path;
|
||||
}(_Primitives__WEBPACK_IMPORTED_MODULE_1__["Obj"]));
|
||||
|
||||
function createStockObjects() {
|
||||
// Create global stock objects
|
||||
var createSolidBrush = function (r, g, b) {
|
||||
@@ -2899,7 +2855,6 @@ var GDIContextState = /** @class */ (function () {
|
||||
}
|
||||
return GDIContextState;
|
||||
}());
|
||||
|
||||
var GDIContext = /** @class */ (function () {
|
||||
function GDIContext(svg) {
|
||||
this._svg = svg;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
-4
@@ -8781,8 +8781,6 @@ var ColortblDestination = /** @class */ (function (_super) {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldDestination", function() { return FieldDestination; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldBase", function() { return FieldBase; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldHyperlink", function() { return FieldHyperlink; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FldinstDestination", function() { return FldinstDestination; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FldrsltDestination", function() { return FldrsltDestination; });
|
||||
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
|
||||
@@ -8889,7 +8887,6 @@ var FieldBase = /** @class */ (function () {
|
||||
};
|
||||
return FieldBase;
|
||||
}());
|
||||
|
||||
var FieldHyperlink = /** @class */ (function (_super) {
|
||||
__extends(FieldHyperlink, _super);
|
||||
function FieldHyperlink(fldinst, data) {
|
||||
@@ -8932,7 +8929,6 @@ var FieldHyperlink = /** @class */ (function (_super) {
|
||||
};
|
||||
return FieldHyperlink;
|
||||
}(FieldBase));
|
||||
|
||||
var FldinstDestination = /** @class */ (function (_super) {
|
||||
__extends(FldinstDestination, _super);
|
||||
function FldinstDestination(parser, inst) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+44
-78
@@ -459,9 +459,6 @@ SOFTWARE.
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Renderer", function() { return Renderer; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WMFRect16", function() { return WMFRect16; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WMFPlacable", function() { return WMFPlacable; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WMF", function() { return WMF; });
|
||||
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
||||
/* harmony import */ var _Blob__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
|
||||
/* harmony import */ var _GDIContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38);
|
||||
@@ -573,7 +570,6 @@ var WMFRect16 = /** @class */ (function () {
|
||||
};
|
||||
return WMFRect16;
|
||||
}());
|
||||
|
||||
var WMFPlacable = /** @class */ (function () {
|
||||
function WMFPlacable(reader) {
|
||||
reader.skip(2);
|
||||
@@ -585,7 +581,6 @@ var WMFPlacable = /** @class */ (function () {
|
||||
}
|
||||
return WMFPlacable;
|
||||
}());
|
||||
|
||||
var WMF = /** @class */ (function () {
|
||||
function WMF(reader, placable, version, hdrsize) {
|
||||
this._version = version;
|
||||
@@ -600,7 +595,6 @@ var WMF = /** @class */ (function () {
|
||||
}());
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 36 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
@@ -1073,7 +1067,6 @@ var Helper = /** @class */ (function () {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GDIContextState", function() { return GDIContextState; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GDIContext", function() { return GDIContext; });
|
||||
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
|
||||
/* harmony import */ var _Primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39);
|
||||
@@ -1170,7 +1163,6 @@ var GDIContextState = /** @class */ (function () {
|
||||
}
|
||||
return GDIContextState;
|
||||
}());
|
||||
|
||||
var GDIContext = /** @class */ (function () {
|
||||
function GDIContext(svg) {
|
||||
this._svg = svg;
|
||||
@@ -2657,9 +2649,6 @@ var Palette = /** @class */ (function (_super) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapBase", function() { return BitmapBase; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapCoreHeader", function() { return BitmapCoreHeader; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapInfoHeader", function() { return BitmapInfoHeader; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BitmapInfo", function() { return BitmapInfo; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DIBitmap", function() { return DIBitmap; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bitmap16", function() { return Bitmap16; });
|
||||
@@ -2704,18 +2693,6 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
||||
};
|
||||
})();
|
||||
|
||||
var BitmapBase = /** @class */ (function () {
|
||||
function BitmapBase() {
|
||||
}
|
||||
BitmapBase.prototype.getWidth = function () {
|
||||
throw new _Helper__WEBPACK_IMPORTED_MODULE_0__["WMFJSError"]("getWidth not implemented");
|
||||
};
|
||||
BitmapBase.prototype.getHeight = function () {
|
||||
throw new _Helper__WEBPACK_IMPORTED_MODULE_0__["WMFJSError"]("getHeight not implemented");
|
||||
};
|
||||
return BitmapBase;
|
||||
}());
|
||||
|
||||
var BitmapCoreHeader = /** @class */ (function () {
|
||||
function BitmapCoreHeader(reader, skipsize) {
|
||||
if (skipsize) {
|
||||
@@ -2731,7 +2708,6 @@ var BitmapCoreHeader = /** @class */ (function () {
|
||||
};
|
||||
return BitmapCoreHeader;
|
||||
}());
|
||||
|
||||
var BitmapInfoHeader = /** @class */ (function () {
|
||||
function BitmapInfoHeader(reader, skipsize) {
|
||||
if (skipsize) {
|
||||
@@ -2758,29 +2734,25 @@ var BitmapInfoHeader = /** @class */ (function () {
|
||||
};
|
||||
return BitmapInfoHeader;
|
||||
}());
|
||||
|
||||
var BitmapInfo = /** @class */ (function (_super) {
|
||||
__extends(BitmapInfo, _super);
|
||||
var BitmapInfo = /** @class */ (function () {
|
||||
function BitmapInfo(reader, usergb) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this._reader = reader;
|
||||
_this._offset = reader.pos;
|
||||
_this._usergb = usergb;
|
||||
this._reader = reader;
|
||||
this._offset = reader.pos;
|
||||
this._usergb = usergb;
|
||||
var hdrsize = reader.readUint32();
|
||||
_this._infosize = hdrsize;
|
||||
this._infosize = hdrsize;
|
||||
if (hdrsize === _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPCOREHEADER_SIZE) {
|
||||
_this._header = new BitmapCoreHeader(reader, false);
|
||||
_this._infosize += _this._header.colors() * (usergb ? 3 : 2);
|
||||
this._header = new BitmapCoreHeader(reader, false);
|
||||
this._infosize += this._header.colors() * (usergb ? 3 : 2);
|
||||
}
|
||||
else {
|
||||
_this._header = new BitmapInfoHeader(reader, false);
|
||||
var masks = _this._header.compression === _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BitmapCompression.BI_BITFIELDS ? 3 : 0;
|
||||
this._header = new BitmapInfoHeader(reader, false);
|
||||
var masks = this._header.compression === _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BitmapCompression.BI_BITFIELDS ? 3 : 0;
|
||||
if (hdrsize <= _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPINFOHEADER_SIZE + (masks * 4)) {
|
||||
_this._infosize = _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPINFOHEADER_SIZE + (masks * 4);
|
||||
this._infosize = _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"].GDI.BITMAPINFOHEADER_SIZE + (masks * 4);
|
||||
}
|
||||
_this._infosize += _this._header.colors() * (usergb ? 4 : 2);
|
||||
this._infosize += this._header.colors() * (usergb ? 4 : 2);
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
BitmapInfo.prototype.getWidth = function () {
|
||||
return this._header.width;
|
||||
@@ -2795,17 +2767,14 @@ var BitmapInfo = /** @class */ (function (_super) {
|
||||
return this._header;
|
||||
};
|
||||
return BitmapInfo;
|
||||
}(BitmapBase));
|
||||
}());
|
||||
|
||||
var DIBitmap = /** @class */ (function (_super) {
|
||||
__extends(DIBitmap, _super);
|
||||
var DIBitmap = /** @class */ (function () {
|
||||
function DIBitmap(reader, size) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this._reader = reader;
|
||||
_this._offset = reader.pos;
|
||||
_this._size = size;
|
||||
_this._info = new BitmapInfo(reader, true);
|
||||
return _this;
|
||||
this._reader = reader;
|
||||
this._offset = reader.pos;
|
||||
this._size = size;
|
||||
this._info = new BitmapInfo(reader, true);
|
||||
}
|
||||
DIBitmap.prototype.getWidth = function () {
|
||||
return this._info.getWidth();
|
||||
@@ -2855,44 +2824,41 @@ var DIBitmap = /** @class */ (function (_super) {
|
||||
return _Helper__WEBPACK_IMPORTED_MODULE_0__["Helper"]._blobToBinary(view);
|
||||
};
|
||||
return DIBitmap;
|
||||
}(BitmapBase));
|
||||
}());
|
||||
|
||||
var Bitmap16 = /** @class */ (function (_super) {
|
||||
__extends(Bitmap16, _super);
|
||||
var Bitmap16 = /** @class */ (function () {
|
||||
function Bitmap16(reader, size) {
|
||||
var _this = _super.call(this) || this;
|
||||
if (reader != null) {
|
||||
size = size;
|
||||
_this._reader = reader;
|
||||
_this._offset = reader.pos;
|
||||
_this._size = size;
|
||||
_this.type = reader.readInt16();
|
||||
_this.width = reader.readInt16();
|
||||
_this.height = reader.readInt16();
|
||||
_this.widthBytes = reader.readInt16();
|
||||
_this.planes = reader.readUint8();
|
||||
_this.bitsPixel = reader.readUint8();
|
||||
_this.bitsOffset = reader.pos;
|
||||
_this.bitsSize = (((_this.width * _this.bitsPixel + 15) >> 4) << 1) * _this.height;
|
||||
if (_this.bitsSize > size - 10) {
|
||||
throw new _Helper__WEBPACK_IMPORTED_MODULE_0__["WMFJSError"]("Bitmap should have " + _this.bitsSize + " bytes, but has " + (size - 10));
|
||||
this._reader = reader;
|
||||
this._offset = reader.pos;
|
||||
this._size = size;
|
||||
this.type = reader.readInt16();
|
||||
this.width = reader.readInt16();
|
||||
this.height = reader.readInt16();
|
||||
this.widthBytes = reader.readInt16();
|
||||
this.planes = reader.readUint8();
|
||||
this.bitsPixel = reader.readUint8();
|
||||
this.bitsOffset = reader.pos;
|
||||
this.bitsSize = (((this.width * this.bitsPixel + 15) >> 4) << 1) * this.height;
|
||||
if (this.bitsSize > size - 10) {
|
||||
throw new _Helper__WEBPACK_IMPORTED_MODULE_0__["WMFJSError"]("Bitmap should have " + this.bitsSize + " bytes, but has " + (size - 10));
|
||||
}
|
||||
}
|
||||
else {
|
||||
var copy = size;
|
||||
_this._reader = copy._reader;
|
||||
_this._offset = copy._offset;
|
||||
_this._size = copy._size;
|
||||
_this.type = copy.type;
|
||||
_this.width = copy.width;
|
||||
_this.height = copy.height;
|
||||
_this.widthBytes = copy.widthBytes;
|
||||
_this.planes = copy.planes;
|
||||
_this.bitsPixel = copy.bitsPixel;
|
||||
_this.bitsOffset = copy.bitsOffset;
|
||||
_this.bitsSize = copy.bitsSize;
|
||||
this._reader = copy._reader;
|
||||
this._offset = copy._offset;
|
||||
this._size = copy._size;
|
||||
this.type = copy.type;
|
||||
this.width = copy.width;
|
||||
this.height = copy.height;
|
||||
this.widthBytes = copy.widthBytes;
|
||||
this.planes = copy.planes;
|
||||
this.bitsPixel = copy.bitsPixel;
|
||||
this.bitsOffset = copy.bitsOffset;
|
||||
this.bitsSize = copy.bitsSize;
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
Bitmap16.prototype.getWidth = function () {
|
||||
return this.width;
|
||||
@@ -2904,7 +2870,7 @@ var Bitmap16 = /** @class */ (function (_super) {
|
||||
return new Bitmap16(null, this);
|
||||
};
|
||||
return Bitmap16;
|
||||
}(BitmapBase));
|
||||
}());
|
||||
|
||||
var PatternBitmap16 = /** @class */ (function (_super) {
|
||||
__extends(PatternBitmap16, _super);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+9
-15
@@ -26,19 +26,15 @@ SOFTWARE.
|
||||
*/
|
||||
|
||||
import { Blob } from "./Blob";
|
||||
import { EMFJSError, Helper } from "./Helper";
|
||||
import { Helper } from "./Helper";
|
||||
|
||||
export class BitmapBase {
|
||||
public getWidth(): number {
|
||||
throw new EMFJSError("getWidth not implemented");
|
||||
}
|
||||
interface Bitmap {
|
||||
getWidth(): number
|
||||
|
||||
public getHeight(): number {
|
||||
throw new EMFJSError("getHeight not implemented");
|
||||
}
|
||||
getHeight(): number
|
||||
}
|
||||
|
||||
export class BitmapCoreHeader {
|
||||
class BitmapCoreHeader {
|
||||
public width: number;
|
||||
public height: number;
|
||||
public planes: number;
|
||||
@@ -59,7 +55,7 @@ export class BitmapCoreHeader {
|
||||
}
|
||||
}
|
||||
|
||||
export class BitmapInfoHeader {
|
||||
class BitmapInfoHeader {
|
||||
public width: number;
|
||||
public height: number;
|
||||
public planes: number;
|
||||
@@ -96,13 +92,12 @@ export class BitmapInfoHeader {
|
||||
}
|
||||
}
|
||||
|
||||
export class BitmapInfo extends BitmapBase {
|
||||
export class BitmapInfo implements Bitmap {
|
||||
private _usergb: boolean;
|
||||
private _infosize: number;
|
||||
private _header: BitmapCoreHeader | BitmapInfoHeader;
|
||||
|
||||
constructor(reader: Blob, usergb: boolean) {
|
||||
super();
|
||||
this._usergb = usergb;
|
||||
const hdrsize = reader.readUint32();
|
||||
this._infosize = hdrsize;
|
||||
@@ -137,14 +132,13 @@ export class BitmapInfo extends BitmapBase {
|
||||
}
|
||||
}
|
||||
|
||||
export class DIBitmap extends BitmapBase {
|
||||
export class DIBitmap implements Bitmap {
|
||||
private _reader: Blob;
|
||||
private _offset: number;
|
||||
private _location: any;
|
||||
private _info: BitmapInfo;
|
||||
|
||||
constructor(reader: Blob, bitmapInfo?: any) {
|
||||
super();
|
||||
this._reader = reader;
|
||||
this._offset = reader.pos;
|
||||
this._location = bitmapInfo;
|
||||
@@ -159,7 +153,7 @@ export class DIBitmap extends BitmapBase {
|
||||
return this._info.getHeight();
|
||||
}
|
||||
|
||||
public totalSize() {
|
||||
public totalSize(): number {
|
||||
return this._location.header.size + this._location.data.size;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import { PointL, PointS, RectL, SizeL } from "./Primitives";
|
||||
import { Region } from "./Region";
|
||||
import { Brush, ColorRef, Pen } from "./Style";
|
||||
|
||||
export class EmfHeader {
|
||||
class EmfHeader {
|
||||
private size: number;
|
||||
private bounds: RectL;
|
||||
private frame: RectL;
|
||||
|
||||
@@ -32,17 +32,17 @@ import { Obj, PointL, PointS, RectL } from "./Primitives";
|
||||
import { CreateSimpleRegion, Region } from "./Region";
|
||||
import { Brush, ColorRef, Font, Pen } from "./Style";
|
||||
|
||||
export interface ISelectedStyle {
|
||||
interface ISelectedStyle {
|
||||
brush?: Brush;
|
||||
pen?: Pen;
|
||||
font?: Font;
|
||||
region?: Region;
|
||||
path?: Path;
|
||||
|
||||
[key: string]: Obj;
|
||||
[key: string]: Obj | undefined;
|
||||
}
|
||||
|
||||
export class Path extends Obj {
|
||||
class Path extends Obj {
|
||||
public svgPath: SVGPathBuilder;
|
||||
|
||||
constructor(svgPath: SVGPathBuilder, copy?: Path) {
|
||||
@@ -105,9 +105,9 @@ function createStockObjects(): { [key: string]: Obj } {
|
||||
return objs;
|
||||
}
|
||||
|
||||
export const _StockObjects = createStockObjects();
|
||||
const _StockObjects = createStockObjects();
|
||||
|
||||
export class GDIContextState {
|
||||
class GDIContextState {
|
||||
public _svggroup: SVGElement;
|
||||
public _svgclipChanged: boolean;
|
||||
public _svgtextbkfilter: SVGFilterElement;
|
||||
|
||||
@@ -98,7 +98,7 @@ export class Renderer {
|
||||
}
|
||||
}
|
||||
|
||||
export class EMF {
|
||||
class EMF {
|
||||
private _hdrsize: number;
|
||||
private _records: EMFRecords;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ export class FieldDestination extends DestinationBase {
|
||||
}
|
||||
}
|
||||
|
||||
export class FieldBase {
|
||||
class FieldBase {
|
||||
private _fldinst: FldinstDestination;
|
||||
|
||||
constructor(fldinst: FldinstDestination) {
|
||||
@@ -108,7 +108,7 @@ export class FieldBase {
|
||||
}
|
||||
}
|
||||
|
||||
export class FieldHyperlink extends FieldBase {
|
||||
class FieldHyperlink extends FieldBase {
|
||||
private _url: string;
|
||||
|
||||
constructor(fldinst: FldinstDestination, data: string) {
|
||||
|
||||
+8
-15
@@ -27,17 +27,13 @@ SOFTWARE.
|
||||
import { Blob } from "./Blob";
|
||||
import { Helper, WMFJSError } from "./Helper";
|
||||
|
||||
export class BitmapBase {
|
||||
public getWidth(): number {
|
||||
throw new WMFJSError("getWidth not implemented");
|
||||
}
|
||||
interface Bitmap {
|
||||
getWidth(): number
|
||||
|
||||
public getHeight(): number {
|
||||
throw new WMFJSError("getHeight not implemented");
|
||||
}
|
||||
getHeight(): number
|
||||
}
|
||||
|
||||
export class BitmapCoreHeader {
|
||||
class BitmapCoreHeader {
|
||||
public width: number;
|
||||
public height: number;
|
||||
public planes: number;
|
||||
@@ -58,7 +54,7 @@ export class BitmapCoreHeader {
|
||||
}
|
||||
}
|
||||
|
||||
export class BitmapInfoHeader {
|
||||
class BitmapInfoHeader {
|
||||
public width: number;
|
||||
public height: number;
|
||||
public planes: number;
|
||||
@@ -95,7 +91,7 @@ export class BitmapInfoHeader {
|
||||
}
|
||||
}
|
||||
|
||||
export class BitmapInfo extends BitmapBase {
|
||||
export class BitmapInfo implements Bitmap {
|
||||
private _reader: Blob;
|
||||
private _offset: number;
|
||||
private _usergb: boolean;
|
||||
@@ -103,7 +99,6 @@ export class BitmapInfo extends BitmapBase {
|
||||
private _header: BitmapCoreHeader | BitmapInfoHeader;
|
||||
|
||||
constructor(reader: Blob, usergb: boolean) {
|
||||
super();
|
||||
this._reader = reader;
|
||||
this._offset = reader.pos;
|
||||
this._usergb = usergb;
|
||||
@@ -140,14 +135,13 @@ export class BitmapInfo extends BitmapBase {
|
||||
}
|
||||
}
|
||||
|
||||
export class DIBitmap extends BitmapBase {
|
||||
export class DIBitmap implements Bitmap {
|
||||
private _reader: Blob;
|
||||
private _offset: number;
|
||||
private _size: number;
|
||||
private _info: BitmapInfo;
|
||||
|
||||
constructor(reader: Blob, size: number) {
|
||||
super();
|
||||
this._reader = reader;
|
||||
this._offset = reader.pos;
|
||||
this._size = size;
|
||||
@@ -206,7 +200,7 @@ export class DIBitmap extends BitmapBase {
|
||||
}
|
||||
}
|
||||
|
||||
export class Bitmap16 extends BitmapBase {
|
||||
export class Bitmap16 implements Bitmap {
|
||||
public type: number;
|
||||
public width: number;
|
||||
public height: number;
|
||||
@@ -220,7 +214,6 @@ export class Bitmap16 extends BitmapBase {
|
||||
private _size: number;
|
||||
|
||||
constructor(reader: Blob, size: number | Bitmap16) {
|
||||
super();
|
||||
if (reader != null) {
|
||||
size = size as number;
|
||||
this._reader = reader;
|
||||
|
||||
@@ -32,17 +32,17 @@ import { Obj, PointS, Rect } from "./Primitives";
|
||||
import { CreateSimpleRegion, Region } from "./Region";
|
||||
import { Brush, ColorRef, Font, Palette, Pen } from "./Style";
|
||||
|
||||
export interface ISelectedStyle {
|
||||
interface ISelectedStyle {
|
||||
brush?: Brush;
|
||||
pen?: Pen;
|
||||
font?: Font;
|
||||
palette?: Palette;
|
||||
region?: Region;
|
||||
|
||||
[key: string]: Obj;
|
||||
[key: string]: Obj | undefined;
|
||||
}
|
||||
|
||||
export class GDIContextState {
|
||||
class GDIContextState {
|
||||
public _svggroup: SVGElement;
|
||||
public _svgclipChanged: boolean;
|
||||
public _svgtextbkfilter: SVGFilterElement;
|
||||
|
||||
@@ -108,7 +108,7 @@ export class Renderer {
|
||||
}
|
||||
}
|
||||
|
||||
export class WMFRect16 {
|
||||
class WMFRect16 {
|
||||
private left: number;
|
||||
private top: number;
|
||||
private right: number;
|
||||
@@ -127,7 +127,7 @@ export class WMFRect16 {
|
||||
}
|
||||
}
|
||||
|
||||
export class WMFPlacable {
|
||||
class WMFPlacable {
|
||||
private boundingBox: WMFRect16;
|
||||
private unitsPerInch: number;
|
||||
|
||||
@@ -141,7 +141,7 @@ export class WMFPlacable {
|
||||
}
|
||||
}
|
||||
|
||||
export class WMF {
|
||||
class WMF {
|
||||
private _version: number;
|
||||
private _hdrsize: number;
|
||||
private _placable: WMFPlacable;
|
||||
|
||||
Reference in New Issue
Block a user