import { PdfPrintState } from '../enumerator';
import { PdfGraphics } from '../graphics/pdf-graphics';
import { _PdfCrossReference } from '../pdf-cross-reference';
import { PdfDocument } from '../pdf-document';
import { PdfPage } from '../pdf-page';
import { _PdfDictionary, _PdfReference } from '../pdf-primitives';
import { PdfLayerCollection } from './layer-collection';
/**
 * Represents the base class for layer objects.
 * ```typescript
 * // Load an existing PDF document
 * let document: PdfDocument = new PdfDocument(data);
 * // Access the collection of layers in the document
 * let layers: PdfLayerCollection = document.layers;
 * // Retrieve the first layer from the layers collection
 * let layer: PdfLayer = layers.at(0);
 * // Save the document
 * document.save('output.pdf');
 * // Destroy the document
 * document.destroy();
 * ```
 */
export declare class PdfLayer {
    private _page;
    private _graphics;
    /**
     * Content stream for the layer.
     *
     * @private
     * @type {_PdfContentStream}
     */
    private _content;
    /**
     * Graphics state saved for the layer.
     *
     * @private
     * @type {PdfGraphicsState}
     */
    private _graphicsState;
    /**
     * Flag indicating whether graphics need initialization.
     *
     * @private
     * @type {boolean}
     */
    private _needInitializeGraphics;
    /**
     * Internal identifier for the layer.
     *
     * @private
     * @type {string}
     */
    private _id;
    /**
     * Internal name storage for the layer.
     *
     * @private
     * @type {string}
     */
    private _name;
    /**
     * Visibility flag for the layer (internal use).
     *
     * @private
     * @type {boolean}
     */
    _visible: boolean;
    /**
     * Internal print option dictionary for the layer.
     *
     * @private
     * @type {_PdfDictionary}
     */
    _printOption: _PdfDictionary;
    /**
     * Usage dictionary for layer settings.
     *
     * @private
     * @type {_PdfDictionary}
     */
    _usage: _PdfDictionary;
    /**
     * Print state configuration.
     *
     * @private
     * @type {PdfPrintState}
     */
    private _printState;
    /**
     * Internal flag indicating whether the end state marker was written.
     *
     * @private
     * @type {boolean}
     */
    _isEndState: boolean;
    /**
     * Internal dictionary representing the layer object.
     *
     * @private
     * @type {_PdfDictionary}
     */
    _dictionary: _PdfDictionary;
    /**
     * Reference holder used in cross reference lookups.
     *
     * @private
     * @type {_PdfReference}
     */
    _referenceHolder: _PdfReference;
    /**
     * Back reference to the parent PdfLayer instance.
     *
     * @private
     * @type {PdfLayer}
     */
    _layer: PdfLayer;
    /**
     * Document owning this layer.
     *
     * @private
     * @type {PdfDocument}
     */
    _document: PdfDocument;
    /**
     * Pages associated with this layer.
     *
     * @private
     * @type {Array<PdfPage>}
     */
    _pages: Array<PdfPage>;
    /**
     * Child layers collection (initialized lazily).
     *
     * @private
     * @type {PdfLayerCollection}
     */
    private _layers;
    /**
     * Position index for a sub-layer.
     *
     * @private
     * @type {number}
     */
    _subLayerPosition: number;
    /**
     * Internal storage for sub-layer references.
     *
     * @private
     * @type {(_PdfReference | _PdfReference[])[]}
     */
    _subLayer: (_PdfReference | _PdfReference[])[];
    /**
     * Locked state flag for the layer.
     *
     * @private
     * @type {boolean}
     */
    private _locked;
    /**
     * Internal array of lock references.
     *
     * @private
     * @type {_PdfReference[]}
     */
    private _lock;
    /**
     * Parent layers for this layer.
     *
     * @private
     * @type {Array<PdfLayer>}
     */
    _parentLayer: Array<PdfLayer>;
    /**
     * Child layers for this layer.
     *
     * @private
     * @type {Array<PdfLayer>}
     */
    _child: Array<PdfLayer>;
    /**
     * Parent reference for this layer.
     *
     * @private
     * @type {PdfLayer}
     */
    _parent: PdfLayer;
    /**
     * Map of existing graphics instances for reuse.
     *
     * @private
     * @type {Map<PdfGraphics, PdfGraphics>}
     */
    private _graphicsCollection;
    /**
     * Map of pages to their corresponding graphics instances.
     *
     * @private
     * @type {Map<PdfPage, PdfGraphics>}
     */
    private _pageGraphics;
    /**
     * Flag indicating whether the layer page has been parsed.
     *
     * @private
     * @type {boolean}
     */
    private _pageParsed;
    /**
     * Cross-reference used for PDF object resolution.
     *
     * @private
     * @type {_PdfCrossReference}
     */
    _crossReference: _PdfCrossReference;
    /**
     * Internal list of XObject names associated with this layer.
     *
     * @private
     * @type {string[]}
     */
    _xObject: string[];
    /**
     * Initializes a new instance of the `PdfLayer` class.
     *
     * @private
     */
    constructor();
    /**
     * Gets the parsed page associated with this layer.
     *
     * @private
     * @returns {PdfPage} The page where the layer appears.
     */
    readonly _layerPage: PdfPage;
    /**
     * Gets the internal layer identifier.
     *
     * @private
     * @returns {string} The layer identifier string.
     */
    /**
    * Sets the internal layer identifier.
    *
    * @private
    * @param {string} value The identifier to set.
    */
    _layerId: string;
    /**
     * Gets the name of the layer.
     *
     * @returns {string} Name of the layer.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data);
     * // Access the collection of layers in the document
     * let layers: PdfLayerCollection = document.layers;
     * // Retrieve the first layer from the layers collection
     * let layer: PdfLayer = layers.at(0);
     * // Retrieve the name of the layer
     * let name: string = layer.name;
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    /**
    * Sets the name of the layer.
    *
    * @param {string} name Name of the layer.
    *
    * ```typescript
    * // Load an existing PDF document
    * let document: PdfDocument = new PdfDocument(data);
    * // Access the collection of layers in the document
    * let layers: PdfLayerCollection = document.layers;
    * // Retrieve the first layer from the layers collection
    * let layer: PdfLayer = layers.at(0);
    * // Change the name of the layer
    * layer.name = 'Layer2';
    * // Save the document
    * document.save('output.pdf');
    * // Destroy the document
    * document.destroy();
    * ```
    */
    name: string;
    /**
     * Gets the visibility of the layer.
     *
     * @returns {boolean} Boolean indicating whether the specified layer is visible or not.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data);
     * // Access the collection of layers in the document
     * let layers: PdfLayerCollection = document.layers;
     * // Retrieve the first layer from the layers collection
     * let layer: PdfLayer = layers.at(0);
     * // Get the visibility state of the layer
     * let isVisible: boolean = layer.visible;
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    /**
    * Sets the visibility of the layer.
    *
    * @param {boolean} isVisible Boolean indicating whether the specified layer is visible or not.
    *
    * ```typescript
    * // Load an existing PDF document
    * let document: PdfDocument = new PdfDocument(data);
    * // Access the collection of layers in the document
    * let layers: PdfLayerCollection = document.layers;
    * // Retrieve the first layer from the layers collection
    * let layer: PdfLayer = layers.at(0);
    * // Set the layer visibility to true
    * layer.visible = true;
    * // Save the document
    * document.save('output.pdf');
    * // Destroy the document
    * document.destroy();
    * ```
    */
    visible: boolean;
    /**
     * Gets the boolean indicating whether the layer is locked or not.
     *
     * @returns {boolean} Boolean indicating whether the layer is locked or not.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data);
     * // Access the collection of layers in the document
     * let layers: PdfLayerCollection = document.layers;
     * // Retrieve the first layer from the layers collection
     * let layer: PdfLayer = layers.at(0);
     * // Retrieve the lock status of the layer
     * let isLocked: boolean = layer.locked;
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    /**
    * Sets the boolean indicating whether the layer is locked or not.
    *
    * @param {boolean} isLocked Boolean indicating whether the layer is locked or not.
    *
    * ```typescript
    * // Load an existing PDF document
    * let document: PdfDocument = new PdfDocument(data);
    * // Access the collection of layers in the document
    * let layers: PdfLayerCollection = document.layers;
    * // Retrieve the first layer from the layers collection
    * let layer: PdfLayer = layers.at(0);
    * // Lock the layer to prevent modifications
    * layer.locked = true;
    * // Save the document
    * document.save('output.pdf');
    * // Destroy the document
    * document.destroy();
    * ```
    */
    locked: boolean;
    /**
     * Gets the print state of the layer.
     *
     * @returns {PdfPrintState} Print state.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data);
     * // Access the collection of layers in the document
     * let layers: PdfLayerCollection = document.layers;
     * // Retrieve the first layer from the layers collection
     * let layer: PdfLayer = layers.at(0);
     * // Retrieve the printState of the layer
     * let printState: PdfPrintState = layer.printState;
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    /**
    * Sets the print state of the layer.
    *
    * @param {PdfPrintState} printState Print state.
    *
    * ```typescript
    * // Load an existing PDF document
    * let document: PdfDocument = new PdfDocument(data);
    * // Access the collection of layers in the document
    * let layers: PdfLayerCollection = document.layers;
    * // Retrieve the first layer from the layers collection
    * let layer: PdfLayer = layers.at(0);
    * // Set the print state to 'alwaysPrint' to ensure this layer is printed
    * layer.printState = PdfPrintState.alwaysPrint;
    * // Save the document
    * document.save('output.pdf');
    * // Destroy the document
    * document.destroy();
    * ```
    */
    printState: PdfPrintState;
    /**
     * Gets the collection of `PdfLayer` from the layer.
     *
     * @returns {PdfLayerCollection} Layer collection.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data);
     * // Access the collection of layers in the document
     * let layers: PdfLayerCollection = document.layers;
     * // Retrieve the first layer from the layers collection
     * let layer: PdfLayer = layers.at(0);
     * // Access the collection of layers in the layer (parent layer)
     * let childLayers: PdfLayerCollection = layer.layers;
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    readonly layers: PdfLayerCollection;
    /**
     * Initializes graphics context of the layer.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data);
     * // Access the collection of layers in the document
     * let layers: PdfLayerCollection = document.layers;
     * // Add a new layer to the document with the name 'Layer1'
     * let layer: PdfLayer = layers.add('Layer1');
     * // Create graphics for the newly added layer on the specified page
     * let graphics: PdfGraphics = layer.createGraphics(page);
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     *
     * @param {PdfPage} page The PDF page.
     * @returns {PdfGraphics} Graphics of the layer content.
     */
    createGraphics(page: PdfPage): PdfGraphics;
    /**
     * Parses and sets up graphics for the layer on the current page.
     *
     * @private
     * @returns {void} nothing.
     */
    private _parseGraphics;
    /**
     * Initializes resource properties for the layer's graphics.
     *
     * @private
     * @returns {void} nothing.
     */
    private _initializeProperties;
    /**
     * Loads and normalizes the contents array for the page.
     *
     * @private
     * @returns {void} nothing.
     */
    private _loadContents;
    /**
     * Initializes the `PdfGraphics` instance for the provided content stream.
     *
     * @private
     * @param {_PdfContentStream} stream The content stream to initialize graphics for.
     * @returns {void} nothing.
     */
    private _initializeGraphics;
    /**
     * Begins a layer drawing sequence, writing necessary BDC markers.
     *
     * @private
     * @param {PdfGraphics} currentGraphics The current graphics context.
     * @returns {void} nothing.
     */
    _beginLayer(currentGraphics: PdfGraphics): void;
    /**
     * Updates document OCProperties to reflect the visibility state.
     *
     * @private
     * @param {boolean} value Visibility flag to apply.
     * @returns {void} nothing.
     */
    private _setVisibility;
    /**
     * Updates document OCProperties to reflect the lock state for this layer.
     *
     * @private
     * @param {boolean} isSetLock Whether to set or clear the lock.
     * @returns {void} nothing.
     */
    private _setLock;
    /**
     * Parses document pages to locate the page and ID for this layer.
     *
     * @private
     * @returns {void} nothing.
     */
    private _parseLayerPage;
    /**
     * Parses a dictionary or reference array to locate matching layer definitions.
     *
     * @private
     * @param {_PdfDictionary} dictionary The dictionary to examine.
     * @param {_PdfReference} reference The reference associated with the dictionary.
     * @param {PdfPage} pageBase The page being examined.
     * @param {string} layerID The layer identifier name to match.
     * @returns {boolean} True if the layer was found on the page.
     */
    private _parseDictionary;
    /**
     * Associates a found reference with this layer and records the page.
     *
     * @private
     * @param {_PdfReference} reference The reference pointing to the layer object.
     * @param {PdfPage} pageBase The page that contains the layer.
     * @param {string} layerID The identifier name for the layer.
     * @returns {boolean} True when this layer's reference matches.
     */
    private _setLayerPage;
    /**
     * Creates and updates print related dictionaries for this layer.
     *
     * @private
     * @returns {void} nothing.
     */
    private _setPrintState;
}
