xwt
2025-07-04 b76e716ff4656191d73eba398e9eb39ee975e13b
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
export type WaitOnEventOrTimeoutParameters = {
    /**
     * - The event target, can for example be:
     * `window`, `document`, a DOM element, or an {EventBus} instance.
     */
    target: Object;
    /**
     * - The name of the event.
     */
    name: string;
    /**
     * - The delay, in milliseconds, after which the
     * timeout occurs (if the event wasn't already dispatched).
     */
    delay: number;
};
/**
 * Simple event bus for an application. Listeners are attached using the `on`
 * and `off` methods. To raise an event, the `dispatch` method shall be used.
 */
export class EventBus {
    /**
     * @param {string} eventName
     * @param {function} listener
     * @param {Object} [options]
     */
    on(eventName: string, listener: Function, options?: Object): void;
    /**
     * @param {string} eventName
     * @param {function} listener
     * @param {Object} [options]
     */
    off(eventName: string, listener: Function, options?: Object): void;
    /**
     * @param {string} eventName
     * @param {Object} data
     */
    dispatch(eventName: string, data: Object): void;
    /**
     * @ignore
     */
    _on(eventName: any, listener: any, options?: null): void;
    /**
     * @ignore
     */
    _off(eventName: any, listener: any, options?: null): void;
    #private;
}
/**
 * NOTE: Only used in the Firefox build-in pdf viewer.
 */
export class FirefoxEventBus extends EventBus {
    constructor(globalEventNames: any, externalServices: any, isInAutomation: any);
    dispatch(eventName: any, data: any): void;
    #private;
}
/**
 * @typedef {Object} WaitOnEventOrTimeoutParameters
 * @property {Object} target - The event target, can for example be:
 *   `window`, `document`, a DOM element, or an {EventBus} instance.
 * @property {string} name - The name of the event.
 * @property {number} delay - The delay, in milliseconds, after which the
 *   timeout occurs (if the event wasn't already dispatched).
 */
/**
 * Allows waiting for an event or a timeout, whichever occurs first.
 * Can be used to ensure that an action always occurs, even when an event
 * arrives late or not at all.
 *
 * @param {WaitOnEventOrTimeoutParameters}
 * @returns {Promise} A promise that is resolved with a {WaitOnType} value.
 */
export function waitOnEventOrTimeout({ target, name, delay }: WaitOnEventOrTimeoutParameters): Promise<any>;
export namespace WaitOnType {
    let EVENT: string;
    let TIMEOUT: string;
}