/** @module Exports.XlsxAdv */ /** */

import * as ARJS from '@mescius/ar-js-pagereport';
import { PageDocument } from '@mescius/ar-js-pagereport';

type RenderOptions = NonNullable<Parameters<PageDocument['runRenderer']>[0]>;
/** Xlsx info */
type XlsxSettingsInfo = {
    /** Creator */
    creator?: string;
};
/** Xlsx export settings. */
type XlsxAdvSettings = {
    /** Document metadata. */
    info?: XlsxSettingsInfo;
    /** Encrypts a document with a password. */
    password?: string;
    /** @hidden */
    renderOptions?: RenderOptions;
};
/** Export result */
type XlsxExportResult = {
    /** Result content. */
    data: Blob;
    /** Triggers browser download of file with export result. */
    download: (filename?: string) => void;
};
/** The type of callback that gets called after each sheet is rendered. */
type OnProgressCallback = (pageNumber: number) => void;
/** The type of callback that gets called before sheet rendering, the render process will be canceled if the function returns _true_. */
type CheckCancelCallback = () => boolean;

/**
 * Exports a provided PageDocument to the XLSX format and returns it as Blob.
 * @param source The document to export.
 * @param settings Export settings.
 * @param onProgress The callback that gets called after each sheet is rendered.
 * @param checkCancel The callback that gets called before sheet rendering, the render process will be canceled if the function returns _true_.
 */
declare function exportDocument(source: ARJS.PageDocument | ARJS.VDomRenderer | ((options: ARJS.RenderOptions & {
    forceCellbased?: boolean;
}) => Promise<ARJS.VDomRenderer>), settings?: XlsxAdvSettings, onProgress?: OnProgressCallback, checkCancel?: CheckCancelCallback): Promise<XlsxExportResult>;

export { CheckCancelCallback, OnProgressCallback, XlsxAdvSettings, XlsxExportResult, XlsxSettingsInfo, exportDocument };
