define(["require", "exports", "./../pdf-primitives", "./../graphics/pdf-template", "./annotation", "../utils"], function (require, exports, pdf_primitives_1, pdf_template_1, annotation_1, utils_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var PdfAppearance = (function () {
function PdfAppearance(bounds, annot) {
this._isNormalKey = true;
this._dictionary = new pdf_primitives_1._PdfDictionary();
Eif (utils_1._isNullOrUndefined(bounds)) {
this._bounds = bounds;
}
else {
this._bounds = { x: 0, y: 0, width: 0, height: 0 };
}
Eif (annot instanceof annotation_1.PdfAnnotation) {
this._annotations = annot;
this._crossReference = annot._crossReference;
}
else {
this._isNormalKey = false;
}
this._initialize();
}
Object.defineProperty(PdfAppearance.prototype, "normal", {
get: function () {
Iif (!this._templateNormal && this._dictionary && this._dictionary.has('AP')) {
this._templateNormal = this._dictionary.get('N');
}
return this._templateNormal;
},
set: function (value) {
Eif (value) {
this._templateNormal = value;
Eif (this._isNormalKey) {
this._dictionary.set('N', this._templateNormal);
}
}
},
enumerable: true,
configurable: true
});
PdfAppearance.prototype._initialize = function () {
this.normal = new pdf_template_1.PdfTemplate(this._bounds, this._crossReference);
};
return PdfAppearance;
}());
exports.PdfAppearance = PdfAppearance;
});
|