@syncfusion/ej2-pdf
Version:
Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.
453 lines (452 loc) • 14.6 kB
TypeScript
import { _PdfAbstractSyntaxElement } from './abstract-syntax';
import { _ConstructionType, _TagClassType } from './enumerator';
import { _PdfCharacterString } from './character-string';
/**
* Unique BER/DER encoding element used for encodings that require element uniqueness
* and provides helpers for serialization and decoding of primitive and constructed values.
*
* @private
*/
export declare class _PdfUniqueEncodingElement extends _PdfAbstractSyntaxElement {
/**
* Internal storage for this element's value; may be raw bytes or child elements.
*/
private _value;
/**
* Cached current computed value length when available.
*/
private _currentValueLength;
constructor(tagClass?: _TagClassType, construction?: _ConstructionType, tagNumber?: number, value?: any);
/**
* Returns the raw value bytes for this element, handling explicit conversions
* for primitive encodings and concatenating constructed content when necessary.
*
* @private
* @returns {Uint8Array} The raw value bytes.
*/
_getValue(): Uint8Array;
/**
* Sets the raw value bytes for this element and updates the cached length.
*
* @param {Uint8Array} v The value bytes to assign.
* @returns {void} nothing.
*/
_setValue(v: Uint8Array): void;
/**
* Decodes and returns the boolean value for this element.
*
* @private
* @returns {boolean} The decoded boolean.
*/
_getBooleanValue(): boolean;
/**
* Encodes and sets a boolean value for this element.
*
* @private
* @param {boolean} value The boolean to set.
* @returns {void} nothing.
*/
_setBooleanValue(value: boolean): void;
/**
* Returns the bit string content for this element, concatenating parts if constructed.
*
* @private
* @returns {Uint8ClampedArray} The bit string.
*/
_getBitString(): Uint8ClampedArray;
/**
* Encodes and sets a bit string value for this element.
*
* @private
* @param {Uint8ClampedArray} value The bit string to assign.
* @returns {void} nothing.
*/
_setBitString(value: Uint8ClampedArray): void;
/**
* Returns the octet string bytes for this element.
*
* @private
* @returns {Uint8Array} The octet string bytes.
*/
_getOctetString(): Uint8Array;
/**
* Sets the octet string value for this element.
*
* @private
* @param {Uint8Array} value The octet string bytes to assign.
* @returns {void} nothing.
*/
_setOctetString(value: Uint8Array): void;
/**
* Returns the object descriptor string for this element.
*
* @private
* @returns {string} The object descriptor.
*/
_getObjectDescriptor(): string;
/**
* Encodes and sets the object descriptor string for this element.
*
* @private
* @param {string} value The descriptor to assign.
* @returns {void} nothing.
*/
_setObjectDescriptor(value: string): void;
/**
* Returns the UTF-8 string value for this element.
*
* @private
* @returns {string} The UTF-8 decoded string.
*/
_getUtf8String(): string;
/**
* Sets the UTF-8 string value for this element.
*
* @private
* @param {string} value The UTF-8 string to assign.
* @returns {void} nothing.
*/
_setUtf8String(value: string): void;
/**
* Returns the sequence child elements for this constructed element.
*
* @private
* @returns {_PdfAbstractSyntaxElement[]} The sequence elements.
*/
_getSequence(): _PdfAbstractSyntaxElement[];
/**
* Sets the sequence child elements for this element and marks it constructed.
*
* @private
* @param {_PdfAbstractSyntaxElement[]} value The sequence elements to assign.
* @returns {void} nothing.
*/
_setSequence(value: _PdfAbstractSyntaxElement[]): void;
/**
* Returns the elements for an abstract SET value after uniqueness validation.
*
* @private
* @returns {_PdfAbstractSyntaxElement[]} The set elements.
*/
_getAbstractSetValue(): _PdfAbstractSyntaxElement[];
/**
* Sets the elements for an abstract SET value.
*
* @private
* @param {_PdfAbstractSyntaxElement[]} value The set elements to assign.
* @returns {void} nothing.
*/
_setAbstractSetValue(value: _PdfAbstractSyntaxElement[]): void;
/**
* Returns the elements when this is a `SEQUENCE OF`.
*
* @private
* @returns {_PdfAbstractSyntaxElement[]} The sequence-of elements.
*/
_getSequenceOf(): _PdfAbstractSyntaxElement[];
/**
* Sets the elements when this is a `SEQUENCE OF` and marks constructed.
*
* @private
* @param {_PdfAbstractSyntaxElement[]} value The elements to assign.
* @returns {void} nothing.
*/
_setSequenceOf(value: _PdfAbstractSyntaxElement[]): void;
/**
* Returns the elements when this is a `SET OF`.
*
* @private
* @returns {_PdfAbstractSyntaxElement[]} The set-of elements.
*/
_getAbstractSetOf(): _PdfAbstractSyntaxElement[];
/**
* Sets the elements when this is a `SET OF`.
*
* @private
* @param {_PdfAbstractSyntaxElement[]} value The elements to assign.
* @returns {void} nothing.
*/
_setAbstractSetOf(value: _PdfAbstractSyntaxElement[]): void;
_getNumericString(): string;
_setNumericString(value: string): void;
/**
* Returns the printable string value for this element.
*
* @private
* @returns {string} The printable string.
*/
_getPrintableString(): string;
/**
* Sets the printable string value for this element.
*
* @private
* @param {string} value The printable string to assign.
* @returns {void} nothing.
*/
_setPrintableString(value: string): void;
/**
* Returns teleprinter (Teletex) text bytes for this element.
*
* @private
* @returns {Uint8Array} The teleprinter bytes.
*/
_getTeleprinterText(): Uint8Array;
/**
* Sets teleprinter text bytes for this element.
*
* @private
* @param {Uint8Array} value The bytes to assign.
* @returns {void} nothing.
*/
_setTeleprinterText(value: Uint8Array): void;
/**
* Returns videotex information bytes for this element.
*
* @private
* @returns {Uint8Array} The videotex bytes.
*/
_getVideoTextInformation(): Uint8Array;
/**
* Sets videotex information bytes for this element.
*
* @private
* @param {Uint8Array} value The bytes to assign.
* @returns {void} nothing.
*/
_setVideoTextInformation(value: Uint8Array): void;
/**
* Returns the IA5 (international alphabet) string for this element.
*
* @private
* @returns {string} The IA5 string.
*/
_getInternationalAlphabetString(): string;
/**
* Sets the IA5 (international alphabet) string for this element.
*
* @private
* @param {string} value The IA5 string to assign.
* @returns {void} nothing.
*/
_setInternationalAlphabetString(value: string): void;
/**
* Returns the graphic string for this element.
*
* @private
* @returns {string} The graphic string.
*/
_getGraphicString(): string;
/**
* Sets the graphic string value for this element.
*
* @private
* @param {string} value The graphic string to assign.
* @returns {void} nothing.
*/
_setGraphicString(value: string): void;
/**
* Returns the visible string for this element.
*
* @private
* @returns {string} The visible string.
*/
_getVisibleString(): string;
/**
* Sets the visible string value for this element.
*
* @private
* @param {string} value The visible string to assign.
* @returns {void} nothing.
*/
_setVisibleString(value: string): void;
/**
* Returns the universal (UTF-32) string for this element.
*
* @private
* @returns {string} The universal string.
*/
_getUniversalString(): string;
/**
* Sets the universal (UTF-32) string for this element.
*
* @private
* @param {string} value The universal string to assign.
* @returns {void} nothing.
*/
_setUniversalString(value: string): void;
/**
* Returns the BMP (UTF-16BE) string for this element.
*
* @private
* @returns {string} The BMP string.
*/
_getBmpString(): string;
/**
* Sets the BMP (UTF-16BE) string for this element.
*
* @private
* @param {string} value The BMP string to assign.
* @returns {void} nothing.
*/
_setBmpString(value: string): void;
/**
* Constructs this element from provided child elements (internal helper).
*
* @private
* @param {_PdfAbstractSyntaxElement[]} els The child elements to set.
* @returns {void} nothing.
*/
_construct(els: _PdfAbstractSyntaxElement[]): void;
/**
* Encodes a JavaScript value into the appropriate ASN.1 encoding for this element.
*
* @private
* @param {any} value The value to encode.
* @returns {void} nothing.
*/
_encode(value: any): void;
/**
* Wraps a set of basic encoding elements into a `_PdfUniqueEncodingElement` representing a SET.
*
* @private
* @param {_PdfAbstractSyntaxElement[]} set The set elements.
* @returns {_PdfUniqueEncodingElement} The constructed set element.
*/
_fromSet(set: (_PdfAbstractSyntaxElement)[]): _PdfUniqueEncodingElement;
/**
* Wraps a set-of elements into a `_PdfUniqueEncodingElement` representing a SET OF.
*
* @private
* @param {_PdfUniqueEncodingElement[]} set The set-of elements.
* @returns {_PdfUniqueEncodingElement} The constructed set-of element.
*/
_fromSetOf(set: (_PdfUniqueEncodingElement)[]): _PdfUniqueEncodingElement;
/**
* Retrieves the single inner element for explicitly-encoded elements.
*
* @private
* @returns {_PdfAbstractSyntaxElement} The inner element.
*/
_getInner(): _PdfAbstractSyntaxElement;
/**
* Sets a single inner element and marks this element as constructed.
*
* @private
* @param {_PdfAbstractSyntaxElement} value The inner element to assign.
* @returns {void} nothing.
*/
_setInner(value: _PdfAbstractSyntaxElement): void;
/**
* Decodes this element from the provided DER bytes and returns number of bytes consumed.
*
* @private
* @param {Uint8Array} bytes The input bytes to decode.
* @returns {number} The number of bytes consumed.
*/
_fromBytes(bytes: Uint8Array): number;
/**
* Produces the tag and length bytes for this element.
*
* @private
* @returns {Uint8Array} The tag-and-length bytes.
*/
_tagAndLengthBytes(): Uint8Array;
/**
* Serializes this element into an array of buffers representing tag, length and value parts.
*
* @private
* @returns {Uint8Array[]} Array of buffers.
*/
_toBuffers(): Uint8Array[];
/**
* Serializes constructed or primitive content into a single byte buffer.
*
* @private
* @returns {Uint8Array} The serialized value bytes.
*/
_serialize(): Uint8Array;
/**
* Returns the length octets for the current value length.
*
* @private
* @returns {number[]} The length octets.
*/
_getLengthOctets(): number[];
/**
* Returns the component elements when this element represents constructed content.
*
* @private
* @returns {_PdfAbstractSyntaxElement[]} Component elements.
*/
_getComponents(): _PdfAbstractSyntaxElement[];
/**
* Decodes an ASN.1 BIT STRING from bytes into a bit array.
*
* @private
* @param {Uint8Array} value The bytes to decode.
* @returns {Uint8ClampedArray} The decoded bit array.
*/
_decodeBitString(value: Uint8Array): Uint8ClampedArray;
/**
* Decodes an ASN.1 BOOLEAN from bytes.
*
* @private
* @param {Uint8Array} value The bytes to decode.
* @returns {boolean} The decoded boolean.
*/
_decodeBoolean(value: Uint8Array): boolean;
/**
* Encodes a `_PdfCharacterString` structure into bytes suitable for this element.
*
* @private
* @param {_PdfCharacterString} value The character-string structure to encode.
* @returns {Uint8Array} The encoded bytes.
*/
_encodeCharacterString(value: _PdfCharacterString): Uint8Array;
/**
* Decodes a sequence of unique encoding elements from bytes.
*
* @private
* @param {Uint8Array} value The bytes to decode.
* @returns {_PdfUniqueEncodingElement[]} Decoded unique elements.
*/
_decodeSequence(value: Uint8Array): _PdfUniqueEncodingElement[];
/**
* Wraps a sequence of abstract syntax elements into a unique encoding element.
*
* @private
* @param {_PdfAbstractSyntaxElement[]} sequence The sequence elements.
* @returns {_PdfUniqueEncodingElement} The wrapped unique element.
*/
_fromSequence(sequence: (_PdfAbstractSyntaxElement)[]): _PdfUniqueEncodingElement;
/**
* Returns the external encoding represented by an encoding element, mapping tag options to values.
*
* @private
* @param {_PdfAbstractSyntaxElement} encodingElement The encoding element describing the external.
* @returns {_PdfAbstractSyntaxElement|Uint8Array|Uint8ClampedArray} The decoded external payload.
*/
_getExternalEncoding(encodingElement: _PdfAbstractSyntaxElement): _PdfAbstractSyntaxElement | Uint8Array | Uint8ClampedArray;
/**
* Returns the length in bytes of this element's encoded value.
*
* @private
* @returns {number} The value length.
*/
_valueLength(): number;
/**
* Computes the number of bytes required to encode the length field for a value length.
*
* @private
* @param {number} [valueLength] Optional explicit value length to evaluate.
* @returns {number} The number of bytes used to encode the length.
*/
_lengthLength(valueLength?: number): number;
/**
* Returns the total encoded length of this element including tag and length fields.
*
* @private
* @returns {number} The combined tag+length+value length in bytes.
*/
_tagValueLength(): number;
}