import { rdlxParams, ResourceLocator, PageReport, AnimationSettings, Rdl, Event } from "@mescius/ar-js-pagereport";
/** UI theme */
type BuiltInUITheme = "System" | "Default" | "DefaultDark" | "DarkOled" | "HighContrast" | "HighContrastDark" | "ActiveReports" | "ActiveReportsDark";
/**
 * @module Viewer
 * Provies a facility to trigger and handle cancellation requests.
 */
/**
 * Cancellation token.
 */
declare class CancellationToken {
    private _isCancellationRequested;
    private _cancellationPromise;
    private _cancel;
    /** The parent token */
    readonly parentToken?: CancellationToken;
    private constructor();
    /**
     * Creates a cancellation token and trigger function.
     * @param parentToken The parent token.
     */
    static create(parentToken?: CancellationToken): {
        token: CancellationToken;
        cancel: (e: any) => void;
    };
    /**
     * Gets true if cancellation is being requested.
     */
    get isCancellationRequested(): boolean;
    /**
     * Gets a promise that is triggered when cancellation is requested.
     */
    get promise(): Promise<any>;
    /**
     * Registers a new cancellation handler. Handler is invoked when cancellation is requested.
     * @param callback
     */
    register(callback: (reason: any) => any): void;
}
/** @hidden */ /** */
declare class ChangedEventArgs {
    readonly state: Model;
    constructor(state: Model);
}
type ColorTheme = {
    name: string;
    type: ColorThemeType;
    backgroundMain: string;
    backgroundPanels: string;
    primary?: ColorThemeItem;
    secondary?: ColorThemeItem;
    neutral?: ColorThemeItem;
    error?: ColorThemeItem;
    warning?: ColorThemeItem;
    fontFamily?: string;
};
type ColorThemeItem = string | ColorThemeShades;
type ColorThemeShades = {
    veryLight: string;
    light: string;
    lighter: string;
    lightMedium: string;
    medium: string;
    base: string;
    darkMedium: string;
    darker: string;
    dark: string;
    veryDark: string;
};
type ColorThemeType = "light" | "dark";
/** @module ReportViewer */ /** */
interface Component<P = {}, S = {}> {
}
declare abstract class Component<P, S> {
}
type CssIcon = {
    /** Icon type */
    type: "css";
    /** CSS class name */
    cssClass: string;
};
/**
 * Defines the 'documentLoaded' event arg.
 */
type DocumentLoadEventArgs = {
    /** number of document pages. */
    readonly pageCount: number;
    /** true if document rendering was cancelled */
    readonly cancelled?: boolean;
};
/** @hidden Pointer to a document with required settings/parameters */
interface DocumentMoniker {
    readonly pluginKey: string;
}
type DocViewModel = {
    readonly status: ViewerStatus;
    readonly pageCount: number;
    readonly pageIndex: number;
    readonly scrollRequestNo: number;
    readonly scrollToSelector: string | null;
    readonly progressMessage: string;
    readonly pageBuffer: Array<PageInfo>;
    readonly highlightPage: {
        pageIndex: number;
        pageView: PageView;
    } | null;
};
interface DropdownItem {
    key: string;
    text: string;
    icon?: Icon;
    enabled?: boolean;
    selected?: boolean;
}
type ErrorHandler = (error: ErrorMessage) => boolean;
type ErrorMessage = {
    severity: ErrorSeverity;
    message: string;
    details: string;
};
/** @hidden */ /** */
/** End of long running tasks API */
/** Error reporting */
type ErrorSeverity = "error" | "warn" | "info" | "debug";
type EventHandler<T> = (value: T) => void;
/** @hidden */
/** @hidden */ /** */
interface ExportResult {
    readonly data: Blob | string;
    readonly download: (filename?: string) => void;
}
/**
 * Initial settings for export panel:
 *
 * ``` javascript
 * var exportSettings = {
 * 	filename: 'NewFile'
 * };
 * ```
 *
 */
