import { _PdfContentStream, _PdfCrossReference, _PdfRecord, PdfDocument, PdfPage, Rectangle } from '@syncfusion/ej2-pdf';
import { TextGlyph } from '../text-structure';
import { _PdfContentParserHelper } from '../content-parser-helper';
import { canvasRenderCallback } from '../utils';
import { _TextGlyphMapper } from './text-glyph-mapper';
import { _PdfRedactionProcessor } from './pdf-redaction-processor';
import { PdfRedactionRegion } from './pdf-redaction-region';
/**
 * Represents a content redactor from an existing PDF document.
 *
 * ```typescript
 * let document: PdfDocument = new PdfDocument(data, password);
 * // Create a new text extractor
 * let redactor: PdfRedactor = new PdfRedactor(document);
 * // Add redactions to the collection
 * let redactions: PdfRedactionRegion[] = [];
 * redactions.push(new PdfRedactionRegion(0, {x: 10, y: 10, width: 100, height: 50}));
 * redactions.push(new PdfRedactionRegion(2, {x: 10, y: 10, width: 100, height: 50}, true, {r: 255, g: 0, b: 0}));
 * redactor.add(redactions);
 * // Apply redactions on the PDF document
 * redactor.redactSync();
 * // Save the document
 * document.save('output.pdf');
 * // Destroy the document
 * document.destroy();
 * ```
 */
