WXL
9 天以前 2895b4ea66e09cb355aeb4e030ca0de297bf8ce3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
export type PDFHistoryOptions = {
    /**
     * - The navigation/linking service.
     */
    linkService: IPDFLinkService;
    /**
     * - The application event bus.
     */
    eventBus: EventBus;
};
export type InitializeParameters = {
    /**
     * - The PDF document's unique fingerprint.
     */
    fingerprint: string;
    /**
     * - Reset the browsing history.
     */
    resetHistory?: boolean | undefined;
    /**
     * - Attempt to update the document URL, with
     * the current hash, when pushing/replacing browser history entries.
     */
    updateUrl?: boolean | undefined;
};
export type PushParameters = {
    /**
     * - The named destination. If absent, a
     * stringified version of `explicitDest` is used.
     */
    namedDest?: string | undefined;
    /**
     * - The explicit destination array.
     */
    explicitDest: any[];
    /**
     * - The page to which the destination points.
     */
    pageNumber: number;
};
export type EventBus = import("./event_utils").EventBus;
export type IPDFLinkService = import("./interfaces").IPDFLinkService;
export function isDestArraysEqual(firstDest: any, secondDest: any): boolean;
export function isDestHashesEqual(destHash: any, pushHash: any): boolean;
export class PDFHistory {
    /**
     * @param {PDFHistoryOptions} options
     */
    constructor({ linkService, eventBus }: PDFHistoryOptions);
    linkService: import("./interfaces").IPDFLinkService;
    eventBus: import("./event_utils.js").EventBus;
    _initialized: boolean;
    _fingerprint: string;
    _boundEvents: {
        updateViewarea: ({ location }: {
            location: any;
        }) => void;
        popState: ({ state }: {
            state: any;
        }) => void;
        pageHide: () => void;
    } | null;
    _isPagesLoaded: boolean;
    /**
     * Initialize the history for the PDF document, using either the current
     * browser history entry or the document hash, whichever is present.
     * @param {InitializeParameters} params
     */
    initialize({ fingerprint, resetHistory, updateUrl }: InitializeParameters): void;
    _updateUrl: boolean | undefined;
    _popStateInProgress: boolean | undefined;
    _blockHashChange: number | undefined;
    _currentHash: string | undefined;
    _numPositionUpdates: number | undefined;
    _uid: any;
    _maxUid: any;
    _destination: any;
    _position: {
        hash: any;
        page: number;
        first: any;
        rotation: any;
    } | null | undefined;
    _initialRotation: any;
    _initialBookmark: any;
    /**
     * Reset the current `PDFHistory` instance, and consequently prevent any
     * further updates and/or navigation of the browser history.
     */
    reset(): void;
    _updateViewareaTimeout: any;
    /**
     * Push an internal destination to the browser history.
     * @param {PushParameters}
     */
    push({ namedDest, explicitDest, pageNumber }: PushParameters): void;
    /**
     * Push a page to the browser history; generally the `push` method should be
     * used instead.
     * @param {number} pageNumber
     */
    pushPage(pageNumber: number): void;
    /**
     * Push the current position to the browser history.
     */
    pushCurrentPosition(): void;
    /**
     * Go back one step in the browser history.
     * NOTE: Avoids navigating away from the document, useful for "named actions".
     */
    back(): void;
    /**
     * Go forward one step in the browser history.
     * NOTE: Avoids navigating away from the document, useful for "named actions".
     */
    forward(): void;
    /**
     * @type {boolean} Indicating if the user is currently moving through the
     *   browser history, useful e.g. for skipping the next 'hashchange' event.
     */
    get popStateInProgress(): boolean;
    get initialBookmark(): any;
    get initialRotation(): any;
    /**
     * @private
     */
    private _pushOrReplaceState;
    /**
     * @private
     */
    private _tryPushCurrentPosition;
    /**
     * @private
     */
    private _isValidPage;
    /**
     * @private
     */
    private _isValidState;
    /**
     * @private
     */
    private _updateInternalState;
    /**
     * @private
     */
    private _parseCurrentHash;
    /**
     * @private
     */
    private _updateViewarea;
    /**
     * @private
     */
    private _popState;
    /**
     * @private
     */
    private _pageHide;
    /**
     * @private
     */
    private _bindEvents;
    /**
     * @private
     */
    private _unbindEvents;
}