import { BufferSource as BufferSource$1 } from 'pvtsutils';
import { EventEmitter } from 'events';
import * as pkijs from 'pkijs';
import { X509Certificate } from '@peculiar/x509';

/**
 * Defines commonly used character codes and sets in PDF document processing
 */
declare class CharSet {
    /** Line feed character (0x0a, \n) */
    static readonly newLineChar = 10;
    /** Common whitespace characters including NUL, tab, LF, FF, CR, and space */
    static readonly whiteSpaceChars: Uint8Array<ArrayBuffer>;
    /** Less than symbol '<' (0x3c) */
    static readonly lessThanChar = 60;
    /** Greater than symbol '>' (0x3e) */
    static readonly greaterThanChar = 62;
    /** Valid hexadecimal characters (0-9, a-f, A-F) */
    static readonly hexadecimalChars: Uint8Array<ArrayBuffer>;
    /** Percent symbol '%' (0x25) */
    static readonly percentChar = 37;
    /** Space character (0x20) */
    static readonly whiteSpaceChar = 32;
    /** ASCII representation of 'trailer' keyword */
    static readonly trailerChars: Uint8Array<ArrayBuffer>;
    /** ASCII representation of 'xref' keyword */
    static readonly xrefChars: Uint8Array<ArrayBuffer>;
}

type ViewReaderFindCallback = (value: number, index: number, array: Uint8Array, reader: ViewReader) => boolean;
declare class ViewReader {
    view: Uint8Array;
    position: number;
    backward: boolean;
    get isEOF(): boolean;
    constructor(view: BufferSource$1);
    /**
     * Finds index of the first element that satisfies the callback function. If not found, returns -1.
     * @param param Callback function, view or text to find
     * @returns Returns index of the first element that satisfies the callback function. If not found, returns -1.
     */
    findIndex(cb: ViewReaderFindCallback): number;
    /**
     * Finds index of the first element that satisfies the view. If not found, returns -1.
     * @param view View to find
     * @returns Returns index of the first element that satisfies the view. If not found, returns -1.
     */
    findIndex(view: Uint8Array): number;
    /**
     * Finds index of the first element that satisfies the text. If not found, returns -1.
     * @param text Text to find
     * @returns Returns index of the first element that satisfies the text. If not found, returns -1.
     */
    findIndex(text: string): number;
    findIndex(param: ViewReaderFindCallback | Uint8Array | string): number;
    /**
     * Finds index of the first element that satisfies the callback function. If not found, returns -1.
     * @param cb Callback function
     * @returns Returns index of the first element that satisfies the callback function. If not found, returns -1.
     */
    protected findIndexByCallback(cb: ViewReaderFindCallback): number;
    /**
     * Finds index of the first element that satisfies the callback function. If not found, returns -1.
     * @param text Text to find
     * @returns Returns index of the first element that satisfies the text. If not found, returns -1.
     */
    protected findIndexByString(text: string): number;
    /**
     * Finds index of the first element that satisfies the callback function. If not found, returns -1.
     * @param view View to find
     * @returns Returns index of the first element that satisfies the view. If not found, returns -1.
     */
    protected findIndexByView(view: Uint8Array): number;
    readByte(): number;
    readUint8(): number;
    readUint16(littleEndian?: boolean): number;
    readUint32(littleEndian?: boolean): number;
    readString(size: number): string;
    read(): Uint8Array;
    read(length: number): Uint8Array;
    read(text: string): Uint8Array;
    read(view: Uint8Array): Uint8Array;
    read(length: number): Uint8Array;
    read(cb: ViewReaderFindCallback): Uint8Array;
    read(param?: ViewReaderFindCallback | number | string | Uint8Array): Uint8Array;
    /**
     * Returns byte value at the current position, without cursor changing
     * @returns Byte value
     */
    get current(): number | undefined;
    /**
     * Moves cursor to the end of the view
     */
    end(): void;
    /**
     * Moves cursor to the beginning of the view
     */
    start(): void;
}

type ViewWriterCallback = (subarray: Uint8Array) => void;
declare class ViewWriter {
    private buffer;
    private totalLength;
    get length(): number;
    private addToLength;
    write(data: BufferSource$1, cb?: ViewWriterCallback): void;
    writeLine(data?: BufferSource$1): void;
    writeByte(char: number): void;
    writeByteLine(char: number): void;
    writeString(text: string): void;
    writeStringLine(text: string): void;
    toArrayBuffer(): ArrayBuffer;
    toUint8Array(): Uint8Array;
    toString(): string;
}

declare const staticDataFF: Uint8Array<ArrayBuffer>;
declare const staticData: Uint8Array<ArrayBuffer>;
declare const algorithms: {
    md5: {
        name: string;
    };
    rc4: {
        name: string;
    };
    sha256: {
        name: string;
    };
    sha384: {
        name: string;
    };
    sha512: {
        name: string;
    };
    AesCBC: {
        name: string;
    };
    AesECB: {
        name: string;
    };
};
interface globalParametersCryptFilter {
    stm: {
        key: ArrayBuffer;
        keyType: string;
    };
    str: {
        key: ArrayBuffer;
        keyType: string;
    };
}
interface clientSideParametersPublicKey {
    keys: CryptoKey[];
    certificates: unknown[];
    algorithm: string;
    encrypt?: {
        seed: ArrayBuffer;
        recipientsBuffer: ArrayBuffer;
    };
}

declare class ActionDictionary extends PDFDictionary {
    static readonly TYPE = "Action";
    /**
     * The type of PDF object that this dictionary describes; if
     * present, shall be `Action` for an action dictionary.
     */
    type: "Action" | null;
    /**
     * The type of action that this dictionary describes
     */
    s: string;
    /**
     * The next action or sequence of actions that shall be performed after
     * the action represented by this dictionary. The value is either a single
     * action dictionary or an array of action dictionaries that shall be performed
     * in order; see Note 1 for further discussion.
     * @remarks PDF 1.2
     */
    next: PDFDictionary | PDFArray | null;
    onCreate(): void;
}

declare class AdditionalActionsDictionary extends PDFDictionary {
    /**
     * An action that shall be performed when the cursor enters the
     * annotation’s active area.
     * @remarks PDF 1.2
     */
    e: PDFDictionary | null;
    /**
     * An action that shall be performed when the cursor exits the
     * annotation’s active area.
     * @remarks PDF 1.2
     */
    x: PDFDictionary | null;
    /**
     * An action that shall be performed when the mouse button is
     * pressed inside the annotation’s active area.
     * @remarks PDF 1.2
     */
    d: PDFDictionary | null;
    /**
     * An action that shall be performed when the mouse button is
     * released inside the annotation’s active area.
     * @remarks PDF 1.2
     */
    u: PDFDictionary | null;
    /**
     * An action that shall be performed when the annotation receives the input focus.
     * @remarks PDF 1.2
     */
    fo: PDFDictionary | null;
    /**
     * An action that shall be performed when the annotation loses the input focus
     * @remarks
     * - PDF 1.2
     * - widget annotations only)
     */
    bl: PDFDictionary | null;
    /**
     * An action that shall be performed when the page containing the annotation is opened.
     * @remarks PDF 1.5
     */
    po: PDFDictionary | null;
    /**
     * An action that shall be performed when the page containing the annotation is closed.
     * @remarks PDF 1.5
     */
    pc: PDFDictionary | null;
    /**
     * An action that shall be performed when the page containing the annotation becomes visible.
     * @remarks PDF 1.5
     */
    pv: PDFDictionary | null;
    /**
     * An action that shall be performed when the page containing the annotation is no longer visible
     * in the interactive PDF processor’s user interface.
     * @remarks PDF 1.5
     */
    pi: PDFDictionary | null;
}

interface EncryptionObject {
    encrypted?: boolean;
    encryptAsync(): Promise<ArrayBuffer>;
    decryptAsync(): Promise<ArrayBuffer>;
}

declare abstract class PDFString extends PDFObject {
    static DEFAULT_TEXT: string;
    text: string;
    constructor();
    constructor(view: BufferSource$1);
    constructor(string: PDFString);
    constructor(text: string);
    constructor(param?: PDFString | string | BufferSource$1);
    protected onCopy(copy: PDFString): void;
    protected onEqual(target: PDFObject): boolean;
}

declare abstract class PDFTextString extends PDFString implements EncryptionObject {
    encrypted?: boolean;
    encryptAsync(): Promise<ArrayBuffer>;
    decryptAsync(): Promise<ArrayBuffer>;
    encode(): Promise<string>;
    decode(): Promise<string>;
    toArrayBuffer(): ArrayBuffer;
    toUint8Array(): Uint8Array;
    protected onCreate(): void;
    protected onCopy(copy: PDFTextString): void;
}

declare class DocumentSecurityStoreDictionary extends PDFDictionary {
    static readonly TYPE = "DSS";
    /**
     * If present, shall be DSS for a document security store dictionary
     */
    Type: typeof DocumentSecurityStoreDictionary.TYPE | null;
    /**
     * This dictionary contains Signature VRI dictionaries
     */
    VRI: Maybe<PDFDictionary>;
    /**
     * An array of indirect reference to streams, each containing one DER encoded X.509 certificate (see RFC 5280).
     * This array contains certificates that may be used in the validation of any signatures in the document.
     */
    Certs: Maybe<PDFArray>;
    /**
     * An array of indirect references to streams, each containing a DER encoded
     * Online Certificate Status Protocol (OCSP) response (see RFC 6960). This
     * array contains OCSPs that may be used in the validation of the signatures
     * in the document
     */
    OCSPs: Maybe<PDFArray>;
    /**
     * An array of indirect references to streams, each containing a DER encoded
     * Certificate Revocation List (CRL) (see RFC 5280). This array contains
     * CRLs that may be used in the validation of the signatures in the document
     */
    CRLs: Maybe<PDFArray>;
    protected onCreate(): void;
}

declare class DeveloperExtensionsDictionary extends PDFDictionary {
    static readonly TYPE = "DeveloperExtensions";
    /**
     * The type of PDF object that this dictionary describes; if present, shall
     * be DeveloperExtensions.
     * @remarks
     * - Optional
     */
    Type: typeof DeveloperExtensionsDictionary.TYPE;
    /**
     * The name of the PDF version to which this extension applies. The name
     * shall be consistent with the syntax used for the Version entry of the catalog
     * dictionary (see 7.7.2, "Document catalog dictionary").
     * @remarks
     * - Required
     */
    BaseVersion: string;
    /**
     * An integer defined by the developer to denote the extension being
     * used. If the developer introduces more than one extension to a
     * given BaseVersion the extension level numbers assigned by that developer shall
     * increase over time.
     * @remarks
     * - Required
     */
    ExtensionLevel: number;
    /**
     * A URL that refers to the documentation for this extension (see Annex E,
     * "PDF Name Registry").
     * @remarks
     * - Optional
     */
    URL: PDFTextString | null;
    protected onCreate(): void;
}

declare class ExtensionsDictionary extends PDFDictionary {
    static readonly TYPE = "Extensions";
    /**
     * The type of PDF object that this dictionary describes; if present, shall
     * be Extensions.
     * @remarks
     * - Optional
     */
    Type: typeof ExtensionsDictionary.TYPE;
    /**
     * Developer extensions dictionary
     */
    ADBE: Maybe<DeveloperExtensionsDictionary>;
}

declare class IconFitDictionary extends PDFDictionary {
    /**
     * The circumstances under which the icon shall be scaled inside the
     * annotation rectangle:
     * - A Always scale.
     * - B Scale only when the icon is bigger than the annotation rectangle.
     * - S Scale only when the icon is smaller than the annotation rectangle.
     * - N Never scale.
     *
     * Default value: A.
     */
    sw: "A" | "B" | "S" | "N";
    /**
     * The type of scaling that shall be used:
     * - A Anamorphic scaling: Scale the icon to fill the annotation rectangle exactly,
     * without regard to its original aspect ratio (ratio of width to height).
     * - P Proportional scaling: Scale the icon to fit the width or height of the annotation
     * rectangle while maintaining the icon’s original aspect ratio. If the required
     * horizontal and vertical scaling factors are different, use the smaller of the two,
     * centring the icon within the annotation rectangle in the other dimension.
     *
     * Default value: P.
     */
    s: "A" | "P";
    /**
     * An array of two numbers that shall be between 0.0 and 1.0 indicating the
     * fraction of leftover space to allocate at the left and bottom of the icon. A value of [0.0
     * 0.0] shall position the icon at the bottom-left corner of the annotation rectangle. A
     * value of [0.5 0.5] shall centre it within the rectangle. This entry shall be used only if
     * the icon is scaled proportionally.
     *
     * Default value: [0.5 0.5].
     */
    a: PDFArray | null;
    /**
     * If true, indicates that the button appearance shall be scaled to fit
     * fully within the bounds of the annotation without taking into consideration the line
     * width of the border. Default value: false.
     * @remarks PDF 1.5
     */
    fb: boolean;
}

declare enum CaptionPosition {
    /**
     * No icon; caption only
     */
    noIcon = 0,
    /**
     * No caption; icon only
     */
    noCaption = 1,
    /**
     * Caption below the icon
     */
    captionBelow = 2,
    /**
     * Caption above the icon
     */
    captionAbove = 3,
    /**
     * Caption to the right of the icon
     */
    captionRight = 4,
    /**
     * Caption to the left of the icon
     */
    captionLeft = 5,
    /**
     * Caption overlaid directly on the icon
     */
    captionOverlaid = 6
}
declare class AppearanceCharacteristicsDictionary extends PDFDictionary {
    /**
     * The number of degrees by which the widget annotation shall be
     * rotated counterclockwise relative to the page. The value shall be a multiple of
     * 90. Default value: 0
     */
    r: number | null;
    /**
     * An array of numbers that shall be in the range 0.0 to 1.0 specifying
     * the colour of the widget annotation’s border. The number of array elements
     * determines the colour space in which the colour shall be defined:
     * - 0 No colour; transparent
     * - 1 DeviceGray
     * - 3 DeviceRGB
     * - 4 DeviceCMYK
     */
    BC: PDFArray | null;
    /**
     * An array of numbers that shall be in the range 0.0 to 1.0 specifying
     * the colour of the widget annotation’s background. The number of array
     * elements shall determine the colour space, as described for BC.
     */
    BG: PDFArray | null;
    /**
     * The widget annotation’s normal caption, which
     * shall be displayed when it is not interacting with the user.
     *
     * Unlike the remaining entries listed in this Table, which apply only to widget
     * annotations associated with push-button fields (see 12.7.5.2.2, "Pushbuttons"),
     * he CA entry may be used with any type of button field, including
     * check boxes (see 12.7.5.2.3, "Check boxes") and radio buttons (12.7.5.2.4,
     * "Radio buttons").
     * @remarks Button fields only
     */
    ca: PDFTextString | null;
    /**
     * The widget annotation’s rollover caption, which shall be displayed
     * when the user rolls the cursor into its active area
     * without pressing the mouse button.
     * @remarks Push-button fields only
     */
    rc: PDFTextString | null;
    /**
     * The widget annotation’s alternate (down) caption, which shall be displayed
     * when the mouse button is pressed within its active area.
     * @remarks Push-button fields only
     */
    ac: PDFTextString | null;
    /**
     * A form XObject defining the widget annotation’s normal icon, which shall be
     * displayed when it is not interacting with the user.
     * @remarks
     * - push-button fields only
     * - shall be an indirect reference
     */
    I: PDFStream | null;
    /**
     * A form XObject defining the widget annotation’s rollover icon, which shall be
     * displayed when the user rolls the cursor into its active area without pressing
     * the mouse button.
     * @remarks Push-button fields only
     */
    ri: PDFStream | null;
    /**
     * A form XObject defining the widget annotation’s alternate (down) icon, which shall
     * be displayed when the mouse button is pressed within its active area.
     * @remarks Push-button fields only
     */
    ix: PDFStream | null;
    /**
     * An icon fit dictionary specifying how the widget annotation’s icon
     * shall be displayed within its annotation rectangle. If present, the icon fit
     * dictionary shall apply to all of the annotation’s icons (normal, rollover, and
     * alternate).
     * @remarks Push-button fields only
     */
    if: IconFitDictionary | null;
    /**
     * A code indicating where to position the
     * text of the widget annotation’s caption relative to its icon:
     * - 0 No icon; caption only
     * - 1 No caption; icon only
     * - 2 Caption below the icon
     * - 3 Caption above the icon
     * - 4 Caption to the right of the icon
     * - 5 Caption to the left of the icon
     * - 6 Caption overlaid directly on the icon
     *
     * Default value: 0.
     * @remarks Push-button fields only
     */
    tp: CaptionPosition;
}

declare enum BorderStyle {
    /**
     * A solid rectangle surrounding the annotation
     */
    solid = "S",
    /**
     * A dashed rectangle surrounding the annotation. The dash pattern
     * may be specified by the D entry
     */
    dashed = "D",
    /**
     * A simulated embossed rectangle that appears to be raised above
     * the surface of the page
     */
    beveled = "B",
    /**
     * A simulated engraved rectangle that appears to be recessed below
     * the surface of the page
     */
    insert = "I",
    /**
     * A single line along the bottom of the annotation rectangle
     */
    underline = "U"
}
declare class BorderStyleDictionary extends PDFDictionary {
    static readonly TYPE = "Border";
    /**
     * The type of PDF object that this dictionary describes; if present, shall
     * be `Border` for a border style dictionary.
     */
    type: typeof BorderStyleDictionary.TYPE | null;
    /**
     * The border width in points. If this value is 0, no border shall drawn.
     * Default value: 1
     */
    W: number;
    /**
     * The border style
     */
    S: BorderStyle | null;
    /**
     * A dash array defining a pattern of dashes and gaps that shall be used in
     * drawing a dashed border (border style D in the S entry). The dash array shall be
     * specified in the same format as in the line dash pattern parameter of the graphics
     * state (see 8.4.3.6, "Line dash pattern"). The dash phase shall not be specified and
     * shall be assumed to be 0.
     */
    D: PDFArray | null;
    protected onCreate(): void;
}

interface WidgetOptions {
    coordinate: {
        x: number;
        y: number;
    };
}
declare enum WidgetHighlightingMode {
    /**
     * No highlighting.
     */
    none = "N",
    /**
     * Invert the colours used to display the contents of the annotation rectangle.
     */
    invert = "I",
    /**
     * Stroke the colours used to display the annotation border. That
     * is, for each colour channel in the colour space used for display of the
     * annotation value, colour values shall be transformed by the function
     * `𝑓(𝑥) = 1 – 𝑥` for display.
     */
    outline = "O",
    /**
     * Display the annotation’s down appearance, if any (see 12.5.5,
     * "Appearance streams"). If no down appearance is defined, the contents
     * of the annotation rectangle shall be offset to appear as if it were being
     * pushed below the surface of the page.
     */
    push = "P",
    /**
     * Same as P (which is preferred).
     */
    toggle = "T"
}
declare class WidgetDictionary extends AnnotationDictionary {
    static readonly SUBTYPE = "Widget";
    /**
     * The type of annotation that this dictionary describes. Shall be
     * `Widget` for a widget annotation.
     */
    subtype: typeof WidgetDictionary.SUBTYPE;
    /**
     * The annotation’s highlighting mode, the visual effect that shall be
     * used when the mouse button is pressed or held down inside its active area.
     *
     * A highlighting mode other than P shall override any down appearance
     * defined for the annotation. Default value: I
     */
    h: WidgetHighlightingMode;
    /**
     * An appearance characteristics dictionary (see {@link AppearanceCharacteristicsDictionary}) that shall be used in
     * constructing a dynamic appearance stream specifying the annotation’s visual
     * presentation on the page.
     *
     * The name MK for this entry is of historical significance only and has no direct
     * meaning
     */
    MK: Maybe<AppearanceCharacteristicsDictionary>;
    /**
     * An action that shall be performed when the annotation is activated
     * @remarks PDF 1.1
     */
    A: Maybe<ActionDictionary>;
    /**
     * An additional-actions dictionary defining the annotation’s behavior in response
     * to various trigger events (see {@link AdditionalActionsDictionary}).
     * @remarks PDF 1.2
     */
    aa: AdditionalActionsDictionary | null;
    /**
     * A border style dictionary (see {@link BorderStyleDictionary}")
     * specifying the width and dash pattern that shall be used in drawing the annotation’s border.
     * The annotation dictionary’s AP entry, if present, shall take precedence over the BS entry.
     * @remarks PDF 1.2
     */
    BS: Maybe<BorderStyleDictionary>;
    /**
     * An indirect reference to the widget annotation’s parent field.
     * A widget annotation may have at most one parent; that is, it can be included
     * in the Kids array of at most one field
     * @remarks Required if this widget annotation is one of multiple children in a field; optional otherwise
     */
    Parent: PDFField | null;
    protected onCreate(): void;
}
declare class SingleWidgetDictionary extends WidgetDictionary implements IFieldDictionary {
    ft: string;
    Kids: Maybe<PDFArray>;
    t: PDFTextString;
    TU: PDFLiteralString | null;
    tm: PDFLiteralString | null;
    ff: FieldFlags | number;
    V: PDFObjectTypes | null;
    dv: PDFObjectTypes | null;
}

declare enum FieldFlags {
    /**
     * If set, an interactive PDF processor shall not allow a user to change the
     * value of the field. Additionally, any associated widget annotations should
     * not interact with the user; that is, they should not respond to mouse clicks
     * nor change their appearance in response to mouse motions.
     */
    readOnly = 1,
    /**
     * If set, the field shall have a value at the time it is exported by a submit-form action
     */
    required = 2,
    /**
     * If set, the field shall not be exported by a submit-form action
     */
    noExport = 4
}
interface IFieldDictionary extends PDFDictionary {
    /**
     * The type of field that this dictionary describes
     */
    ft: string;
    /**
     * The field that is the immediate parent of this one
     */
    Parent: PDFDictionary | null;
    /**
     * An array of indirect references to the immediate children of this field
     */
    Kids: Maybe<PDFArray>;
    /**
     * The partial field name
     */
    t: PDFTextString;
    /**
     * An alternate field name that shall be used in place
     * of the actual field name wherever the field shall be identified in the
     * user interface (such as in error or status messages referring to the
     * field). This text is also useful when extracting the document’s contents
     * in support of accessibility to users with disabilities or for other
     * purposes
     */
    TU: PDFLiteralString | null;
    /**
     * The mapping name that shall be used when
     * exporting interactive form field data from the document
     */
    tm: PDFLiteralString | null;
    /**
     * A set of flags specifying various characteristics
     * of the field
     */
    ff: FieldFlags | number;
    /**
     * The field’s value, whose format varies depending on the field type
     */
    V: PDFObjectTypes | null;
    /**
     * The default value to which the field reverts when
     * a reset-form action is executed
     */
    dv: PDFObjectTypes | null;
    /**
     * An additional-actions dictionary defining the field’s
     * behavior in response to various trigger events
     */
    aa: AdditionalActionsDictionary | null;
}
declare class PDFField extends PDFDictionary implements IFieldDictionary {
    /**
     * The type of field that this dictionary describes
     *
     * - Btn Button (see 12.7.5.2, "Button fields")
     * - Tx Text (see 12.7.5.3, "Text fields")
     * - Ch Choice (see 12.7.5.4, "Choice fields")
     * - Sig (PDF 1.3) Signature (see 12.7.5.5, "Signature fields")
     */
    ft: string;
    /**
     * The field that is the immediate parent of this one
     *
     * Required if this field is the child of another in the field hierarchy; absent otherwise
     */
    Parent: PDFField | null;
    /**
     * An array of indirect references to the immediate children of this field
     */
    Kids: Maybe<PDFArray>;
    /**
     * The partial field name
     */
    t: PDFTextString;
    /**
     * An alternative field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface
     */
    TU: PDFLiteralString | null;
    /**
     * The mapping name that shall be used when exporting interactive form field data from the document
     */
    tm: PDFLiteralString | null;
    /**
     * A set of flags specifying various characteristics of the field. Default is 0
     */
    ff: FieldFlags | number;
    /**
     * The field’s value, whose format varies depending on the field type
     */
    V: PDFObjectTypes | null;
    /**
     * The default value to which the field reverts when a reset-form action is executed
     */
    dv: PDFObjectTypes | null;
    /**
     * An additional-actions dictionary defining the field’s behavior in response to various trigger events
     */
    aa: AdditionalActionsDictionary | null;
    protected onCreate(): void;
    /**
     * Adds a new kid to this field. This operation can only be performed if this
     * field is a non-terminal node in the field hierarchy (e.g. a non-terminal
     * widget annotation).
     * @param kid
     */
    addKid(kid: IFieldDictionary | WidgetDictionary): boolean;
    removeKid(kid: IFieldDictionary | WidgetDictionary): boolean;
    /**
     * Returns the full name of this field.
     * @returns The full name of this field.
     */
    getFullName(): string;
    /**
     * Remove this field from its parent. This operation can only be performed if
     * this field has a parent.
     */
    removeFromParent(): boolean;
}

declare enum ButtonFlags {
    /**
     * If set, exactly one radio button shall be selected at all times;
     * selecting the currently selected button has no effect. If clear,
     * clicking the selected button deselects it, leaving no button selected
     */
    noToggleToOff = 16384,
    /**
     * If set, the field is a set of radio buttons; if clear, the field is a check box.
     * This flag may be set only if the Pushbutton flag is clear.
     */
    radio = 32768,
    /**
     * If set, the field is a push-button that does not retain a permanent value.
     */
    pushbutton = 65536,
    /**
     * If set, a group of radio buttons within a radio button field that
     * use the same value for the on state will turn on and off in unison; that
     * is if one is checked, they are all checked. If clear, the buttons are
     * mutually exclusive (the same behavior as HTML radio buttons).
     * @remarks PDF 1.5
     */
    radiosInUnison = 33554432
}
declare class ButtonDictionary extends PDFField {
    ff: FieldFlags | ButtonFlags;
    opt: PDFArray | null;
}

declare enum CertificateSeedValueFlags {
    subject = 1,
    issuer = 2,
    oid = 4,
    subjectDN = 8,
    reserved = 16,
    keyUsage = 32,
    url = 64
}
declare enum KeyUsageState {
    notShallBe = 0,
    shallBe = 1,
    notMatter = 2
}
interface CertificateSeedValueKeyUsages {
    digitalSignature: KeyUsageState;
    nonRepudiation: KeyUsageState;
    keyEncipherment: KeyUsageState;
    dataEncipherment: KeyUsageState;
    keyAgreement: KeyUsageState;
    keyCertSign: KeyUsageState;
    cRLSign: KeyUsageState;
    encipherOnly: KeyUsageState;
    decipherOnly: KeyUsageState;
}
declare class CertificateSeedValueDictionary extends PDFDictionary {
    /**
     * The type of PDF object that this dictionary describes
     *
     * if present, shall be SVCert for a certificate seed value dictionary
     */
    type: PDFName | null;
    /**
     * A set of bit flags specifying the interpretation of specific
     * entries in this dictionary.
     *
     * A value of 1 for the flag means that a signer shall be required
     * to use only the specified values for the entry.
     * A value of 0 means that other values are permissible.
     */
    ff: CertificateSeedValueFlags;
    /**
     * An array of byte strings containing DER-encoded X.509v3
     * certificates that are acceptable for signing
     */
    subject: PDFArray | null;
    /**
     * An array of dictionaries, each specifying a Subject Distinguished Name (DN)
     * that shall be present within the certificate for it to be acceptable for signing
     */
    subjectDN: PDFArray | null;
    /**
     * An array of ASCII strings, where each string specifies an acceptable
     * key-usage extension that shall be present in the signing certificate
     */
    keyUsage: CertificateSeedValueKeyUsages[] | null;
    /**
     * An array of byte strings containing DER-encoded X.509v3 certificates
     * of acceptable issuers
     */
    issuer: PDFArray | null;
    oid: PDFLiteralString[] | null;
    /**
     * A URL, the use for which shall be defined by the URLType entry
     */
    url: PDFLiteralString | null;
    /**
     * A name indicating the usage of the URL entry
     */
    urlType: string | null;
}

declare class PDFBoolean extends PDFObject {
    value: boolean;
    static readonly NAME = ObjectTypeEnum.Boolean;
    constructor();
    constructor(value: boolean);
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    protected onCopy(copy: PDFBoolean): void;
    toString(): string;
    protected onEqual(target: PDFObject): boolean;
}

declare class PDFName extends PDFString {
    static readonly NAME = ObjectTypeEnum.Name;
    static isNameChar(char: number): boolean;
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    toString(): string;
}

