puppeteer-core
Version:
A high-level API to control headless Chrome over the DevTools Protocol
29 lines • 1.06 kB
TypeScript
import { type Logger } from '../common/Debug.js';
import type { ExecutionContext } from './ExecutionContext.js';
/**
* @internal
*/
export interface BindingOptions {
/** Whether to dispose node arguments after the binding call finishes. */
ownsArguments?: boolean;
/** Whether to dispose a returned handle after forwarding it to the page. */
ownsResult?: boolean;
}
/**
* @internal
*/
export declare class Binding {
#private;
constructor(name: string, fn: (...args: unknown[]) => unknown, initSource: string, logger: Logger, options?: BindingOptions);
get name(): string;
get initSource(): string;
/**
* @param context - Context to run the binding in; the context should have
* the binding added to it beforehand.
* @param id - ID of the call. This should come from the CDP
* `onBindingCalled` response.
* @param args - Plain arguments from CDP.
*/
run(context: ExecutionContext, id: number, args: unknown[], isTrivial: boolean): Promise<void>;
}
//# sourceMappingURL=Binding.d.ts.map