type ExportSettings = Record<string, string | boolean | number | null>;
/** Defines options to perform search. */
type FindOptions = {
    /** The text to search for. */
    Text: string;
    /** Specifies whether the search is case sensitive. */
    MatchCase: boolean;
    /** Specifies whether to search for the specified whole word only. */
    WholeWord: boolean;
    /** Specifies whether to perform the search in the backward order. */
    SearchBackward: boolean;
};
interface FontDescriptor {
    name: string;
    source: string | string[];
    weight?: string;
    style?: string;
    postscriptName?: string;
}
type FontIcon = {
    /** Icon type */
    type: "font";
    /** CSS class name */
    iconCssClass: string;
    /** Icon font size */
    fontSize?: string;
};
type GotoTarget = "first" | "prev" | "next" | "last";
/**
 * History api
 */
interface HistoryApi {
    /** Navigates to a next item in the browsing history. */
    moveNext(): void;
    /** Navigates to previously stored state. */
    movePrev(): void;
    /** Clears all page navigation events from history. */
    clear(): void;
    /** Gets true if history contains any "forward" actions. */
    canMoveNext(): boolean;
    /** Gets true if history contains any action that could be rolled back. */
    canMovePrev(): boolean;
}
type HistoryDir = "Back" | "Fwd" | "Parent";
type Icon = FontIcon | CssIcon | SVGIcon;
/** Internal document representation */
interface IDocument {
    /** Indicates whether the view can be created immediately after document is loaded. Primarily for AutoRun. */
    canView(): boolean;
    /** Creates a new document view (runs the reports or renders the document).
     * @param baseView the view to inherit settings or parameters from. Consider "refresh" behavior in report viewer.
     * @param sink the interface to communicate progress into to a viewer.
     */
    createView(baseView: IDocumentView | null, sink: IRunEventsSink): Promise<IDocumentView | undefined>;
    /** Updates the document view without data retrieval. Usually is called when view settings are changed. */
    updateView(view: IDocumentView, sink: IRunEventsSink): Promise<IDocumentView | undefined>;
}
/** Visual representation of the document. */
interface IDocumentView {
    /** Gets the number of pages within a document. */
    readonly pageCount: PageCountResult;
    /** Gets the document page. */
    awaitPage(index: number): Promise<IPageData | null>;
    /** Override to provide fulltext search implementation */
    search?(options: FindOptions, startFrom: SearchResult): AsyncIterableIterator<SearchResult>;
}
/** Defines a parameter for reportError method */
interface IErrorParams {
    readonly severity?: ErrorSeverity;
    readonly message: string;
    readonly details?: string;
}
/** Marker interface for page data */
interface IPageData {
    /** Gets the page size */
    readonly pageSize: PageSize;
}
/** end of History API */
interface IReportError {
    /** Reports the error to user/UI. */
    reportError(params: IErrorParams): void;
}
/** Interface for communicating viewer when document rendering is in progress. */
interface IRunEventsSink extends IReportError {
    /** Changes current status and provides additional progress info. */
    progress(message: ProgressMessage): Promise<void>;
    /** Instruct viewer to reset cached page data for particular page or range of pages */
    invalidatePage(index: number, count?: number): void;
    /** Provides cancellation token for rendering routine. The latter should check cancellation status and cancel rendering as soon as possible. */
    readonly cancel: CancellationToken;
}
declare namespace JSXR {
    interface Element {
    }
}
/** @hidden */ /** */
type LoadResult = {
    status: "loaded";
    document: IDocument;
} | {
    status: "error";
    message: string;
    details?: string;
} | {
    status: "cancelled";
};
type Model = {
    settings: ViewSettings;
    session: DocViewModel;
};
type MouseEvent<T = Element> = (value: T) => void;
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
declare enum MouseMode {
    Select = 0,
    Move = 1
}
type PageCountResult = {
    totalPageCount: number | null;
    renderedSoFar: number;
};
type PageDecoration = "none" | "border" | "shadow";
/** @hidden */ /** */
type PageInfo = {
    size: PageSize | null;
    data: PageView | null;
    isLoading: boolean;
    isInvalid: boolean;
    /** Indicates that page has remained from previous document */
    isOld: boolean;
    reqIndex: number;
};
type PageSize = {
    /** Page width in html units. E.g. "13cm", "5in" */
    width: string;
    /** Page height. */
    height: string;
};
/** Rendering friendly page representation. */
type PageView = {
    kind: "html";
    html: string;
} | {
    kind: "dom";
    dom: Element;
};
/** Viewer panels location */
type PanelsLocation = "sidebar" | "toolbar";
/** Parameters view/panel location */
type ParameterPanelLocation = "auto" | "default" | "top" | "bottom" | "modal";
/** Defines a progress message for IRunEventSink.progress() method. */
type ProgressMessage = {
    phase: "starting";
    message: string;
} | {
    phase: "run";
    document?: IDocumentView;
    count: PageCountResult;
} | {
    phase: "complete";
    document?: IDocumentView;
    pageCount: number;
} | {
    phase: "cancelled";
};
/** Defines a text range. */
declare class Range {
    /** The range start */
    readonly Start: number;
    /** The range length */
    readonly Length: number;
    /**
     * Constructor of {@link Range}
     * @param start The range start
     * @param length The range length
     */
    constructor(start: number, length: number);
    /** True is range is empty */
    get isEmpty(): boolean;
    /** Gets the empty range. */
    static readonly Empty: Range;
}
/** @module Viewer/Search */ /** */
declare class Rect {
    /** @hidden */
    constructor(left: number, top: number, width: number, height: number);
    /** Gets or sets the left coordinate of this @see:Rect. */
    left: number;
    /** Gets or sets the top coordinate of this @see:Rect. */
    top: number;
    /** Gets or sets the width of this @see:Rect. */
    width: number;
    /** Gets or sets the height of this @see:Rect. */
    height: number;
}
/**
 * 'reportLoaded' event arg
 */
