@mescius/dspdfviewer
Version:
Document Solutions PDF Viewer
61 lines (60 loc) • 3.15 kB
TypeScript
/** @hidden */ /** */
//@ts-ignore
import { MouseEvent } from 'react';
import { DocumentMoniker, PluginModel, ReportViewerCmd, ReportViewerCommandStatus } from '../api';
import { ViewerAction } from '../api/PluginModel';
import { DocumentViewer } from '../components';
import { SearchResult } from '../features/search';
import { CancellationToken } from './CancellationToken';
import { LoadResult } from './SessionState';
export type ViewerMouseEvent = MouseEvent;
/** Encapsulates viewer state and isolates it from main control.
*/
export declare class ViewerState {
readonly raiseChangedEvent: (model: DocumentViewer.Model) => void;
readonly raiseOpenDocumentEvent: (document: PluginModel.IDocument | null) => void;
readonly raiseOpenDocumentViewEvent: (document: PluginModel.IDocumentView | null) => void;
readonly onDocumentProgress: (view: PluginModel.ProgressMessage) => void;
readonly errorSink: PluginModel.IReportError;
readonly viewerState: PluginModel.IStateBinder<DocumentViewer.Model>;
constructor(raiseChangedEvent: (model: DocumentViewer.Model) => void, raiseOpenDocumentEvent: (document: PluginModel.IDocument | null) => void, raiseOpenDocumentViewEvent: (document: PluginModel.IDocumentView | null) => void, onDocumentProgress: (view: PluginModel.ProgressMessage) => void, errorSink: PluginModel.IReportError, viewerState: PluginModel.IStateBinder<DocumentViewer.Model>);
private _plugin;
private _session;
private readonly _settingsStore;
private readonly _viewerStore;
/** Gets the view settings */
get viewState(): DocumentViewer.Model;
get viewSettings(): DocumentViewer.ViewSettings;
get isDocumentOpened(): boolean;
get documentView(): PluginModel.IDocumentView | null;
updateUi: (msg: DocumentViewer.SettingsMsg) => void;
toggleNarrowScreen: (isNarrow?: boolean) => void;
highlight: (result: SearchResult | null) => Promise<void>;
setPlugin(plugin: PluginModel.IPluginModule<PluginModel.ViewerEvent, any>): void;
private onChangeDocument;
private onChangeDocumentView;
private getContext;
resolveAction: (event: ViewerMouseEvent) => any;
processAction: (action: ViewerAction) => boolean;
private processEvent;
/** Does seamless transition between reports with possible failures handling */
private tryLoadAndOpenDocument;
handleViewerCmd: (cmd: ReportViewerCmd) => void;
get commandStatus(): ReportViewerCommandStatus;
resetDocument: () => Promise<void>;
load: (doc: DocumentMoniker, parentToken?: CancellationToken) => Promise<LoadResult>;
open: (doc: DocumentMoniker) => Promise<LoadResult>;
private processLoadFailure;
private cancelSession;
private setSession;
private createSession;
/** history store implementation. Consider moving it out */
private readonly _history;
private _historyPosition;
pushEvent: (event: PluginModel.ViewerEvent) => void;
private historyGoBack;
private historyGoParent;
private historyGoForward;
private historyReset;
private historyResetNavigation;
}