type PDFDictionaryKey = PDFName | string;
declare class PDFDictionary extends PDFObject {
    static readonly NAME: string;
    static readonly FORMAT_SPACE = "  ";
    static getName(name: string | PDFName): string;
    items: Map<string, PDFObjectTypes>;
    constructor();
    constructor(dictionary: PDFDictionary);
    constructor(items: [PDFDictionaryKey, PDFObjectTypes][]);
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    get size(): number;
    /**
     * Get dictionary value by name
     * @param name Name to search for
     */
    get(name: PDFDictionaryKey): PDFObjectTypes;
    /**
     * Get dictionary value by name
     * @param name Name to search for
     * @param type Expected type of returning value
     * @param replace Replace the original item
     */
    get<T extends PDFObject>(name: PDFDictionaryKey, type: abstract new () => T, replace?: boolean): T;
    has(name: PDFDictionaryKey): boolean;
    /**
     * Set dictionary value by name
     * @param name Name to search for
     * @param value Value to set
     */
    set(name: PDFDictionaryKey, value: PDFObjectTypes): this;
    /**
     * Remove dictionary value by name
     * @param name Name to search for
     */
    delete(name: PDFDictionaryKey): boolean;
    clear(): void;
    protected onCopy(copy: PDFDictionary): void;
    toString(depth?: number): string;
    protected onEqual(target: PDFObject): boolean;
    to<T extends PDFDictionary>(type: new () => T, replace?: boolean): T;
}

declare class PDFHexString extends PDFTextString {
    static readonly NAME = ObjectTypeEnum.HexString;
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    get data(): Uint8Array;
    toString(): string;
}

declare abstract class PDFIndirect extends PDFObject implements IPDFIndirect {
    id: number;
    generation: number;
    constructor();
    constructor(id: number, generation?: number);
    protected onFromPDF(reader: ViewReader): void;
    protected onCopy(copy: PDFIndirect): void;
    protected onEqual(target: PDFObject): boolean;
}

declare class PDFIndirectReference extends PDFIndirect {
    static readonly NAME = ObjectTypeEnum.IndirectReference;
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    getValue(): PDFObjectTypes;
    getValue<T extends PDFObject>(type: abstract new () => T): T;
    toString(): string;
}

declare class PDFNull extends PDFObject {
    static readonly NAME = ObjectTypeEnum.Null;
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    toString(): string;
    protected onEqual(target: PDFObject): boolean;
}

/**
 * Represents a numeric object in a PDF document.
 * Numeric objects are used to represent integers or real numbers.
 */
declare class PDFNumeric extends PDFObject {
    static readonly NAME = ObjectTypeEnum.Numeric;
    static assertPositiveInteger(number: PDFNumeric): asserts number is PDFNumeric;
    /** The value of the numeric object */
    value: number;
    constructor(value?: number);
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    toString(): string;
    protected onCopy(copy: PDFNumeric): void;
    protected onEqual(target: PDFObject): boolean;
}

type PDFObjectTypes = PDFNull | PDFBoolean | PDFNumeric | PDFLiteralString | PDFHexString | PDFName | PDFDictionary | PDFArray | PDFIndirectReference | PDFTextString;

declare class PDFArray extends PDFObject implements Iterable<PDFObject> {
    static readonly NAME = ObjectTypeEnum.Array;
    [Symbol.iterator](): Iterator<PDFObject, unknown, undefined>;
    items: PDFObjectTypes[];
    constructor(array: PDFArray);
    constructor(...items: PDFObjectTypes[]);
    /**
     * The number of items in the array.
     */
    get length(): number;
    /**
     * Retrieves an item from the array at the specified index.
     * @param index - The index of the item to retrieve.
     * @returns The item at the specified index, or `null` if the index is out of bounds.
     */
    find(index: number): PDFObjectTypes | null;
    /**
     * Retrieves an item from the array at the specified index.
     *
     * @param index - The index of the item to retrieve.
     * @param type - An optional constructor for the expected type of the item.
     * @param replace - An optional flag indicating whether to convert and replace the item
     * if it is not of the expected type.
     * @returns The item at the specified index, or `null` if the index is out of bounds.
     */
    find<T extends PDFObject>(index: number, type: abstract new () => T, replace?: boolean): T | null;
    /**
     * Retrieves an item from the array at the specified index.
     * @param index - The index of the item to retrieve.
     * @returns The item at the specified index.
     * @throws RangeError - If the index is out of bounds.
     */
    get(index: number): PDFObjectTypes;
    /**
     * Retrieves an item from the array at the specified index.
     *
     * @param index - The index of the item to retrieve.
     * @param type - An optional constructor for the expected type of the item.
     * @param replace - An optional flag indicating whether to replace the item if it is not found.
     * @returns The item at the specified index.
     * @throws RangeError - If the index is out of bounds.
     */
    get<T extends PDFObject>(index: number, type: abstract new () => T, replace?: boolean): T;
    /**
     * Adds one or more items to the end of the array.
     *
     * @param items - The items to be added to the array. Each item must be of type `PDFObjectTypes`.
     *
     * @remarks
     * - If an item is of type `Stream`, it will be made indirect.
     * - If an item is not indirect, its `ownerElement` will be set to this array.
     * - If the array has a `documentUpdate` and the item does not, the item's `documentUpdate`
     * will be set to the array's `documentUpdate`.
     *
     * @returns void
     */
    push(...items: PDFObjectTypes[]): void;
    /**
     * Returns the index of the specified item in the array.
     *
     * @param item - The item to locate in the array.
     * @returns The index of the item if found; otherwise, -1.
     */
    indexOf(item: PDFObjectTypes): number;
    /**
     * Checks if the specified item is present in the array.
     *
     * @param item - The item to search for in the array.
     * @returns `true` if the item is found in the array, otherwise `false`.
     */
    includes(item: PDFObjectTypes): boolean;
    /**
     * Removes elements from an array and, if necessary, inserts new elements in their place,
     * returning the deleted elements.
     * This method modifies the array and triggers the `modify` method if any elements are removed.
     *
     * @param start - The zero-based index at which to start changing the array.
     * @param deleteCount - The number of elements to remove from the array. If not specified,
     * all elements from the start index to the end of the array will be removed.
     * @returns An array containing the deleted elements.
     */
    splice(start: number, deleteCount?: number): PDFObjectTypes[];
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    protected onCopy(copy: PDFArray): void;
    toString(): string;
    protected onEqual(target: PDFObject): boolean;
    clear(): this;
}

declare class PDFComment extends PDFString {
    static readonly NAME = ObjectTypeEnum.Comment;
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    toString(): string;
}

declare abstract class Filter {
    decodeParams: PDFDictionary | null;
    abstract name: string;
    constructor(decodeParams?: PDFDictionary | null);
    /**
     * Decode data using current filter
     * @param stream The stream to work on
     * @param typeString String representation of the primary type for input stream
     */
    abstract decode(stream: Uint8Array): Promise<ArrayBuffer>;
    /**
     * Encode data using current filter
     * @param stream The stream to work on
     * @param typeString String representation of the primary type for input stream
     */
    abstract encode(stream: Uint8Array): Promise<ArrayBuffer>;
    /**
     * Decode data using current filter
     * @param stream The stream to work on
     * @param typeString String representation of the primary type for input stream
     */
    abstract decodeSync(stream: Uint8Array): ArrayBuffer;
    /**
     * Encode data using current filter
     * @param stream The stream to work on
     * @param typeString String representation of the primary type for input stream
     */
    abstract encodeSync(stream: Uint8Array): ArrayBuffer;
}

interface FilterConstructor {
    new (decodeParams?: PDFDictionary | null): Filter;
    NAME: string;
}
declare class FilterFactory {
    static filters: Map<string, FilterConstructor>;
    static register(filter: FilterConstructor): void;
    static get(type: string): FilterConstructor;
}

declare class ASCII85Filter extends Filter {
    static readonly NAME = "ASCII85Decode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(view: Uint8Array): ArrayBuffer;
    encodeSync(view: Uint8Array): ArrayBuffer;
}

