//@ts-ignore
import { CancellationToken, DocumentViewOpenedEventArgs, PluginModel, ReactStateBinder, Store } from "@grapecity/viewer-core";
import GcPdfViewer from "../GcPdfViewer";
import { SearchPanelBase } from "./SearchPanelBase";
import { FindOptions, SearchMsg, SearchPanelModel, SearchResult } from "./types";
/// <reference path="../vendor/i18next.d.ts" />
//@ts-ignore

import { i18n } from 'i18next';
export interface ISearchWorkerListener {
    onDocumentViewOpen(args: DocumentViewOpenedEventArgs): any;
}
export declare class SearchWorker {
    viewer: GcPdfViewer;
    searchStore: Store<SearchPanelModel, SearchMsg>;
    binder: ReactStateBinder<SearchPanelModel, SearchMsg>;
    i18n: i18n;
//@ts-ignore
    _iterator: AsyncIterableIterator<any> | null;
    _doc: PluginModel.IDocumentView | null;
    _cancelToken: CancellationToken | null;
    _cancel: ((reason: any) => void) | null;
    _listeners: {
        [id: string]: ISearchWorkerListener;
    };
    constructor(viewer: GcPdfViewer);
    beginSearch: (searchOptions: FindOptions) => void;
    onDocumentViewOpen(args: DocumentViewOpenedEventArgs): void;
    onResultClick: (result: SearchResult | null) => Promise<void>;
    cancel(reason: any): void;
    dispatch(msg: SearchMsg): void;
    /**
     * Continue search in document.
     * @param maxResultsCount
     * @returns Returns false when search is suspended, otherwise returns true (search completed or canceled).
     **/
    searchNext(maxResultsCount?: number): Promise<boolean>;
    setListener(key: string, listener: ISearchWorkerListener): void;
    static getInstance(viewer: any): SearchWorker;
}
/**
 * Registers search feature in the viewer control.
 * @hidden
 */
export declare const registerSearchPanel: (viewer: GcPdfViewer, outRef: {
    searchPanel?: SearchPanelBase;
}) => PluginModel.PanelHandle;