type ReportLoadEventArgs = {
    /** The loaded report */
    readonly report: PageReport;
};
interface ReportSettings {
    /** The name of the report (when referenced from report expressions). */
    ReportName: string;
    /** Optional parameter values to be passed to a report. */
    ReportParams: {
        Name: string;
        Value: rdlxParams.ParameterVariant[];
    }[];
    ResourceLocator: Partial<ResourceLocator>;
}
/** @hidden */
type ReportViewerCmd = {
    type: "Goto";
    payload: {
        target: GotoTarget;
    };
} | {
    type: "GotoPage";
    payload: {
        pageIndex: number;
        scrollTo?: string;
    };
} | {
    type: "SetCurrentPage";
    payload: {
        pageIndex: number;
    };
} | {
    type: "FetchPages";
    payload: {
        startPage: number;
        pageCount: number;
    };
} | {
    type: "Refresh";
} | {
    type: "Run";
    payload?: {
        dontCutHistory: boolean;
        gotoPageIndex?: number;
    };
} | {
    type: "Cancel";
}
/** Resets the pages navigation history. Clears document drill history if `hard` parameter is set to true */
 | {
    type: "ClearHistory";
    payload: {
        hard?: boolean;
    };
} | {
    type: "GoHistory";
    payload: {
        direction: HistoryDir;
    };
} | {
    type: "UpdateView";
} | {
    type: "OpenDocument";
    payload: DocumentMoniker;
};
/** Defines the argument type for the ReportViewer.search method. */
type SearchOptions = {
    /** Text to search for. */
    text: string;
    /** Case-sensitive search. */
    matchCase?: boolean;
    /** Search backward from the current position. */
    searchBackward?: boolean;
    /** Match whole word. */
    wholeWord?: boolean;
    /** The page to start the search from. */
    startPage?: number;
};
/** Defines a search result. */
declare class SearchResult {
    /** The index of the page where the occurence is found.*/
    readonly PageIndex: number;
    /** Text to display. */
    readonly DisplayText: string;
    /** The whole text item area coordinates. */
    readonly ItemArea: Rect;
    /** The logical page item number (for subsequent searches, ordered). */
    readonly ItemIndex: number;
    /** The selection text range. */
    readonly Range: Range;
    /** Plugin-specific data. */
    readonly UserData?: any;
    /** @hidden */
    constructor(
    /** The index of the page where the occurence is found.*/
    PageIndex: number, 
    /** Text to display. */
    DisplayText: string, 
    /** The whole text item area coordinates. */
    ItemArea: Rect, 
    /** The logical page item number (for subsequent searches, ordered). */
    ItemIndex: number, 
    /** The selection text range. */
    Range: Range, 
    /** Plugin-specific data. */
    UserData?: any);
    /** @hidden Result indicating page boundaries, not an actual result. */
    static readonly MakePageStart: (pageIndex: number) => SearchResult;
    /** Result indicating search is finished. Also indicates position past the end of document. */
    static readonly PastEnd: SearchResult;
    /** Special result value for Find method to begin searching from the beginning of the document/page */
    static readonly BeforeBegin: SearchResult;
}
/** @module Viewer/Search */ /** */
/** Defines search result */
declare enum SearchStatus {
    /** Search completed */
    Completed = "completed",
    /** Search cancelled */
    Cancelled = "cancelled",
    /** Search argument error */
    ArgumentError = "argerror"
}
/** Parameters view/panel open behaviour */
type ShowParametersOnOpen = "always" | "auto";
type SVGIcon = {
    /** Icon type */
    type: "svg";
    /** SVG element to render */
    content: JSXR.Element;
    /**
     * Size of the icon
     * @deprecated Use new icon guidelines
     */
    size?: "small" | "default" | "large" | "custom";
    /** Rotation of the icon */
    rotate?: "90" | "180" | "270";
    /** Custom CSS class name */
    cssClass?: string;
};
/** @module Viewer */
/** Viewer toolbar. */
interface Toolbar {
    /** Adds a new item to the toolbar.
     *
     * ```javascript
     * var pdfExportButton = {
     *     key: '$pdfExportButtonKey',
     *     iconCssClass: 'mdi mdi-file-pdf',
     *     enabled: true,
     *     action: function(item) {
     *         console.log('Export to PDF function works here');
     *     },
     *     onUpdate: function(arg, item) {
     *         console.log('Something in viewer was updated, check/update button state here');
     *     }
     * };
     * viewer.toolbar.addItem(pdfExportButton);
     * ```
     *
     * @param item  An item to be added.
     */
    addItem<Item extends ToolbarControl = ToolbarControl>(item: Item): void;
    /** Updates a previously added toolbar item.
     *
     * @param key  the toolbar item key, as it was specified in the addItem parameters.
     * @param itemUpdate  New toolbar item settings.
     */
    updateItem<Item extends ToolbarControl = ToolbarControl>(key: string, itemUpdate?: Partial<Item>): void;
    /** Removes a toolbar item.
     * @param key  The toolbar item key, as it was specified in the addItem parameters.
     */
    removeItem(key: string): void;
    /**
     * Defines the toolbar items layout (order and visibility) for different view modes.
     * A parameter is an object with default, full-screen, mobile mode properties (each property is an array of items to be shown in specific views). Setting to default will only affect all modes (full-screen, mobile) if they are not specified externally.
     *
     * ```javascript
     * viewer.toolbar.addItem(pdfExportButton); //now you want to remove everything except pdfExportButton and the navigation block.
     * viewer.toolbar.updateLayout({default: ['$pdfExportButtonKey', '$navigation']});
     * ```
     *
     * will create a toolbar with the export button and the "navigation" block.
     */
    updateLayout(layout: ToolbarLayout): void;
    /** Gets the list of default toolbar items. */
    getDefaultToolbarItems(): string[];
}
type ToolbarControl = XOR<ToolbarItemButton, ToolbarItemDropdown>;
type ToolbarItemBase<T> = {
    key: string;
    /**
     * @deprecated use icon instead
     */
    iconCssClass?: string;
    icon?: Icon;
    text?: string;
    title?: string;
    enabled?: boolean;
    action?: (curr?: ToolbarItemBase<T>) => Partial<ToolbarItemBase<T>> | void;
    onUpdate?: (args: ChangedEventArgs, curr: ToolbarItemBase<T>) => Partial<ToolbarItemBase<T>> | void;
} & T;
type ToolbarItemButton = ToolbarItemBase<{
    checked?: boolean;
}>;
type ToolbarItemDropdown = ToolbarItemBase<{
    items: DropdownItem[];
    selectedKey?: string;
}>;
/** Describes the toolbar items layout (order and visibility) for different view models. */
type ToolbarLayout = {
    /** Default (desktop) view mode. Also applied when other modes are not specified. */
    default?: string[];
    /** The layout for the full-screen mode. */
    fullscreen?: string[];
    /** The toolbar layout for mobile devices. */
    mobile?: string[];
};
type UITheme = BuiltInUITheme | ColorTheme;
type UIThemeConfig = {
    /**
     * The initial theme to be applied.
     *
     * @default "Default"
     */
    initialTheme?: string;
    /**
     * Controls Theme Picker behavior
     */
    themeSelector?: {
        /**
         * An array of available themes that can be picked by the user.
         * These themes are built-in themes.
         *
         * @default ["System", "Default", "DefaultDark", "DarkOled", "HighContrast", "HighContrastDark", "ActiveReports", "ActiveReportsDark"]
         */
        availableThemes?: UITheme[];
        /** shows Theme Picker in UI */
        isEnabled?: boolean;
    };
};
/** Report viewer component. */
declare class Viewer {
    private readonly _viewer;
    private readonly _arPlugin;
    private readonly _exportPanelApi;
    private readonly _reportLoadedEvent;
    private readonly _documentLoadedEvent;
    private readonly _themeList;
    /** Creates the viewer within container element (div) with id='viewer' and sets the language:
     *
     *  ```javascript
     *  var options = { language: 'ru' };
     *  var viewer = new ActiveReports.Viewer('#viewer', options );
     *  viewer.open('report.json');
     *  ```
     *
     * @param element  Where to render the viewer control.
     *  Accepts on of the following values:
     *  - string: DOM selector of the element to render viewer to. E.g. '#viewer'
     *  - DOM Element. E.g. document.getElementById('viewer')
     *  - JQuery object. E.g. $('#viewer')
     *
     * @param options  Control settings.
     *
     */
    constructor(element: string | Element | object, options?: ViewerOptions);
    /**
     * Resets current viewer document
     */
    resetDocument(): Promise<void>;
    /**
     * Opens report from file or as definition (json string)).
     *
     * ```javascript
     * var viewer = new ActiveReports.Viewer(#viewerPlace);
     * viewer.open('report.json');
     * ```
     *
     * @param report  The report template. Can be report URI, or report definition, or instance of PageReport class.
     * @param settings  Additional settings for report (name, parameters).
     */
    open(report: string | Rdl.Report | PageReport, settings?: Partial<ReportSettings>): Promise<LoadResult>;
    /** Gets the viewer toolbar component. */
    get toolbar(): Toolbar;
    /**
     * Toggle sidebar panel(hide or show it). In case if no parameter passed works as toggle.
     *
     * ```javascript
     * viewer.toggleSidebar(); //will hide toolbar if visible
     * viewer.toggleSidebar(true);//will show it regardless current state
     * ```
     *
     * @param visible  New visibility status. If value is not passed, the function will toggle current state.
     */
    toggleSidebar(visible?: boolean): void;
    /**
     * Toggle toolbar (hide or show it).
     *
     * ```javascript
     * viewer.toggleToolbar(); // toggles toolbar visibility
     * viewer.toggleToolbar(true); //will show it
     * ```
     *
     * @param show  Pass **true** to switch toolbar ON, and vise-versa. Do not pass any value to toggle visibility.
     */
    toggleToolbar(show?: boolean): void;
    /**
     * Change viewer mode to fullscreen.
     *
     * ```javascript
     * viewer.toggleFullScreen();
     * ```
     */
    toggleFullScreen(enabled?: boolean): void;
    /**
     * Gets or sets behaviour of parameter panel.
     * ```javascript
     * viewer.showParametersOnOpen = 'always';
     * ```
     */
    get showParametersOnOpen(): ShowParametersOnOpen;
    set showParametersOnOpen(mode: ShowParametersOnOpen);
    /**
     * Gets or sets viewer render mode. Available values are: **Galley** | **Paginated**
     *
     * ```javascript
     * viewer.renderMode = 'Galley';
     * ```
     */
    get renderMode(): ViewerRenderMode;
    set renderMode(mode: ViewerRenderMode);
    /**
     * Gets or sets viewer viewMode.
     *
     * ```javascript
     * enum ViewMode {
     *     SinglePage = 0,
     *     ContinousPage = 1
     * }
     * var viewMode = viewer.viewMode //by default SinglePage
     * //set to continous
     * viewer.viewMode = 'continuous' // or viewer.viewMode = 1;
     * ```
     */
    get viewMode(): ViewerViewMode | ViewMode;
    set viewMode(value: ViewerViewMode | ViewMode);
    /**
     * Gets or sets current zoom value. Zoom value could be specified as factor. Valid values:
     * - **from 0 up to 3** where 0.5 indicate 50% and 3 = 300%;
     * - const values **'FitToWidth' | 'FitPage'** (case insensitive)
     *
     * ```javascript
     * var currentZoom = viewer.zoom; //by default 1 (100%)
     * //now set mode to Fit to Width
     * viewer.zoom = 'FitToWidth';
     * //now verify value
     * var newValue = viewer.zoom;
     * //newValue will be equal to FitToWidth
     * ```
     */
    get zoom(): ViewerZoomMode;
    set zoom(value: ViewerZoomMode);
    /**
     * Gets or sets mouse mode in viewer. Available values are: **Pan | Selection**.
     *
     * ```javascript
     * viewer.mouseMode = "pan";
     * ```
     */
    get mouseMode(): ViewerMouseMode;
    set mouseMode(value: ViewerMouseMode);
    /**
     *  Gets or sets error handler for viewer. Allow user to override existing and not to show error pane if user wants to customize error output.
     *
     * ```javascript
     * type ErrorMessage = {
     *     severity: "error" | "warn" | "info" | "debug";
     *     message: string,
     *     details: string);
     *
     * function handler(error: ErrorMessage){
     *     console.log(error.message);
     *     return true; // return true if you don't want to show this error in viewer's error pane
     * }
     *
     *
     * viewer.errorHandler = handler;
     * ```
     */
    get errorHandler(): ErrorHandler;
    set errorHandler(handler: ErrorHandler);
    /** Gets UI theme */
    get theme(): UITheme | undefined;
    /** Sets UI theme */
    set theme(value: UITheme | undefined);
    /**
     * Gets the event indicating the viewer state is changed.
     * The changes include visual settings and content change such as rendering document.
     */
    get stateChanged(): Event<ChangedEventArgs>;
    private noDocument;
    /**
     * Navigates to the first page.
     *
     * ```javascript
     * viewer.goToFirstPage();
     * ```
     * */
    goToFirstPage(): void;
    /**
     * Navigates to the previous page.
     *
     * ```javascript
     * viewer.goToPrevPage();
     * ```
     * */
    goToPrevPage(): void;
    /**
     * Navigates to the next page.
     *
     * ```javascript
     * viewer.goToNextPage();
     * ```
     * */
    goToNextPage(): void;
    /**
     * Navigates to the last page.
     *
     * ```javascript
     * viewer.goToLastPage();
     * ```
     * */
    goToLastPage(): void;
    /**
     * Navigates to the specified page (starting from 1).
     *
     * ```javascript
     * viewer.goToPage(3); //will navigate to 3d page
     * ```
     * */
    goToPage(pageNumber: number): void;
    /**
     * Performs backToParent action which will return user to parent report.
     *
     * ```javascript
     * viewer.backToParent();
     * ```
     */
    backToParent(): void;
    /**
     * Performs refresh operation in report (re-render report).
     *
     * ```javascript
     * viewer.refresh();
     * ```
     *  */
    refresh(): void;
    /** Gets **true** if backToParent command is applicable to current document. */
    canBackToParent(): boolean;
    /**
     * Gets current page number (1-based). Returns 0 if no document loaded.
     *
     * ```javascript
     * var pageNumber = viewer.currentPage;
     * ```
     * */
    get currentPage(): number;
    /**
     * Gets the total number of pages available in report.
     *
     * ```javascript
     * var totalPages = viewer.pageCount;
     * ```
     * */
    get pageCount(): number;
    /** Provides access to the "history" API. */
    get history(): HistoryApi;
    private _availableExports;
    /**
     * Set exports which should be displayed in export panel when export plugins attached to viewer.
     *
     * ```javascript
     * viewer.availableExports = [''] //disable all loaded export modules
     * viewer.availableExports = ['pdf'] //filters out any export formats other than PDF
     * viewer.availableExports = [] //enable all loaded export modules
     * ```
     */
    get availableExports(): string[];
    set availableExports(formatKeys: string[]);
    /**
     * Exports currently displayed report to specified output format. Returns object which contains result data as blob object | string and download function. So you could either use this blob object or download file immediately. Please note that you can specify settings in PDF export as plain list (like **{title: 'Title', author: 'Author Name', ownerPassword: '1'}** etc...
     *
     * ```javascript
     * var options = {filename:"Invoice List"};
     * var cancelCallback = function(){
     *     return false; // continue export. Return true to cancel export process
     * }
     * viewer.export('pdf', options, {cancel: cancelCallback }).then(result => doSmthWithBlob(result.data));
     * //or you can download file
     * viewer.export('pdf', options, {cancel: cancelCallback }).then(result => result.download('Invoice List'));
     * ```
     *
     * @param format  Export format identifier. One of 'pdf', 'xlsx' or 'html'.
     * @param settings  Format specific export settings.
     * @param params  Additional export customization.
     */
    export(format: string, settings: Record<string, string | boolean | number>, params?: {
        cancel?: () => boolean;
    }): Promise<ExportResult>;
    /**
     * Prints currently displayed report.
     *
     * ```javascript
     * viewer.print();
     * ```
     */
    print(): void;
    /**
     * Set and register reportLoaded event which occurs once report is loaded in viewer. Doesn't account for drill through reports.
     *
     * ```javascript
     *  type ReportLoadEventArgs = {
     *     report: PageReport;
     * }
     *
     *
     * viewer.reportLoaded.register(args => console.log('Report just loaded ', args));
     * ```
     */
    get reportLoaded(): Event<ReportLoadEventArgs>;
    /**
     * Set and register documentLoaded event which occurs once document is fully rendered in viewer. Also works on refresh.
     *
     * ```javascript
     * type DocumentLoadedEventArgs = {
     *     pageCount: number;
     *     cancelled?: boolean;
     * }
     *
     * viewer.documentLoaded.register(args => console.log('Report was fully rendered ', args));
     * ```
     */
    get documentLoaded(): Event<DocumentLoadEventArgs>;
    /**
     * Performs search operation in currently rendered report. Allows you to create your own custom search pane.
     *
     * ```javascript
     * viewer.search({
     *     text: "Ship",
     *     matchCase: true
     * }, function(result){
     *     console.log(result)
     * }, function(progress){
     *     console.log(progress)
     * })
     * ```
     */
    search(options: SearchOptions, resultFn: (result: SearchResult) => void, progressFn?: (progress: {
        pageIndex: number;
        pageCount: number | null;
    }) => void, cancel?: CancellationToken): Promise<SearchStatus>;
    /**
     * Highlights the search result returned by a search method.
     *
     * ```javascript
     * results = [];
     *
     *
     * function search(text){
     *     viewer.search({text}, function(result){
     *         results.push(result)
     *     }).then(function(status){
     *         console.log(status)
     *     })
     * }
     *
     *
     * function nextSearchResult(index){
     *     if(results.length == 0){
     *         viewer.highlight(null);
     *         return;
     *     }
     *     viewer.hightlight(resutls[index]);
     * }
     * ```
     */
    highlight(result: SearchResult | null): Promise<void>;
    /** Removes the control from the DOM and disposes any resources (internal). */
    dispose(): void;
    /** @ignore Gets access to diagnostics API. For INTERNAL use only, won't available in production. */
    get diag(): {
        processCommand(cmd: ReportViewerCmd): void;
        fetchPages(startPageIndex?: number, count?: number): void;
    };
}
/** Viewer mouse mode */
type ViewerMouseMode = "Pan" | "Selection";
/**
 * Viewer control settings.
 */
