/** * Copyright 2023 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { ElementHandle } from '../api/ElementHandle.js'; import type { Frame } from '../api/Frame.js'; import type { WaitForSelectorOptions } from '../api/Page.js'; import type PuppeteerUtil from '../injected/injected.js'; import type { Awaitable, AwaitableIterable } from './types.js'; /** * @internal */ export type QuerySelectorAll = (node: Node, selector: string, PuppeteerUtil: PuppeteerUtil) => AwaitableIterable; /** * @internal */ export type QuerySelector = (node: Node, selector: string, PuppeteerUtil: PuppeteerUtil) => Awaitable; /** * @internal */ export declare class QueryHandler { static querySelectorAll?: QuerySelectorAll; static querySelector?: QuerySelector; static get _querySelector(): QuerySelector; static get _querySelectorAll(): QuerySelectorAll; /** * Queries for multiple nodes given a selector and {@link ElementHandle}. * * Akin to {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll | Document.querySelectorAll()}. */ static queryAll(element: ElementHandle, selector: string): AwaitableIterable>; /** * Queries for a single node given a selector and {@link ElementHandle}. * * Akin to {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector}. */ static queryOne(element: ElementHandle, selector: string): Promise | null>; /** * Waits until a single node appears for a given selector and * {@link ElementHandle}. * * This will always query the handle in the Puppeteer world and migrate the * result to the main world. */ static waitFor(elementOrFrame: ElementHandle | Frame, selector: string, options: WaitForSelectorOptions): Promise | null>; } //# sourceMappingURL=QueryHandler.d.ts.map