import { type Browser, type BrowsingContext } from '../../../protocol/protocol.js'; import type { BrowsingContextImpl } from '../context/BrowsingContextImpl.js'; import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js'; import { ContextConfig } from './ContextConfig.js'; import type { UserContextStorage } from './UserContextStorage.js'; /** * Manages context-specific configurations. This class allows setting * configurations at three levels: global, user context, and browsing context. * * When `getActiveConfig` is called, it merges the configurations in a specific * order of precedence: `global -> user context -> browsing context`. For each * configuration property, the value from the highest-precedence level that has a * non-`undefined` value is used. * * `updateConfig` merges the provided configuration with the existing one at the * corresponding level. Properties with `undefined` values in the provided * configuration are ignored, preserving the existing value. */ export declare class ContextConfigStorage { #private; constructor(browsingContextStorage: BrowsingContextStorage, userContextStorage: UserContextStorage); /** * Returns the current global configuration. */ getGlobalConfig(): ContextConfig; /** * Calculates the active configuration by merging global, user context, and * browsing context settings. */ getActiveConfig(topLevelBrowsingContextId: string | undefined, userContext: string): ContextConfig; /** * Updates the configuration at the browsing context, user context, or global * level, and returns the related top-level browsing contexts. * * `browsingContextIds` and `userContextIds` are mutually exclusive: * - To update specific top-level browsing contexts, pass `browsingContextIds` * and omit `userContextIds`: `updateConfig(config, browsingContextIds)`. * - To update specific user contexts, pass `undefined` for * `browsingContextIds` and provide `userContextIds`: * `updateConfig(config, undefined, userContextIds)`. * - To update the global configuration, omit both (or pass `undefined` for * both): `updateConfig(config)`. * * Properties with `undefined` values in `config` are ignored, preserving * existing values. Properties with `null` values reset the setting at the * target level so it falls back to a broader level (or default). * * @param config The configuration fields to merge into the target scope. * @param browsingContextIds Top-level browsing context IDs to update, or * `undefined`. * @param userContextIds User context IDs to update, or `undefined`. * @param allowGlobal Whether updating the global configuration (when both * `browsingContextIds` and `userContextIds` are `undefined`) is allowed. * Defaults to `true`. If `false`, throws `InvalidArgumentException` when * neither is provided. * @param validateConfig Optional validation to run after target validation * but before any configuration is changed. * @returns The deduplicated list of related top-level browsing contexts. */ updateConfig(config: ContextConfig, browsingContextIds?: BrowsingContext.BrowsingContext[], userContextIds?: Browser.UserContext[], allowGlobal?: boolean, validateConfig?: () => void): Promise; }