export declare class PdfRedactor {
    _document: PdfDocument;
    _isHex: boolean;
    _redactionRegion: PdfRedactionRegion[];
    _redaction: Map<number, PdfRedactionRegion[]>;
    _parser: _PdfContentParserHelper;
    _crossReference: _PdfCrossReference;
    _object: _PdfRedactionProcessor;
    /**
     * Initializes a new instance of the `PdfRedactor` class.
     *
     * @param {PdfDocument} document The PDF document to which the redactions will be applied.
     * @throws {Error} If the document is null, undefined, or not a loaded document instance.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data, password);
     * // Initialize a new instance of the `PdfRedactor` class
     * let redactor: PdfRedactor = new PdfRedactor(document);
     * // Initialize a new instance of the `PdfRedactionRegion` class.
     * let redaction: PdfRedactionRegion = new PdfRedactionRegion(0, {x: 40, y: 41.809, width: 80, height: 90});
     * // Sets the fill color used to fill the redacted area.
     * redaction.fillColor = {r: 255, g: 0, b: 0};
     * redactions.push(redaction);
     * // Add redactions with specified options.
     * redactor.add(redactions);
     * // Apply redactions on the PDF document
     * redactor.redactSync();
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    constructor(document: PdfDocument);
    /**
     * Initializes a new instance of the `PdfRedactor` class with the specified redactions.
     *
     * @param {PdfDocument} document The PDF document to which the redactions will be applied.
     * @param {PdfRedactionRegion[]} redactions An array of redaction objects.
     * @throws {Error} If the document is null, undefined, or not a loaded document instance.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data, password);
     * // Add redactions to the collection
     * let redactions: PdfRedactionRegion[] = [];
     * // Initialize a new instance of the `PdfRedactionRegion` class.
     * let redaction: PdfRedactionRegion = new PdfRedactionRegion(0, {x: 40, y: 41.809, width: 80, height: 90});
     * // Sets the fill color used to fill the redacted area.
     * redaction.fillColor = {r: 255, g: 0, b: 0};
     * redactions.push(redaction);
     * // Initialize a new instance of the `PdfRedactor` class with redactions
     * let redactor: PdfRedactor = new PdfRedactor(document, redactions);
     * // Apply redactions on the PDF document
     * redactor.redactSync();
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    constructor(document: PdfDocument, redactions: PdfRedactionRegion[]);
    /**
     * Add redactions with specified options.
     *
     * @param {PdfRedactionRegion[]} redactions An array of redaction objects to specify the page index, bounds and appearance of the redaction to be applied.
     * @returns {void} Nothing.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data, password);
     * // Add redactions to the collection
     * let redactions: PdfRedactionRegion[] = [];
     * // Initialize a new instance of the `PdfRedactor` class
     * let redactor: PdfRedactor = new PdfRedactor(document);
     * // Initialize a new instance of the `PdfRedactionRegion` class.
     * let redaction: PdfRedactionRegion = new PdfRedactionRegion(0, {x: 40, y: 41.809, width: 80, height: 90});
     * // Sets the fill color used to fill the redacted area.
     * redaction.fillColor = {r: 255, g: 0, b: 0};
     * redactions.push(redaction);
     * // Add redactions with specified options.
     * redactor.add(redactions);
     * // Apply redactions on the PDF document
     * redactor.redactSync();
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    add(redactions: PdfRedactionRegion[]): void;
    /**
     * Redacts all marked regions in the PDF document synchronously.
     *
     * This method removes text and vector content within the specified redaction regions. It does **not** support image redaction.To redact images inside the PDF, use the asynchronous `redact()` method instead.
     *
     * @returns {void} Nothing.
     *
     * ```typescript
     * // Load an existing PDF document
     * let document: PdfDocument = new PdfDocument(data, password);
     * // Add redactions to the collection
     * let redactions: PdfRedactionRegion[] = [];
     * // Initialize a new instance of the `PdfRedactor` class
     * let redactor: PdfRedactor = new PdfRedactor(document);
     * // Initialize a new instance of the `PdfRedactionRegion` class.
     * let redaction: PdfRedactionRegion = new PdfRedactionRegion(0, {x: 40, y: 41.809, width: 80, height: 90});
     * // Sets the fill color used to fill the redacted area.
     * redaction.fillColor = {r: 255, g: 0, b: 0};
     * redactions.push(redaction);
     * // Add redactions with specified options.
     * redactor.add(redactions);
     * // Apply redactions on the PDF document
     * redactor.redactSync();
     * // Save the document
     * document.save('output.pdf');
     * // Destroy the document
     * document.destroy();
     * ```
     */
    redactSync(): void;
    /**
     * Redacts all marked regions in the PDF document.
     *
     * @param {Function} callBack - A function that supplies a canvas element along with the current application platform.The canvas is used internally to render and redact image content.
     * @returns {void} A promise that resolves once all redactions have been applied.
     *
     * ```typescript
     * // Load an existing PDF document
     * let doc: PdfDocument = new PdfDocument(data, password);
     * // Add redactions to the collection
     * let redactions: PdfRedactionRegion[] = [];
     * // Initialize a new instance of the `PdfRedactor` class
     * let redactor: PdfRedactor = new PdfRedactor(doc);
     * // Initialize a new instance of the `PdfRedactionRegion` class.
     * let redaction: PdfRedactionRegion = new PdfRedactionRegion(0, {x: 40, y: 41.809, width: 80, height: 90});
     * // Sets the fill color used to fill the redacted area.
     * redaction.fillColor = {r: 255, g: 0, b: 0};
     * redactions.push(redaction);
     * // Add redactions with specified options.
     * redactor.add(redactions);
     * // Define a canvas render callback that returns a canvas element and the application platform.
     * const canvasRenderCallback = (): {canvas: any, applicationPlatform: ApplicationPlatform} => {
     *     const canvas = document.createElement('canvas');
     *     return { canvas: canvas, applicationPlatform: ApplicationPlatform.typescript };
     * };
     * // Apply redactions on the PDF document
     * await redactor.redact(callBack: canvasRenderCallback);
     * // Save the document
     * doc.save('output.pdf');
     * // Destroy the document
     * doc.destroy();
     * ```
     */
    redact(callBack: canvasRenderCallback): Promise<void>;
    _applyRedaction(page: PdfPage): void;
    _calculateRotatedBounds(page: PdfPage, bounds: Rectangle): Rectangle;
    _combineBounds(options: PdfRedactionRegion[]): void;
    _optimizeContent(recordCollection: _PdfRecord[], index: number, updatedText: string, stream: _PdfContentStream): void;
    _getBytes(text: string): number[];
    _isFoundBounds(values: Rectangle, redactionBounds: PdfRedactionRegion[]): boolean;
    _contains(bounds: {
        x: number;
        y: number;
        width: number;
        height: number;
    }, point: number[]): boolean;
    _intersectsWith(rect1: {
        x: number;
        y: number;
        width: number;
        height: number;
    }, rect2: {
        x: number;
        y: number;
        width: number;
        height: number;
    }): boolean;
    _splitHexString(hexString: string): string[];
    _replacedText(glyph: TextGlyph[], text: string[], originalText: string, decodeText: string[]): string;
    _mapString(mainTextCollection: string[], imageGlyph: TextGlyph[]): _TextGlyphMapper[];
}
