Merge pull request #15500 from Snuffleupagus/LoopbackPort-rm-export
[api-minor] Stop exposing the `LoopbackPort` class in the API
This commit is contained in:
commit
4cedbca365
@ -1853,34 +1853,33 @@ class PDFPageProxy {
|
||||
}
|
||||
|
||||
class LoopbackPort {
|
||||
constructor() {
|
||||
this._listeners = [];
|
||||
this._deferred = Promise.resolve();
|
||||
}
|
||||
#listeners = [];
|
||||
|
||||
#deferred = Promise.resolve();
|
||||
|
||||
postMessage(obj, transfers) {
|
||||
const event = {
|
||||
data: structuredClone(obj, transfers),
|
||||
};
|
||||
|
||||
this._deferred.then(() => {
|
||||
for (const listener of this._listeners) {
|
||||
this.#deferred.then(() => {
|
||||
for (const listener of this.#listeners) {
|
||||
listener.call(this, event);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
addEventListener(name, listener) {
|
||||
this._listeners.push(listener);
|
||||
this.#listeners.push(listener);
|
||||
}
|
||||
|
||||
removeEventListener(name, listener) {
|
||||
const i = this._listeners.indexOf(listener);
|
||||
this._listeners.splice(i, 1);
|
||||
const i = this.#listeners.indexOf(listener);
|
||||
this.#listeners.splice(i, 1);
|
||||
}
|
||||
|
||||
terminate() {
|
||||
this._listeners.length = 0;
|
||||
this.#listeners.length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,6 @@ import {
|
||||
import {
|
||||
build,
|
||||
getDocument,
|
||||
LoopbackPort,
|
||||
PDFDataRangeTransport,
|
||||
PDFWorker,
|
||||
setPDFNetworkStreamFactory,
|
||||
@ -128,7 +127,6 @@ export {
|
||||
InvalidPDFException,
|
||||
isPdfFile,
|
||||
loadScript,
|
||||
LoopbackPort,
|
||||
MissingPDFException,
|
||||
OPS,
|
||||
PasswordResponses,
|
||||
|
Loading…
Reference in New Issue
Block a user