/** * Typed library errors for `@syncfusion/ej2-xlsx`. * * @private Not part of the published package surface. Library code throws these; * tests may import them from `src/xlsx/core/errors.js`. Switch on {@link XlsxError.code}, * never on message text. */ /** * Stable error code strings thrown by the library. * * @private */ export declare type XlsxErrorCode = 'INVALID_PACKAGE' | 'UNSUPPORTED_ENCRYPTION' | 'PACKAGE_LIMIT' | 'IO_ERROR' | 'INVALID_WORKBOOK' | 'DUPLICATE_SHEET_NAME' | 'LAST_SHEET' | 'INVALID_SHEET_NAME' | 'MISSING_WORKSHEET_PART' | 'INVALID_SHARED_STRING_INDEX' | 'INVALID_SHARED_STRINGS' | 'INVALID_STYLE_INDEX' | 'INVALID_STYLES' | 'INVALID_NUMBER_FORMAT' | 'INVALID_ADDRESS' | 'INVALID_CELL_VALUE' | 'INVALID_ERROR_CODE' | 'INVALID_FORMULA' | 'INVALID_WORKSHEET' | 'INVALID_MERGE_REF' | 'MERGE_OVERLAP' | 'INVALID_DEFINED_NAME' | 'INVALID_DATA_VALIDATION' | 'INVALID_CONDITIONAL_FORMATTING' | 'INVALID_HYPERLINK' | 'INVALID_THREADED_COMMENT' | 'INVALID_TABLE' | 'INVALID_CHART' | 'INVALID_SORT_STATE' | 'INVALID_AUTO_FILTER' | 'INVALID_PROTECTION' | 'INVALID_COMMENT' | 'INVALID_ARGUMENT'; /** * Base error for all library failures. * * @private */ export declare class XlsxError extends Error { /** * Stable machine-readable code. * @private */ readonly code: XlsxErrorCode; /** * Optional OPC part name or ZIP entry related to the failure. * @private */ readonly partName: string | undefined; /** * @private */ constructor(code: XlsxErrorCode, message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Package structure is missing, corrupt, or not a ZIP-based OPC container. * * @private */ export declare class InvalidPackageError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Encrypted Office package (CFB / OOXML encryption). Decrypt is out of scope. * * @private */ export declare class UnsupportedEncryptionError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * ZIP/OPC safety ceiling exceeded (entry count, uncompressed size, etc.). * * @private */ export declare class PackageLimitError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Underlying codec or byte I/O failure wrapped for consumers. * * @private */ export declare class IoError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Workbook part XML is missing, has the wrong root, or fails structural checks. * * @private */ export declare class InvalidWorkbookError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Sheet name collides with an existing sheet (Excel case-insensitive uniqueness). * * @private */ export declare class DuplicateSheetNameError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Attempted to remove the last worksheet from the workbook. * * @private */ export declare class LastSheetError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Sheet name is empty, too long, or contains Excel-illegal characters. * * @private */ export declare class InvalidSheetNameError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Workbook relationship target for a worksheet is missing from the package. * * @private */ export declare class MissingWorksheetPartError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Cell or API requested a shared-string index that is not present in the SST. * * @private */ export declare class InvalidSharedStringIndexError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Shared strings part XML is missing the expected root or is structurally invalid. * * @private */ export declare class InvalidSharedStringsError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Cell or API requested a cellXfs / style index that is not present. * * @private */ export declare class InvalidStyleIndexError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Styles part XML is missing the expected root or is structurally invalid. * * @private */ export declare class InvalidStylesError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Custom number format code is empty or otherwise invalid for `numFmt` authoring. * * @private */ export declare class InvalidNumberFormatError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * A1 address token is malformed or outside the Excel grid. * * @private */ export declare class InvalidAddressError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Cell value is not a supported {@link CellValue} shape. * * @private */ export declare class InvalidCellValueError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Error cell code is not a recognized Excel error string. * * @private */ export declare class InvalidErrorCodeError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Formula text or type is invalid for the cell formula API. * * Empty expression for a normal formula, or an unrecognized ST_CellFormulaType. * The library never evaluates formulas; this only covers API input checks. * * @private */ export declare class InvalidFormulaError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Worksheet part XML is missing the expected root or is structurally invalid. * * @private */ export declare class InvalidWorksheetError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Merge range ref is unparseable, inverted, empty, or outside the Excel grid. * * @private */ export declare class InvalidMergeRefError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * New merge range overlaps an existing merge on the worksheet. * * @private */ export declare class MergeOverlapError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Defined name is empty or otherwise invalid for authoring. * * @private */ export declare class InvalidDefinedNameError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Data validation rule or sqref is invalid (unknown enum, bad range, empty list source). * * @private */ export declare class InvalidDataValidationError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Conditional formatting rule or sqref is invalid (unknown enum, bad range, bad priority). * * @private */ export declare class InvalidConditionalFormattingError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Hyperlink ref or target is invalid (empty target, bad ref, unusable location). * * @private */ export declare class InvalidHyperlinkError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Threaded comment is invalid (duplicate cell thread, bad handle/target, empty text shape). * * @private */ export declare class InvalidThreadedCommentError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Table definition is invalid (duplicate displayName, bad range, empty columns, * unknown tableType/totalsRowFunction on authoring). * * @private */ export declare class InvalidTableError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Chart definition is invalid (unsupported type, missing series/data range, * bad anchor, or unusable chart package wiring). * * @private */ export declare class InvalidChartError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Sort state or sort condition is invalid (unparseable ref, condition ref * not contained in the state ref, unknown enum on authoring). * * @private */ export declare class InvalidSortStateError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * AutoFilter or filter column is invalid (unparseable ref, bad colId on * authoring, stale handle after replace/clear). */ export declare class InvalidAutoFilterError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Sheet, workbook, or protected-range protection is invalid (bad password, * options, or hash material; unprotect mismatch). * * @private */ export declare class InvalidProtectionError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Classic comment / note is invalid (bad cell ref, author, text, or package * comments wiring). * * @private */ export declare class InvalidCommentError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * API argument is missing or empty where a value is required. * * @private */ export declare class InvalidArgumentError extends XlsxError { constructor(message: string, options?: { readonly cause?: unknown; readonly partName?: string; }); } /** * Type guard for {@link XlsxError}. * * @private */ export declare function isXlsxError(value: unknown): value is XlsxError;