import { PDFDict, PDFName, PDFStream } from "../..";
var PDFAnnotationAppearance = /** @class */ (function () {
    function PDFAnnotationAppearance(dict) {
        this.dict = dict;
    }
    PDFAnnotationAppearance.fromDict = function (dict) {
        return new PDFAnnotationAppearance(dict);
    };
    PDFAnnotationAppearance.prototype.N = function () {
        var normalAppearance = this.dict.lookup(PDFName.N);
        if (normalAppearance instanceof PDFDict) {
            return this.dict.lookup(PDFName.N, PDFDict);
        }
        return this.dict.lookup(PDFName.N, PDFStream);
    };
    PDFAnnotationAppearance.prototype.getNormal = function () {
        return this.N();
    };
    PDFAnnotationAppearance.prototype.D = function () {
        var downAppearance = this.dict.lookup(PDFName.D);
        if (downAppearance instanceof PDFDict) {
            return this.dict.lookup(PDFName.D, PDFDict);
        }
        else if (downAppearance instanceof PDFStream) {
            return this.dict.lookup(PDFName.D, PDFStream);
        }
        return this.N();
    };
    PDFAnnotationAppearance.prototype.getDown = function () {
        return this.D();
    };
    PDFAnnotationAppearance.prototype.R = function () {
        var rolloverAppearance = this.dict.lookup(PDFName.R);
        if (rolloverAppearance instanceof PDFDict) {
            return this.dict.lookup(PDFName.R, PDFDict);
        }
        else if (rolloverAppearance instanceof PDFStream) {
            return this.dict.lookup(PDFName.R, PDFStream);
        }
        return this.N();
    };
    PDFAnnotationAppearance.prototype.getRollover = function () {
        return this.R();
    };
    return PDFAnnotationAppearance;
}());
export default PDFAnnotationAppearance;
//# sourceMappingURL=PDFAnnotationAppearance.js.map