/**
 * Workbook - Cross-platform Excel Workbook
 *
 * Full functionality:
 * - xlsx: File/stream/buffer support (file operations Node.js only)
 * - csv: CSV read/write support (file operations Node.js only)
 * - streaming: createStreamWriter/createStreamReader for large files
 *
 * Note: Browser build uses rolldown aliases to swap in browser-specific
 * implementations for xlsx, csv, and stream modules.
 */
import { Worksheet, type WorksheetModel } from "./worksheet.js";
import { DefinedNames, type DefinedNameModel } from "./defined-names.js";
import { XLSX } from "./xlsx/xlsx.js";
import { CSV } from "../csv/csv.js";
import { WorkbookWriter, type WorkbookWriterOptions } from "./stream/workbook-writer.js";
import { WorkbookReader, type WorkbookReaderOptions } from "./stream/workbook-reader.js";
import type { Readable } from "../stream/index.js";
import type { PivotTable } from "./pivot-table.js";
import type { AddWorksheetOptions, CalculationProperties, Image, WorkbookProperties, WorkbookView, Buffer as ExcelBuffer } from "./types.js";
/** Internal media type - more flexible than public Media type */
export interface WorkbookMedia {
    type: string;
    extension: string;
    filename?: string;
    buffer?: ExcelBuffer | Uint8Array;
    base64?: string;
    name?: string;
}
/** Internal model type for serialization */
export interface WorkbookModel {
    creator?: string;
    lastModifiedBy?: string;
    lastPrinted?: Date;
    created: Date;
    modified: Date;
    properties: Partial<WorkbookProperties>;
    worksheets: WorksheetModel[];
    sheets?: WorksheetModel[];
    definedNames: DefinedNameModel[];
    views: WorkbookView[];
    company: string;
    manager: string;
    title: string;
    subject: string;
    keywords: string;
    category: string;
    description: string;
    language?: string;
    revision?: number;
    contentStatus?: string;
    themes?: unknown;
    media: WorkbookMedia[];
    pivotTables: PivotTable[];
    /** Loaded pivot tables from file - used during reconciliation */
    loadedPivotTables?: any[];
    calcProperties: Partial<CalculationProperties>;
    /** Passthrough files (charts, etc.) preserved for round-trip */
    passthrough?: Record<string, Uint8Array>;
    /** Raw drawing XML data for passthrough (when drawing contains chart references) */
    rawDrawings?: Record<string, Uint8Array>;
    /** Default font preserved from the original file for round-trip fidelity */
    defaultFont?: any;
}
declare class Workbook {
    /**
     * Streaming workbook writer class for large files.
     * @example
     * // Node.js: new Workbook.Writer({ filename: "large.xlsx" })
     * // Browser: new Workbook.Writer({ stream: writableStream })
     */
    static Writer: typeof WorkbookWriter;
    /**
     * Streaming workbook reader class for large files.
     * @example
     * // Node.js: new Workbook.Reader("large.xlsx")
     * // Browser: new Workbook.Reader(readableStream)
     */
    static Reader: typeof WorkbookReader;
    category: string;
    company: string;
    created: Date;
    description: string;
    keywords: string;
    manager: string;
    modified: Date;
    subject: string;
    title: string;
    creator?: string;
    lastModifiedBy?: string;
    lastPrinted?: Date;
    language?: string;
    revision?: number;
    contentStatus?: string;
    properties: Partial<WorkbookProperties>;
    calcProperties: Partial<CalculationProperties>;
    views: WorkbookView[];
    media: WorkbookMedia[];
    pivotTables: PivotTable[];
    private _worksheets;
    private _definedNames;
    private _themes?;
    /** Passthrough files (charts, etc.) preserved for round-trip */
    private _passthrough;
    /** Raw drawing XML data for passthrough (when drawing contains chart references) */
    private _rawDrawings;
    /** Default font preserved from original file for round-trip fidelity */
    private _defaultFont?;
    private _xlsx?;
    private _csv?;
    constructor();
    /**
     * xlsx file format operations
     * Node.js: readFile, writeFile, read (stream), write (stream), load (buffer), writeBuffer
     * Browser: load (buffer), writeBuffer
     */
    get xlsx(): XLSX;
    /**
     * csv file format operations
     * Node.js: readFile, writeFile, read (stream), write (stream)
     * Browser: load (string/buffer), writeString, writeBuffer
     */
    get csv(): CSV;
    /**
     * Create a streaming workbook writer for large files.
     * This is more memory-efficient than using Workbook for large datasets.
     *
     * @param options - Options for the workbook writer
     *   - Node.js: can use { filename } or { stream }
     *   - Browser: must use { stream }
     * @returns A new WorkbookWriter instance
     *
     * @example
     * ```ts
     * // Node.js with filename
     * const writer = Workbook.createStreamWriter({ filename: "large-file.xlsx" });
     *
     * // Browser or Node.js with stream
     * const writer = Workbook.createStreamWriter({ stream: writableStream });
     *
     * const sheet = writer.addWorksheet("Sheet1");
     * for (let i = 0; i < 1000000; i++) {
     *   sheet.addRow([i, `Row ${i}`]).commit();
     * }
     * await writer.commit();
     * ```
     */
    static createStreamWriter(options?: WorkbookWriterOptions): WorkbookWriter;
    /**
     * Create a streaming workbook reader for large files.
     * This is more memory-efficient than using Workbook.xlsx.readFile for large datasets.
     *
     * @param input - File path (Node.js only) or readable stream
     * @param options - Options for the workbook reader
     * @returns A new WorkbookReader instance
     *
     * @example
     * ```ts
     * // Node.js with file path
     * const reader = Workbook.createStreamReader("large-file.xlsx");
     *
     * // Browser or Node.js with stream
     * const reader = Workbook.createStreamReader(readableStream);
     *
     * for await (const event of reader) {
     *   if (event.eventType === "worksheet") {
     *     const worksheet = event.value;
     *     for await (const row of worksheet) {
     *       console.log(row.values);
     *     }
     *   }
     * }
     * ```
     */
    static createStreamReader(input: string | Readable, options?: WorkbookReaderOptions): WorkbookReader;
    get nextId(): number;
    /**
     * Add a new worksheet and return a reference to it
     */
    addWorksheet(name?: string, options?: AddWorksheetOptions): Worksheet;
    removeWorksheetEx(worksheet: Worksheet): void;
    removeWorksheet(id: number | string): void;
    /**
     * Fetch sheet by name or id
     */
    getWorksheet(id?: number | string): Worksheet | undefined;
    /**
     * Return a clone of worksheets in order
     */
    get worksheets(): Worksheet[];
    /**
     * Iterate over all sheets.
     *
     * Note: `workbook.worksheets.forEach` will still work but this is better.
     */
    eachSheet(callback: (sheet: Worksheet, id: number) => void): void;
    get definedNames(): DefinedNames;
    clearThemes(): void;
    /**
     * Add Image to Workbook and return the id
     */
    addImage(image: Image): number;
    getImage(id: number | string): WorkbookMedia | undefined;
    get model(): WorkbookModel;
    set model(value: WorkbookModel);
}
export { Workbook };