declare class ASCIIHexFilter extends Filter {
    static readonly NAME = "ASCIIHexDecode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

declare class CCITTFaxFilter extends Filter {
    static readonly NAME = "CCITTFaxDecode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

declare class CryptFilter extends Filter {
    static readonly NAME = "Crypt";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: BufferSource$1): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

declare class DCTFilter extends Filter {
    static readonly NAME = "DCTDecode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

interface FlateFilterBuildHuffmanCodesResult {
    codes: Record<number, string>;
    maximumLength: number;
}
declare class FlateFilter extends Filter {
    static readonly PREDICTOR = 1;
    static readonly COLUMNS = 1;
    static readonly COLORS = 1;
    static readonly BITS_PER_COMPONENT = 8;
    static readonly FIELD_PREDICTOR = "Predictor";
    static readonly FIELD_COLUMNS = "Columns";
    static readonly FIELD_COLORS = "Colors";
    static readonly FIELD_BITS_PER_COMPONENT = "BitsPerComponent";
    static readonly NAME = "FlateDecode";
    name: string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

declare class JBIG2Filter extends Filter {
    static readonly NAME = "JBIG2Decode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

declare class JPXFilter extends Filter {
    static readonly NAME = "JPXDecode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

declare class LZWFilter extends Filter {
    static readonly NAME = "LZWDecode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(stream: Uint8Array): ArrayBuffer;
}

interface PredictorParameters {
    prevData?: Uint8Array;
    colors?: number;
    bitsPerComponent?: number;
    columns?: number;
    parameters?: PDFDictionary;
}
declare abstract class Predictor {
    prevData: Uint8Array;
    colors: number;
    bitsPerComponent: number;
    columns: number;
    constructor(parameters?: PredictorParameters);
    abstract decode(view: Uint8Array): Uint8Array;
    abstract encode(view: Uint8Array): Uint8Array;
}

declare class PNGPredictor extends Predictor {
    static readonly className = "PNGPredictor";
    decode(view: Uint8Array): Uint8Array;
    encode(view: Uint8Array): Uint8Array;
}

declare class RunLengthFilter extends Filter {
    static readonly NAME = "RunLengthDecode";
    name: string;
    static get className(): string;
    decode(view: Uint8Array): Promise<ArrayBuffer>;
    encode(view: Uint8Array): Promise<ArrayBuffer>;
    decodeSync(stream: Uint8Array): ArrayBuffer;
    encodeSync(_stream: Uint8Array): ArrayBuffer;
}

declare class PDFStream extends PDFDictionary implements EncryptionObject {
    static readonly NAME = ObjectTypeEnum.Stream;
    protected static skipEndOfLine(reader: ViewReader): void;
    length: PDFNumeric;
    filter: PDFArray | PDFName | null;
    decodeParams: Array<PDFDictionary | null> | null;
    static readonly DEFAULT_STREAM: Uint8Array<ArrayBuffer>;
    static createAsync(data: BufferSource$1, filters?: Filter[], parameters?: {
        [key: string]: PDFObjectTypes;
    }): Promise<PDFStream>;
    private _stream;
    get stream(): Uint8Array;
    set stream(value: Uint8Array);
    encrypted?: boolean;
    constructor(stream?: BufferSource$1 | PDFStream);
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    protected getFilters(): Filter[];
    encodeSync(): ArrayBuffer;
    decodeSync(): ArrayBuffer;
    encode(): Promise<ArrayBuffer>;
    decode(): Promise<ArrayBuffer>;
    encryptAsync(): Promise<ArrayBuffer>;
    decryptAsync(): Promise<ArrayBuffer>;
    protected onCopy(copy: PDFStream): void;
    protected onCreate(): void;
    toString(): string;
    protected onToStringStream(): string;
    /**
     * Adds the name of the filter to the Field entry
     * @param name The name of the filter
     * @returns
     */
    addFilter(name: string): void;
    to<T extends PDFDictionary>(type: new () => T, replace?: boolean): T;
    clear(streamOnly?: boolean): void;
}

declare enum ObjectTypeEnum {
    Null = "PDFNull",
    Boolean = "PDFBoolean",
    Numeric = "PDFNumeric",
    Name = "PDFName",
    LiteralString = "PDFLiteralString",
    HexString = "PDFHexString",
    IndirectReference = "PDFIndirectReference",
    Array = "PDFArray",
    Dictionary = "PDFDictionary",
    Stream = "PDFStream",
    Comment = "PDFComment"
}

declare class PDFLiteralString extends PDFTextString {
    static readonly NAME = ObjectTypeEnum.LiteralString;
    private static readonly ESCAPE_PATTERN;
    private static readonly OCTAL_PATTERN;
    private static readonly PARSE_PATTERN;
    private static readonly WRITE_ESCAPE_MAP;
    private static readonly READ_ESCAPE_MAP;
    protected onWritePDF(writer: ViewWriter): void;
    /**
     * Returns the highest Unicode code point value found in the given string.
     *
     * @param text - The string to search for the highest Unicode code point.
     * @returns The highest Unicode code point value found in the string.
     */
    static getMaxUnicode(text: string): number;
    protected onFromPDF(reader: ViewReader): void;
    /**
     * Reads string data from the provided `ViewReader` instance.
     *
     * This method processes the input data to handle nested parentheses and escape sequences.
     * It reads until it finds a matching closing parenthesis for the initial opening parenthesis.
     *
     * @param reader - The `ViewReader` instance to read data from.
     * @returns An object containing the read data as a `Uint8Array` and the final depth of nested parentheses.
     *
     * @remarks
     * - The method keeps track of the depth of nested parentheses.
     * - It handles escape sequences denoted by the backslash (`\`) character.
     * - The method stops reading when the depth of nested parentheses reaches zero.
     */
    private readStringData;
    toString(): string;
}

declare class PDFDate extends PDFLiteralString {
    getDateAsync(): Promise<Date>;
    getDate(): Date;
    setDate(date: Date): void;
    constructor(param?: Date | PDFString | string | BufferSource);
    static createDate(update: PDFDocument | PDFDocumentUpdate, date?: Date): PDFDate;
}

declare enum TransformMethod {
    /**
     * Used to detect modifications to a document relative
     * to a signature field that is signed by the originator
     * of a document
     */
    docMDP = "DocMDP",
    /**
     * Used to detect modifications to a document that would
     * invalidate a signature in a right-enabled document
     */
    ur = "UR",
    /**
     * Used to detect modifications to a list of form fields
     * specified in TransformParams
     */
    fieldMDP = "FieldMDP"
}
declare class SignatureReferenceDictionary extends PDFDictionary {
    /**
     * The type of PDF object that this dictionary describes
     */
    type: string;
    /**
     * The name of the transform method that shall guide the
     * modification analysis that takes place when the signature is
     * validated
     */
    transformMethod: TransformMethod;
    /**
     * A dictionary specifying transform parameters (variable data)
     * for the transform method specified by TransformMethod
     */
    transformParams: PDFDictionary | null;
    /**
     * An indirect reference to the object in the document upon which the object
     * modification analysis should be performed. For transform
     * methods other than FieldMDP, this object is implicitly defined
     */
    data: PDFObjectTypes | null;
    /**
     * A name identifying the algorithm that
     * shall be used when computing the digest
     */
    digest: string | null;
}

declare enum SignatureType {
    signature = "Sig",
    timeStamp = "DocTimeStamp"
}
declare class SignatureDictionary extends PDFDictionary {
    /**
     * The type of PDF object that this dictionary describes; if present, shall be Sig for a signature dictionary or
     * DocTimeStamp for a timestamp signature dictionary.
     *
     * The default value is: Sig.
     * @remarks
     * - Optional if Sig
     * - Required if DocTimeStamp
     */
    type: SignatureType;
    /**
     * The name of the preferred signature handler to use when validating this signature
     *
     * If the Prop_Build entry is not present, it shall be also the
     * name of the signature handler that was used to create the signature. If
     * Prop_Build is present, it may be used to determine the name of the handler that
     * created the signature (which is typically the same as Filter but is not needed to
     * be).
     */
    filter: string;
    /**
     * A name that describes the encoding of the signature value
     * and key information in the signature dictionary
     *
     * (PDF 1.6) The following values for public-key cryptographic signatures
     * shall be used: adbe.x509.rsa_sha1, adbe.pkcs7.detached, and adbe.pkcs7.sha1
     */
    subFilter: string | null;
    /**
     * The signature value
     */
    Contents: PDFHexString;
    /**
     * An array of byte strings that shall represent the X.509 certificate chain used when
     * signing and verifying signatures that use public-key cryptography, or a byte string
     * if the chain has only one entry
     */
    cert: PDFArray | PDFHexString | null;
    /**
     * An array of pairs of integers (starting byte offset, length in bytes) that shall
     * describe the exact byte range for the digest calculation
     */
    ByteRange: Maybe<PDFArray>;
    /**
     * An array of signature reference dictionaries
     */
    reference: SignatureReferenceDictionary[] | null;
    /**
     * An array of three integers that shall specify changes to the
     * document that have been made between the previous signature and
     * this signature.
     */
    changes?: PDFArray;
    /**
     * The name of the person or authority signing the document.
     * This value should be used only when it is not possible to extract the
     * name from the signature
     */
    name: PDFLiteralString | null;
    /**
     * The time of signing
     */
    signingTime: PDFDate | null;
    /**
     * The CPU host name or physical location of the signing
     */
    Location: Maybe<PDFLiteralString>;
    /**
     * The reason for the signing, such as (I agree…)
     */
    Reason: Maybe<PDFLiteralString>;
    /**
     * Information provided by the signer to enable a recipient to
     * contact the signer to verify the signature
     */
    contactInfo: PDFLiteralString | null;
    /**
     * The version of the signature handler that was used to create the signature
     */
    r: string | null;
    /**
     * The version of the signature dictionary format
     */
    v: string | null;
    /**
     * A dictionary that may be used by a signature
     * handler to record information that captures the state of the computer
     * environment used for signing, such as the name of the handler used to
     * create the signature, software build date, version, and operating
     * system
     */
    propBuild: PDFDictionary | null;
    /**
     * The number of seconds since the signer was last authenticated,
     * used in claims of signature repudiation
     */
    propAuthTime: number | null;
    /**
     * The method that shall be used to authenticate the signer,
     * used in claims of signature repudiation
     */
    propAuthType: string | null;
    protected onCreate(): void;
}

declare enum SignatureLockAction {
    /**
     * All fields in the document
     */
    all = "All",
    /**
     * All fields specified in Fields
     */
    include = "Include",
    /**
     * All fields except those specified in Fields
     */
    exclude = "Exclude"
}
/**
 * The signature field lock dictionary contains the names of form fields
 * whose values shall no longer be changed after this signature has been signed
 */
declare class SignatureLockDictionary extends PDFDictionary {
    static readonly TYPE = "SigFieldLock";
    /**
     * The type of PDF object that this dictionary describes; if present,
     * shall be SigFieldLock for a signature field lock dictionary
     */
    Type: string | null;
    /**
     * A name which, in conjunction with Fields, indicates the set of fields
     * that should be locked.
     *
     * The value shall be one of the following:
     * - `All` All fields in the document
     * - `Include` All fields specified in Fields
     * - `Exclude` All fields except those specified in Fields
     */
    Action: SignatureLockAction;
    /**
     * An array of text strings containing field names
     *
     * @remarks Required if the value of Action is Include or Exclude
     */
    Fields: Maybe<PDFArray>;
    /**
     * The access permissions granted for this document.
     *
     * Valid values shall be:
     * 1. No changes to the document are permitted; any change to the document shall invalidate the signature.
     * 2. Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature.
     * 3. Permitted changes are the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature.
     *
     * @remarks PDF 2.0
     */
    P: number | null;
}

declare class SignatureField extends PDFField {
    static readonly FIELD_TYPE = "Sig";
    /**
     * The minimum required capability of the signature field seed value
     * dictionary parser. A value of 1 specifies that the parser shall be able to recognize
     * all seed value dictionary entries in a PDF 1.5 file. A value of 2 specifies that it
     * shall be able to recognize all seed value dictionary entries specified. A value of 3
     * specifies that it shall be able to recognize all seed value dictionary entries
     * specified in PDF 2.0 and earlier.
     *
     * The Ff entry indicates whether this shall be treated as a required constraint.
     */
    V: SignatureDictionary | null;
    /**
     * A signature field lock dictionary that specifies
     * a set of form fields that shall be locked when this
     * signature field is signed
     *
     * @remarks PDF 1.5
     */
    Lock: Maybe<SignatureLockDictionary>;
    /**
     * A seed value dictionary containing information
     * that constrains the properties of a signature
     * that is applied to this field
     */
    SV: PDFDictionary | null;
    protected onCreate(): void;
}

declare class SignatureMDPDictionary extends PDFDictionary {
    p: number;
}

declare enum SignatureSeedValueFlags {
    filter = 1,
    subFilter = 2,
    v = 4,
    reasons = 8,
    legalAttestation = 16,
    addRevInfo = 32,
    digestMethod = 64
}
declare class SignatureSeedValueDictionary extends PDFDictionary {
    /**
     * The type of PDF object that this dictionary describes
     *
     * if present, shall be SV for a seed value dictionary
     */
    type: PDFName | null;
    /**
     * A set of bit flags specifying the interpretation of specific entries in this dictionary.
     *
     * A value of 1 for the flag indicates that the associated entry is a required constraint.
     * A value of 0 indicates that the associated entry is an optional constraint.
     */
    ff: SignatureSeedValueFlags;
    /**
     * The signature handler that shall be used to sign the signature field
     */
    filter: string | null;
    /**
     * An array of names indicating encodings to use when signing
     */
    subFilter: PDFArray | null;
    /**
     * An array of names indicating acceptable digest
     * algorithms to use while signing. The value shall be one of SHA1,
     * SHA256, SHA384, SHA512 and RIPEMD160. The default value is
     * implementation-specific
     */
    digestMethod: PDFArray | null;
    /**
     * The minimum required capability of the signature field seed
     * value dictionary parser. A value of 1 specifies that the parser shall be
     * able to recognize all seed value dictionary entries in a PDF 1.5 file. A
     * value of 2 specifies that it shall be able to recognize all seed value
     * dictionary entries specified
     */
    v: number | null;
    /**
     * A certificate seed value dictionary containing
     * information about the characteristics of the certificate that shall be used
     * when signing
     */
    cert: PDFDictionary | null;
    /**
     * An array of text strings that specifying possible reasons for
     * signing a document. If specified, the reasons supplied in this entry
     * replace those used by conforming products
     */
    reasons: PDFArray | null;
    /**
     * A dictionary containing a single entry whose key is
     * P and whose value is an integer between 0 and 3
     */
    mdp: SignatureMDPDictionary | null;
    /**
     * A time stamp dictionary containing two entries
     */
    timeStamp: PDFDictionary | null;
    /**
     * An array of text strings specifying possible legal attestations
     */
    legalAttestation: PDFArray | null;
    /**
     * A flag indicating whether revocation checking shall be carried out
     */
    addRevInfo: boolean;
}

declare class ValidationRelatedInformationDictionary extends PDFDictionary {
    static readonly TYPE = "VRI";
    /**
     *  If present, shall be VRI for a validation-related information dictionary
     */
    type: typeof ValidationRelatedInformationDictionary.TYPE;
    /**
     * An array of (indirect references to) streams, each containing one DER encoded
     * X.509 certificate (see RFC 5280). This array contains certificates that were used
     * in the validation of this signature
     */
    Cert: Maybe<PDFArray>;
    /**
     * An array of indirect references to streams that are all
     * CRLs used to determine the validity of the certificates in the chains
     * related to this signature. Each stream shall reference a CRL that is an entry
     * in the CRLs array in the DSS dictionary
     */
    CRL: Maybe<PDFArray>;
    /**
     * An array of indirect references to streams that are all OCSPs used to determine
     * the validity of the certificates in the chains related to this signature.
     * Each stream shall reference an OCSP that is an entry in the OCSPs array in the
     * DSS dictionary
     */
    OCSP: Maybe<PDFArray>;
    /**
     * The date/time at which this signature VRI dictionary was created.
     * TU shall be a date string
     */
    TU: PDFDate | null;
    /**
     * A stream containing the DER-encoded timestamp (see RFC 3161 as updated
     * by RFC 5816) that contains the date/time at which this signature VRI dictionary
     * was created
     */
    TS: PDFStream | null;
}

declare enum TextFieldFlags {
    /**
     * If set, the field may contain multiple lines of text; if clear, the field’s text
     * shall be restricted to a single line.
     */
    multiline = 4096,
    /**
     * If set, the field is intended for entering a secure password that should not
     * be echoed visibly to the screen. Characters typed from the keyboard shall
     * instead be echoed in some unreadable form, such as asterisks or bullet
     * characters.
     * @note To protect password confidentiality, it is imperative that
     * interactive PDF processors never store the value of the text
     * field in the PDF file if this flag is set.
     */
    password = 8192,
    /**
     * (PDF 1.4) If set, the text entered in the field represents the pathname of a
     * file whose contents shall be submitted as the value of the field.
     */
    fileSelect = 1048576,
    /**
     * (PDF 1.4) If set, text entered in the field shall not be spell-checked.
     */
    doNotSpellCheck = 4194304,
    /**
     * (PDF 1.4) If set, the field shall not scroll (horizontally for single-line
     * fields, vertically for multiple-line fields) to accommodate more text than
     * fits within its annotation rectangle. Once the field is full, no further text
     * shall be accepted for interactive form filling; for non-interactive form
     * filling, the filler should take care not to add more character than will
     * visibly fit in the defined area.
     */
    doNotScroll = 8388608,
    /**
     * (PDF 1.5) May be set only if the MaxLen entry is present in the text field
     * dictionary (see "Table 232: Additional entry specific to a text field") and
     * if the Multiline, Password, and FileSelect flags are clear. If set, the field
     * shall be automatically divided into as many equally spaced positions, or
     * combs, as the value of MaxLen, and the text is laid out into those combs.
     */
    comb = 16777216,
    /**
     * (PDF 1.5) If set, the value of this field shall be a rich text string (see Annex
     * M, "Rich Text Reference"). If the field has a value, the RV entry of the field
     * dictionary ("Table 228: Additional entries common to all fields
     * containing variable text") shall specify the rich text string.
     */
    richText = 33554432
}

declare enum ChoiceFlags {
    /**
     * If set, the field is a combo box; if clear, the field is a list box.
     */
    combo = 131072,
    /**
     * If set, the combo box shall include an editable text box as well as a
     * drop-down list; if clear, it shall include only a drop-down list.
     * This flag shall be used only if the Combo flag is set.
     */
    edit = 262144,
    /**
     * If set, the field’s option items shall be sorted alphabetically. This
     * flag is intended for use by PDF writers, not by PDF readers. PDF readers
     * shall display the options in the order in which they occur in the Opt array
     * (see "Table 233: Additional entries specific to a choice field").
     */
    sort = 524288,
    /**
     * If set, more than one of the field’s option items may be selected simultaneously;
     * if clear, at most one item shall be selected.
     *
     * @since PDF 1.4
     */
    multiSelect = 2097152,
    /**
     * If set, text entered in the field shall not be spell-checked. This flag
     * shall not be used unless the Combo and Edit flags are both set.
     *
     * @since PDF 1.4
     */
    doNotSpellCheck = 4194304,
    /**
     * If set, the new value shall be committed as soon as a selection is made
     * (commonly with the pointing device). In this case, supplying a value
     * for a field involves three actions: selecting the field for fill-in,
     * selecting a choice for the fill-in value, and leaving that field, which
     * finalizes or "commits" the data choice and triggers any actions associated
     * with the entry or changing of this data. If this flag is on, then processing
     * does not wait for leaving the field action to occur, but immediately proceeds
     * to the third step.
     *
     * This option enables applications to perform an action once
     * as election is made, without requiring the user to exit the field. If clear,
     * the new value is not committed until the user exits the field.
     *
     * @since PDF 1.5
     */
    commitOnSelChange = 67108864
}
declare class ChoiceDictionary extends PDFField {
    ff: FieldFlags | ChoiceFlags;
    /**
     * An array of options that shall be presented to the user. Each element of the array
     * is either a text string representing one of the available options or an array
     * consisting of two text strings: the option’s export value and the text that shall be
     * displayed as the name of the option.
     *
     * If this entry is not present, no choices should be presented to the user.
     */
    Opt: PDFArray | null;
    /**
     * For scrollable list boxes, the top index (the index in the Opt array of the first
     * option visible in the list).
     *
     * Default value: 0.
     */
    Tl: number;
    /**
     * For choice fields that allow multiple selection (MultiSelect flag set), an array of integers,
     * sorted in ascending order, representing the zero-based indices in the Opt array of
     * the currently selected option items. This entry shall be used when two or more elements
     * in the Opt array have different names but the same export value or when the value
     * of the choice field is an array. If the items identified by this entry differ from those
     * in the V entry of the field dictionary (see discussion following this Table), the V entry
     * shall be used.
     *
     * @remarks
     * Sometimes required, otherwise optional
     *
     * @since PDF 1.4
     */
    I: PDFArray | null;
    protected onCreate(): void;
}

declare class ResourceDictionary extends PDFDictionary {
    /**
     * A dictionary that maps resource names to graphics state
     * parameter dictionaries (see 8.4.5, "Graphics state parameter
     * dictionaries").
     */
    extGState: PDFDictionary | null;
    /**
     * A dictionary that maps each resource name to either the name
     * of a device-dependent colour space or an array describing a colour space
     */
    colorSpace: PDFDictionary | null;
    /**
     * A dictionary that maps resource names to pattern object
     */
    pattern: PDFDictionary | null;
    /**
     * A dictionary that maps resource names to shading dictionaries
     */
    Shading: PDFDictionary | null;
    /**
     * A dictionary that maps resource names to external objects
     */
    XObject: PDFDictionary | null;
    /**
     * A dictionary that maps resource names to font dictionaries
     */
    font: PDFDictionary | null;
    /**
     * An array of predefined procedure set names
     * @deprecated Deprecated in PDF 2.0
     */
    procSet: PDFArray | null;
    /**
     * A dictionary that maps resource names to property list dictionaries for marked content
     */
    properties: PDFDictionary | null;
}

declare enum SignatureFlags {
    /**
     * If set, the document contains at least one signature field
     *
     * This flag allows a conforming reader to enable user interface items
     * (such as menu items or pushbuttons) related to signature processing
     * without having to scan the entire document for the presence of signature
     * fields.
     */
    signaturesExist = 1,
    /**
     * If set, the document contains signatures that may be invalidated if
     * the file is saved (written) in a way that alters its previous contents,
     * as opposed to an incremental update. Merely updating the file by
     * appending new information to the end of the previous version is safe
     */
    appendOnly = 2
}
declare class InteractiveFormDictionary extends PDFDictionary {
    /**
     * An array of references to the document’s root fields (those with no ancestors in the field hierarchy).
     */
    Fields: PDFArray;
    /**
     * A flag specifying whether to construct appearance streams
     * and appearance dictionaries for all widget annotations in the document
     * @remarks Deprecated in PDF 2.0
     * @note Appearance streams are required in PDF 2.0.
     */
    needAppearances: boolean;
    /**
     * A set of flags specifying various document-level characteristics related
     * to signature fields
     * @remarks PDF 1.3
     */
    SigFlags: SignatureFlags;
    /**
     * An array of indirect references to field dictionaries with calculation actions,
     * defining the calculation order in which their values will be recalculated
     * when the value of any field changes
     * @remarks
     * - Required if any fields in the document have additional-actions
     * dictionaries containing a C entry
     * - PDF 1.3
     */
    co: PDFArray | null;
    /**
     * A resource dictionary containing default resources (such as fonts,
     * patterns, or color spaces) that shall be used by form field
     * appearance streams
     */
    DR: Maybe<ResourceDictionary>;
    /**
     * A document-wide default value for the DA attribute of variable text fields
     */
    da: string | null;
    /**
     * A document-wide default value for the Q attribute
     * of variable text fields
     */
    q: number | null;
    /**
     * A stream or array containing an XFA resource,
     * whose format shall be described by the Data Package
     * (XDP) Specification
     * @remarks Deprecated in PDF 2.0
     */
    xfa: PDFArray | PDFStream | null;
    protected onCreate(): void;
    findFieldByGroup(type: string, group: string): PDFField | null;
    /**
     * Adds a field to this form.
     * @param field - The field to be added.
     * @remarks The field is added to the form's `Fields` array. If the field is
     * not already indirect, this method will make it indirect. If the field is
     * already part of a form, this method will skip adding it.
     * @returns Whether or not the field was added to the form.
     */
    addField(field: IFieldDictionary): boolean;
    /**
     * Removes a field from this form.
     * @param field - The field to be removed.
     * @returns Whether or not the field was removed from the form.
     */
    removeField(field: IFieldDictionary): boolean;
    /**
     * Finds or creates a field with the given fully qualified name.
     * @param name - The fully qualified name of the field to be found or created.
     * @returns The field with the given name.
     * @remarks If a field already exists with the given name, this method will
     * return that field. Otherwise it will create a new field with that name and
     * add it to the form's `Fields` array. If the name is qualified, intermediate
     * fields will be created as necessary.
     */
    findOrCreateField(name: string): PDFField;
    /**
     * Finds a field in this form by its fully qualified name.
     * @param name - The fully qualified name of the field to find.
     * @returns The field with the fully qualified name, or `null`
     */
    findField(name: string): PDFField | null;
}

interface PrintMetricConverter {
    names: string[];
    toPoint(value: number): number;
}
type TypographySize = number | string;
/**
 * Point (typography) converter
 * @see https://en.wikipedia.org/wiki/Point_(typography)
 */
declare class TypographyConverter {
    static converters: PrintMetricConverter[];
    static register(converter: PrintMetricConverter): void;
    static findConverter(name: string): PrintMetricConverter | null;
    static toPoint(value: TypographySize): number;
    /**
     * Converts typography size value to PDF Numeric
     * @param value Typography size value
     * @returns PDF number
     */
    static toPDFNumeric(value: TypographySize): PDFNumeric;
}

/** Array of 6 numbers representing a transformation matrix [a,b,c,d,e,f] */
type MetricsNumberArray = [
    number,
    number,
    number,
    number,
    number,
    number
];
/** 3x3 transformation matrix representation */
type TransformationMatrix = [
    [
        number,
        number,
        0
    ],
    [
        number,
        number,
        0
    ],
    [
        number,
        number,
        1
    ]
];
/** Rotation transformation parameters */
interface RotateTransformation {
    type: "rotate";
    /** Angle in degrees */
    angle: number;
}
/** Translation transformation parameters */
interface TranslateTransformation {
    type: "translate";
    /** X-axis translation distance */
    x: TypographySize;
    /** Y-axis translation distance */
    y: TypographySize;
}
/** Scaling transformation parameters */
interface ScaleTransformation {
    type: "scale";
    /** Horizontal scale factor */
    width: number;
    /** Vertical scale factor */
    height: number;
}
/** Skewing transformation parameters */
interface SkewTransformation {
    type: "skew";
    /** Skews the X axis by an angle a */
    a: number;
    /** Skews the Y axis by an angle b */
    b: number;
}
type Transformation = ScaleTransformation | RotateTransformation | SkewTransformation | TranslateTransformation;
type Transformations = Transformation[];
/**
 * Represents a transformation matrix in PDF documents.
 * Handles various geometric transformations like translation, rotation, scaling, and skewing.
 * The transformation matrix is represented as:
 * ```plaintext
 * | a b 0 |
 * | c d 0 |
 * | e f 1 |
 * ```
 */
declare class Metrics extends PDFArray {
    /**
     * Converts degrees to radians
     * @param degrees - Angle in degrees
     * @returns Angle in radians
     */
    static toRadians(degrees: number): number;
    /**
     * Converts a 6-element array to a 3x3 transformation matrix
     * @param metrics - Array of 6 numbers [a,b,c,d,e,f]
     * @returns 3x3 transformation matrix
     */
    static toMatrix(metrics: MetricsNumberArray): TransformationMatrix;
    /**
     * Creates a new Metrics instance without attaching it to a document
     * @returns New Metrics instance with identity matrix values
     */
    static createWithoutDocument(): Metrics;
    /**
     * Sets a value in the transformation matrix
     * @param index - Index in the matrix array
     * @param v - New value to set
     */
    protected setValue(index: number, v: number): void;
    /**
     * Gets a value from the transformation matrix
     * @param index - Index in the matrix array
     * @returns Value at the specified index
     */
    protected getValue(index: number): number;
    /** Gets/sets the scaling factor for the x axis */
    get a(): number;
    set a(v: number);
    /** Gets/sets the horizontal skewing factor */
    get b(): number;
    set b(v: number);
    /** Gets/sets the vertical skewing factor */
    get c(): number;
    set c(v: number);
    /** Gets/sets the scaling factor for the y axis */
    get d(): number;
    set d(v: number);
    /** Gets/sets the horizontal translation */
    get e(): number;
    set e(v: number);
    /** Gets/sets the vertical translation */
    get f(): number;
    set f(v: number);
    /**
     * Initializes the metrics with identity matrix values
     */
    protected onCreate(): void;
    /**
     * Converts the transformation matrix to an array representation
     * @returns Array of 6 numbers [a,b,c,d,e,f]
     */
    toArray(): MetricsNumberArray;
    /**
     * Applies a transformation matrix to the current matrix
     * @param metrics - Transformation matrix to apply
     */
    protected transformMetrics(metrics: MetricsNumberArray): void;
    /**
     * Translates the coordinate system
     * @param x - Horizontal translation distance
     * @param y - Vertical translation distance
     */
    translate(x: TypographySize, y: TypographySize): void;
    /**
     * Scales the coordinate system
     * @param width - Horizontal scale factor
     * @param height - Vertical scale factor
     */
    scale(width: number, height: number): void;
    /**
     * Rotates the coordinate system
     * @param angle - Rotation angle in degrees
     */
    rotate(angle: number): void;
    /**
     * Skews the coordinate system
     * @param a - X-axis skew angle in degrees
     * @param b - Y-axis skew angle in degrees
     */
    skew(a: number, b: number): void;
    /**
     * Applies a series of transformations in sequence
     * @param transforms - Array of transformation operations to apply
     */
    transform(transforms: Transformations): void;
    /**
     * Multiplies two matrices together
     * @param a - First matrix
     * @param b - Second matrix
     * @returns Result of matrix multiplication
     * @throws Error if matrices cannot be multiplied
     */
    protected multiply(a: number[][], b: number[][]): number[][];
}

type NameTreeIterator = [string, PDFObject, NameTree];
type NameTreeType = typeof NameTree.EMPTY | typeof NameTree.ROOT | typeof NameTree.INTERMEDIATE | typeof NameTree.LEAF;
/**
 * Represents a NameTree object in a PDF document.
 */
declare class NameTree extends PDFDictionary implements Iterable<NameTreeIterator> {
    static EMPTY: string;
    static ROOT: string;
    static INTERMEDIATE: string;
    static LEAF: string;
    /** Parent NameTree */
    private parent?;
    /**
     * Gets the type of the NameTree object.
     */
    get type(): NameTreeType;
    /**
     * Shall be an array of indirect references to the immediate children of this node.
     * The children may be intermediate or leaf nodes.
     *
     * @remarks
     * Root and intermediate nodes only; required in intermediate nodes; present in the root node
     * if and only if Names is not present
     *
     */
    Kids: PDFArray | null;
    /**
     * An array of elements which are the leaves of the names tree
     *
     * Shall be an array of the form
     * ```
     * [key1 value1 key2 value2 ... keyN valueN ]
     * ```
     * where each keyI shall be a string and the corresponding valueI shall be the object associated with that key.
     * The keys shall be sorted in lexical order.
     *
     * @remarks
     * Root and leaf nodes only; required in leaf nodes; present in the root node if and only if Kids is not present
     */
    Names: PDFArray | null;
    /**
     * Shall be an array of two strings, that shall specify the (lexically) least and greatest keys
     * included in the Names array of a leaf node or in the Names arrays of any leaf nodes
     * that are descendants of an intermediate node.
     *
     * @remarks
     * Required for intermediate and leaf nodes; not permitted in root nodes
     */
    Limits: PDFArray | null;
    private leafArray;
    /**
     * Returns an array of key-value pairs from the NameTree object.
     * @returns Returns an array of key-value pairs
     */
    toArray(): NameTreeIterator[];
    [Symbol.iterator](): Iterator<NameTreeIterator, unknown, undefined>;
    private findValueIterator;
    /**
     * This method searches for a value within a NameTree based on a specified key.
     * @param key Represents the key to be searched for in the tree
     * @returns Returns the corresponding PDFObject, or null if no such value exists
     */
    findValue(key: string): PDFObject | null;
    /**
     * Returns the value associated with the given key, casting it to the given type if possible.
     * @param key The key whose associated value should be retrieved
     * @param type The type to which the associated value should be cast
     * @returns the value associated with the given key, cast to the given type
     * @throws `Error` if the value associated with the given key cannot be retrieved
     * @throws `TypeError` if the value associated with the given key cannot be cast to the given type
     */
    getValue<T extends PDFObject>(key: string, type?: new () => T): T;
    /**
     * Returns the value associated with the given key.
     * @param key The key whose associated value should be retrieved
     * @returns the value associated with the given key
     * @throws `Error` if the value associated with the given key cannot be retrieved
     */
    getValue(key: string): PDFObject;
    /**
     * Returns an array of all the keys in the NameTree object.
     * @returns Returns an array of keys
     */
    keys(): string[];
    /**
     * Returns an array of all the entries in the NameTree object.
     * @returns Returns an array of entries
     */
    entries(): PDFObject[];
    /**
     * Compares Limits to a given key string.
     * @param key The key string to compare with.
     * @returns
     * `-1` if the first limit is greater than the key,
     * `0` if the key is within the limits, and
     * `1` if the last limit is less than the key.
     */
    compare(key: string): number;
    /**
     * Returns the first element of the tree. If the tree is empty, returns null.
     * @returns The first element of the tree, or null if the tree is empty.
     */
    first(): NameTreeIterator | null;
    /**
     * Returns the last element of the tree. If the tree is empty, returns null.
     * @returns The first element of the tree, or null if the tree is empty.
     */
    last(): NameTreeIterator | null;
    /**
     * Sets the value of the given key.
     *
     * @param key The key to set the value for.
     * @param value The value to set for the given key.
     * @throws `` if the given key cannot be set.
     */
    setValue(key: string, value: PDFObject): void;
}

declare class NumberTrees extends PDFDictionary {
    /**
     * The array of indirect references to the immediate children of this node
     */
    Kids: null | PDFIndirectReference[];
    /**
     * The array of the form: key (integer) and value (PDFIndirectReference)
     */
    Names: PDFArray | null;
    /**
     * array of two strings, that shall specify the (lexically) least and greatest keys
     * included in the Names array of a leaf node or in the Names arrays of any leaf nodes
     * that are descendants of an intermediate node.
     */
    Limits: null | PDFLiteralString[];
}

declare class NameDictionary extends PDFDictionary {
    /**
     * A name tree mapping name strings to destinations
     *
     * @since PDF 1.2
     */
    Dests: NameTree | null;
    /**
     * A name tree mapping name strings to annotation appearance streams
     *
     * @since PDF 1.3
     */
    AP: NameTree | null;
    /**
     * A name tree mapping name strings to document-level ECMAScript actions
     *
     * @since PDF 1.3
     */
    JavaScript: NameTree | null;
    /**
     * A name tree mapping name strings to visible pages for use in interactive forms
     *
     * @since PDF 1.3
     */
    Pages: NameTree | null;
    /**
     * A name tree mapping name strings to invisible(template) pages for use in interactive forms
     *
     * @since PDF 1.3
     */
    Templates: NameTree | null;
    /**
     * A name tree mapping digital identifiers to Web. Capture content sets
     *
     * @since PDF 1.3
     */
    IDS: NameTree | null;
    /**
     * A name tree mapping uniform resource locators. (URLs) to Web Capture content sets
     *
     * @since PDF 1.3
     */
    URLS: NameTree | null;
    /**
     * A name tree mapping name strings to file specifications for embedded file streams.
     *
     * All File Specification dictionaries referenced from this name tree shall contain
     * an EF key whose value is a dictionary which contains either an F or UF key whose
     * value is an embedded file stream.
     *
     * @remarks PDF 2.0
     *
     * For unencrypted wrapper documents for an encrypted payload document (see 7.6.7, "Unencrypted wrapper document")
     * the name strings provided in this tree shall not contain or be derived from the encrypted payload document’s
     * actual file name. This is to avoid potential disclosure of sensitive information in the original filename.
     * The name string should match the value of F or UF in the referenced File Specification dictionary.
     *
     * @since PDF 1.4
     */
    EmbeddedFiles: NameTree | null;
    /**
     * A name tree mapping name strings to alternate presentations
     *
     * @since PDF 1.4
     * @deprecated PDF 2.0
     */
    AlternatePresentations: NameTree | null;
    /**
     * A name tree mapping name strings (which shall have Unicode encoding) to rendition objects
     *
     * @since PDF 1.5
     */
    Renditions: NameTree | null;
}

declare enum PDFDocumentObjectTypes {
    null = "z",
    free = "f",
    inUse = "n",
    compressed = "c"
}
interface PDFDocumentObjectParameters {
    documentUpdate: PDFDocumentUpdate;
    /**
     * Object number
     */
    id: number;
    /**
     * The byte offset of the object (for inUse and free objects) or the object number
     * of the object stream in which this object is stored (for compressed objects)
     */
    offset: number;
    /**
     * The generation number (for inUse and free objects) or the index (for compressed) of this object within the object stream
     */
    generation: number;
    /**
     * Type of the object. Should be 'inUse', 'free' or 'compressed'
     */
    type: PDFDocumentObjectTypes;
}
declare class PDFDocumentObject implements PDFDocumentObjectParameters {
    #private;
    documentUpdate: PDFDocumentUpdate;
    id: number;
    offset: number;
    generation: number;
    type: PDFDocumentObjectTypes;
    constructor(parameters: PDFDocumentObjectParameters);
    createReference(): PDFIndirectReference;
    get indirect(): PDFIndirectObject;
    /**
     * Returns a copy of object
     * @returns The new instance of {@link PDFDocumentObject} with erased offset value
     */
    copy(): PDFDocumentObject;
    static create(indirect: PDFIndirectObject): PDFDocumentObject;
    get value(): PDFObject;
    set value(value: PDFObject);
    /**
     * Returns previous version of PDF document object otherwise `null`
     * @returns null or {@link PDFDocumentObject}
     */
    prev(): PDFDocumentObject | null;
    toString(): string;
}

interface PageInheritable {
    Resources: ResourceDictionary;
    MediaBox: PDFRectangle;
    CropBox: PDFRectangle | null;
    Rotate: number;
}
declare abstract class PageDictionary extends PDFDictionary implements PageInheritable {
    createMediaBox(width: TypographySize, heigh: TypographySize): PDFRectangle;
    abstract Parent: PageDictionary | null;
    protected getInherited<T extends keyof PageInheritable, R extends PDFObject>(name: T, type: new () => R, optional?: false): R;
    protected getInherited<T extends keyof PageInheritable, R extends PDFObject>(name: T, type: new () => R, optional: true): R | null;
    /**
     * A dictionary containing any resources required by the page contents.
     * If the page requires no resources, the value of this entry shall be
     * an empty dictionary
     */
    get Resources(): ResourceDictionary;
    set Resources(v: ResourceDictionary);
    /**
     * A rectangle, expressed in default user space units, that shall define the boundaries
     * of the physical medium on which the page shall be displayed or printed
     */
    get MediaBox(): PDFRectangle;
    set MediaBox(v: PDFRectangle);
    /**
     * A rectangle, expressed in default user space units, that shall define
     * the visible region of default user space. When the page is displayed
     * or printed, its contents shall be clipped (cropped) to this rectangle
     */
    get CropBox(): PDFRectangle | null;
    set CropBox(v: PDFRectangle | null);
    /**
     * The number of degrees by which the page shall be rotated clockwise
     * when displayed or printed. The value shall be a multiple of 90
     */
    get Rotate(): number;
    set Rotate(v: number);
    addResource(resource: PDFObject, preferredName: string): string;
}

declare class PDFOperator {
    static readonly NAME_REGEX: RegExp;
    static readonly SPACE_CHAR = " ";
    static readonly DEFAULT_NAME = "";
    name: string;
    parameters: PDFObjectTypes[];
    static create(name: string, ...parameters: PDFObjectTypes[]): PDFOperator;
    static fromString(data: string): PDFOperator;
    fromString(data: string): void;
    toString(): string;
}

type GrayscaleColor = number | [number];
type RGBColor = [number, number, number];
type CMYKColor = [number, number, number, number];
type Colors = GrayscaleColor | RGBColor | CMYKColor;
declare class ColorConverter {
    static fromPDFNumberArray(array: PDFNumeric[]): Colors;
    static fromPDFArray(array: PDFArray): Colors;
    static toPDFNumberArray(color: Colors): PDFNumeric[];
    static toPDFArray(color: Colors): PDFArray;
}

type PDFContentCreateParams = [string, ...PDFObjectTypes[]];
/**
 * Line cap styles
 */
declare enum LineCapStyle {
    /**
     * Butt cap. The stroke shall be squared off at the endpoint of the path. There shall be
     * no projection beyond the end of the path.
     */
    buttCap = 0,
    /**
     * Round cap. A semicircular arc with a diameter equal to the line width shall be
     * drawn around the endpoint and shall be filled in.
     */
    roundCap = 1,
    /**
     * Projecting square cap. The stroke shall continue beyond the endpoint of the path
     * for a distance equal to half the line width and shall be squared off.
     */
    projectingSquareCap = 2
}
declare enum LineJoinStyle {
    /**
     * Miter join. The outer edges of the strokes for the two segments shall be extended
     * until they meet at an angle, as in a picture frame. If the segments meet at too sharp
     * an angle (as defined by the miter limit parameter — see 8.4.3.5, "Miter limit"), a
     * bevel join shall be used instead.
     */
    miterJoin = 0,
    /**
     * Round join. An arc of a circle with a diameter equal to the line width shall be drawn
     * around the point where the two segments meet, connecting the outer edges of the
     * strokes for the two segments. This pie-slice-shaped figure shall be filled in,
     * producing a rounded corner.
     */
    roundJoin = 1,
    /**
     * Bevel join. The two segments shall be finished with butt caps (see 8.4.3.3, "Line cap
     * style") and the resulting notch beyond the ends of the segments shall be filled with
     * a triangle.
     */
    bevelJoin = 2
}
interface ContentSetFontSizeParameters {
    font: string;
    size: number;
}
interface ClippingAreaParams {
    x: TypographySize;
    y: TypographySize;
    width: TypographySize;
    height: TypographySize;
}
interface ContentDrawTextParameters extends ContentSetFontSizeParameters {
    graphicsState?: string;
    color: Colors;
    clippingArea?: ClippingAreaParams;
    transforms?: Transformations;
}
interface ContextDrawEllipseParameters {
    borderWidth: TypographySize;
    borderColor?: Colors;
    bgColor?: Colors;
}
declare class PDFContent extends EventEmitter {
    static readonly SPLITTERS = " \n\r\t";
    static create(...params: PDFContentCreateParams[]): PDFContent;
    emit(event: "clear"): boolean;
    emit(event: "push", operator: PDFOperator | PDFContentScope): boolean;
    emit(event: string | symbol, ...args: any[]): boolean;
    on(event: "clear", listener: () => void): this;
    on(event: "push", listener: (operator: PDFOperator | PDFContentScope) => void): this;
    on(event: string | symbol, listener: (...args: any[]) => void): this;
    once(event: "clear", listener: () => void): this;
    once(event: "push", listener: (operator: PDFOperator | PDFContentScope) => void): this;
    once(event: string | symbol, listener: (...args: any[]) => void): this;
    push(scope: PDFContentScope): this;
    push(operator: PDFOperator): this;
    push(...params: PDFContentCreateParams[]): this;
    operators: Array<PDFOperator | PDFContent>;
    clear(): this;
    static fromString(data: string): PDFContent;
    fromString(data: string): void;
    toString(singleLine?: boolean): string;
    setFontAndSize(params: ContentSetFontSizeParameters): this;
    toArrayBuffer(): ArrayBuffer;
    toUint8Array(): Uint8Array;
    /**
     * Save the current graphics state on the graphics state stack
     */
    graphicsBegin(): this;
    /**
     * Restore the graphics state by removing the most recently saved state from the
     * stack and making it the current state
     */
    graphicsEnd(): this;
    graphicsState(dictName: string): this;
    /**
     * Modify the current transformation matrix (CTM) by concatenating the specified
     * matrix (see 8.3.2, "Coordinate spaces"). Although the operands specify a matrix,
     * they shall be written as six separate numbers, not as an array.
     * @param a Operand in matrix
     * @param b Operand in matrix
     * @param c Operand in matrix
     * @param d Operand in matrix
     * @param e Operand in matrix
     * @param f Operand in matrix
     * @returns
     */
    concatMatrix(a: TypographySize, b: TypographySize, c: TypographySize, d: TypographySize, e: TypographySize, f: TypographySize): this;
    /**
     * Set the line width in the graphics state
     * @param width
     */
    setLineWidth(width: TypographySize): this;
    /**
     * Set the line cap style in the graphics state
     * @param cap Line cap style
     */
    setLineCap(cap: LineCapStyle): this;
    /**
     * Set the line join style in the graphics state
     * @param join Line join style
     */
    setLineJoin(join: LineJoinStyle): this;
    /**
     * Begin a new subpath by moving the current point to coordinates (x, y), omitting any
     * connecting line segment. If the previous path construction operator in the current path was
     * also m, the new m overrides it; no vestige of the previous m operation remains in the path.
     * @param x Typography size of X coordinate
     * @param y Typography size of Y coordinate
     */
    moveTo(x: TypographySize, y: TypographySize): this;
    /**
     * Append a straight line segment from the current point to the point (x, y). The new current
     * point shall be (x, y).
     */
    lineTo(x: TypographySize, y: TypographySize): this;
    /**
     * Append a cubic Bézier curve to the current path. The curve shall extend from the current
     * point to the point (x3 , y3), using (x1, y1 ) and (x2, y2 ) as the Bézier control points (see 8.5.2.2,
     * y3 "Cubic Bézier curves"). The new current point shall be (x3 , y3 ).
     */
    curveTo(x1: TypographySize, y1: TypographySize, x2: TypographySize, y2: TypographySize, x3: TypographySize, y3: TypographySize): this;
    /**
     * Stroke the path
     * @param close Close or not
     */
    stroke(close?: boolean): this;
    /**
     * Fill the path, using the non-zero winding number rule to determine the region to fill
     */
    fill(): this;
    /**
     * End the path object without filling or stroking it. This operator shall be a path-painting no-op,
     * used primarily for the side effect of changing the current clipping path (see 8.5.4, "Clipping path
     * operators").
     */
    pathEnd(): this;
    clippingArea(params: ClippingAreaParams): this;
    /**
     * Modify the current clipping path by intersecting it with the current path, using the non-zero
     * winding number rule to determine which regions lie inside the clipping path.
     */
    clip(): this;
    /**
     * Modify the current clipping path by intersecting it with the current path, using the even-odd
     * rule to determine which regions lie inside the clipping path.
     */
    clipEO(): this;
    textBegin(): this;
    textEnd(): this;
    /**
     * Set the character spacing, Tc, to charSpace, which shall be a number expressed in
     * unscaled text space units. Character spacing shall be used by the Tj, TJ, and '
     * operators. Initial value: 0.
     * @param charSpace Char space
     */
    textCharacterSpacing(charSpace: TypographySize): this;
    /**
     * Set the word spacing, Tw, to wordSpace, which shall be a number expressed in
     * unscaled text space units. Word spacing shall be used by the Tj, TJ, and ' operators.
     * Initial value: 0.
     * @param wordSpace Word space
     */
    textWordSpacing(wordSpace: TypographySize): this;
    /**
     * Set the horizontal scaling, Th , to (scale ÷ 100). scale shall be a number specifying
     * the percentage of the normal width. Initial value: 100 (normal width).
     * @param scale Scale in the percentage of the normal width
     * @returns
     */
    textScale(scale: number): this;
    /**
     * Set the text leading, Tl , to leading, which shall be a number expressed in unscaled
     * text space units. Text leading shall be used only by the T*, ', and " operators. Initial
     * value: 0.
     * @param leading Leading
     */
    textLeading(leading: TypographySize): this;
    /**
     * Set the text font, Tf, to font and the text font size, Tfs, to size. font shall be the name
     * of a font resource in the Font subdictionary of the current resource dictionary;
     * size shall be a number representing a scale factor. There is no initial value for
     * either font or size; they shall be specified explicitly by using Tf before any text is
     * shown. Zero sized text shall not mark or clip any pixels (depending on text render
     * mode).
     * @param font Font name
     * @param size Font size
     */
    textFont(font: string, size: TypographySize): this;
    /**
     * Set the text rendering mode, Tmode, to render, which shall be an integer.
     * Initial value: 0.
     * @param render
     */
    textRender(render: number): this;
    /**
     * Set the text rise, Trise , to rise, which shall be a number expressed in unscaled text
     * space units. Initial value: 0.
     * @param rise
     */
    textRise(rise: TypographySize): this;
    /**
     * Move to the start of the next line, offset from the start of the
     * current line by (tx , ty ). tx and ty shall denote numbers expressed in
     * unscaled text space units.
     * @param x
     * @param y
     */
    textMove(x: TypographySize, y: TypographySize): this;
    /**
     * Move to the start of the next line, offset from the start of the
     * current line by (tx , ty ). As a side effect, this operator shall set the
     * leading parameter in the text state
     * @param x
     */
    textMoveLeading(x: TypographySize, y: TypographySize): this;
    /**
     * Set the text matrix, Tm , and the text line matrix, Tlm
     * @param a
     * @param b
     * @param c
     * @param d
     * @param e
     * @param f
     */
    textMatrix(a: number, b: number, c: number, d: number, e: number, f: number): this;
    textMatrix(matrix: Metrics): this;
    textTransform(transforms: Transformations): this;
    /**
     * Move to the start of the next line. This operator has the same effect as the code
     * @returns
     */
    textNextLine(): this;
    /**
     * Show a text string
     * @param text
     */
    textShow(text: string | PDFLiteralString | PDFHexString | BufferSource$1): this;
    /**
     * Sets color
     * @example
     * ```
     * content.setColor(0.5); // 0.5 g % grayscale filling
     * content.setColor(0.5, true); // 0.5 G % grayscale stroking
     *
     * content.setColor([0, 0, 1]); // 0 0 1 rg % RGB filling
     * content.setColor([0, 0, 1], true); // 0 0 1 RG % RGB stroking
     *
     * content.setColor([0, 0, 0, 1]); // 0 0 0 1 k % CMYK filling
     * content.setColor([0, 0, 0, 1], true); // 0 0 0 1 K % CMYK stroking
     *
     * ```
     * @param color
     * @param stroking
     * @returns
     */
    setColor(color: Colors, stroking?: boolean): this;
    drawXObject(name: string): this;
    /**
     * Begin a marked-content sequence
     * @param tag
     * @param properties
     */
    markedContentBegin(tag: string, properties?: PDFDictionary): this;
    /**
     * End a marked-content sequence
     */
    markedContentEnd(): this;
    /**
     * Draws a circle
     * @param x X coordinate of the circle center
     * @param y Y coordinate of the circle center
     * @param r Radius of the circle
     */
    drawCircle(x: TypographySize, y: TypographySize, r: TypographySize): this;
    /**
     * Draws rectangle
     * @param x X coordinate (left top corner)
     * @param y Y coordinate (left top corner)
     * @param width Width
     * @param height Height
     * @returns
     */
    drawRectangle(x: TypographySize, y: TypographySize, width: TypographySize, height: TypographySize): this;
    translate(x: TypographySize, y: TypographySize): this;
    scale(width: TypographySize, height: TypographySize): this;
    skew(a: number, b: number): this;
    rotate(angle: number): this;
    transform(params: Transformations): this;
    graphics(): PDFGraphicsScope;
    text(variable?: boolean): PDFTextScope;
}
declare class PDFContentScope extends PDFContent {
    begin: PDFOperator;
    end: PDFOperator;
    constructor(begin: PDFOperator, end: PDFOperator);
    toString(singleLine?: boolean): string;
}
declare class PDFGraphicsScope extends PDFContentScope {
    static readonly BEGIN: PDFOperator;
    static readonly END: PDFOperator;
    constructor();
}
declare class PDFTextScope extends PDFContentScope {
    static readonly BEGIN: PDFOperator;
    static readonly END: PDFOperator;
    constructor();
}

declare class PDFContentStream extends PDFStream {
    #private;
    constructor();
    constructor(stream: BufferSource);
    constructor(stream: PDFStream);
    get content(): PDFContent;
    protected serializeContent(): void;
    encode(): Promise<ArrayBuffer>;
    clear(streamOnly?: boolean): void;
}

declare enum PageTabsOrders {
    /**
     * Row order
     */
    row = "R",
    /**
     * Column order
     */
    column = "C",
    /**
     * Structure order
     */
    structure = "S",
    /**
     * Annotation array order.
     * @remarks PDF 2.0
     */
    annotationsArray = "A",
    /**
     * Widget order
     * @remarks PDF 2.0
     */
    widget = "order"
}
declare class PageObjectDictionary extends PageDictionary {
    static readonly TYPE = "Page";
    /**
     * The type of PDF object that this dictionary describes
     */
    type: string;
    /**
     * The page tree node (see {@link PageTreeNodesDictionary}) that is the immediate parent of this page object.
     * Objects of Type Template shall have no Parent key.
     */
    Parent: PageTreeNodesDictionary;
    /**
     * The date and time when the page’s contents were most recently modified.
     * @remarks Required if PieceInfo is present; optional otherwise; PDF 1.3
     */
    lastModified: PDFDate | null;
    /**
     * A rectangle, expressed in default user space units, that shall define
     * the region to which the contents of the page shall be clipped
     * when output in a production environment
     * @remarks PDF 1.3
     */
    bleedBox: PDFRectangle | null;
    /**
     * A rectangle, expressed in default user space units, that shall define
     * the intended dimensions of the finished page after trimming
     * @remarks PDF 1.3
     */
    trimBox: PDFRectangle | null;
    /**
     * A rectangle, expressed in default user space units, that shall define
     * the extent of the page’s meaningful content (including potential white-space)
     * as intended by the page’s creator
     * @remarks PDF 1.3
     */
    artBox: PDFRectangle | null;
    /**
     * A box colour information dictionary that shall specify the colours
     * and other visual characteristics that should be used in displaying
     * guidelines on the screen for the various page boundaries
     * @remarks PDF 1.4
     */
    boxColorInfo: PDFDictionary | null;
    /**
     * A content stream that shall describe the contents of this page
     */
    contents: PDFStream | PDFArray | null;
    /**
     * A group attributes dictionary that shall specify the attributes
     * of the page’s page group for use in the transparent imaging model
     * @remarks PDF 1.4
     */
    group: PDFDictionary | null;
    /**
     * A group attributes dictionary that shall specify the attributes
     * of the page’s page group for use in the transparent imaging model
     */
    thumb: PDFStream | null;
    /**
     * An array that shall contain indirect references to all article beads
     * appearing on the page
     * @remarks PDF 1.1
     */
    b: PDFArray | null;
    /**
     * The page’s display duration (also called its advance timing):
     * the maximum length of time, in seconds, that the page shall be
     * displayed during presentations before the viewer application shall
     * automatically advance to the next page
     * @remarks PDF 1.1
     */
    dur: PDFNumeric | null;
    /**
     * A transition dictionary describing the transition effect
     * that shall be used when displaying the page during presentations
     * @remarks PDF 1.1
     */
    trans: PDFDictionary | null;
    /**
     * An array of annotation dictionaries that shall contain indirect references
     * to all annotations associated with the page
     */
    annots: PDFArray | null;
    /**
     * An additional-actions dictionary that shall define actions to be performed
     * when the page is opened or closed
     * @remarks PDF 1.2
     */
    aa: PDFDictionary | null;
    /**
     * A metadata stream that shall contain metadata for the page
     * @remarks PDF 1.4
     */
    metadata: PDFStream | null;
    /**
     * A page-piece dictionary associated with the page
     * @remarks PDF 1.3
     */
    pieceInfo: PDFDictionary | null;
    /**
     * The integer key of the page’s entry in the structural parent tree
     * @remarks PDF 1.3
     */
    structParents: number | null;
    /**
     * The digital identifier of the page’s parent Web Capture content set
     * @remarks PDF 1.3
     */
    ID: PDFTextString | null;
    /**
     * The page’s preferred zoom (magnification) factor: the factor by which
     * it shall be scaled to achieve the natural display magnification
     * @remarks PDF 1.3
     */
    pz: number | null;
    /**
     * A separation dictionary that shall contain information needed
     * to generate colour separations for the page
     * @remarks PDF 1.3
     */
    separationInfo: PDFDictionary | null;
    /**
     * A name specifying the tab order that shall be used for annotations on the page
     * @remarks PDF 1.5
     */
    tabs: PageTabsOrders | null;
    /**
     * The name of the originating page object
     * @remarks PDF 1.5
     */
    templateInstantiated: PageTabsOrders | null;
    /**
     * A navigation node dictionary that shall represent the first node on the page
     * @remarks PDF 1.5
     */
    presSteps: PDFDictionary | null;
    /**
     * A positive number that shall give the size of default user space units,
     * in multiples of 1 ⁄ 72 inch. The range of supported values shall be
     * implementation-dependent. Default value: 1.0
     * @remarks PDF 1.6
     */
    userUnit: number;
    /**
     * An array of viewport dictionaries that shall specify rectangular regions of the page
     * @remarks PDF 1.6
     */
    vp: PDFArray | null;
    /**
     * An array of one or more file specification dictionaries which denote the
     * associated files for this page
     * @remarks PDF 2.0
     */
    af: PDFArray | null;
    /**
     * An array of output intent dictionaries that shall specify the colour characteristics
     * of output devices on which this page might be rendered
     * @remarks PDF 2.0
     */
    outputIntents: PDFArray | null;
    /**
     * The DPart dictionary whose range of pages includes this page object
     * @remarks PDF 2.0
     */
    dPart: PDFDictionary | null;
    protected onCreate(): void;
    protected getOrCreateContents(): PDFArray | PDFStream;
    /**
     * Adds annotation and links it with the page
     * @param annot Annotation dictionary
     * @remarks If PageObject doesn't have a list of annotation creates it
     */
    addAnnot(annot: AnnotationDictionary): void;
    addContent(content: PDFContent): void;
}

declare class PageTreeNodesDictionary extends PageDictionary {
    static readonly TYPE = "Pages";
    static createWithData(target: PDFDocument | PDFDocumentUpdate, ...items: Array<PageTreeNodesDictionary | PageObjectDictionary>): PageTreeNodesDictionary;
    /**
     * The type of PDF object that this dictionary describes
     */
    Type: string;
    /**
     * The page tree node that is the immediate parent of this one
     */
    Parent: PageTreeNodesDictionary | null;
    /**
     * An array of indirect references to the immediate children of this node
     */
    Kids: PDFArray;
    /**
     * The number of leaf nodes (page objects) that are descendants
     * of this node within the page tree
     */
    Count: number;
    protected onCreate(): void;
    /**
     * Adds page to Kids
     * @param page
     */
    addPage(page: PageObjectDictionary): void;
    indexOf(page: PageObjectDictionary): number;
    insertBefore(newPage: PageObjectDictionary, refPage?: PageObjectDictionary): void;
    remove(page: PageObjectDictionary | number): void;
    /**
     * TODO Remove this method
     * @param page
     * @returns
     * @deprecated
     */
    addPageOld(page?: PageObjectDictionary | PDFDocumentObject): Promise<PDFDocumentObject>;
    /**
     * Download all indirect references of object
     * @param element
     * @param secondUpdate
     * @param references
     * @param key
     * @returns
     */
    copyAllRef(element: PDFDocumentObject | PDFObject, secondUpdate: PDFDocumentUpdate, references?: Map<string, {
        id: number;
        generation: number;
    }>, key?: string): Promise<void>;
    /**
     * Returns all pages of the tree node
     */
    getPages(): PageObjectDictionary[];
    push(...items: Array<PageTreeNodesDictionary | PageObjectDictionary>): void;
}

/**
 * Page layout enum
 */
declare enum PageLayout {
    /**
     * Display one page at a time
     */
    singlePage = "SinglePage",
    /**
     * Display the pages in one column
     */
    oneColumn = "OneColumn",
    /**
     * Display the pages in two columns,
     * with odd-numbered pages on the left
     */
    twoColumnLeft = "TwoColumnLeft",
    /**
     * Display the pages in two columns,
     * with odd-numbered pages on the right
     */
    twoColumnRight = "TwoColumnRight",
    /**
     * (PDF 1.5) Display the pages two at a time,
     * with odd-numbered pages on the left
     */
    twoPageLeft = "TwoPageLeft",
    /**
     * (PDF 1.5) Display the pages two at a time,
     * with odd - numbered pages on the right
     */
    twoPageRight = "TwoPageRight"
}
/**
 * Page mode enum
 */
declare enum PageMode {
    /**
     * Neither document outline nor thumbnail images visible
     */
    useNone = "UseNone",
    /**
     * Document outline visible
     */
    useOutlines = "UseOutlines",
    /**
     * Thumbnail images visible
     */
    useThumbs = "UseThumbs",
    /**
     * Full-screen mode, with no menu bar, window controls,
     * or any other window visible
     */
    fullScreen = "FullScreen",
    /**
     * (PDF 1.5) Optional content group panel visible
     */
    useOC = "UseOC",
    /**
     * (PDF 1.6) Attachments panel visible
     */
    useAttachments = "UseAttachments"
}
declare class CatalogDictionary extends PDFDictionary {
    static readonly TYPE = "Catalog";
    /**
     * The type of PDF object that this dictionary describes
     */
    Type: typeof CatalogDictionary.TYPE;
    /**
     * The version of the PDF specification to which the document conforms
     * @remarks PDF 1.4
     */
    Version: string | null;
    /**
     * An extensions dictionary containing developer prefix identification
     * and version numbers for developer extensions
     */
    Extensions: Maybe<ExtensionsDictionary>;
    /**
     * The page tree node that shall be the root of the document’s page tree
     */
    Pages: PageTreeNodesDictionary;
    /**
     * A number tree defining the page labelling for the document
     * @remarks PDF 1.3
     */
    PageLabels: PDFObjectTypes | null;
    /**
     * The document’s name dictionary
     * @remarks PDF 1.2
     */
    Names: Maybe<NameDictionary>;
    /**
     * A dictionary of names and corresponding destinations.
     * @remarks PDF 1.1
     */
    Dests: PDFDictionary | null;
    /**
     * A viewer preferences dictionary
     * @remarks PDF 1.2
     */
    ViewerPreferences: PDFDictionary | null;
    /**
     * A name object specifying the page layout shall be used when the document is opened
     */
    PageLayout: PageLayout;
    /**
     * A name object specifying how the document shall be displayed when opened
     */
    PageMode: PageMode;
    /**
     * The outline dictionary that shall be the root of the document’s outline hierarchy
     */
    Outlines: PDFDictionary | null;
    /**
     * An array of thread dictionaries that shall represent the document’s article threads
     * @remarks PDF 1.1
     */
    Threads: PDFArray | null;
    /**
     * A value specifying a destination that shall be displayed or
     * an action that shall be performed when the document is opened
     * @remarks PDF 1.1
     */
    OpenAction: PDFDictionary | PDFArray | null;
    /**
     * An additional-actions dictionary defining the actions
     * that shall be taken in response to various trigger events
     * affecting the document as a whole
     * @remarks PDF 1.4
     */
    AA: PDFDictionary | null;
    /**
     * A URI dictionary containing document-level information for URI
     * @remarks PDF 1.1
     */
    URI: PDFDictionary | null;
    /**
     * The document’s interactive form (AcroForm) dictionary
     * @remarks PDF 1.2
     */
    AcroForm: Maybe<InteractiveFormDictionary>;
    /**
     * A metadata stream that shall contain metadata for the document
     * @remarks PDF 1.4
     */
    Metadata: PDFStream | null;
    /**
     * The document’s structure tree root dictionary
     * @remarks PDF 1.3
     */
    StructTreeRoot: PDFDictionary | null;
    /**
     * A mark information dictionary that shall contain information
     * about the document’s usage of Tagged PDF conventions
     * @remarks PDF 1.4
     */
    MarkInfo: PDFDictionary | null;
    /**
     * A language identifier that shall specify the natural language
     * for all text in the document except where overridden
     * by language specifications for structure elements or
     * marked content
     * @remarks PDF 1.4
     */
    Lang: string | null;
    /**
     * A Web Capture information dictionary that shall contain
     * state information used by any Web Capture extension
     * @remarks PDF 1.3
     */
    SpiderInfo: PDFDictionary | null;
    /**
     * An array of output intent dictionaries that shall
     * specify the colour characteristics of output devices on which the
     * document might be rendered
     * @remarks PDF 1.4
     */
    OutputIntents: PDFArray | null;
    /**
     * A page-piece dictionary associated with the document
     * @remarks PDF 1.4; Deprecated in PDF 2.0
     */
    PieceInfo: PDFDictionary | null;
    /**
     * The document’s optional content properties dictionary
     * @remarks PDF 1.5; required if a document contains optional content
     */
    OCProperties: PDFDictionary | null;
    /**
     * A permissions dictionary that shall specify user access permissions for the document
     * @remarks PDF 1.5
     */
    Perms: PDFDictionary | null;
    /**
     * A dictionary that shall contain attestations regarding the content
     * of a PDF document, as it relates to the legality of digital signatures
     * @remarks PDF 1.5
     */
    Legal: PDFDictionary | null;
    /**
     * An array of requirement dictionaries that shall
     * represent requirements for the document
     * @remarks PDF 1.7
     */
    Requirements: PDFArray | null;
    /**
     * A collection dictionary that a conforming
     * reader shall use to enhance the presentation of file attachments
     * stored in the PDF document
     * @remarks PDF 1.7
     */
    Collection: PDFDictionary | null;
    /**
     * A flag used to expedite the display of PDF
     * documents containing XFA forms
     * @remarks Deprecated in PDF 2.0
     */
    NeedsRendering: boolean;
    /**
     * A DSS dictionary containing document-wide security information
     * @remarks PDF 2.0
     */
    DSS: DocumentSecurityStoreDictionary | null;
    protected onCreate(): void;
}

declare enum CryptoFilterMethods {
    /**
     * The application shall not decrypt data but shall direct the input
     * stream to the security handler for decryption
     */
    None = "None",
    /**
     * The application shall ask the security handler for
     * the file encryption key and shall implicitly decrypt data with
     * 7.6.3.1, "Algorithm 1: Encryption of data using the RC4 or AES
     * algorithms", using the RC4 algorithm.
     */
    RC4 = "V2",
    /**
     * The application shall ask the security
     * handler for the file encryption key and shall implicitly decrypt
     * data with 7.6.3.1, "Algorithm 1: Encryption of data using the RC4
     * or AES algorithms", using the AES algorithm in Cipher Block
     * Chaining (CBC) mode with a 16-byte block size and an
     * initialization vector that shall be randomly generated and placed
     * as the first 16 bytes in the stream or string. The key size
     * (Length) shall be 128 bits.
     * @since PDF 1.6
     */
    AES128 = "AESV2",
    /**
     * The application shall ask the security handler for the
     * file encryption key and shall implicitly decrypt data with 7.6.3.2,
     * "Algorithm 1.A: Encryption of data using the AES algorithms",
     * using the AES-256 algorithm in Cipher Block Chaining (CBC)
     * with padding mode with a 16-byte block size and an
     * initialization vector that is randomly generated and placed as
     * the first 16 bytes in the stream or string. The key size (Length)
     * shall be 256 bits.
     * @since PDF 2.0
     */
    AES256 = "AESV3"
}
declare class CryptoFilterDictionary extends PDFDictionary {
    static TYPE: string;
    /**
     * If present, shall be CryptFilter for a crypt filter dictionary.
     */
    Type: typeof CryptoFilterDictionary.TYPE;
    /**
     * The method used, if any, by the PDF reader to decrypt data
     */
    CFM: CryptoFilterMethods;
    AuthEvent: string;
    /**
     * The standard security handler expresses the Length entry in bytes.
     */
    Length: null | number;
}

declare class CryptoFiltersDictionary extends PDFDictionary {
    /**
     * Looks for the {@link CryptoFilterDictionary} from the Dictionary
     * @param name name of the filter
     * @returns returns {@link CryptoFilterDictionary} if it exists, otherwise `null`
     */
    findItem(name: string): CryptoFilterDictionary | null;
    findItem<T extends CryptoFilterDictionary>(name: string, type: new () => T): T | null;
    findItem(name: string, type?: new () => CryptoFilterDictionary): CryptoFilterDictionary | null;
    /**
     * Gets {@link CryptoFilterDictionary} from the Dictionary
     * @param name name of the filter
     * @returns returns {@link CryptoFilterDictionary}
     */
    getItem(name: string): CryptoFilterDictionary;
    getItem<T extends CryptoFilterDictionary>(name: string, type: new () => T): T;
    /**
     * Adds {@link CryptoFilterDictionary} into the Dictionary
     * @param name name of the filter
     * @param filter filter
     */
    setFilter(name: string, filter: CryptoFilterDictionary): void;
}

declare class EncryptDictionary extends PDFDictionary {
    static IDENTITY: string;
    /**
     * The name of the preferred security handler for this document. It shall be
     * the name of the security handler that was used to encrypt the document
     */
    Filter: string;
    /**
     *  A name that completely specifies the format and interpretation of
     * the contents of the encryption dictionary
     */
    SubFilter: null | string;
    /**
     * A code specifying the algorithm to be used in encrypting and decrypting
     * the document.
     *
     * 0 - An algorithm that is undocumented. This value shall not be used.
     *
     * 1 - (Deprecated) Indicates the use of 7.6.3.1, "Algorithm 1: Encryption of data
     * using the RC4 or AES algorithms" (deprecated) with a file encryption key
     * length of 40 bits; see below.
     *
     * 2 - (PDF 1.4; deprecated) Indicates the use of 7.6.3.1, "Algorithm 1: Encryption of
     * data using the RC4 or AES algorithms" (deprecated) but permitting file
     * encryption key lengths greater than 40 bits.
     *
     * 3 - (PDF 1.4; deprecated) An unpublished algorithm that permits file encryption
     * key lengths ranging from 40 to 128 bits. This value shall not appear in a
     * conforming PDF file.
     *
     * 4 - (PDF 1.5; deprecated) The security handler defines the use of encryption and
     * decryption in the document, using the rules specified by the CF, StmF, and StrF
     * entries using 7.6.3.1, "Algorithm 1: Encryption of data using the RC4 or AES
     * algorithms" (deprecated) with a file encryption key length of 128 bits.
     *
     * 5 - (PDF 2.0) The security handler defines the use of encryption and decryption in
     * the document, using the rules specified by the CF, StmF, StrF and EFF entries
     * using 7.6.3.2, "Algorithm 1.A: Encryption of data using the AES algorithms"
     * with a file encryption key length of 256 bits.
     */
    V: number;
    /**
     * The length of the file encryption key, in bits. The value shall be a multiple of 8,
     * in the range 40 to 128.
     *
     * Default value: 40.
     */
    Length: number;
    /**
     * A dictionary whose keys shall be crypt filter names and whose values shall be the
     * corresponding crypt filter dictionaries
     */
    CF: Maybe<CryptoFiltersDictionary>;
    /**
     * The name of the crypt filter that shall be used by default when decrypting streams
     */
    StmF: string;
    /**
     * The name of the crypt filter that shall be used when decrypting all strings in the document
     */
    StrF: string;
    /**The name of the crypt filter that shall be used when encrypting embedded file streams that do
     * not have their own crypt filter specifier; it shall correspond to a key in the CF
     * dictionary or a standard crypt filter name
     */
    EFF: null | string;
}

interface CrossReference extends PDFDictionary {
    addObject(obj: PDFDocumentObject): void;
    objects: ReadonlyArray<PDFDocumentObject>;
    Encrypt: EncryptDictionary | null;
    ID: PDFTextString[] | null;
    Root: CatalogDictionary;
    Prev: number | null;
    Size: number;
    documentUpdate: PDFDocumentUpdate | null;
}

interface CrossReferenceIndex {
    start: number;
    size: number;
}
declare class CrossReferenceStream extends PDFStream implements CrossReference {
    static readonly TYPE = "XRef";
    /**
     * Returns object number from Index value
     * @param indexes Array of indexes from the Index field of the Compressed-Reference Stream
     * @param position
     * @returns
     */
    static getIdentifier(indexes: CrossReferenceIndex[], position: number): number;
    /**
     * The type of PDF object that this dictionary describes
     */
    Type: string;
    /**
     * The total number of entries in the file’s cross-reference table,
     * as defined by the combination of the original section and all update sections
     * @remarks Shall not be an indirect reference
     */
    Size: number;
    /**
     * The byte offset in the decoded stream from the beginning of the file
     * to the beginning of the previous cross-reference section
     * @remarks
     * - present only if the file has more than one cross-reference section
     * - shall be a direct object
     */
    Prev: null | number;
    /**
     * The catalog dictionary for the PDF document contained in the file
     * (see {@link CatalogDictionary})
     */
    Root: CatalogDictionary;
    /**
     * The document’s encryption dictionary
     * @remarks
     * - required if document is encrypted
     * - PDF 1.1
     */
    Encrypt: null | EncryptDictionary;
    /**
     * The document’s information dictionary.
     * @remarks Deprecated in PDF 2.0
     */
    Info: Maybe<InformationDictionary>;
    /**
     * An array of two byte-strings constituting a file identifier for the file.
     * The ID array shall (PDF 2.0) have a minimum length of 16 bytes. If there is an Encrypt entry,
     * this array and the two byte-strings shall be direct objects and shall be unencrypted.
     * @remarks
     * - required in PDF 2.0 or if an Encrypt entry is present
     * - PDF 1.1
     */
    ID: null | PDFTextString[];
    /**
     * An array containing a pair of integers for each subsection in this section
     */
    Index: null | CrossReferenceIndex[];
    /**
     * An array of integers representing the size of the fields in a single
     * cross-reference entry
     */
    W: number[];
    objects: PDFDocumentObject[];
    private computerNumberLength;
    private computeWidths;
    private numberToUint8Array;
    prepare(): Promise<void>;
    onCreate(): void;
    protected onToStringStream(): string;
    addObject(obj: PDFDocumentObject): void;
    protected onFromPDF(reader: ViewReader): void;
}

declare class InformationDictionary extends PDFDictionary {
    Title: null | string;
    Author: null | string;
    Subject: null | string;
    Keywords: null | string;
    Creator: null | string;
    Producer: null | string;
    CreationDate: null | PDFDate;
    ModDate: PDFDate;
    Trapped: string;
}

declare class TrailerDictionary extends PDFDictionary {
    /**
     * The total number of entries in the file’s cross-reference table,
     * as defined by the combination of the original section and all update sections
     * @remarks Shall not be an indirect reference
     */
    Size: number;
    /**
     * The byte offset in the decoded stream from the beginning of the file
     * to the beginning of the previous cross-reference section
     * @remarks
     * - present only if the file has more than one cross-reference section
     * - shall be a direct object
     */
    Prev: null | number;
    /**
     * The catalog dictionary for the PDF document contained in the file
     * (see {@link CatalogDictionary})
     */
    Root: CatalogDictionary;
    /**
     * The document’s encryption dictionary
     * @remarks
     * - required if document is encrypted
     * - PDF 1.1
     */
    Encrypt: null | EncryptDictionary;
    /**
     * The document’s information dictionary.
     * @remarks Deprecated in PDF 2.0
     */
    Info: Maybe<InformationDictionary>;
    /**
     * An array of two byte-strings constituting a file identifier for the file.
     * The ID array shall (PDF 2.0) have a minimum length of 16 bytes. If there is an Encrypt entry,
     * this array and the two byte-strings shall be direct objects and shall be unencrypted.
     * @remarks
     * - required in PDF 2.0 or if an Encrypt entry is present
     * - PDF 1.1
     */
    ID: null | PDFTextString[];
    protected onCreate(): void;
}

declare class CrossReferenceTable extends TrailerDictionary implements CrossReference {
    objects: PDFDocumentObject[];
    xrefStream?: CrossReferenceStream;
    protected onFromPDF(reader: ViewReader): void;
    protected onWritePDF(writer: ViewWriter): void;
    toString(): string;
    addObject(obj: PDFDocumentObject): void;
}

declare class PDFDocumentUpdate {
    #private;
    /**
     * @internal
     * %%EOF end-of-line characters.
     * This parameter is more suitable for test cases and should not be used in production.
     */
    static EOF_EOL: string;
    static readonly DEFAULT_VIEW: Uint8Array<ArrayBuffer>;
    view: Uint8Array<ArrayBuffer>;
    document: PDFDocument;
    xref: CrossReference | null;
    startXref: number;
    /**
     * Indicates whether the "Size" field in the Trailer object of a PDF file
     * is set according to the PDF specification.
     */
    private sizeChecked;
    constructor(document: PDFDocument);
    get items(): ReadonlyArray<PDFDocumentObject>;
    get Encrypt(): EncryptDictionary | null;
    get id(): PDFTextString[] | null;
    get catalog(): CatalogDictionary | null;
    fromPDF(reader: ViewReader): Promise<number>;
    fromPDF(data: Uint8Array, offset?: number): Promise<number>;
    fromPDF(text: string): Promise<number>;
    fromPDF(data: string | Uint8Array | ViewReader, offset?: number): Promise<number>;
    writePDF(writer: ViewWriter): Promise<void>;
    previous: PDFDocumentUpdate | null;
    getObjects(): PDFDocumentObject[];
    getObject(obj: PDFIndirect): PDFDocumentObject;
    getObject(id: number, generation?: number): PDFDocumentObject;
    getObject(param: number | PDFIndirect, generation?: number): PDFDocumentObject;
    protected getCompressedObjectNumbers(): number[];
    protected getCompressedObjects(): PDFDocumentObject[];
    decompress(): Promise<void>;
    decompressSync(): void;
    protected createCrossReferenceStream(): CrossReferenceStream;
    protected createCrossReferenceTable(): CrossReferenceTable;
    protected getOrCreateXref(): CrossReference;
    /**
     * Identifies and corrects the incorrect "Size" value in such non-compliant PDFs.
     *
     * Issue: https://github.com/PeculiarVentures/pdf/issues/102
     *
     * This function addresses an issue where the "Size" field in the Trailer object
     * of a PDF file may not be set according to the PDF specification.
     *
     *
     * @param pdfData - The PDF data to be modified.
     * @returns Corrected PDF data.
     */
    private correctSize;
    createPDFDocumentObject(element: PDFObject): PDFDocumentObject;
    delete(element: number | PDFDocumentObject): void;
    protected getOrCreateCompressedObject(): PDFDocumentObject;
    append(element: PDFObject | PDFDocumentObject, compressed?: boolean): PDFDocumentObject;
    toString(): Promise<string>;
    addCatalog(): CatalogDictionary;
    protected getObjectReferences(obj: PDFObject, refs?: PDFIndirect[]): PDFIndirect[];
    decrypt(): Promise<void>;
    encrypt(): Promise<void>;
    protected decryptObject(value: PDFObject): Promise<void>;
    protected encryptObject(value: PDFObject, skipIndirect?: boolean): Promise<void>;
}

declare class PDFRectangle extends PDFArray {
    static createWithData(update: PDFDocumentUpdate, llX: number, llY: number, urX: number, urY: number): PDFRectangle;
    get llX(): number;
    set llX(v: number);
    get llY(): number;
    set llY(v: number);
    get urX(): number;
    set urX(v: number);
    get urY(): number;
    set urY(v: number);
    protected onCreate(): void;
    /**
     * Returns the rectangle as an array of numbers.
     * @returns An array of numbers in the form [llX, llY, urX, urY].
     * @throws If the rectangle does not have 4 coordinates.
     * @throws If any of the coordinates are not numbers.
     */
    toArray(): Array<number>;
}

declare class AppearanceDictionary extends PDFDictionary {
    /**
     * The annotation’s normal appearance
     */
    N: PDFDictionary | PDFArray;
    /**
     * The annotation’s rollover appearance.
     *
     * Default value: the value of the N entry
     */
    r: PDFDictionary | PDFArray | null;
    /**
     * The annotation’s down appearance.
     *
     * Default value: the value of the N entry
     */
    D: PDFDictionary | PDFArray | null;
}

declare enum AnnotationFlags {
    /**
     * Applies only to annotations which do not belong to one of the standard annotation types
     * and for which no annotation handler is available. If set, do not render the unknown
     * annotation using an appearance stream specified by its appearance dictionary, if any (see
     * annotation and do not print it even if the Print flag is set. If clear, render such an unknown
     * 12.5.5, "Appearance streams").
     */
    invisible = 1,
    /**
     * If set, do not render the annotation or allow it to interact with the user,
     * regardless of its annotation type or whether an annotation handler is available.
     * @remarks In cases where screen space is limited, the ability to hide and show
     * annotations selectively can be used in combination with appearance
     * streams (see 12.5.5, "Appearance streams") to render auxiliary popup
     * information similar in function to online help systems.
     * @remarks PDF 1.2
     */
    hidden = 2,
    /**
     * If set, print the annotation when the page is printed unless the Hidden flag is
     * also set. If clear, never print the annotation, regardless of whether it is rendered on the
     * screen. If the annotation does not contain any appearance streams this flag shall be
     * ignored.
     * @remarks This can be useful for annotations representing interactive push-buttons,
     * which would serve no meaningful purpose on the printed page.
     * @remarks PDF 1.2
     */
    print = 4,
    /**
     * If set, do not scale the annotation’s appearance to match the magnification of the
     * page. The location of the annotation on the page (defined by the upper-left corner of its
     * annotation rectangle) shall remain fixed, regardless of the page magnification. See further
     * discussion following this table.
     * @remarks PDF 1.3
     */
    noZoom = 8,
    /**
     * If set, do not rotate the annotation’s appearance to match the rotation of the
     * page. The upper-left corner of the annotation rectangle shall remain in a fixed location on
     * the page, regardless of the page rotation. See further discussion following this table
     * @remarks PDF 1.3
     */
    noRotate = 16,
    /**
     * If set, do not render the annotation on the screen or allow it to interact with the
     * user. The annotation may be printed (depending on the setting of the Print flag) but
     * should be considered hidden for purposes of on-screen display and user interaction.
     * @remarks PDF 1.3
     */
    noView = 32,
    /**
     * If set, do not allow the annotation to interact with the user. The annotation may
     * be rendered or printed (depending on the settings of the NoView and Print flags) but
     * should not respond to mouse clicks or change its appearance in response to mouse
     * motions.
     *
     * This flag shall be ignored for widget annotations; its function is subsumed by the
     * ReadOnly flag of the associated form field (see "Table 226: Field flags common to all field
     * types").
     * @remarks PDF 1.3
     */
    readOnly = 64,
    /**
     * If set, do not allow the annotation to be deleted or its properties (including
     * position and size) to be modified by the user. However, this flag does not restrict changes
     * to the annotation’s contents, such as the value of a form field.
     * @remarks PDF 1.4
     */
    locked = 128,
    /**
     * If set, invert the interpretation of the NoView flag for annotation selection and
     * mouse hovering, causing the annotation to be visible when the mouse pointer hovers over
     * the annotation or when the annotation is selected.
     * @remarks PDF 1.5
     */
    toggleNoView = 256,
    /**
     * If set, do not allow the contents of the annotation to be modified by the user.
     * This flag does not restrict deletion of the annotation or changes to other annotation
     * properties, such as position and size.
     * @remarks PDF 1.7
     */
    lockedContents = 512
}
declare enum SubTypeAnnotation {
    /**
     * Text annotations
     */
    text = "Text",
    /**
     * Link annotations
     */
    link = "Link",
    /**
     * Free text annotations
     */
    freeText = "FreeText",
    /**
     * Line annotations
     */
    line = "Line",
    /**
     * Square and circle annotations
     */
    square = "Square",
    /**
     * Square and circle annotations
     */
    circle = "Circle",
    /**
     * Polygon and polyline annotations
     */
    polygon = "Polygon",
    /**
     * Polygon and polyline annotations
     */
    polyLine = "PolyLine",
    /**
     * Text markup annotations
     */
    highlight = "Highlight",
    /**
     * Text markup annotations
     */
    underline = "Underline",
    /**
     * Text markup annotations
     */
    squiggly = "Squiggly",
    /**
     * Text markup annotations
     */
    strikeOut = "StrikeOut",
    /**
     * Caret annotations
     */
    caret = "Caret",
    /**
     * Rubber stamp annotations
     */
    stamp = "Stamp",
    /**
     * Ink annotations
     */
    ink = "Ink",
    /**
     * Pop-up annotations
     */
    popup = "Popup",
    /**
     * File attachment annotations
     */
    fileAttachment = "FileAttachment",
    /**
     * Sound annotations
     */
    sound = "Sound",
    /**
     * Movie annotations
     */
    movie = "Movie",
    /**
     * Screen annotations
     */
    screen = "Screen",
    /**
     * Widget annotations
     */
    widget = "Widget",
    /**
     * Printer’s mark annotations
     */
    printerMark = "PrinterMark",
    /**
     * Trap network annotations
     */
    trapNet = "TrapNet",
    /**
     * Watermark annotations
     */
    watermark = "Watermark",
    /**
     * Redaction annotations
     */
    redact = "Redact",
    /**
     * Projection annotations
     */
    projection = "Projection",
    /**
     * RichMedia annotations"
     */
    richMedia = "RichMedia",
    /**
     * 3D Annotations
     */
    threeD = "3D"
}
declare class AnnotationDictionary extends PDFDictionary {
    static readonly TYPE = "Annot";
    /**
     * The type of PDF object that this dictionary describes; if present, shall be Annot
     * for an annotation dictionary
     */
    type: typeof AnnotationDictionary.TYPE;
    /**
     *  The type of annotation that this dictionary describes
     */
    subtype: string;
    /**
     * The annotation rectangle, defining the location of the annotation on the page
     * in default user space units.
     */
    rect: PDFRectangle;
    /**
     * Text that shall be displayed for the annotation or, if this type of annotation
     * does not display text, an alternative description of the annotation’s contents
     * in humanreadable form. In either case, this text is useful when extracting the document’s content
     * in support of accessibility to users with disabilities or for other purposes
     */
    contents: string | null;
    /**
     * An indirect reference to the
     * page object with which this annotation is associated
     */
    p: PageObjectDictionary | null;
    /**
     * The annotation name, a text string uniquely identifying it among all
     * the annotations on its page.
     */
    nm: string | null;
    /**
     * The date and time when the annotation was most recently modified.
     */
    m: Date | null;
    /**
     * A set of flags specifying various characteristics of the annotation. Default value: 0
     */
    f: AnnotationFlags;
    /**
     * An appearance dictionary specifying how the annotation shall be
     * presented visually on the page (see 12.5.5, "Appearance streams"). A PDF writer shall
     * include an appearance dictionary when writing or updating an annotation dictionary
     * except for the two cases listed below
     */
    AP: Maybe<AppearanceDictionary>;
    /**
     * The annotation’s appearance state, which selects the applicable appearance stream from
     * an appearance subdictionary
     */
    as: string | null;
    /**
     * An array specifying the characteristics of the annotation’s border, which shall
     * be drawn as a rounded rectangle.
     */
    border: PDFArray | null;
    /**
     * An array of numbers in the range 0.0 to 1.0, representing a colour
     * used for the following purposes:
     * The background of the annotation’s icon when closed,
     * The title bar of the annotation’s popup window,
     * The border of a link annotation
     */
    c: PDFArray | null;
    /**
     * The integer key of the annotation’s entry in the structural parent tree
     */
    structParent: number | null;
    /**
     * An optional content group or optional content membership dictionary
     * specifying the optional content properties for the annotation.
     */
    oc: PDFDictionary | null;
    /**
     * An array of one or more file specification dictionaries which denote the associated files for this annotation
     */
    af: PDFDictionary | null;
    ca: number | null;
    CA: number | null;
    /**
     * The blend mode that shall be used when painting the annotation onto the page
     */
    bm: string | null;
    /**
     * A language identifier overriding the document’s language identifier to
     * specify the natural language for all text in the annotation except where overridden by
     * other explicit language specifications
     */
    lang: string | null;
    protected onCreate(): void;
}

declare class ExtGStateDictionary extends PDFDictionary {
    static TYPE: string;
    /**
     * The type of PDF object that this dictionary describes;
     * shall be ExtGState for a graphics state parameter dictionary
     */
    Type: typeof ExtGStateDictionary.TYPE;
    /**
     * The line width
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    LW: number | null;
    /**
     * The line cap style
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    LC: LineCapStyle | null;
    /**
     * The line cap style
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    LJ: LineJoinStyle | null;
    /**
     * The miter limit
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    ML: number | null;
    /**
     * The line dash pattern, expressed as an array of the form
     * [dashArray dashPhase], where dashArray shall be itself an array and dashPhase
     * shall be a number
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    D: Maybe<PDFArray>;
    /**
     * The name of the rendering intent (see 8.6.5.8, "Rendering intents").
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    RI: string | null;
    /**
     * A flag specifying whether to apply overprint (see 8.6.7, "Overprint
     * control"). In PDF 1.2 and earlier, there is a single overprint parameter that
     * applies to all painting operations. Beginning with PDF 1.3, two separate
     * overprint parameters were defined: one for stroking and one for all other
     * painting operations. Specifying an OP entry shall set both parameters unless
     * there is also an op entry in the same graphics state parameter dictionary, in
     * which case the OP entry shall set only the overprint parameter for stroking.
     * @remarks
     * - Optional
     */
    OP: boolean;
    /**
     * A flag specifying whether to apply overprint (see 8.6.7,
     * "Overprint control") for painting operations other than stroking. If this entry is
     * absent, the OP entry, if any, shall also set this parameter.
     * @remarks
     * - Optional
     * -  PDF 1.3
     */
    op: boolean;
    /**
     * The overprint mode (see 8.6.7, "Overprint control").
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    OPM: number | null;
    /**
     * An array of the form [font size], where font shall be an
     * indirect reference to a font dictionary and size shall be a number expressed in
     * text space units. These two objects correspond to the operands of
     * the Tf operator (see 9.3, "Text state parameters and operators"); however, the
     * first operand shall be an indirect object reference instead of a resource name.
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    Font: Maybe<PDFArray>;
    /**
     * The black-generation function, which maps the interval [0.0 1.0] to
     * the interval [0.0 1.0] (see 10.4.2.3, "Conversion from DeviceRGB to
     * DeviceCMYK").
     * @remarks
     * - Optional
     */
    BG: PDFObjectTypes;
    /**
     * Same as BG except that the value may also be the name
     * Default, denoting the black-generation function that was in effect at the start of
     * the page. If both BG and BG2 are present in the same graphics state parameter
     * dictionary, BG2 shall take precedence.
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    BG2: PDFObjectTypes;
    /**
     * The undercolour-removal function, which maps the interval [0.0 1.0]
     * to the interval [−1.0 1.0] (see 10.4.2.3, "Conversion from DeviceRGB to
     * DeviceCMYK").
     * @remarks
     * - Optional
     */
    UCR: PDFObjectTypes;
    /**
     * Same as UCR except that the value may also be the
     * name Default, denoting the undercolour-removal function that was in effect at
     * the start of the page. If both UCR and UCR2 are present in the same graphics
     * state parameter dictionary, UCR2 shall take precedence.
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    UCR2: PDFObjectTypes;
    /**
     * The transfer function, which maps the interval
     * [0.0 1.0] to the interval [0.0 1.0] (see 10.5, "Transfer functions"). The value shall
     * be either a single function (which applies to all process colourants) or an array
     * of four functions (which apply to the process colourants individually). The name
     * Identity may be used to represent the Identity function.
     * @remarks
     * - Optional
     * - Deprecated in PDF 2.0
     */
    TR: PDFObjectTypes;
    /**
     * Same as TR except that the value may
     * also be the name Default, denoting the transfer function that was in effect at the
     * start of the page. If both TR and TR2 are present in the same graphics state
     * parameter dictionary, TR2 shall take precedence.
     * @remarks
     * - Optional
     * - PDF 1.3
     * - Deprecated in PDF 2.0
     */
    TR2: PDFObjectTypes;
    /**
     * The halftone dictionary or stream (see 10.6, "Halftones") or the
     * name Default, denoting the halftone that was in effect at the start of the page.
     * @remarks
     * - Optional
     */
    HT: PDFDictionary | PDFStream | PDFName;
    /**
     * The flatness tolerance (see 10.7.2, "Flatness tolerance").
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    FL: number | null;
    /**
     * The smoothness tolerance (see 10.7.3, "Smoothness tolerance").
     * @remarks
     * - Optional
     * - PDF 1.3
     */
    SM: number | null;
    /**
     * A flag specifying whether to apply automatic stroke adjustment (see
     * 10.7.5, "Automatic stroke adjustment").
     */
    SA: boolean | null;
    /**
     * The current blend mode that shall be used in the transparent imaging model (see 11.3.5, "Blend mode").
     * @remarks
     * - Optional
     * - PDF 1.4
     * - Array is deprecated in PDF 2.0
     */
    BM: PDFArray | PDFName;
    /**
     * The current soft mask, specifying the mask shape or mask
     * opacity values that shall be used in the transparent imaging model (see 11.3.7.2,
     * "Source shape and opacity" and 11.6.4.3, "Mask shape and opacity").
     * Although the current soft mask is sometimes referred to as a "soft clip," altering
     * it with the gs operator completely replaces the old value with the new one,
     * rather than intersecting the two as is done with the current clipping path
     * parameter (see 8.5.4, "Clipping path operators").
     * @remarks
     * - Optional
     * - PDF 1.4
     */
    SMask: PDFDictionary | PDFName;
    /**
     * The current stroking alpha constant, specifying the constant
     * shape or constant opacity value that shall be used for stroking operations in the
     * transparent imaging model (see 11.3.7.2, "Source shape and opacity" and
     * 11.6.4.4, "Constant shape and opacity").
     * @remarks
     * - Optional
     * - PDF 1.4
     */
    CA: number | null;
    /**
     * Same as CA, but for nonstroking operations.
     * @remarks
     * - Optional
     * - PDF 1.4
     */
    ca: number | null;
    /**
     * The alpha source flag ("alpha is shape"), specifying whether
     * the current soft mask and alpha constant shall be interpreted as shape values
     * (true) or opacity values (false).
     * @remarks
     * - Optional
     * - PDF 1.4
     */
    AIS: boolean | null;
    /**
     * The text knockout flag, shall determine the behaviour of
     * overlapping glyphs within a text object in the transparent imaging model (see
     * 9.3.8, "Text knockout"). This flag controls the behavior of glyphs obtained from
     * any font type, including Type 3.
     * @remarks
     * - Optional
     * - PDF 1.4
     */
    TK: boolean | null;
    /**
     * This graphics state parameter controls whether black point
     * compensation is performed while doing CIE-based colour conversions. It shall be
     * set to either OFF, ON or Default. The semantics of Default are up to the PDF
     * processor. See 8.6.5.9, "Use of black point compensation".
     *
     * The default value is: Default.
     * @remarks
     * - Optional
     * - PDF 2.0
     */
    UseBlackPTComp: string | null;
    /**
     * Halftone origin, specified as an array of two numbers
     * specifying the X and Y location of the halftone origin in the current coordinate
     * system.
     * @note
     * The HTO key is very similar to the HTP key defined in PDF
     * versions up to 1.3 (1st Edition), but differs in the coordinate
     * system used.
     * @remarks
     * - Optional
     * - PDF 2.0
     */
    HTO: Maybe<PDFArray>;
    onCreate(): void;
}

declare class EmbeddedFileParams extends PDFDictionary {
    /**
     * The size of the uncompressed embedded file, in bytes.
     */
    Size: number | null;
    /**
     * The date and time when the embedded file was created.
     */
    CreationDate: PDFDate | null;
    /**
     * The date and time when the embedded file was last modified.
     *
     * @remarks
     * Required in the case of an embedded file stream used as an associated file
     */
    ModDate: PDFDate | null;
    /**
     * A sub dictionary containing additional information specific to Mac OS files.
     *
     * @deprecated PDF 2.0
     */
    Mac: PDFDictionary | null;
    /**
     * A 16-byte string that is the checksum of the bytes of the uncompressed embedded file.
     *
     * The checksum shall be calculated by applying the standard MD5 message-digest algorithm
     * (described in Internet RFC 1321, The MD5 Message-Digest Algorithm) to the bytes of the
     * embedded file stream.
     *
     * @note This is strictly a checksum, and is not used for security purposes.
     */
    CheckSum: PDFTextString | null;
}

declare class EmbeddedFileStream extends PDFStream {
    static TYPE: string;
    /**
     * The type of PDF object that this dictionary describes.
     *
     * @remarks
     * If present, shall be EmbeddedFile for an embedded file stream.
     */
    Type: typeof EmbeddedFileStream.TYPE;
    /**
     * The subtype of the embedded file.
     *
     * The value of this entry shall conform to the MIME media type names defined in Internet RFC2046,
     * Multipurpose Internet Mail Extensions (MIME), Part Two: MediaTypes, with the provision
     * that characters not permitted in names shall use the 2-character hexadecimal code format
     * described in 7.3.5, "Name objects".
     *
     * @remarks
     * Required in the case of an embedded file stream used as as associated file
     */
    Subtype: string | null;
    /**
     * An embedded file parameter dictionary that shall contain additional file-specific information.
     *
     * @remarks
     * Required in the case of an embedded file stream used as an associated file
     */
    Params: Maybe<EmbeddedFileParams>;
}

declare class FileSpecificationEntries extends PDFDictionary {
    F: Maybe<EmbeddedFileStream>;
    UF: Maybe<EmbeddedFileStream>;
}
/**
 * Represents file specification dictionary described in `Table 43: Entries in a file specification dictionary`
 */
declare class FileSpecificationDictionary extends PDFDictionary {
    static TYPE: string;
    /**
     * The type of PDF object that this dictionary describes
     *
     * Shall be `Filespec` for a file specification dictionary.
     *
     * @remarks
     * Required if an EF, EP or RF entry is present; recommended always
     */
    Type: typeof FileSpecificationDictionary.TYPE;
    /**
     * The name of the file system that shall be used to interpret this file
     * specification. If this entry is present, all other entries in the dictionary shall be
     * interpreted by the designated file system. PDF shall define only one standard
     * filesystem name, URL (see 7.11.5, "URL specifications"); an application can register
     * other names (see Annex E, "PDF Name Registry"). This entry shall be independent of the
     * F and UF entries.
     */
    FS: string | null;
    /**
     * A file specification string of the form described in 7.11.2,"File specification strings"
     * or (if the file system is URL) a uniform resource locator, as described in 7.11.5,
     * "URL specifications".
     *
     * The UF entry should be used in addition to the F entry. The UF entry provides cross-platform
     * and cross-language compatibility and the F entry provides backwards compatibility.
     * A PDF reader shall use the value of the UF key, when present, instead of the F key.
     *
     * @remarks Required if the DOS, Mac, and Unix entries are all absent
     *
     * @remarks Amended with the UF entry for PDF 1.7
     *
     * @remarks PDF 2.0
     *
     * For unencrypted wrapper documents for an encrypted payload document (see 7.6.7, "Unencrypted
     * wrapper document") the F entry shall not contain or be derived from the encrypted payload’s
     * actual file name. This is to avoid potential disclosure of sensitive information in the original
     * filename. The value of F for encrypted payload documents should include the name of the cryptographic
     * filter needed to decrypt the document. See the example in 7.6.7,"Unencrypted wrapper document".
     */
    F: string | null;
    /**
     * A Unicode text string that provides file specification of the form described in 7.11.2,"File
     * specification strings". This is a text string as defined in 7.9.2.2, "Text string type".
     * The F entry should be included along with this entry for backwards compatibility reasons.
     * A PDF reader shall use the value of the UF key, when present, instead of the F key.
     *
     * @remarks Recommended if the F entry exists in the dictionary; PDF 1.7
     *
     * @remarks PDF 2.0
     *
     * For unencrypted wrapper documents for an encrypted payload document (see 7.6.6, "Unencrypted
     * wrapper document") the UF entry shall not contain or be derived from the encrypted payload’s
     * actual file name. This is to avoid potential disclosure of sensitive information in the original
     * filename.
     *
     * @since PDF 1.7
     */
    UF: string | null;
    /**
     * A file specification string representing a DOS file name.
     *
     * @deprecated PDF 2.0
     */
    DOS: string | null;
    /**
     * A file specification string representing a Mac OS file name.
     *
     * @deprecated PDF 2.0
     */
    Mac: string | null;
    /**
     * A file specification string representing a Unix file name.
     *
     * @deprecated PDF 2.0
     */
    Unix: string | null;
    /**
     * An array of two byte strings constituting a file identifier (see 14.4, "File identifiers")
     * that should be included in the referenced file.
     *
     * @note
     * The use of this entry improves an application’s chances of finding the intended file
     * and allows it to warn the user if the file has changed since the link was made.
     */
    ID: PDFArray | null;
    /**
     * A flag indicating whether the file referenced by the file specification is volatile
     * (changes frequently with time). If the value is true, applications shall not cache a copy
     * of the file. For example, a movie annotation referencing a URL to a live video camera could
     * set this flag to true to notify thePDF reader that it should re-acquire the movie each time
     * it is played.
     *
     * Default value: false.
     *
     * @since PDF 1.2
     */
    V: boolean;
    /**
     * A dictionary containing a subset of the F and UF keys corresponding to the entries by those
     * names in the file specification dictionary. The value of each such key shall be an embedded
     * file stream (see 7.11.4, "Embedded file streams") containing the corresponding file. If this
     * entry is present, the Type entry is required and the file specification dictionary shall be
     * indirectly referenced.
     *
     * @remarks Required if RF is present
     *
     * @remarks Amended to include the UF key in PDF 1.7
     *
     * @remarks PDF2.0
     *
     * For unencrypted wrapper documents for an encrypted payload document (see 7.6.7, "Unencrypted
     * wrapper document") the EF dictionary is required for the file stream containing the encrypted
     * payload.
     *
     * @since PDF 1.3
     */
    EF: Maybe<FileSpecificationEntries>;
    /**
     * A dictionary with the same structure as the EF dictionary, which shall be present. For each key
     * in this dictionary, the same key shall appear in the EF dictionary of this file specification
     * dictionary. Each value shall be are lated files array (see 7.11.4.2, "Related files arrays")
     * identifying files that are related to the corresponding file in the EF dictionary. If this entry
     * is present, the Type entry is required and the file specification dictionary shall be indirectly
     * referenced.
     *
     * @since PDF 1.3
     */
    RF: PDFDictionary | null;
    /**
     * Descriptive text associated with the file specification. It shall be used for file specification
     * dictionaries referenced from the EmbeddedFiles name tree (see 7.7.4, "Name dictionary").
     *
     * @since PDF 1.6
     */
    Desc: string | null;
    /**
     * A collection item dictionary, which shall be used to create the user interface for portable
     * collections (see 7.11.6,"Collection items").
     *
     * @remarks Shall be indirect reference
     *
     * @since PDF 1.7
     */
    CI: PDFDictionary | null;
    /**
     * A stream object defining the thumbnail image for the file specification. (See 12.3.4, "Thumbnail
     * images")
     *
     * @since PDF 2.0
     */
    Thumb: PDFStream | null;
    protected onCreate(): void;
}

declare class CharacterEncodingDictionary extends PDFDictionary {
    static readonly TYPE = "Encoding";
    /**
     * The type of PDF object that this dictionary describes if present, shall be Encoding for an encoding dictionary.
     */
    Type: typeof CharacterEncodingDictionary.TYPE;
    /**
     * (Optional) The base encoding — that is, the encoding from which the Differences entry
     * (if present) describes differences — shall be the name of one of the predefined encodings
     * `MacRomanEncoding`, `MacExpertEncoding`, or `WinAnsiEncoding`.
     *
     * If this entry is absent, the Differences entry shall describe differences from a default
     * base encoding. For a font program that is embedded in the PDF file, the default base encoding
     * shall be the font program’s built-in encoding, "Character encoding" and further elaborated in the
     * subclauses on specific font types. Otherwise, for a nonsymbolic font, it shall be StandardEncoding,
     * and for a symbolic font, it shall be the font’s built-in encoding.
     */
    BaseEncoding: string;
    /**
     * An array describing the differences from the encoding specified by BaseEncoding or, if BaseEncoding
     * is absent from a default base encoding. The Differences array is described in subsequent subclauses.
     * @remarks should not be used with TrueType fonts
     */
    Differences?: PDFArray | null;
}

declare class CollectionItemsDictionary extends PDFDictionary {
    static readonly TYPE = "CollectionItem";
    /**
     * The type of PDF object that this dictionary describes; if present,
     * shall be CollectionItem for a collection item dictionary.
     */
    type: typeof CollectionItemsDictionary.TYPE;
    protected onCreate(): void;
}

declare enum FontDescriptorFlags {
    none = 0,
    /**
     * All glyphs have the same width (as opposed to proportional or variable pitch fonts, which have different widths).
     */
    fixedPitch = 1,
    /**
     * Glyphs have serifs, which are short strokes drawn at an angle on the top
     * and bottom of glyph stems. (Sans serif fonts do not have serifs.)
     */
    serif = 2,
    /**
     * Font contains glyphs outside the Standard Latin character set. This flag
     * and the Nonsymbolic flag shall not both be set or both be clear.
     */
    symbolic = 4,
    /**
     * Glyphs resemble cursive handwriting.
     */
    script = 8,
    /**
     * Font uses the Standard Latin character set or a subset of it. This flag and
     * the Symbolic flag shall not both be set or both be clear.
     */
    nonsymbolic = 32,
    /**
     * Glyphs have dominant vertical strokes that are slanted.
     */
    italic = 64,
    /**
     * AllCap Font contains no lowercase letters; typically used for display purposes,
     * such as for titles or headlines.
     */
    allCap = 65536,
    /**
     * Font contains both uppercase and lowercase letters.The uppercase
     * letters are similar to those in the regular version of the same typeface
     * family.The glyphs for the lowercase letters have the same shapes as the
     * corresponding uppercase letters, but they are sized and their proportions
     * adjusted so that they have the same size and stroke weight as lowercase
     * glyphs in the same typeface family.
     */
    smallCap = 131072,
    /**
     * See description after Note 1 in this subclause
     */
    forceBold = 262144
}
declare class FontDescriptorDictionary extends PDFDictionary {
    static readonly TYPE = "Font";
    /**
     * (Required) The type of PDF object that this dictionary describes; shall be
     * FontDescriptor for a font descriptor.
     */
    type: typeof FontDescriptorDictionary.TYPE;
    /**
     * (Required) The PostScript name of the font. This name shall be the same as the
     * value of BaseFont in the font or CIDFont dictionary that refers to this font
     * descriptor.
     */
    fontName: string;
    /**
     * A byte string specifying the preferred font family name.
     * @remarks PDF 1.5
     */
    fontFamily: string | null;
    /**
     * (Optional; PDF 1.5) The font stretch value. It shall be one of these names
     * (ordered from narrowest to widest): UltraCondensed, ExtraCondensed,
     * Condensed, SemiCondensed, Normal, SemiExpanded, Expanded, ExtraExpanded
     * or UltraExpanded.
     * The specific interpretation of these values varies from font to font.
     * @remarks PDF 1.5
     */
    fontStretch: string | null;
    /**
     * The weight (thickness) component of the fully-qualified
     * font name or font specifier. The possible values shall be 100, 200, 300, 400,
     * 500, 600, 700, 800, or 900, where each number indicates a weight that is at
     * least as dark as its predecessor. A value of 400 shall indicate a normal weight;
     * 700 shall indicate bold.
     * The specific interpretation of these values varies from font to font.
     * @remarks PDF 1.5
     */
    fontWeight: number | null;
    /**
     * A collection of flags defining various characteristics of the font
     */
    flags: FontDescriptorFlags;
    /**
     * (Required except for Type 3 fonts) A rectangle,
     * expressed in the glyph coordinate system, that shall specify the font bounding
     * box. This should be the smallest rectangle enclosing the shape that would
     * result if all of the glyphs of the font were placed with their origins coincident
     * and then filled.
     */
    fontBBox: PDFRectangle | null;
    /**
     * (Required) The angle, expressed in degrees counterclockwise from the
     * vertical, of the dominant vertical strokes of the font
     */
    italicAngle: number;
    /**
     * The maximum height above the baseline
     * reached by glyphs in this font. The height of glyphs for accented characters
     * shall be excluded.
     */
    ascent: number | null;
    /**
     * The maximum depth below the baseline
     * reached by glyphs in this font. The value shall be a negative number.
     */
    descent: number | null;
    /**
     * The spacing between baselines of consecutive lines of text.
     * Default value: 0.
     */
    leading: number;
    /**
     * The vertical coordinate of the top of flat capital letters, measured from the baseline.
     */
    capHeight: number | null;
    /**
     * The font’s x height: the vertical coordinate of the top of flat
     * nonascending lowercase letters (like the letter x), measured from the
     * baseline, in fonts that have Latin characters. Default value: 0.
     */
    xHeight: number;
    /**
     * The thickness measured horizontally, of the
     * dominant vertical stems of glyphs in the font.
     */
    stemV: number | null;
    /**
     * The thickness measured vertically of the dominant horizontal
     * stems of glyphs in the font. Default value: 0.
     */
    stemH: number;
    /**
     * The average width of glyphs in the font. Default value: 0.
     */
    avgWidth: number;
    /**
     * The maximum width of glyphs in the font. Default value: 0.
     */
    maxWidth: number;
    /**
     * The width to use for character codes whose widths are not
     * specified in a font dictionary’s Widths array. This shall have a predictable
     * effect only if all such codes map to glyphs whose actual widths are the same as
     * the value of the MissingWidth entry. Default value: 0.
     */
    missingWidth: number;
    /**
     * A stream containing a Type 1 font program
     */
    fontFile: PDFStream | null;
    /**
     * A stream containing a TrueType font program
     * @remarks PDF 1.1
     */
    fontFile2: PDFStream | null;
    /**
     * A stream containing a font program whose format is
     * specified by the Subtype entry in the stream dictionary
     * @remarks PDF 1.2
     */
    fontFile3: PDFStream | null;
    /**
     * A string listing the character names defined in a font subset. The names in this
     * string shall be in PDF syntax — that is, each name preceded by a slash (/). The
     * names may appear in any order. The name . notdef shall be omitted; it shall
     * exist in the font subset. If this entry is absent, the only indication of a font
     * subset shall be the subset tag in the FontName entry
     * @remarks PDF 1.1
     * @deprecated PDF 2.0
     */
    charSet: string | null;
    protected onCreate(): void;
}

declare class FontDictionary extends PDFDictionary {
    static readonly TYPE = "Font";
    /**
     * (Required) The type of PDF object that this dictionary describes; shall be
     * Font for a font dictionary.
     */
    type: typeof FontDictionary.TYPE;
    /**
     * (Required) The type of font; shall be Type1 for a Type 1 font.
     */
    subtype: string;
    /**
     * (Required in PDF 1.0; optional in PDF 1.1 through 1.7, deprecated in PDF
     * 2.0) The name by which this font is referenced in the Font subdictionary
     * of the current resource dictionary.
     * @deprecated in PDF 2.0
     */
    Name: string | null;
    /**
     * (Required; optional in PDF 1.0 - 1.7 for the standard 14 fonts; shall be an
     * indirect reference) A font descriptor describing the font’s metrics other
     * than its glyph widths(see 9.8, "Font descriptors").
     * For the standard 14 fonts, the entries FirstChar, LastChar, Widths,
     * and FontDescriptor shall either all be present or all be absent.
     * Ordinarily, these dictionary keys may be absent; specifying them enables
     * a standard font to be overridden; see 9.6.2.2, "Standard Type 1 fonts
     * (standard 14 fonts)(PDF 1.0 - 1.7)".
     */
    FontDescriptor: FontDescriptorDictionary;
    protected onCreate(): void;
}

declare class MeasureDictionary extends PDFDictionary {
    static readonly TYPE = "PtData";
    static readonly SUBTYPE = "Cloud";
    /**
     * The type of PDF object that this dictionary describes; shall be Measure for a point data dictionary
     */
    type: typeof MeasureDictionary.TYPE;
    /**
     * Shall be Cloud
     * @remarks PDF 2.0
     */
    subtype: typeof MeasureDictionary.SUBTYPE;
    protected onCreate(): void;
}
declare class RectilinearMeasureDictionary extends MeasureDictionary {
    /**
     * A text string expressing the scale ratio of the drawing in the region
     * corresponding to this dictionary. Universally recognised unit abbreviations
     * should be used, either matching those of the number format arrays in this
     * dictionary or those of commonly used scale ratios.
     */
    r: PDFTextString;
    /**
     * A number format array for measurement of change along the x axis
     * and, if Y is not present, along the y axis as well. The first element in the array
     * shall contain the scale factor for converting from default user space units to the
     * largest units in the measuring coordinate system along that axis.
     * The directions of the x and y axes are in the measuring coordinate system and
     * are independent of the page rotation. These directions shall be determined by
     * the BBox entry of the containing viewport (see "Table 265: Entries in a viewport
     * dictionary").
     */
    x: PDFArray;
    /**
     * A number format array for measurement of change along the y axis. The first
     * element in the array shall contain the scale factor for converting from default
     * user space units to the largest units in the measuring coordinate system along
     * the y axis.
     * @remarks Required when the x and y scales have different units or conversion factors
     */
    y: PDFArray | null;
    /**
     * A number format array for measurement of distance in any direction.
     * The first element in the array shall specify the conversion to the largest distance
     * unit from units represented by the first element in X. The scale factors from X, Y
     * (if present) and CYX (if Y is present) shall be used to convert from default user
     * space to the appropriate units before applying the distance function.
     */
    d: PDFArray;
    /**
     * A number format array for measurement of area. The first element in
     * the array shall specify the conversion to the largest area unit from units
     * represented by the first element in X, squared. The scale factors from X, Y (if
     * present) and CYX (if Y is present) shall be used to convert from default user
     * space to the appropriate units before applying the area function.
     */
    a: PDFArray;
    /**
     * A number format array for measurement of angles. The first element
     * in the array shall specify the conversion to the largest angle unit from degrees.
     * The scale factor from CYX (if present) shall be used to convert from default user
     * space to the appropriate units before applying the angle function.
     */
    t: PDFArray | null;
    /**
     * A number format array for measurement of the slope of a line. The
     * first element in the array shall specify the conversion to the largest slope unit
     * from units represented by the first element in Y divided by the first element in X.
     * The scale factors from X, Y (if present) and CYX (if Y is present) shall be used to
     * convert from default user space to the appropriate units before applying the
     * slope function.
     */
    s: PDFArray | null;
    /**
     * An array of two numbers that shall specify the origin of the
     * measurement coordinate system in default user space coordinates. The
     * directions by which x and y increase in value from this origin shall be
     * determined by the viewport’s BBox entry (see "Table 265: Entries in a viewport
     * dictionary").
     *
     * Default value: the first coordinate pair (lower-left corner) of the rectangle
     * specified by the viewport’s BBox entry.
     */
    o: PDFArray | null;
    /**
     * A factor that shall be used to
     * convert the largest units along the y axis to the largest units along the x axis. It
     * shall be used for calculations (distance, area, and angle) where the units are be
     * equivalent; if not specified, these calculations may not be performed (which
     * would be the case in situations such as x representing time and y representing
     * temperature). Other calculations (change in x, change in y, and slope) shall not
     * require this value.
     * @remarks Meaningful only when Y is present
     */
    cyx: number | null;
    protected onCreate(): void;
}
declare class GeospatialMeasureDictionary extends MeasureDictionary {
    /**
     * An array of numbers that shall be taken pairwise to define a series
     * of points that describes the bounds of an area for which geospatial transformations
     * are valid.
     *
     * For maps, this bounding polygon is known as a neatline. These numbers are
     * expressed relative to a unit square that describes the BBox associated with a
     * Viewport or Form XObject, or the bounds of an Image XObject. If not present, the
     * default values shall define a rectangle describing the full unit square, with values of
     * [0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0].
     * @note The polygon description need not be explicitly closed by repeating the
     * first point values as a final point.
     * @remarks PDF 2.0
     */
    bounds: PDFArray | null;
    /**
     * A projected or geographic coordinate system dictionary
     * @remarks PDF 2.0
     */
    gcs: PDFDictionary;
    /**
     * A projected or geographic coordinate system that shall be used for
     * the display of position values, such as latitude and longitude. Formatting the
     * displayed representation of these values is controlled by the interactive PDF
     * processor.
     * @remarks PDF 2.0
     */
    dcs: PDFDictionary | null;
    /**
     * Preferred Display Units. An array of three names that identify in
     * order a linear display unit, an area display unit, and an angular display unit.
     *
     * The following are valid linear display units:
     * - M a metre
     * - KM a kilometre
     * - FT an international foot
     * - USFT a U.S. Survey foot
     * - MI an international mile
     * - NM an international nautical mile
     *
     * The following are valid area display units:
     * - SQM a square metre
     * - HA a hectare (10,000 square metres)
     * - SQKM a square kilometre
     * - SQFT a square foot (US Survey)
     * - A an acre
     * - SQMI a square mile (international)
     *
     * The following are valid angular display units:
     * - DEG a degree
     * - GRD a grad (1/400 of a circle, or 0.9 degrees)
     * @remarks PDF 2.0
     */
    pdu: PDFArray | null;
    /**
     * An array of numbers that shall be taken pairwise, defining points
     * in geographic space as degrees of latitude and longitude, respectively when defining a
     * geographic coordinate system. These values shall be based on the geographic
     * coordinate system described in the GCS dictionary. When defining a projected
     * coordinate system, this array contains values in a planar projected coordinate space
     * as eastings and northings. For Geospatial3D, when Geospatial feature information is
     * present (requirement type Geospatial3D) in a 3D annotation, the GPTS array is
     * required to hold 3D point coordinates as triples rather than pairwise where the third
     * value of each tripe is an elevation value.
     * @remarks PDF 2.0
     * @note Any projected coordinate system includes an underlying geographic
     * coordinate system.
     */
    gpts: PDFArray;
    /**
     * An array of numbers that shall be taken pairwise to define points
     * in a 2D unit square. The unit square is mapped to the rectangular bounds of the
     * Viewport, image XObject, or forms XObject that contains the measure dictionary. This
     * array shall contain the same number of number pairs as the GPTS array; each
     * number pair is the unit square object position corresponding to the geospatial
     * position in the GPTS array. For Geospatial3D, when Geospatial feature information
     * is present in a 3D annotation (requirement type Geospatial3D), the LPTS array is
     * required to hold 3D point coordinates as triples corresponding to the GPTS array in
     * the 3D annotation view world coordinate space.
     * @remarks PDF 2.0
     */
    lpts: PDFArray | null;
    /**
     * A 12-element transformation matrix of real numbers, defining the
     * transformation from Xobject position coordinates to projected coordinate system.
     * If GCS specifies GCS (geographical) then PCSM should be ignored and always
     * used GPTS. If PCSM is present, it has priority over GPTS, and GPTS values may be
     * ignored. This priority provides backward compatibility.
     *
     * PCSM acronym = "Projected Coordinate System Matrix"
     * @remarks PDF 2.0
     */
    pcsm: PDFArray | null;
    protected onCreate(): void;
}
declare class MeasureFactory {
    static items: Map<string, typeof MeasureDictionary>;
    static register(subtype: string, value: typeof MeasureDictionary): void;
    static get(subtype: string): typeof MeasureDictionary;
}

declare class OPIv1_3Dictionary extends PDFDictionary {
    static readonly TYPE = "OPI";
    static readonly VERSION = 1.3;
    /**
     * The type of PDF object that this dictionary describes; if
     * present, shall be OPI for an OPI dictionary
     */
    type: typeof OPIv1_3Dictionary.TYPE;
    /**
     * The version of OPI to which this dictionary refers; shall be the
     * number 1.3 (not the name 1.3, as in an OPI version dictionary).
     */
    version: typeof OPIv1_3Dictionary.VERSION;
    /**
     * The external file containing the image corresponding to this proxy.
     *
     * OPI comment - %ALDImageFilename
     */
    f: PDFObject;
    /**
     * An identifying string denoting the image.
     *
     * OPI comment - %ALDImageID
     */
    id: PDFHexString | null;
    /**
     * A human-readable comment, typically containing instructions
     * or suggestions to the operator of the OPI server on how to handle the
     * image.
     *
     * OPI comment - %ALDObjectComments
     */
    comments: PDFTextString | null;
    /**
     * An array of two integers of the form
     *
     * OPI comment - %ALDImageDimensions
     */
    sizeField: PDFArray | null;
    /**
     * An array of four integers of the form
     *
     * [left top right bottom]
     *
     * specifying the portion of the image that shall be used.
     *
     * OPI comment - %ALDImageCropRect
     */
    cropRect: PDFRectangle;
    /**
     * An array with the same form and meaning as CropRect, but
     * expressed in real numbers instead of integers. Default value: the value
     * of CropRect.
     *
     * OPI comment - %ALDImageCropFixed
     */
    cropFixed: PDFArray | null;
    /**
     * An array of eight numbers of the form
     *
     * [llx lly ulx uly urx ury lrx lry ]
     *
     * specifying the location on the page of the cropped image, where (llx , lly )
     * are the user space coordinates of the lower-left corner, (ulx , uly ) are
     * those of the upper-left corner, (urx , ury ) are those of the upper-right
     * corner, and (lrx , lry ) are those of the lower-right corner. The specified
     * coordinates shall define a parallelogram; that is, they shall satisfy the
     * conditions
     *
     * ul𝑥 − llx = urx − lrx
     *
     * and
     *
     * uly − lly = ury − lry
     *
     * The combination of Position and CropRect determines the image’s
     * scaling, rotation, reflection, and skew.
     *
     * OPI comment - %ALDImagePosition
     */
    position: PDFArray | null;
    /**
     * An array of two numbers of the form
     *
     * [horizRes vertRes]
     *
     * specifying the resolution of the image in samples per inch.
     *
     * OPI comment - %ALDImageResolution
     */
    resolution: PDFArray | null;
    /**
     * The type of colour specified by the Color entry. Valid values
     * are Process, Spot, and Separation. Default value: Spot.
     *
     * OPI comment - %ALDImageColorType
     */
    colorType: string | null;
    /**
     * An array of four numbers and a byte string of the form
     *
     * [C M Y K colorName]
     *
     * specifying the value and name of the colour in which the image is to be
     * rendered. The values of C, M, Y, and K shall all be in the range 0.0 to 1.0.
     *
     * Default value: [0.0 0.0 0.0 1.0 ( Black )].
     *
     * OPI comment - %ALDImageColor
     */
    color: PDFArray | null;
    /**
     * A number in the range 0.0 to 1.0 specifying the concentration
     * of the colour specified by Color in which the image is to be rendered.
     *
     * Default value: 1.0.
     *
     * OPI comment - %ALDImageTint
     */
    tint: number;
    /**
     * A flag specifying whether the image is to overprint (true) or
     * knock out (false) underlying marks on other separations.
     *
     * Default value: false.
     *
     * OPI comment - %ALDImageOverprint
     */
    overprint: boolean;
    /**
     * An array of two integers of the form
     *
     * [samples bits]
     *
     * specifying the number of samples per pixel and bits per sample in the image.
     *
     * OPI comment - %ALDImageTint
     */
    imageType: PDFArray | null;
    /**
     * An array of 2n integers in the range 0 to 65,535 (where n is the
     * number of bits per sample) recording changes made to the brightness or
     * contrast of the image.
     *
     * OPI comment - %ALDImageGrayMap
     */
    grayMap: PDFArray | null;
    /**
     * A flag specifying whether white pixels in the image shall be
     * treated as transparent. Default value: true.
     *
     * OPI comment - %ALDImageTransparency
     */
    transparency: boolean;
    /**
     * An array of pairs of the form
     *
     * [tagNum1 tagText1…tagNumn tagTextn]
     *
     * where each tagNum is an integer representing a TIFF tag number and
     * each tagText is an ASCII string representing the corresponding ASCII tag
     * value.
     *
     * OPI comment - %ALDImageAsciiTag<NNN>
     */
    tags: PDFArray | null;
    protected onCreate(): void;
}
declare class OPIv2_0Dictionary extends PDFDictionary {
    static readonly TYPE = "OPI";
    static readonly VERSION = 2;
    /**
     * The type of PDF object that this dictionary describes; if
     * present, shall be OPI for an OPI dictionary
     */
    type: typeof OPIv2_0Dictionary.TYPE;
    /**
     * The version of OPI to which this dictionary
     * refers; shall be the number 2 or 2.0 (not the name 2.0,
     * as in an OPI version dictionary).
     */
    version: typeof OPIv2_0Dictionary.VERSION;
    /**
     * The external file containing the image corresponding to this proxy.
     *
     * OPI comment - %%ImageFilename
     */
    f: PDFObject;
    /**
     * The pathname of the file containing the
     * full-resolution image corresponding to this proxy, or
     * any other identifying string that uniquely identifies
     * the full-resolution image.
     *
     * OPI comment - %%MainImage
     */
    mainImage: PDFHexString | null;
    /**
     * An array of pairs of the form
     *
     * [tagNum1 tagText1…tagNumn tagTextn]
     *
     * where each tagNum is an integer representing a TIFF
     * tag number and each tagText is an ASCII string or an
     * array of ASCII strings representing the corresponding
     * ASCII tag value
     *
     * OPI comment - %%TIFFASCIITag
     */
    tags: PDFArray | null;
    /**
     * An array of two numbers of the form
     *
     * [width height]
     *
     * specifying the dimensions of the image in pixels.
     *
     * OPI comment - %%ImageDimensions
     */
    sizeField: PDFArray | null;
    /**
     * An array of four numbers of the form
     *
     * [left top right bottom]
     *
     * specifying the portion of the image that shall be used.
     * The Size and CropRect entries shall either both be
     * present or both be absent. If present, they shall satisfy
     * the conditions
     *
     * 0 ≤ left <right ≤ width
     *
     * and
     *
     * 0 ≤ top <bottom ≤ height
     *
     * In this coordinate space, the positive y axis extends
     * vertically downward; hence, the requirement that top
     * <bottom.
     *
     * OPI comment - %%ImageCropRect
     */
    cropRect: PDFRectangle | null;
    /**
     * A flag specifying whether the image is to
     * overprint (true) or knock out (false) underlying
     * marks on other separations. Default value: false.
     */
    Overprint: boolean;
    /**
     * A name object or array specifying the
     * colourants to be applied to the image. The value may
     * be the name full_color or registration or an array of
     * the form
     *
     * [/monochrome name1 tint1…namen tintn]
     *
     * where each name is a string representing the name of
     * a colourant and each tint is a real number in the range
     * 0.0 to 1.0 specifying the concentration of that
     * colourant to be applied.
     *
     * OPI comment - %%ImageInks
     */
    Inks: PDFName | PDFArray | null;
    /**
     * An array of two integers of the form
     *
     * [pixelsWide pixelsHigh]
     *
     * specifying the dimensions of the included image in
     * pixels.
     *
     * OPI comment - %%IncludedImageDimensions
     */
    includedImageDimensions: PDFArray | null;
    /**
     * A number indicating the quality of the
     * included image. Valid values are 1, 2, and 3.
     *
     * OPI comment - %%IncludedImageQuality
     */
    includedImageQuality: number | null;
    protected onCreate(): void;
}
declare class OPIDictionary extends PDFDictionary {
    v1_3: OPIv1_3Dictionary | null;
    v2_0: OPIv2_0Dictionary | null;
}

declare class PointDataDictionary extends PDFDictionary {
    static readonly TYPE = "PtData";
    static readonly SUBTYPE = "Cloud";
    /**
     * The type of PDF object that this dictionary describes; shall be PtData for a point data dictionary
     * @remarks PDF 2.0
     */
    type: typeof PointDataDictionary.TYPE;
    /**
     * Shall be Cloud
     * @remarks PDF 2.0
     */
    subtype: typeof PointDataDictionary.SUBTYPE;
    /**
     * An array of names that identify the internal data elements of the individual point arrays in the XPTS array.
     *
     * There are three predefined names:
     * - LAT latitude in degrees. The XPTS value is a number type.
     * - LON longitude in degrees. The XPTS value is a number type.
     * - ALT altitude in metres. The XPTS value is a number type.
     * @remarks PDF 2.0
     */
    names: PDFArray;
    /**
     * An array of arrays of values. The number of members in each
     * interior array shall correspond to the size of the Names array; each member in the
     * interior arrays is of a type defined by the corresponding name in the Names array.
     *
     * The XPTS array is a collection of tuples without any guaranteed ordering or
     * relationship from point to point.
     * @remarks PDF 2.0
     */
    xpts: PDFArray;
    protected onCreate(): void;
}

declare const XOBJECT_TYPE = "XObject";
interface XObjectDictionary extends PDFStream {
    /**
     * The type of PDF object that this dictionary describes. If present, shall be XObject for a form XObject.
     */
    Type: typeof XOBJECT_TYPE;
    /**
     * The type of XObject that this dictionary describes
     */
    Subtype: string;
}

declare class FormDictionary extends PDFContentStream implements XObjectDictionary {
    static readonly SUBTYPE = "Form";
    /**
     * The type of PDF object that this dictionary describes. If present, shall be XObject for a form XObject.
     */
    Type: typeof XOBJECT_TYPE;
    /**
     * The type of XObject that this dictionary describes. Shall be
     * Form for a form XObject.
     */
    Subtype: typeof FormDictionary.SUBTYPE;
    /**
     * A code identifying the type of form XObject that this dictionary describes.
     * The only valid value is 1.
     *
     * Default value: 1.
     */
    formType: number;
    /**
     * An array of four numbers in the form coordinate system (see
     * above), giving the coordinates of the left, bottom, right, and top edges,
     * respectively, of the form XObject’s bounding box. These boundaries shall
     * be used to clip the form XObject and to determine its size for caching.
     */
    bBox: PDFRectangle;
    /**
     * An array of six numbers specifying the form matrix, which
     * maps form space into user space (see 8.3.4, "Transformation matrices").
     *
     * Default value: the identity matrix [1 0 0 1 0 0].
     */
    matrix: Maybe<Metrics>;
    /**
     * A dictionary specifying any resources (such as fonts and images) required
     * by the form XObject (see 7.8, "Content streams and resources").
     *
     * In a PDF whose version is 1.1 and earlier, all named resources used in the
     * form XObject shall be included in the resource dictionary of each page
     * object on which the form XObject appears, regardless of whether they
     * also appear in the resource dictionary of the form XObject. These
     * resources should also be specified in the form XObject’s resource
     * dictionary as well, to determine which resources are used inside the form
     * XObject. If a resource is included in both dictionaries, it shall have the
     * same name in both locations.
     *
     * In PDF 1.2 and later versions, form XObjects may be independent of the
     * content streams in which they appear, and this is strongly recommended
     * although not required. In an independent form XObject, the resource
     * dictionary of the form XObject is required and shall contain all named
     * resources used by the form XObject. These resources shall not be
     * promoted to the outer content stream’s resource dictionary, although
     * that stream’s resource dictionary refers to the form XObject.
     * @remarks
     * - Optional but strongly recommended
     * - PDF 1.2
     */
    Resources: Maybe<ResourceDictionary>;
    /**
     * A group attributes dictionary indicating that the
     * contents of the form XObject shall be treated as a group and specifying
     * the attributes of that group (see 8.10.3, "Group XObjects").
     *
     * If a Ref entry (see below) is present, the group attributes shall also apply
     * to the external page imported by that entry, which allows such an
     * imported page to be treated as a group without further modification.
     * @remarks PDF 1.4
     */
    group: PDFDictionary | null;
    /**
     * A reference dictionary identifying a page to be
     * imported from another PDF file, and for which the form XObject serves as
     * a proxy (see 8.10.4, "Reference XObjects").
     * @remarks PDF 1.4
     */
    ref: PDFDictionary | null;
    /**
     * A metadata stream containing metadata for the form
     * XObject (see 14.3.2, "Metadata streams").
     * @remarks PDF 1.4
     */
    metadata: PDFStream | null;
    /**
     * A page-piece dictionary associated with the form XObject (see 14.5, "Page-piece dictionaries").
     * @remarks PDF 1.3
     */
    pieceInfo: PDFDictionary | null;
    /**
     * The date and time (see 7.9.4, "Dates") when the form XObject’s contents were
     * most recently modified. If a page-piece dictionary (PieceInfo) is present,
     * the modification date shall be used to ascertain which of the application
     * data dictionaries it contains correspond to the current content of the
     * form (see 14.5, "Page-piece dictionaries").
     * @remarks
     * - Required if PieceInfo is present, optional otherwise
     * - PDF 1.3
     */
    lastModified: PDFDate | null;
    /**
     * The integer key of the form XObject’s entry in the structural parent tree (see
     * 14.7.5.4, "Finding structure elements from content items").
     * @remarks
     * - Required if the form XObject is a structural content item
     * - PDF 1.3
     */
    structParent: number | null;
    /**
     * (Required if the form XObject contains marked-content sequences that are
     * structural content items; PDF 1.3) The integer key of the form XObject’s
     * entry in the structural parent tree (see 14.7.5.4, "Finding structure
     * elements from content items").
     *
     * At most one of the entries StructParent or StructParents shall be
     * present. A form XObject shall be either a content item in its entirety or a
     * container for marked-content sequences that are content items, but not
     * both.
     * @remarks
     * - Required if the form XObject contains marked-content sequences that are
     * structural content items
     * - PDF 1.3
     */
    structParents: number | null;
    /**
     * An OPI version dictionary for the form XObject (see 14.11.7, "Open prepress interface (OPI)").
     * @remarks
     * - PDF 1.2
     * - Deprecated in PDF 2.0
     */
    opi: OPIDictionary;
    /**
     * An optional content group or optional content
     * membership dictionary (see 8.11, "Optional content") specifying the
     * optional content properties for the form XObject. Before the form is
     * processed, its visibility shall be determined based on this entry. If it is
     * determined to be invisible, the entire form shall be skipped, as if there
     * were no Do operator to invoke it.
     * @remarks PDF 1.5
     */
    oc: PDFDictionary;
    /**
     * The name by which this form XObject is referenced in the XObject subdictionary of
     * the current resource dictionary (see 7.8.3, "Resource dictionaries").
     * @remarks
     * - Required in PDF 1.0, optional otherwise
     * - Deprecated in PDF 2.0
     */
    name: string | null;
    /**
     * An array of one or more file specification dictionaries
     * ({@link FileSpecificationDictionary}}) which denote the associated
     * files for this Image XObject.
     * @remarks PDF 2.0
     */
    af: FileSpecificationDictionary | PDFArray | null;
    /**
     * A measure dictionary (see {@link MeasureDictionary}) that specifies the scale and units which shall apply
     * to the image.
     * @remarks PDF 2.0
     */
    measure: MeasureDictionary | null;
    /**
     * A point data dictionary (see {@link PointDataDictionary}) that specifies the extended geospatial data that
     * shall apply to the form.
     * @remarks PDF 2.0
     */
    ptData: PointDataDictionary | null;
    protected onCreate(): void;
}

declare class ImageDictionary extends PDFStream implements XObjectDictionary {
    static readonly SUBTYPE = "Image";
    static readonly WIDTH = 0;
    static readonly HEIGHT = 0;
    /**
     * The type of PDF object that this dictionary describes. If present, shall be XObject for a form XObject.
     */
    Type: typeof XOBJECT_TYPE;
    /**
     * The type of XObject that this dictionary describes. Shall be Image for an image XObject.
     */
    Subtype: typeof ImageDictionary.SUBTYPE;
    /**
     * The width of the image, in samples
     */
    Width: number;
    /**
     * The height of the image, in samples
     */
    Height: number;
    /**
     * The colour space in which image samples shall be specified; it can be any type of colour space except Pattern.
     * If the image uses the JPXDecode filter, this entry may be present:
     * - If ColorSpace is present, any colour space specifications in the
     *   JPEG2000 data shall be ignored.
     * - If ColorSpace is absent, the colour space specifications in the
     *   JPEG2000 data shall be used. The Decode array shall also be
     *   ignored unless ImageMask is true.
     * @remarks
     * - Required for images, except those that use the JPXDecode filter
     * - Not permitted for image masks
     */
    ColorSpace: PDFArray | PDFName | null;
    /**
     * The number of bits used to represent each colour component. Only
     * a single value shall be specified; the number of bits shall be the same for
     * all colour components. The value shall be 1, 2, 4, 8, or (in PDF 1.5) 16. If
     * ImageMask is true, this entry is optional, but if specified, its value shall
     * be 1.
     * If the image stream uses a filter, the value of BitsPerComponent shall be
     * consistent with the size of the data samples that the filter delivers. In
     * particular, a CCITTFaxDecode or JBIG2Decode filter shall always
     * deliver 1-bit samples, a RunLengthDecode or DCTDecode filter shall
     * always deliver 8-bit samples, and an LZWDecode or FlateDecode filter
     * shall deliver samples of a specified size if a predictor function is used.
     * If the image stream uses the JPXDecode filter, this entry is optional and
     * shall be ignored if present. The bit depth is determined by the PDF
     * processor in the process of decoding the JPEG2000 image.
     * @remarks
     * - Required except for image masks and images that use the JPXDecode
     * filter
     */
    BitsPerComponent: number | null;
    /**
     * The name of a colour rendering intent that shall be
     * used in rendering any image that is not an image mask (see 8.6.5.8,
     * "Rendering intents"). This value is ignored if ImageMask is true. Default
     * value: the current rendering intent in the graphics state.
     * @remarks PDF 1.1
     */
    Intent: string | null;
    /**
     * A flag indicating whether the image shall be treated as an
     * image mask (see 8.9.6, "Masked images"). If this flag is true, the value of
     * BitsPerComponent, if present, shall be 1 and Mask and
     * ColorSpace shall not be specified; unmasked areas shall be painted using
     * the current non-stroking colour.
     *
     * Default value: false.
     */
    ImageMask: boolean;
    /**
     * An image XObject defining an image mask to be applied to this image (see 8.9.6.3,
     * "Explicit masking"),or an array specifying a range of colours to be applied
     * to it as a colour key mask (see 8.9.6.4, "Colour key masking"). If
     * ImageMask is true, this entry shall not be present.
     * @remarks
     * - Shall not be present for image masks
     * - PDF 1.3
     */
    Mask: PDFStream | PDFArray | null;
    /**
     * An array of numbers describing how to map image samples
     * into the range of values appropriate for the image’s colour space (see
     * 8.9.5.2, "Decode arrays"). If ImageMask is true, the array shall be either
     * [0 1] or [1 0]; otherwise, its length shall be twice the number of colour
     * components required by ColorSpace. If the image uses the
     * JPXDecode filter and ImageMask is false, Decode shall be ignored by a
     * PDF processor.
     * Default value: see Table 88.
     */
    Decode: PDFArray | null;
    /**
     * A flag indicating whether image interpolation shall be
     * performed by a PDF processor (see 8.9.5.3, "Image interpolation").
     *
     * Default value: false.
     */
    Interpolate: boolean;
    /**
     * An array of alternate image dictionaries for this image
     * (see 8.9.5.4, "Alternate images"). This entry shall not be present in an
     * image XObject that is itself an alternate image.
     * @remarks PDF 1.3
     */
    Alternates: PDFArray | null;
    /**
     * A subsidiary image XObject defining a soft-mask
     * image (see 11.6.5.2, "Soft-mask images") that shall be used as a source of
     * mask shape or mask opacity values in the transparent imaging model.
     * The alpha source parameter in the graphics state determines whether the
     * mask values shall be interpreted as shape or opacity.
     *
     * If present, this entry shall override the current soft mask in the graphics
     * state, as well as the image’s Mask entry, if any. However, the other
     * transparency-related graphics state parameters — blend mode and alpha
     * constant — shall remain in effect. If SMask is absent, the image shall have
     * no associated soft mask (although the current soft mask in the graphics
     * state may still apply).
     * @remarks PDF 1.4
     */
    SMask: PDFStream | null;
    /**
     * A code specifying how soft-mask information (see 11.6.5.2,
     * "Soft-mask images") encoded with image samples shall be used:
     *
     * 0 If present, encoded soft-mask image information shall be ignored.
     *
     * 1 The image’s data stream includes encoded soft-mask values. A PDF
     *   processor shall create a soft-mask image from the information to be
     *   used as a source of mask shape or mask opacity in the transparency
     *   imaging model.
     *
     * 2 The image’s data stream includes colour channels that have been
     *   preblended with a background; the image data also includes an
     *   opacity channel. A PDF processor shall create a soft-mask image
     *   with a Matte entry from the opacity channel information to be used
     *   as a source of mask shape or mask opacity in the transparency
     *   model.
     *
     * If this entry has a non-zero value, SMask shall not be specified. See also
     * 7.4.9, "JPXDecode filter".
     *
     * Default value: 0.
     *
     * @remarks
     * - Optional for images that use the JPXDecode filter, meaningless otherwise
     * - PDF 1.5
     */
    SMaskInData: number | null;
    /**
     * The name by which this image XObject is referenced in the XObject subdictionary of
     * the current resource dictionary (see 7.8.3, "Resource dictionaries").
     * @remarks
     * - Required in PDF 1.0
     * - Optional otherwise
     * - Deprecated in PDF 2.0
     * @deprecated
     */
    Name: PDFName | null;
    /**
     * The integer key of the image’s entry in the structural parent tree (see 14.7.5.4,
     * "Finding structure elements from content items").
     * @remarks
     * - Required if the image is a structural content item
     * - PDF 1.3
     */
    StructParent: number | null;
    /**
     * The digital identifier of the image’s parent Web Capture content set (see 14.10.6, "Object
     * attributes related to web capture").
     * @remarks
     * - PDF 1.3
     * - indirect reference preferred
     */
    ID: PDFHexString | null;
    /**
     * An OPI version dictionary for
     * the image; see 14.11.7, "Open prepress interface (OPI)". If ImageMask is
     * true, this entry shall be ignored.
     * @remarks
     * - PDF 1.2
     * - Deprecated in PDF 2.0
     * @deprecated
     */
    OPI: PDFDictionary | null;
    /**
     * A metadata stream containing metadata for the image
     * (see 14.3.2, "Metadata streams").
     * @remarks PDF 1.4
     */
    Metadata: PDFStream | null;
    /**
     * An optional content group or optional content
     * membership dictionary (see 8.11, "Optional content"), specifying the
     * optional content properties for this image XObject. Before the image is
     * processed by a PDF processor, its visibility shall be determined based on
     * this entry. If it is determined to be invisible, the entire image shall be
     * skipped, as if there were no Do operator to invoke it.
     * @remarks PDF 1.5
     */
    OC: PDFDictionary | null;
    /**
     * An array of one or more file specification dictionaries
     * (7.11.3, "File specification dictionaries") which denote the associated
     * files for this Image XObject. See 14.13, "Associated files" and 14.13.7,
     * "Associated files linked to XObjects" for more details.
     * @remarks PDF 2.0
     */
    AF: PDFArray | null;
    /**
     * A measure dictionary (see "Table 265: Entries in a
     * measure dictionary") that specifies the scale and units which shall apply
     * to the image.
     * @remarks PDF 2.0
     */
    Measure: PDFDictionary | null;
    /**
     * A point data dictionary (see "Table 271: Entries in a
     * point data dictionary") that specifies the extended geospatial data that
     * shall apply to the image.
     * @remarks PDF 2.0
     */
    PtData: PDFDictionary | null;
    protected onCreate(): void;
}

declare enum PublicKeyPermissionFlags {
    none = 0,
    /**
     * When set permits change of encryption and enables all other permissions.
     */
    enableAll = 2,
    /**
     * Print the document (possibly not at the highest quality level, depending on whether bit 12 is also set).
     */
    printDocument = 4,
    /**
     * Copy or otherwise extract text and graphics from the document.
     * However, for the limited purpose of providing this content to assistive
     * technology, a PDF reader shall behave as if this bit was set to 1.
     *
     * @remarks ISO 32000-1 had this option restricted by bit 10, for
     * accessibility, but that exception has been deprecated in
     * PDF 2.0.
     */
    copy = 16,
    /**
     * Add or modify text annotations, fill in interactive form fields, and, if
     * bit 4 is also set, create or modify interactive form fields (including
     * signature fields).
     */
    modify = 32,
    /**
     * Fill in existing interactive form fields (including signature fields), even
     * if bit 6 is clear.
     */
    fillForms = 256,
    /**
     * Assemble the document (insert, rotate, or delete pages and create
     * document outline items or thumbnail images), even if bit 4 is clear.
     */
    assembleDocument = 1024,
    /**
     * Print the document to a representation from which a faithful digital
     * copy of the PDF content could be generated, based on an
     * implementation-dependent algorithm. When this bit is clear (and bit 3
     * is set), printing shall be limited to a low-level representation of the
     * appearance, possibly of degraded quality.
     */
    printRepresentation = 2048
}
declare class PublicKeyEncryptDictionary extends EncryptDictionary {
    /**
     * An array of byte-strings, where each string is a PKCS#7 object listing recipients
     * who have been granted equal access rights to the document.
     *
     * @remarks Required when SubFilter is `adbe.pkcs7.s3` or `adbe.pkcs7.s4`
     * @since PDF 1.3
     */
    Recipients: PDFArray;
    /**
     * A set of flags specifying which operations shall be permitted when the document is opened with user access.
     * If bit 2 is set to 1, all other bits are ignored and all operations are permitted.
     * If bit 2 is set to 0, permission for operations are based on the values of the remaining flags defined in Table 24.
     */
    P: PublicKeyPermissionFlags;
}

declare class PublicKeyCryptoFilterDictionary extends CryptoFilterDictionary {
    /**
     * If the crypt filter is referenced from StmF or StrF in the
     * encryption dictionary, this entry shall be an array of byte strings, where
     * each string shall be a binary-encoded CMS object that shall list recipients
     * that have been granted equal access rights to the document
     */
    Recipients: PDFArray | PDFTextString;
    /**
     * Indicates whether the document-level metadata stream shall be encrypted. PDF
     * processors shall respect this value when determining whether metadata
     * shall be encrypted
     *
     * @remarks Used only by crypt filters that are referenced from StmF in an encryption dictionary
     */
    EncryptMetadata: boolean;
}

declare enum UserAccessPermissionFlags {
    /**
     * Print the document.
     * @remarks Security handlers of revision 2
     */
    printDocument = 4,
    /**
     * Modify the contents of the document by operations other than
     * those controlled by bits {@link annots}, {@link fillForms}, and {@link assembleDocument}.
     */
    modifyContent = 8,
    /**
     * Copy or otherwise extract text and graphics from the document.
     * However, for the limited purpose of providing this content to
     * assistive technology, a PDF reader should behave as if this bit
     * was set to {@link printDocument}.
     */
    copy = 16,
    /**
     * Add or modify text annotations, fill in interactive form fields,
     * and, if bit {@link modifyContent} is also set, create or modify interactive form fields
     * (including signature fields).
     */
    annots = 32,
    /**
     * Fill in existing interactive form fields (including signature fields),
     * even if bit {@link annots} is clear.
     * @remarks Security handlers of revision 3 or greater
     */
    fillForms = 256,
    /**
     * Not used. This bit was previously used to determine whether
     * content could be extracted for the purposes of accessibility,
     * however, that restriction has been deprecated in PDF 2.0. PDF
     * readers shall ignore this bit and PDF writers shall always set this
     * bit to 1 to ensure compatibility with PDF readers following
     * earlier specifications.
     */
    notUsed = 512,
    /**
     * Assemble the document (insert, rotate, or delete pages and create document
     * outline items or thumbnail images), even if bit {@link modifyContent} is clear.
     * @remarks Security handlers of revision 3 or greater
     */
    assembleDocument = 1024,
    /**
     * Print the document to a representation from which a faithful digital copy of the PDF
     * content could be generated, based on an implementation
     * dependent algorithm. When this bit is clear (and bit {@link printDocument} is set),
     * printing shall be limited to a low-level representation of the
     * appearance, possibly of degraded quality.
     * @remarks Security handlers of revision 3 or greater
     */
    printRepresentation = 2048
}
declare class StandardEncryptDictionary extends EncryptDictionary {
    /**
     * A number specifying which revision of the standard security handler shall be used to interpret this dictionary:
     * 2 if the document is encrypted with a V value less than 2 (see Table 20) and does not have any of the access permissions
     * set to 0 (by means of the P entry, below) that are designated “Security handlers of revision 3 or greater” in Table 22
     * 3 if the document is encrypted with a V value of 2 or 3, or has any “Security handlers of revision 3 or greater” access permissions set to 0
     * 4 if the document is encrypted with a V value of 4
     */
    R: number;
    /**
     * A 32-byte string, based on both the owner and user passwords,
     * that shall be used in computing the encryption key and in determining whether a valid owner password was entered.
     * For more information, see 7.6.3.3, "Encryption Key Algorithm," and 7.6.3.4, "Password Algorithms."
     */
    O: PDFTextString;
    /**
     * A 32-byte string, based on the user password, that shall be used in determining whether to prompt
     * the user for a password and, if so, whether a valid user or owner password was entered.
     * For more information, see 7.6.3.4, "Password Algorithms."
     */
    U: PDFTextString;
    /**
     * A 32-byte string, based on the owner and user
     * password, that shall be used in computing the file encryption key
     */
    OE: PDFTextString | null;
    /**
     * A 32-byte string, based on the user password,
     * that shall be used in computing the file encryption key.
     */
    UE: PDFTextString | null;
    /**
     * A set of flags specifying which operations shall be permitted when the document is opened with user access (see Table 22).
     */
    P: UserAccessPermissionFlags;
    /**
     * A 16-byte string, encrypted with the file
     * encryption key, that contains an encrypted copy of the permissions flags.
     */
    Perms: PDFTextString | null;
    /**
     * Indicates whether the document-level metadata stream (see 14.3.2, "Metadata Streams") shall be encrypted.
     * Conforming products should respect this value.
     */
    EncryptMetadata: boolean;
}

declare class TrueTypeFontDictionary extends FontDictionary {
    static readonly SUBTYPE = "TrueType";
    /**
     * (Required) The type of font; shall be Type1 for a Type 1 font.
     */
    subtype: typeof TrueTypeFontDictionary.SUBTYPE;
    /**
     * (Required) The PostScript language name of the font.For Type 1 fonts,
     * this is always the value of the FontName entry in the font program; for
     * more information, see Section 5.2 of the PostScript Language Reference,
     * Third Edition.The PostScript language name of the font may be used to
     * find the font program in the PDF processor or its environment.It is also
     * the name that is used when printing to a PostScript language compatible
     * output device.
     */
    BaseFont: string;
    /**
     * (Required; optional in PDF 1.0 - 1.7 for the standard 14 fonts) The first
     * character code defined in the font’s Widths array.
     */
    FirstChar: number;
    /**
     * (Required; optional in PDF 1.0 - 1.7 for the standard 14 fonts) The last
     * character code defined in the font’s Widths array.
     */
    LastChar: number;
    /**
     * (Required; optional in PDF 1.0 - 1.7 for the standard 14 fonts; indirect
     * reference preferred) An array of(LastChar - FirstChar + 1) numbers,
     * each element being the glyph width for the character code that equals
     * FirstChar plus the array index. For character codes outside the range
     * FirstChar to LastChar, the value of MissingWidth from
     * the FontDescriptor entry for this font shall be used. The glyph widths
     * shall be measured in units in which 1000 units correspond to 1 unit in
     * text space.These widths shall be consistent with the actual widths given
     * in the font program.For more information on glyph widths and other
     * glyph metrics, see 9.2.4, "Glyph positioning and metrics".
     */
    Widths: PDFArray;
    /**
     * (Optional) A specification of the font’s character encoding if different
     * from its built -in encoding.The value of Encoding shall be either the name
     * of a predefined encoding(MacRomanEncoding, MacExpertEncoding,
     * or WinAnsiEncoding, as described in Annex D, "Character Sets and
     * Encodings") or an encoding dictionary that shall specify differences from
     * the font’s built -in encoding or from a specified predefined encoding(see
     * 9.6.5, "Character encoding").
     */
    Encoding: string | null;
    /**
     * (Optional; PDF 1.2) A stream containing a CMap file that maps character
     * codes to Unicode values(see 9.10.3, "ToUnicode CMaps").
     */
    ToUnicode: PDFStream | null;
    protected onCreate(): void;
}

declare class Type0FontDictionary extends FontDictionary {
    static readonly SUBTYPE = "Type0";
    /**
     * (Required) The type of font; shall be Type1 for a Type 1 font.
     */
    subtype: typeof Type0FontDictionary.SUBTYPE;
    /**
     * (Required) The name of the font. If the descendant is a Type 0 CIDFont,
     * this name should be the concatenation of the CIDFont’s BaseFont name,
     * a hyphen, and the CMap name given in the Encoding entry (or
     * the CMapName entry in the CMap). If the descendant is a Type 2
     * CIDFont, this name should be the same as the CIDFont’s BaseFont name.
     */
    BaseFont: string;
    /**
     * (Required) The name of a predefined CMap, or a stream containing a
     * CMap that maps character codes to font numbers and CIDs. If the
     * descendant is a Type 2 CIDFont whose associated TrueType font
     * program is not embedded in the PDF file, the Encoding entry shall be a
     * predefined CMap name
     */
    Encoding: string;
    /**
     * (Required) A one-element array specifying the CIDFont dictionary that is
     * the descendant of this Type 0 font.
     */
    DescendantFonts: PDFArray;
    /**
     * (Optional) A stream containing a CMap file that maps character codes to
     * Unicode values
     */
    ToUnicode: PDFStream | null;
    protected onCreate(): void;
}

declare class Type1FontDictionary extends FontDictionary {
    static readonly SUBTYPE = "Type1";
    /**
     * (Required) The type of font; shall be Type1 for a Type 1 font.
     */
    subtype: typeof Type1FontDictionary.SUBTYPE;
    /**
     * (Required) The PostScript language name of the font.For Type 1 fonts,
     * this is always the value of the FontName entry in the font program; for
     * more information, see Section 5.2 of the PostScript Language Reference,
     * Third Edition.The PostScript language name of the font may be used to
     * find the font program in the PDF processor or its environment.It is also
     * the name that is used when printing to a PostScript language compatible
     * output device.
     */
    BaseFont: string;
    /**
     * (Required; optional in PDF 1.0 - 1.7 for the standard 14 fonts) The first
     * character code defined in the font’s Widths array.
     */
    FirstChar: number | null;
    /**
     * The last character code defined in the font’s Widths array.
     * @remarks
     * - Required
     * - Optional in PDF 1.0 - 1.7 for the standard 14 fonts
     */
    LastChar: number | null;
    /**
     * (Required; optional in PDF 1.0 - 1.7 for the standard 14 fonts; indirect
     * reference preferred) An array of(LastChar + FirstChar + 1) numbers,
     * each element being the glyph width for the character code that equals
     * FirstChar plus the array index.For character codes outside the range
     * FirstChar to LastChar, the value of MissingWidth from
     * the FontDescriptor entry for this font shall be used.The glyph widths
     * shall be measured in units in which 1000 units correspond to 1 unit in
     * text space.These widths shall be consistent with the actual widths given
     * in the font program.For more information on glyph widths and other
     * glyph metrics, see 9.2.4, "Glyph positioning and metrics".
     */
    Widths: PDFArray | null;
    /**
     * (Optional) A specification of the font’s character encoding if different
     * from its built -in encoding.The value of Encoding shall be either the name
     * of a predefined encoding(MacRomanEncoding, MacExpertEncoding,
     * or WinAnsiEncoding, as described in Annex D, "Character Sets and
     * Encodings") or an encoding dictionary that shall specify differences from
     * the font’s built -in encoding or from a specified predefined encoding(see
     * 9.6.5, "Character encoding").
     */
    Encoding: PDFDictionary | PDFName | null;
    /**
     * (Optional; PDF 1.2) A stream containing a CMap file that maps character
     * codes to Unicode values(see 9.10.3, "ToUnicode CMaps").
     */
    ToUnicode: PDFStream | null;
    protected onCreate(): void;
}

declare class Type3FontDictionary extends FontDictionary {
    static readonly SUBTYPE = "Type3";
    /**
     * (Required) The type of font; shall be Type1 for a Type 1 font.
     */
    subtype: typeof Type3FontDictionary.SUBTYPE;
    /**
     * (Required) A rectangle expressed in the glyph coordinate
     * system, specifying the font bounding box.This is the smallest rectangle enclosing all
     * marks that would result if all of the glyphs of the font were placed with their origins
     * coincident and their descriptions executed.
     * If all four elements of the rectangle are zero, a PDF processor shall make no
     * assumptions about glyph sizes based on the font bounding box.If any element is nonzero, the font bounding box shall be accurate.If any glyph’s marks fall outside this
     * bounding box, behaviour is implementation dependent and may not match the
     * creator’s expectations.
     */
    FontBBox: PDFRectangle;
    /**
     * (Required) An array of six numbers specifying the font matrix, mapping glyph space to
     * text space.
     * NOTE A common practice is to define glyphs in terms of a 1000 - unit glyph
     * coordinate system, in which case the font matrix is[0.001 0 0 0.001 0 0].
     */
    FontMatrix: Metrics;
    /**
     * (Required) A dictionary in which each key shall be a glyph name and the value
     * associated with that key shall be a content stream that constructs and paints the glyph
     * for that character.The stream shall include as its first operator either d0 or d1,
     * followed by operators describing one or more graphics objects.See below for more
     * details about Type 3 glyph descriptions.
     */
    CharProcs: PDFDictionary;
    /**
     * (Required) An encoding dictionary whose Differences array shall specify the complete
     * character encoding for this font(see 9.6.5, "Character encoding").
     */
    Encoding: PDFDictionary;
    /**
     * (Required) The first character code defined in the font’s Widths array.
     */
    FirstChar: number;
    /**
     * (Required) The last character code defined in the font’s Widths array.
     */
    LastChar: number;
    /**
     * (Required; should be an indirect reference) An array of(LastChar - FirstChar + 1)
     * numbers, each element being the glyph width for the character code that equals
     * FirstChar plus the array index.For character codes outside the range
     * FirstChar to LastChar, the width shall be 0. These widths shall be interpreted in glyph
     * space as specified by FontMatrix(unlike the widths of a Type 1 font, which are in
     * thousandths of a unit of text space).
     * If FontMatrix specifies a rotation, only the horizontal component of the transformed
     * width shall be used.That is, the resulting displacement shall be horizontal in text space,
     * as is the case for all simple fonts.
     */
    Widths: PDFArray;
    /**
     * (Optional but should be used; PDF 1.2) A list of the named resources, such as fonts and
     * images, required by the glyph descriptions in this font(see 7.8.3, "Resource
     * dictionaries"). If any glyph descriptions refer to named resources but this dictionary is
     * absent, the names shall be looked up in the resource dictionary of the page on which
     * the font is used.
     */
    Resources: PDFDictionary;
    /**
     * (Optional; PDF 1.2) A stream containing a CMap file that maps character codes to
     * Unicode values(see 9.10.3, "ToUnicode CMaps").
     */
    ToUnicode: PDFStream;
    protected onCreate(): void;
}

declare class CIDSystemInfoDictionary extends PDFDictionary {
    /**
     * A string identifying the issuer of the character collection. The
     * string shall begin with the 4 or 5 characters of a registered developer
     * prefix followed by a LOW LINE (5Fh) followed by any other identifying
     * characters chosen by the issuer. See Annex E, "PDF Name Registry", for
     * how to obtain a unique developer prefix.
     */
    Registry: string;
    /**
     * A string that uniquely names the character collection within
     * the specified registry.
     */
    Ordering: string;
    /**
     * The supplement number of the character collection. An
     * original character collection has a supplement number of 0. Whenever
     * additional CIDs are assigned in a character collection, the supplement
     * number shall be increased. Supplements shall not alter the ordering of
     * existing CIDs in the character collection. This value shall not be used in
     * determining compatibility between character collections.
     */
    Supplement: number;
}

declare class CIDFontDictionary extends FontDictionary {
    static readonly SUBTYPE = "CIDFontType2";
    /**
     * (Required) The type of font; shall be Type1 for a Type 1 font.
     */
    subtype: typeof CIDFontDictionary.SUBTYPE;
    /**
     * The PostScript name of the CIDFont. For Type 0 CIDFonts, this
     * shall be the value of the CIDFontName entry in the CIDFont program.
     * For Type 2 CIDFonts, it shall be derived the same way as for a simple
     * TrueType font; see 9.6.3, "TrueType fonts". In either case, the name may
     * have a subset prefix if appropriate; see 9.9.2, "Font subsets".
     */
    BaseFont: string;
    /**
     * A dictionary containing entries that define the character
     * collection of the CIDFont. See "Table 114: Entries in a CIDSystemInfo
     * dictionary".
     */
    CIDSystemInfo: CIDSystemInfoDictionary;
    /**
     * The default width for glyphs in the CIDFont (see 9.7.4.3,
     * "Glyph metrics in CIDFonts"). Default value: 1000.
     */
    DW: PDFNumeric | null;
    /**
     * A description of the widths for the glyphs in the CIDFont
     */
    W: Maybe<PDFArray>;
    /**
     * An array of two numbers specifying the default metrics for vertical writing (see
     * 9.7.4.3, "Glyph metrics in CIDFonts"). Default value: [880 -1000]
     * @remarks applies only to CIDFonts used for vertical writing
     */
    DW2: Maybe<PDFArray>;
    /**
     * A description of the metrics for vertical writing for the glyphs in the CIDFont (see
     * 9.7.4.3, "Glyph metrics in CIDFonts"). Default value: none (the DW2 value
     * shall be used for all glyphs).
     * @remarks applies only to CIDFonts used for vertical writing
     */
    W2: Maybe<PDFArray>;
    /**
     * A specification of the mapping from CIDs to glyph indices. If the value is a
     * stream, the bytes in the stream shall contain the mapping from CIDs to
     * glyph indices: the glyph index for a particular CID value c shall be a 2­
     * byte value stored in bytes 2 × c and 2 × c + 1, where the first byte
     * shall be the high-order byte. If the value of CIDToGIDMap is a name, it
     * shall be Identity, indicating that the mapping between CIDs and glyph
     * indices is the identity mapping
     * @remarks
     * Required for Type 2 CIDFonts with embedded font programs
     */
    CIDToGIDMap: PDFStream | PDFName | null;
    protected onCreate(): void;
}

declare class FixedPrintDictionary extends PDFDictionary {
    static readonly TYPE = "FixedPrint";
    static DEFAULT_0: number;
    /**
     * The type of PDF object that this dictionary describes
     */
    Type: typeof FixedPrintDictionary.TYPE;
    /**
     * The matrix used to transform the annotation’s rectangle before
     * rendering.
     */
    Matrix: Maybe<Metrics>;
    /**
     * The amount to translate the associated content horizontally, as a
     * percentage of the width of the target media (or if unknown, the width of the
     * page’s MediaBox). 1.0 represents 100% and 0.0 represents 0%. Negative
     * values should not be used, since they may cause content to be drawn off the
     * media.
     * Default value: 0.
     */
    H: number;
    /**
     * The amount to translate the associated content vertically, as a
     * percentage of the height of the target media (or if unknown, the height of the
     * page’s MediaBox). 1.0 represents 100% and 0.0 represents 0%. Negative
     * values should not be used, since they may cause content to be drawn off the
     * media.
     * Default value: 0.
     */
    V: number;
    protected onCreate(): void;
}

declare class WatermarkDictionary extends AnnotationDictionary {
    static readonly SUBTYPE = "Watermark";
    /**
     * The type of annotation that this dictionary describes; shall be
     * `Watermark` for a watermark annotation.
     */
    subtype: typeof WatermarkDictionary.SUBTYPE;
    /**
     * A fixed print dictionary that specifies how this annotation shall be drawn relative to the
     * dimensions of the target media. If this entry is not present, the annotation
     * shall be drawn without any special consideration for the dimensions of the
     * target media.
     */
    FixedPrint: FixedPrintDictionary | null;
    protected onCreate(): void;
}

declare class CompressedObject extends PDFStream {
    #private;
    static readonly TYPE = "ObjStm";
    protected onCreate(): void;
    /**
     * The type of PDF object that this dictionary describes.
     * Shall be ObjStm for an object stream
     */
    type: string;
    /**
     * The number of indirect objects stored in the stream
     */
    n: number;
    /**
     * The byte offset in the decoded stream of the first compressed object
     */
    first: number;
    /**
     * A reference to another object stream, of which the current object stream shall be considered an extension
     */
    extends?: CompressedObject | null;
    private get decodedValue();
    private set decodedValue(value);
    decode(): Promise<ArrayBuffer>;
    decodeSync(): ArrayBuffer;
    encode(): Promise<ArrayBuffer>;
    setValue(id: number): void;
    getValue(index: number): PDFObjectTypes;
}

declare enum XrefStructure {
    Stream = 0,
    Table = 1
}

interface EncryptionHandlerCreateParams {
    document: PDFDocument;
    disableString?: boolean;
    disableStream?: boolean;
    id?: string;
    crypto?: pkijs.ICryptoEngine;
}
declare abstract class EncryptionHandler {
    /**
     * Name of the encryption handler
     */
    abstract name: string;
    crypto: pkijs.ICryptoEngine;
    dictionary: EncryptDictionary;
    constructor(dictionary: EncryptDictionary, crypto: pkijs.ICryptoEngine);
    /**
     * Authenticates user
     */
    abstract authenticate(): Promise<void>;
    /**
     * Encrypts incoming data
     * @param data Data that should be encrypted
     * @param target Target object which includes that data
     * @returns Returns encrypted message
     */
    abstract encrypt(data: BufferSource$1, target: PDFStream | PDFTextString): Promise<ArrayBuffer>;
    /**
     * Decrypts incoming data
     * @param data Data that should be decrypted
     * @param target Target object which includes that data
     * @returns Returns decrypted message
     */
    abstract decrypt(data: BufferSource$1, target: PDFStream | PDFTextString): Promise<ArrayBuffer>;
}

interface EncryptionHandlerConstructor {
    new (dictionary: EncryptDictionary, crypot: pkijs.ICryptoEngine): EncryptionHandler;
    NAME: string;
}
/**
 * Represents the global registry for encryption handlers. PDF document uses it for encryption handler getting
 */
declare class EncryptionFactory {
    static handlers: Map<string, EncryptionHandlerConstructor>;
    /**
     * Registers encryption handler in the registry
     *
     * If handler with the same name already exists, then replaces it
     * @param handler Constructor of the encryption handler
     */
    static register(handler: EncryptionHandlerConstructor): void;
    /**
     * Returns constructor of EncryptionHandler for specified type. If handler doesn't exists returns PublicKeyEncryptionHandler
     * @param type Textual name of the encryption handler
     * @returns
     */
    static get(type: string): EncryptionHandlerConstructor;
}

interface EncryptionKey {
    type: CryptoFilterMethods;
    raw: Uint8Array;
}

interface PublicKeyEncryptionHandlerCreateParams extends EncryptionHandlerCreateParams {
    permission?: PublicKeyPermissionFlags;
    algorithm: CryptoFilterMethods;
    encryptMetadata?: boolean;
    recipients: X509Certificate[];
}
interface Recipient {
    key: CryptoKey | BufferSource$1;
    certificate: X509Certificate;
    crypto: Crypto;
}
interface CertificateHandleParams {
    serialNumber: string;
    issuer: string;
    algorithm: Algorithm;
}
type CertificateHandle = (params: CertificateHandleParams) => Promise<Recipient | null>;
declare class PublicKeyEncryptionHandler extends EncryptionHandler {
    #private;
    static readonly NAME = "Adobe.PubSec";
    static create(params: PublicKeyEncryptionHandlerCreateParams): Promise<PublicKeyEncryptionHandler>;
    name: typeof PublicKeyEncryptionHandler.NAME;
    dictionary: PublicKeyEncryptDictionary;
    onCertificate?: CertificateHandle;
    authenticate(): Promise<void>;
    encrypt(stream: BufferSource$1, target: PDFStream | PDFTextString): Promise<ArrayBuffer>;
    decrypt(stream: BufferSource$1, target: PDFStream | PDFTextString): Promise<ArrayBuffer>;
    /**
     * Returns encryption file key for specified Crypto Filter Name (eg CFStd)
     * @param filterName Filter name
     * @returns Encryption key
     */
    protected getKeyF(filterName: string): Promise<EncryptionKey>;
}

type Password = string | BufferSource;

interface StandardEncryptionHandlerCreateCommonParams {
    permission?: UserAccessPermissionFlags;
    ownerPassword?: Password;
    userPassword?: Password;
    encryptMetadata?: boolean;
}
interface StandardEncryptionHandlerCreateParamsV4 extends EncryptionHandlerCreateParams, StandardEncryptionHandlerCreateCommonParams {
    algorithm: CryptoFilterMethods;
}
declare enum PasswordReason {
    first = 0,
    incorrect = 1
}
interface StandardEncryptionHandlerCreateParams extends EncryptionHandlerCreateParams, StandardEncryptionHandlerCreateCommonParams {
    algorithm: CryptoFilterMethods;
}
type UserPasswordHandle = (reason: PasswordReason) => Promise<Password>;
declare class StandardEncryptionHandler extends EncryptionHandler {
    #private;
    static readonly NAME = "Standard";
    static create(params: StandardEncryptionHandlerCreateParams): Promise<StandardEncryptionHandler>;
    name: string;
    /**
     * Handler which is used if User password is required
     */
    onUserPassword?: UserPasswordHandle;
    /**
     * PDF Standard Encrypt dictionary
     */
    dictionary: StandardEncryptDictionary;
    /**
     * Gets the revision number
     */
    get revision(): number;
    /**
     * Gets the encryption key length
     */
    get length(): number;
    /**
     * Gets ID from the Trailer dictionary
     */
    get id(): ArrayBuffer;
    checkUserPassword(password?: Password): Promise<boolean>;
    checkOwnerPassword(password?: Password): Promise<boolean>;
    /**
     * Returns encryption file key for specified Crypto Filter Name (eg CFStd)
     * @param password Password
     * @param filterName Filter name
     * @returns Encryption key
     */
    protected getKeyF(password: Password, filterName: string): Promise<EncryptionKey>;
    authenticate(): Promise<void>;
    decrypt(stream: BufferSource$1, target: PDFStream | PDFTextString): Promise<ArrayBuffer>;
    encrypt(stream: BufferSource$1, target: PDFStream | PDFTextString): Promise<ArrayBuffer>;
}

interface FindIndexOptions {
    reversed?: boolean;
    offset?: number;
}
interface DocumentOptions {
    xref?: XrefStructure;
    password?: {
        user?: string;
        owner?: string;
    };
    disableAscii85Encoding?: boolean;
    disableCompressedStreams?: boolean;
    disableCompressedObjects?: boolean;
    crypto?: clientSideParametersPublicKey;
}
declare class PDFDocument {
    #private;
    /**
     * Indicates whether the PDF file has an incorrect structure.
     *
     * Set to true when:
     *   1. An update section's startXref is smaller than the previous update section's startXref
     *   2. The xref table/stream appears after any of the objects it refers to in an update section
     *
     * These conditions violate PDF specification requirements for file structure
     */
    wrongStructure: boolean;
    static fromPDF(reader: ViewReader): Promise<PDFDocument>;
    static fromPDF(data: BufferSource$1, offset?: number): Promise<PDFDocument>;
    static fromPDF(text: string): Promise<PDFDocument>;
    static fromPDF(data: BufferSource$1 | ViewReader | string, offset?: number): Promise<PDFDocument>;
    static create(options?: DocumentOptions): PDFDocument;
    static readonly DEFAULT_VERSION = 1.5;
    static readonly DEFAULT_VIEW: Uint8Array<ArrayBuffer>;
    view: Uint8Array<ArrayBuffer>;
    version: number;
    update: PDFDocumentUpdate;
    options: DocumentOptions;
    get catalog(): CatalogDictionary;
    get encryptHandler(): EncryptionHandler | null;
    set encryptHandler(v: EncryptionHandler | null);
    writePDF(writer: ViewWriter): Promise<void>;
    /**
     * Converts the PDF document to a PDF file.
     * @returns The PDF file as a buffer.
     *
     * @note This method serializes the PDF document on each call. If you need to start a new
     * update section, then you should use the {@link createUpdate} method after calling this method.
     */
    toPDF(): Promise<ArrayBuffer>;
    fromPDF(reader: ViewReader): Promise<number>;
    fromPDF(data: BufferSource$1, offset?: number): Promise<number>;
    fromPDF(text: string): Promise<number>;
    fromPDF(data: BufferSource$1 | ViewReader | string, offset?: number): Promise<number>;
    getObject(ref: IPDFIndirect): PDFDocumentObject;
    getObject(id: number, generationNumber?: number): PDFDocumentObject;
    delete(element: number | PDFDocumentObject): void;
    append(element: PDFObject | PDFDocumentObject, compressed?: boolean): PDFDocumentObject;
    addPage(page?: PageObjectDictionary | PDFDocumentObject): Promise<PageObjectDictionary>;
    createUpdate(): Promise<PDFDocumentUpdate>;
    protected findIndex(cb: (c: number, i: number, array: Uint8Array) => boolean, options?: FindIndexOptions): number;
    toString(): Promise<string>;
    createNull(): PDFNull;
    createBoolean(value: boolean): PDFBoolean;
    createNumber(number: number, padding?: number): PDFNumeric;
    createName(text: string): PDFName;
    /**
     * Creates a PDFLiteralString object from the given text or binary data.
     *
     * @param text - The text to create the PDFLiteralString from.
     * @returns A PDFLiteralString object.
     */
    createString(text: string | BufferSource$1): PDFLiteralString;
    createHexString(data?: BufferSource$1): PDFHexString;
    createArray(...items: PDFObjectTypes[]): PDFArray;
    createDictionary(...items: [string, PDFObjectTypes][]): PDFDictionary;
    createStream(view?: BufferSource$1): PDFStream;
    createRectangle(llX: number, llY: number, urX: number, urY: number): PDFRectangle;
    /**
     * Creates a PDFDate object from the given date.
     * @param date - The date to create the PDFDate from.
     * @returns A PDFDate object.
     */
    createDate(date?: Date): PDFDate;
    decrypt(): Promise<void>;
    encrypt(): Promise<void>;
}

interface PDFObjectConstructor<T extends PDFObject> {
    /**
     * Name of the PDF Object. This name is required for ObjectReader.
     */
    NAME: string;
    fromPDF(this: new () => T, reader: ViewReader): T;
    fromPDF(this: new () => T, data: Uint8Array, offset?: number): T;
    fromPDF(this: new () => T, text: string): T;
    fromPDF(this: new () => T, data: Uint8Array | ViewReader | string, offset?: number): T;
    create(this: new () => T, update: PDFDocumentUpdate): T;
    new (): T;
}
interface IPDFIndirect {
    id: number;
    generation: number;
}
declare abstract class PDFObject {
    static readonly DEFAULT_VIEW: Uint8Array<ArrayBuffer>;
    /**
     * Creates new instance of the class and assigns it to the document
     * @param target PDF document or update
     * @returns
     */
    static create<T extends PDFObject>(this: new () => T, target: PDFDocument | PDFDocumentUpdate): T;
    protected onCreate(): void;
    static getReader(reader: ViewReader): ViewReader;
    static getReader(text: string): ViewReader;
    static getReader(data: BufferSource$1, offset?: number): ViewReader;
    static getReader(data: BufferSource$1 | ViewReader | string, offset?: number): ViewReader;
    static fromPDF<T extends PDFObject>(this: new () => T, reader: ViewReader): T;
    static fromPDF<T extends PDFObject>(this: new () => T, data: Uint8Array, offset?: number): T;
    static fromPDF<T extends PDFObject>(this: new () => T, text: string): T;
    static fromPDF<T extends PDFObject>(this: new () => T, data: Uint8Array | ViewReader | string, offset?: number): T;
    ownerElement: PDFObject | null;
    isIndirect(): boolean;
    findIndirect(deep?: boolean): IPDFIndirect | null;
    /**
     * Returns indirect object of the object.
     *
     * If deep is false and the object is not directly in Indirect object it throws an error.
     * @param deep If `true`, then looks for the Indirect object through its parent.
     * @returns
     */
    getIndirect(deep?: boolean): IPDFIndirect;
    makeIndirect(compressed?: boolean): this;
    view: Uint8Array<ArrayBuffer>;
    documentUpdate: PDFDocumentUpdate | null;
    padding: number;
    protected getDocument(): PDFDocument;
    protected getDocumentUpdate(): PDFDocumentUpdate;
    toPDF(fromEarlySaved?: boolean): Uint8Array;
    writePDF(writer: ViewWriter, fromEarlySaved?: boolean): void;
    fromPDF(reader: ViewReader): number;
    fromPDF(text: string): number;
    fromPDF(data: Uint8Array, offset?: number): number;
    fromPDF(data: Uint8Array | ViewReader | string, offset?: number): number;
    adoptChild(obj: PDFObject): void;
    /**
     * Handles the conversion of the object from PDF stream.
     * @param reader - The reader to read the object from.
     */
    protected abstract onFromPDF(reader: ViewReader): void;
    /**
     * Handles the object writing to PDF stream.
     * @param writer - The writer to write the object to.
     */
    protected abstract onWritePDF(writer: ViewWriter): void;
    /**
     * Returns copy of the object.
     * @returns The copy of the current object.
     */
    copy<T extends PDFObject>(this: T): T;
    /**
     * Copies required fields from the original object to it's copy
     * @remarks Each child class must call super's method
     * @param copy The copy of the current object
     */
    protected onCopy(copy: PDFObject): void;
    modify(): this;
    /**
     * Compares the current object with the target object
     * @param target - The target object to compare with.
     * @returns `true` if the objects are equal, otherwise `false`.
     */
    equal(target: PDFObject): boolean;
    /**
     * Handles the comparison of the current object with the target object
     * @param target - The target object to compare with.
     * @returns `true` if the objects are equal, otherwise `false`.
     */
    protected abstract onEqual(target: PDFObject): boolean;
}

declare class PDFIndirectObject extends PDFIndirect {
    value: PDFObject;
    constructor();
    constructor(id?: number, generation?: number, value?: PDFObject);
    protected onWritePDF(writer: ViewWriter): void;
    protected onFromPDF(reader: ViewReader): void;
    adoptChild(obj: PDFObject): void;
    protected onCopy(copy: PDFIndirectObject): void;
    toString(): string;
}

declare class PDFTypeConverter {
    static convert<T extends PDFObject>(target: T): T;
    static convert<T extends PDFObject>(target: PDFObject, type: abstract new () => T, replace?: boolean): T;
}

declare abstract class PDFObjectReader {
    protected static items: Record<string, PDFObjectConstructor<PDFObject>>;
    static register<T extends PDFObject>(type: PDFObjectConstructor<T>): void;
    static get(name: ObjectTypeEnum.Null): typeof PDFNull;
    static get(name: ObjectTypeEnum.Boolean): typeof PDFBoolean;
    static get(name: ObjectTypeEnum.Numeric): typeof PDFNumeric;
    static get(name: ObjectTypeEnum.Name): typeof PDFName;
    static get(name: ObjectTypeEnum.LiteralString): typeof PDFLiteralString;
    static get(name: ObjectTypeEnum.HexString): typeof PDFHexString;
    static get(name: ObjectTypeEnum.IndirectReference): typeof PDFIndirectReference;
    static get(name: ObjectTypeEnum.Array): typeof PDFArray;
    static get(name: ObjectTypeEnum.Dictionary): typeof PDFDictionary;
    static get(name: ObjectTypeEnum.Stream): typeof PDFStream;
    static get(name: ObjectTypeEnum.Comment): typeof PDFComment;
    static get<T extends PDFObject>(name: string): PDFObjectConstructor<T>;
    static read(reader: ViewReader, update?: PDFDocumentUpdate | null, parent?: PDFObject | null): PDFObjectTypes;
    /**
     * Move pointer in the reader skipping all white spaces and comments
     * @param reader View reader
     */
    static skip(reader: ViewReader): void;
}

declare class Maybe<T extends PDFObject> {
    parent: PDFDictionary;
    name: string;
    indirect: boolean;
    private _type;
    static readonly DEFAULT_VIEW: Uint8Array<ArrayBuffer>;
    constructor(parent: PDFDictionary, name: string, indirect: boolean, _type: PDFObjectConstructor<T>);
    /**
     * Gets or creates the internal value. Value creation depends on the `required` filed value.
     * @param required If this parameter is `true` and the value is null, it throws an error.
     * If this parameter is `false` and the value is empty, it creates a new value.
     * @param compressed If `true`, object will be added to compressed stream, otherwise no. Default is `true`
     * @returns returns internal value
     */
    get(required?: boolean, compressed?: boolean): T;
    has(): boolean;
    set(value: T): void;
}

interface PDFDictionaryFieldParameters<T extends PDFObjectTypes, TReturn = any> {
    name: string;
    optional?: boolean;
    type?: abstract new () => T;
    indirect?: boolean;
    get?: (object: T) => TReturn;
    set?: (object: TReturn) => T;
    cache?: boolean;
    defaultValue?: TReturn;
    maybe?: boolean;
}
declare function PDFDictionaryField<T extends PDFObjectTypes = PDFObjectTypes, TReturn = any>(parameters: PDFDictionaryFieldParameters<T, TReturn>): PropertyDecorator;

declare function PDFNumberField(name: string, optional?: boolean, defaultValue?: number): PropertyDecorator;
declare function PDFNameField(name: string, optional?: boolean, defaultValue?: string): PropertyDecorator;
declare function PDFLiteralStringField(name: string, optional?: boolean, defaultValue?: string): PropertyDecorator;
declare function PDFHexStringField(name: string, optional?: boolean, defaultValue?: string): PropertyDecorator;
declare function PDFBooleanField(name: string, optional?: boolean, defaultValue?: boolean): PropertyDecorator;
declare function PDFArrayField(name: string, optional?: boolean, defaultValue?: PDFArray): PropertyDecorator;
declare function PDFStreamField(name: string, optional?: boolean): PropertyDecorator;
declare function PDFTextField(name: string, prefer: typeof PDFLiteralString | typeof PDFHexString, optional?: boolean): PropertyDecorator;
declare function PDFTextStringField(name: string, optional?: boolean): PropertyDecorator;
declare function PDFArrayOrDictionaryField(name: string, optional?: boolean): PropertyDecorator;
declare function PDFMaybeField(name: string, type: abstract new () => PDFObjectTypes, indirect?: boolean): PropertyDecorator;

declare function PDFDateField(name: string, optional?: boolean, defaultValue?: Date): PropertyDecorator;

declare class PDFCryptoEngine extends pkijs.CryptoEngine {
    getOIDByAlgorithm(algorithm: Algorithm, safety?: boolean, target?: string): string;
    getSignatureParameters(privateKey: CryptoKey, hashAlgorithm?: string): Promise<pkijs.CryptoEngineSignatureParams>;
    getAlgorithmByOID(oid: string): Algorithm;
    fillPublicKeyParameters(publicKeyInfo: pkijs.PublicKeyInfo, signatureAlgorithm: pkijs.AlgorithmIdentifier): pkijs.CryptoEnginePublicKeyParams;
    getPublicKey(publicKeyInfo: pkijs.PublicKeyInfo, signatureAlgorithm: pkijs.AlgorithmIdentifier, parameters?: pkijs.CryptoEnginePublicKeyParams): Promise<CryptoKey>;
    getAlgorithmParameters(algName: string, usage: pkijs.CryptoEngineAlgorithmOperation): pkijs.CryptoEngineAlgorithmParams;
    digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
    generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
    generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
    generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
    generateKey(algorithm: globalThis.AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
    encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
    decrypt(...args: any[]): Promise<ArrayBuffer>;
}

declare class PDFError extends Error {
    static readonly NAME: string;
    inner?: Error;
    constructor(message: string, cause?: Error);
}

declare class ParsingError extends PDFError {
    static readonly NAME: string;
    position: number;
    constructor(message: string, position?: number, cause?: Error);
}

declare class BadCharError extends ParsingError {
    static readonly NAME: string;
    constructor(position?: number, cause?: Error);
    constructor(message: string, position?: number, cause?: Error);
}

declare class UnregisteredObjectTypeError extends PDFError {
    static readonly NAME: string;
    constructor(name: string, cause?: Error);
}

declare class PNG {
    static readonly HEADER: Uint8Array<ArrayBuffer>;
    static isPNG(view: BufferSource$1): boolean;
    static fromView(view: BufferSource$1): PNG;
    width: number;
    height: number;
    bitDepth: number;
    colorType: number;
    hasAlphaChannel: boolean;
    compressionMethod: number;
    filterMethod: number;
    interlaceMethod: number;
    sections: Map<string, Uint8Array>;
}

declare class JPEG {
    static readonly DEFAULT_VIEW: Uint8Array<ArrayBuffer>;
    static isJPEG(view: BufferSource): boolean;
    data: Uint8Array<ArrayBuffer>;
    bitsPerComponent: number;
    height: number;
    width: number;
    channels: number;
    static fromView(view: BufferSource): JPEG;
}

declare class UUID {
    /**
     * Generates UUID
     * @returns UUID string
     */
    static generate(): string;
}

export { ASCII85Filter, ASCIIHexFilter, ActionDictionary, AdditionalActionsDictionary, AnnotationDictionary, AnnotationFlags, AppearanceCharacteristicsDictionary, AppearanceDictionary, BadCharError, BorderStyle, BorderStyleDictionary, ButtonDictionary, ButtonFlags, CCITTFaxFilter, CIDFontDictionary, CIDSystemInfoDictionary, type CMYKColor, CaptionPosition, CatalogDictionary, type CertificateHandle, type CertificateHandleParams, CertificateSeedValueDictionary, CertificateSeedValueFlags, type CertificateSeedValueKeyUsages, CharSet, CharacterEncodingDictionary, ChoiceDictionary, ChoiceFlags, type ClippingAreaParams, CollectionItemsDictionary, ColorConverter, type Colors, CompressedObject, type ContentDrawTextParameters, type ContentSetFontSizeParameters, type ContextDrawEllipseParameters, type CrossReference, type CrossReferenceIndex, CrossReferenceStream, CrossReferenceTable, CryptFilter, CryptoFilterDictionary, CryptoFilterMethods, CryptoFiltersDictionary, DCTFilter, DeveloperExtensionsDictionary, type DocumentOptions, DocumentSecurityStoreDictionary, EmbeddedFileParams, EmbeddedFileStream, EncryptDictionary, EncryptionFactory, EncryptionHandler, type EncryptionHandlerConstructor, type EncryptionHandlerCreateParams, type EncryptionObject, ExtGStateDictionary, ExtensionsDictionary, FieldFlags, FileSpecificationDictionary, FileSpecificationEntries, Filter, type FilterConstructor, FilterFactory, type FindIndexOptions, FixedPrintDictionary, FlateFilter, type FlateFilterBuildHuffmanCodesResult, FontDescriptorDictionary, FontDescriptorFlags, FontDictionary, FormDictionary, GeospatialMeasureDictionary, type GrayscaleColor, type IFieldDictionary, type IPDFIndirect, IconFitDictionary, ImageDictionary, InformationDictionary, InteractiveFormDictionary, JBIG2Filter, JPEG, JPXFilter, KeyUsageState, LZWFilter, LineCapStyle, LineJoinStyle, Maybe, MeasureDictionary, MeasureFactory, Metrics, type MetricsNumberArray, NameDictionary, NameTree, type NameTreeIterator, type NameTreeType, NumberTrees, OPIDictionary, OPIv1_3Dictionary, OPIv2_0Dictionary, PDFArray, PDFArrayField, PDFArrayOrDictionaryField, PDFBoolean, PDFBooleanField, PDFComment, PDFContent, type PDFContentCreateParams, PDFContentScope, PDFContentStream, PDFCryptoEngine, PDFDate, PDFDateField, PDFDictionary, PDFDictionaryField, type PDFDictionaryFieldParameters, type PDFDictionaryKey, PDFDocument, PDFDocumentObject, type PDFDocumentObjectParameters, PDFDocumentObjectTypes, PDFDocumentUpdate, PDFError, PDFField, PDFGraphicsScope, PDFHexString, PDFHexStringField, PDFIndirect, PDFIndirectObject, PDFIndirectReference, PDFLiteralString, PDFLiteralStringField, PDFMaybeField, PDFName, PDFNameField, PDFNull, PDFNumberField, PDFNumeric, PDFObject, type PDFObjectConstructor, PDFObjectReader, type PDFObjectTypes, PDFOperator, PDFRectangle, PDFStream, PDFStreamField, PDFString, PDFTextField, PDFTextScope, PDFTextString, PDFTextStringField, PDFTypeConverter, PNG, PNGPredictor, PageDictionary, PageLayout, PageMode, PageObjectDictionary, PageTabsOrders, PageTreeNodesDictionary, ParsingError, type Password, PasswordReason, PointDataDictionary, type PrintMetricConverter, PublicKeyCryptoFilterDictionary, PublicKeyEncryptDictionary, PublicKeyEncryptionHandler, type PublicKeyEncryptionHandlerCreateParams, PublicKeyPermissionFlags, type RGBColor, type Recipient, RectilinearMeasureDictionary, ResourceDictionary, type RotateTransformation, RunLengthFilter, type ScaleTransformation, SignatureDictionary, SignatureField, SignatureFlags, SignatureLockAction, SignatureLockDictionary, SignatureMDPDictionary, SignatureReferenceDictionary, SignatureSeedValueDictionary, SignatureSeedValueFlags, SignatureType, SingleWidgetDictionary, type SkewTransformation, StandardEncryptDictionary, StandardEncryptionHandler, type StandardEncryptionHandlerCreateCommonParams, type StandardEncryptionHandlerCreateParams, type StandardEncryptionHandlerCreateParamsV4, SubTypeAnnotation, TextFieldFlags, TrailerDictionary, TransformMethod, type Transformation, type TransformationMatrix, type Transformations, type TranslateTransformation, TrueTypeFontDictionary, Type0FontDictionary, Type1FontDictionary, Type3FontDictionary, TypographyConverter, type TypographySize, UUID, UnregisteredObjectTypeError, UserAccessPermissionFlags, type UserPasswordHandle, ValidationRelatedInformationDictionary, ViewReader, type ViewReaderFindCallback, ViewWriter, type ViewWriterCallback, WatermarkDictionary, WidgetDictionary, WidgetHighlightingMode, type WidgetOptions, XOBJECT_TYPE, type XObjectDictionary, XrefStructure, algorithms, type clientSideParametersPublicKey, type globalParametersCryptFilter, staticData, staticDataFF };
