/** @hidden */ /** */
//@ts-ignore
import { MouseEventHandler } from 'react';
import { PluginModel, ReportViewerCmd } from '../../api';
import { PageViewOptions } from '../../control/ReportViewer';
export type PageInfo = {
    size: PluginModel.PageSize | null;
    data: PluginModel.PageView | null;
    isLoading: boolean;
    isInvalid: boolean;
    /** Indicates that page has remained from previous document */
    isOld: boolean;
    reqIndex: number;
};
export declare enum ViewerStatus {
    Empty = 0,
    Loading = 1,
    Cancelled = 2,
    Ready = 3,
    Failed = 4
}
export declare enum ZoomMode {
    Value = 0,
    PageWidth = 1,
    WholePage = 2
}
export declare enum ViewMode {
    SinglePage = 0,
    Continuous = 1
}
export declare enum MouseMode {
    Select = 0,
    Move = 1
}
export type UISize = 'small' | 'medium' | 'large';
export type ZoomSettings = {
    mode: ZoomMode.PageWidth;
} | {
    mode: ZoomMode.WholePage;
} | {
    mode: ZoomMode.Value;
    factor: number;
};
export type ZoomTarget = 'viewport' | 'page';
export type PageDecoration = 'none' | 'border' | 'shadow';
export type ViewSettings = {
    zoom: ZoomSettings;
    zoomTarget: ZoomTarget;
    mode: ViewMode;
    mouseMode: MouseMode;
    isFullscreen: boolean;
    narrowScreen: boolean;
    isToolbarVisible: boolean;
    isSidebarVisible: boolean;
    backgroundColor: string;
    pageDecoration: PageDecoration;
    enableSidebarInFullscreen: boolean;
};
export 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: PluginModel.PageView;
    } | null;
};
export type SettingsMsg = {
    type: 'UpdateZoom';
    payload: {
        zoom: ZoomSettings;
    };
} | {
    type: 'UpdateZoomTarget';
    payload: {
        zoomTarget: ZoomTarget;
    };
} | {
    type: 'UpdateView';
    payload: {
        mode: ViewMode;
    };
} | {
    type: 'UpdateMouseMode';
    payload: {
        mode: MouseMode;
    };
} | {
    type: 'UpdateFullscreen';
    payload: {
        isFullscreen: boolean;
    };
} | {
    type: 'UpdateToolbarVisibility';
    payload: {
        isVisible: boolean;
    };
} | {
    type: 'UpdateSidebarVisibility';
    payload: {
        isVisible: boolean;
    };
} | {
    type: 'ToggleNarrowScreen';
    payload: {
        isNarrow?: boolean;
    };
} | {
    type: 'UpdateBackgroundColor';
    payload: {
        backgroundColor: string;
    };
} | {
    type: 'UpdatePageDecoration';
    payload: {
        pageDecoration: PageDecoration;
    };
} | {
    type: 'EnableSidebarInFullscreen';
    payload: {
        enableSidebarInFullscreen: boolean;
    };
};
export type DocViewMsg = {
    type: 'Reset';
    payload: Record<string, never>;
} | {
    type: 'SetStatus';
    payload: {
        status: ViewerStatus;
        message: string;
    };
} | {
    type: 'SetPageCount';
    payload: {
        pageCount: number;
    };
} | {
    type: 'SetCurrentPage';
    payload: {
        pageIndex: number;
        doScroll?: boolean;
        scrollTo?: string;
    };
} | {
    type: 'Fetching';
    payload: {
        pageIndex: number;
        reqIndex: number;
    };
} | {
    type: 'Fetched';
    payload: {
        pageIndex: number;
        reqIndex: number;
        data: PluginModel.PageView;
        size: PluginModel.PageSize;
    };
} | {
    type: 'RemoveHighlight';
} | {
    type: 'HighlightPage';
    payload: {
        pageIndex: number;
        pageView: PluginModel.PageView;
    };
} | {
    type: 'Invalidate';
    payload: {
        startPage: number;
        pageCount: number;
    };
} | {
    type: 'MarkPagesAsOld';
    payload: {
        startPage: number;
        pageCount: number;
    };
} | {
    type: 'ClearOldPages';
};
export type PageViewProps = DocViewModel & {
    settings: ViewSettings;
    dispatchVwr: (cmd: ReportViewerCmd) => void;
    onClick: MouseEventHandler;
    resizeObserver: (handler: () => void) => () => void;
    horizontalAlignment: PageViewOptions['horizontalAlignment'];
};
export type Model = {
    settings: ViewSettings;
    session: DocViewModel;
};
export type Msg = {
    type: 'settings';
    payload: SettingsMsg;
} | {
    type: 'session';
    payload: DocViewMsg;
};