interface ViewerOptions {
    /**
     * Viewer language.
     */
    language?: string;
    /**
     * Custom error handler:
     *
     * ```
     * var options = {
     * 	ErrorHandler: error => {
     * 		console.error(error.message);
     * 		return true;
     *		}
     * };
     * ```
     *
     */
    ErrorHandler?: ErrorHandler;
    /**
     * Initial settings for export panel:
     *
     * ```
     * var options = {
     * 	ExportsSettings: {
     * 		pdf: { ... },
     * 		xlsx: { ... },
     * 		html: { ... }
     * 	}
     * };
     * ```
     *
     */
    ExportsSettings?: Record<string, ExportSettings>;
    /** Layout of panels bar. */
    PanelsLayout?: PanelsLocation;
    /** Initial toolbar layout:
     *
     * ```
     * var options = {
     *  ToolbarLayout: {
     *		default: ['$navigation', '$refresh', '$zoom', '$fullscreen'],
     *		fullscreen: ['$refresh', '$print', '$fullscreen'],
     *		mobile: ['$refresh', '$navigation', '$split', '$fullscreen']}
     *  }
     * };
     * ```
     */
    ToolbarLayout?: ToolbarLayout;
    /** Parameters panel location. */
    ParameterPanelLocation?: ParameterPanelLocation;
    /** Enables report data memoization if set to "true".  */
    memoizeData?: boolean;
    /**
     * Configures various theme-related settings.
     */
    themeConfig?: UIThemeConfig;
    /**
     * Configures report animations.
     */
    animations?: AnimationSettings;
}
/** Viewer render mode */
type ViewerRenderMode = "Galley" | "Paginated";
declare enum ViewerStatus {
    Empty = 0,
    Loading = 1,
    Cancelled = 2,
    Ready = 3,
    Failed = 4
}
/** Viewer view mode */
type ViewerViewMode = "Continuous" | "SinglePage";
/** Viewer zoom mode */
type ViewerZoomMode = "FitToWidth" | "FitPage" | number;
declare enum ViewMode {
    SinglePage = 0,
    Continuous = 1
}
type ViewSettings = {
    zoom: ZoomSettings;
    zoomTarget: ZoomTarget;
    mode: ViewMode;
    mouseMode: MouseMode;
    isFullscreen: boolean;
    narrowScreen: boolean;
    isToolbarVisible: boolean;
    isSidebarVisible: boolean;
    backgroundColor: string;
    pageDecoration: PageDecoration;
    enableSidebarInFullscreen: boolean;
};
/** @hidden */ /** */
type Without<T, U> = {
    [P in Exclude<keyof T, keyof U>]?: never;
};
type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : never;
declare enum ZoomMode {
    Value = 0,
    PageWidth = 1,
    WholePage = 2
}
type ZoomSettings = {
    mode: ZoomMode.PageWidth;
} | {
    mode: ZoomMode.WholePage;
} | {
    mode: ZoomMode.Value;
    factor: number;
};
type ZoomTarget = "viewport" | "page";
export { CancellationToken, MouseMode, Range, Rect, SearchResult, SearchStatus, ViewMode, Viewer, ViewerStatus, ZoomMode };
export type { BuiltInUITheme, DocumentLoadEventArgs, ExportResult, ExportSettings, FontDescriptor, HistoryApi, LoadResult, PanelsLocation, ParameterPanelLocation, ReportLoadEventArgs, ReportSettings, SearchOptions, ShowParametersOnOpen, Toolbar, ToolbarLayout, UITheme, UIThemeConfig, ViewerMouseMode, ViewerOptions, ViewerRenderMode, ViewerViewMode, ViewerZoomMode };
