BidiServer.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright 2021 Google LLC.
  3. * Copyright (c) Microsoft Corporation.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. import { EventEmitter } from '../utils/EventEmitter.js';
  18. import { type LoggerFn } from '../utils/log.js';
  19. import type { Message } from '../protocol/protocol.js';
  20. import type { ICdpConnection } from '../cdp/cdpConnection.js';
  21. import { type BidiParser } from './CommandProcessor.js';
  22. import type { BidiTransport } from './BidiTransport.js';
  23. import { BrowsingContextStorage } from './domains/context/browsingContextStorage.js';
  24. import type { OutgoingBidiMessage } from './OutgoingBidiMessage.js';
  25. type BidiServerEvents = {
  26. message: Message.RawCommandRequest;
  27. };
  28. export declare class BidiServer extends EventEmitter<BidiServerEvents> {
  29. #private;
  30. private constructor();
  31. static createAndStart(bidiTransport: BidiTransport, cdpConnection: ICdpConnection, selfTargetId: string, parser?: BidiParser, logger?: LoggerFn): Promise<BidiServer>;
  32. topLevelContextsLoaded(): Promise<void>;
  33. /**
  34. * Sends BiDi message.
  35. */
  36. emitOutgoingMessage(messageEntry: Promise<OutgoingBidiMessage>): void;
  37. close(): void;
  38. getBrowsingContextStorage(): BrowsingContextStorage;
  39. }
  40. export {};