PreloadScriptStorage.d.ts 948 B

123456789101112131415161718192021
  1. import type { CommonDataTypes } from '../../../protocol/protocol.js';
  2. import type { CdpTarget } from './cdpTarget.js';
  3. import type { BidiPreloadScript } from './bidiPreloadScript.js';
  4. /**
  5. * BidiPreloadScripts can be filtered by either context ID, BiDi ID or
  6. * target ID.
  7. */
  8. export type BidiPreloadScriptFilter = Partial<Pick<BidiPreloadScript, 'contextId'> & Pick<BidiPreloadScript, 'id'> & Pick<CdpTarget, 'targetId'>> & {
  9. contextIds?: (CommonDataTypes.BrowsingContext | null)[];
  10. };
  11. /**
  12. * Container class for preload scripts.
  13. */
  14. export declare class PreloadScriptStorage {
  15. #private;
  16. /** Finds all entries that match the given filter. */
  17. findPreloadScripts(filter?: BidiPreloadScriptFilter): BidiPreloadScript[];
  18. addPreloadScript(preloadScript: BidiPreloadScript): void;
  19. /** Deletes all BiDi preload script entries that match the given filter. */
  20. removeBiDiPreloadScripts(filter?: BidiPreloadScriptFilter): void;
  21. }