WXL
3 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
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
export type EventBus = import("./event_utils").EventBus;
export type PDFScriptingManagerOptions = {
    /**
     * - The application event bus.
     */
    eventBus: EventBus;
    /**
     * - The path and filename of the scripting
     * bundle.
     */
    sandboxBundleSrc: string;
    /**
     * - The factory that is used when
     * initializing scripting; must contain a `createScripting` method.
     * PLEASE NOTE: Primarily intended for the default viewer use-case.
     */
    scriptingFactory?: Object | undefined;
    /**
     * - The function that is used to
     * lookup the necessary document properties.
     */
    docPropertiesLookup?: Function | undefined;
};
/**
 * @typedef {Object} PDFScriptingManagerOptions
 * @property {EventBus} eventBus - The application event bus.
 * @property {string} sandboxBundleSrc - The path and filename of the scripting
 *   bundle.
 * @property {Object} [scriptingFactory] - The factory that is used when
 *   initializing scripting; must contain a `createScripting` method.
 *   PLEASE NOTE: Primarily intended for the default viewer use-case.
 * @property {function} [docPropertiesLookup] - The function that is used to
 *   lookup the necessary document properties.
 */
export class PDFScriptingManager {
    /**
     * @param {PDFScriptingManagerOptions} options
     */
    constructor({ eventBus, sandboxBundleSrc, scriptingFactory, docPropertiesLookup, }: PDFScriptingManagerOptions);
    _pdfDocument: any;
    _pdfViewer: any;
    _closeCapability: any;
    _destroyCapability: any;
    _scripting: any;
    _mouseState: any;
    _ready: boolean;
    _eventBus: import("./event_utils").EventBus;
    _sandboxBundleSrc: string;
    _scriptingFactory: Object;
    _docPropertiesLookup: Function;
    setViewer(pdfViewer: any): void;
    setDocument(pdfDocument: any): Promise<void>;
    dispatchWillSave(detail: any): Promise<any>;
    dispatchDidSave(detail: any): Promise<any>;
    dispatchWillPrint(detail: any): Promise<any>;
    dispatchDidPrint(detail: any): Promise<any>;
    get mouseState(): any;
    get destroyPromise(): any;
    get ready(): boolean;
    /**
     * @private
     */
    private get _internalEvents();
    /**
     * @private
     */
    private get _domEvents();
    /**
     * @private
     */
    private get _pageOpenPending();
    /**
     * @private
     */
    private get _visitedPages();
    /**
     * @private
     */
    private _updateFromSandbox;
    /**
     * @private
     */
    private _dispatchPageOpen;
    /**
     * @private
     */
    private _dispatchPageClose;
    /**
     * @returns {Promise<Object>} A promise that is resolved with an {Object}
     *   containing the necessary document properties; please find the expected
     *   format in `PDFViewerApplication._scriptingDocProperties`.
     * @private
     */
    private _getDocProperties;
    /**
     * @private
     */
    private _createScripting;
    /**
     * @private
     */
    private _destroyScripting;
}