/** * DOCX module error types. * * All DOCX-related errors extend DocxError. */ import { BaseError, type BaseErrorOptions } from "../../utils/errors.js"; /** * Base class for all DOCX-related errors. */ export declare class DocxError extends BaseError { constructor(message: string, options?: BaseErrorOptions); } /** * Check if an error is a DOCX error. */ export declare function isDocxError(err: unknown): err is DocxError; /** * Error thrown when DOCX parsing fails. */ export declare class DocxParseError extends DocxError { name: string; } /** * Error thrown when DOCX generation/writing fails. */ export declare class DocxWriteError extends DocxError { name: string; } /** * Error thrown when a required DOCX part is missing. */ export declare class DocxMissingPartError extends DocxParseError { name: string; constructor(partPath: string); } /** * Error thrown when document structure is invalid. */ export declare class DocxInvalidStructureError extends DocxParseError { name: string; } /** * Error thrown when an unsupported feature is encountered during parsing. */ export declare class DocxUnsupportedFeatureError extends DocxError { name: string; constructor(feature: string); } /** * Error thrown when a DOCX file is encrypted (CFB format) and no password * was provided. Pass `{ password }` in the second argument of `readDocx()` * to decrypt automatically, or call `decryptDocx()` from "excelts/word/crypto" * directly if you need lower-level access to the decrypted ZIP bytes. */ export declare class DocxEncryptedError extends DocxError { name: string; constructor(); } /** * Error thrown when an encrypted DOCX cannot be decrypted with the provided * password (wrong password) or when the encryption metadata is malformed. */ export declare class DocxDecryptionError extends DocxError { name: string; } /** * Error thrown when an input package exceeds a declared resource limit (e.g. * total package size, single part size, number of parts). Used to defend * against ZIP bombs and runaway memory usage. */ export declare class DocxLimitExceededError extends DocxParseError { name: string; /** Limit category that was exceeded. */ readonly limit: "packageSize" | "partSize" | "partCount"; /** Configured maximum. */ readonly maximum: number; /** Actual measured value (or the value that would have been reached). */ readonly actual: number; constructor(limit: "packageSize" | "partSize" | "partCount", maximum: number, actual: number, detail?: string); } /** * Error thrown when the active `WordSecurityPolicy.rawXmlPolicy` is `"reject"` * and the writer encounters opaque/preserved rawXml that would otherwise have * been emitted verbatim. Callers can either drop the offending model field * before serialisation or relax the policy to `"strip"` / `"preserve"`. */ export declare class DocxRawXmlPolicyError extends DocxWriteError { name: string; /** Short label identifying the offending writer site. */ readonly site: string; constructor(site: string); }