docs: fix some api-extractor warnings (#9806)

This commit is contained in:
Nikolay Vitkov 2023-03-09 09:22:09 +01:00 committed by GitHub
parent bc1a04def8
commit 38d511b5c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 54 additions and 36 deletions

View File

@ -69,7 +69,7 @@ The constructor for this class is marked as internal. Third-party code should no
| [hover(this)](./puppeteer.elementhandle.hover.md) | | This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.mouse.md) to hover over the center of the element. If the element is detached from DOM, the method throws an error. |
| [isIntersectingViewport(this, options)](./puppeteer.elementhandle.isintersectingviewport.md) | | Resolves to true if the element is visible in the current viewport. |
| [press(key, options)](./puppeteer.elementhandle.press.md) | | Focuses the element, and then uses [Keyboard.down()](./puppeteer.keyboard.down.md) and [Keyboard.up()](./puppeteer.keyboard.up.md). |
| [screenshot(this, options)](./puppeteer.elementhandle.screenshot.md) | | This method scrolls element into view if needed, and then uses to take a screenshot of the element. If the element is detached from DOM, the method throws an error. |
| [screenshot(this, options)](./puppeteer.elementhandle.screenshot.md) | | This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot_2.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error. |
| [select(values)](./puppeteer.elementhandle.select.md) | | Triggers a <code>change</code> and <code>input</code> event once all the provided options have been selected. If there's no <code>&lt;select&gt;</code> element matching <code>selector</code>, the method throws an error. |
| [tap(this)](./puppeteer.elementhandle.tap.md) | | This method scrolls element into view if needed, and then uses [Touchscreen.tap()](./puppeteer.touchscreen.tap.md) to tap in the center of the element. If the element is detached from DOM, the method throws an error. |
| [toElement(tagName)](./puppeteer.elementhandle.toelement.md) | | Converts the current handle to the given element type. |

View File

@ -4,7 +4,7 @@ sidebar_label: ElementHandle.screenshot
# ElementHandle.screenshot() method
This method scrolls element into view if needed, and then uses to take a screenshot of the element. If the element is detached from DOM, the method throws an error.
This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot_2.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error.
#### Signature:

View File

@ -6,7 +6,7 @@ sidebar_label: Page.addStyleTag
Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a `<style type="text/css">` tag with the content.
Shortcut for .
Shortcut for [page.mainFrame().addStyleTag(options)](./puppeteer.frame.addstyletag_1.md).
#### Signature:

View File

@ -82,7 +82,7 @@ page.off('request', logRequest);
| [$eval(selector, pageFunction, args)](./puppeteer.page._eval.md) | | This method runs <code>document.querySelector</code> within the page and passes the result as the first argument to the <code>pageFunction</code>. |
| [$x(expression)](./puppeteer.page._x.md) | | The method evaluates the XPath expression relative to the page document as its context node. If there are no such elements, the method resolves to an empty array. |
| [addScriptTag(options)](./puppeteer.page.addscripttag.md) | | Adds a <code>&lt;script&gt;</code> tag into the page with the desired URL or content. |
| [addStyleTag(options)](./puppeteer.page.addstyletag.md) | | <p>Adds a <code>&lt;link rel=&quot;stylesheet&quot;&gt;</code> tag into the page with the desired URL or a <code>&lt;style type=&quot;text/css&quot;&gt;</code> tag with the content.</p><p>Shortcut for .</p> |
| [addStyleTag(options)](./puppeteer.page.addstyletag.md) | | <p>Adds a <code>&lt;link rel=&quot;stylesheet&quot;&gt;</code> tag into the page with the desired URL or a <code>&lt;style type=&quot;text/css&quot;&gt;</code> tag with the content.</p><p>Shortcut for [page.mainFrame().addStyleTag(options)](./puppeteer.frame.addstyletag_1.md).</p> |
| [addStyleTag(options)](./puppeteer.page.addstyletag_1.md) | | |
| [addStyleTag(options)](./puppeteer.page.addstyletag_2.md) | | |
| [authenticate(credentials)](./puppeteer.page.authenticate.md) | | Provide credentials for <code>HTTP authentication</code>. |

View File

@ -17,6 +17,6 @@ export declare class ProtocolError extends CustomError
## Properties
| Property | Modifiers | Type | Description |
| --------------------------------------------------------------- | --------- | ------------------- | ----------- |
| [code](./puppeteer.protocolerror.code.md) | | number \| undefined | |
| [originalMessage](./puppeteer.protocolerror.originalmessage.md) | | string | |
| --------------------------------------------------------------- | --------------------- | ------------------- | ----------- |
| [code](./puppeteer.protocolerror.code.md) | <code>readonly</code> | number \| undefined | |
| [originalMessage](./puppeteer.protocolerror.originalmessage.md) | <code>readonly</code> | string | |

View File

@ -799,7 +799,7 @@ export class ElementHandle<
/**
* This method scrolls element into view if needed, and then uses
* {@link Page.screenshot} to take a screenshot of the element.
* {@link Page.(screenshot:3) } to take a screenshot of the element.
* If the element is detached from DOM, the method throws an error.
*/
async screenshot(

View File

@ -1121,7 +1121,7 @@ export class Page extends EventEmitter {
* a `<style type="text/css">` tag with the content.
*
* Shortcut for
* {@link Frame.addStyleTag | page.mainFrame().addStyleTag(options)}.
* {@link Frame.(addStyleTag:2) | page.mainFrame().addStyleTag(options)}.
*
* @returns An {@link ElementHandle | element handle} to the injected `<link>`
* or `<style>` element.

View File

@ -26,11 +26,11 @@ import {scriptInjector} from './ScriptInjector.js';
*/
export interface CustomQueryHandler {
/**
* @returns A {@link Node} matching the given `selector` from {@link node}.
* @returns A {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | Node} matching the given `selector` from {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | node}.
*/
queryOne?: (node: Node, selector: string) => Node | null;
/**
* @returns Some {@link Node}s matching the given `selector` from {@link node}.
* @returns Some {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | Nodes} matching the given `selector` from {@link https://developer.mozilla.org/en-US/docs/Web/API/Node | node}.
*/
queryAll?: (node: Node, selector: string) => Iterable<Node>;
}

View File

@ -51,26 +51,22 @@ export class ProtocolError extends CustomError {
#code?: number;
#originalMessage = '';
/**
* @internal
*/
set code(code: number | undefined) {
this.#code = code;
}
/**
* @readonly
* @public
*/
get code(): number | undefined {
return this.#code;
}
/**
* @internal
*/
set originalMessage(originalMessage: string) {
this.#originalMessage = originalMessage;
}
/**
* @readonly
* @public
*/
get originalMessage(): string {

View File

@ -67,26 +67,11 @@ const SOURCE_URL_REGEX = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m;
* @internal
*/
export class ExecutionContext {
/**
* @internal
*/
_client: CDPSession;
/**
* @internal
*/
_world?: IsolatedWorld;
/**
* @internal
*/
_contextId: number;
/**
* @internal
*/
_contextName?: string;
/**
* @internal
*/
constructor(
client: CDPSession,
contextPayload: Protocol.Runtime.ExecutionContextDescription,

View File

@ -68,6 +68,9 @@ export const NetworkManagerEmittedEvents = {
RequestFinished: Symbol('NetworkManager.RequestFinished'),
} as const;
/**
* @internal
*/
interface FrameManager {
frame(frameId: string): Frame | null;
}

View File

@ -102,7 +102,7 @@ export class QueryHandler {
/**
* Queries for multiple nodes given a selector and {@link ElementHandle}.
*
* Akin to {@link Document.prototype.querySelectorAll}.
* Akin to {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll | Document.querySelectorAll()}.
*/
static async *queryAll(
element: ElementHandle<Node>,
@ -123,7 +123,7 @@ export class QueryHandler {
/**
* Queries for a single node given a selector and {@link ElementHandle}.
*
* Akin to {@link Document.prototype.querySelector}.
* Akin to {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector}.
*/
static async queryOne(
element: ElementHandle<Node>,

View File

@ -69,3 +69,4 @@ export * from './USKeyboardLayout.js';
export * from './util.js';
export * from './WaitTask.js';
export * from './WebWorker.js';
export * from './QueryHandler.js';

View File

@ -247,6 +247,9 @@ export class BrowserRunner {
removeEventListeners(this.#listeners);
}
/**
* @internal
*/
async setupWebDriverBiDiConnection(options: {
timeout: number;
slowMo: number;

View File

@ -126,7 +126,7 @@ export class FirefoxLauncher extends ProductLauncher {
});
if (protocol === 'webDriverBiDi') {
let browser;
let browser: Browser;
try {
const connection = await runner.setupWebDriverBiDiConnection({
timeout,

View File

@ -37,10 +37,25 @@ const puppeteer = new PuppeteerNode({
});
export const {
/**
* @public
*/
connect,
/**
* @public
*/
createBrowserFetcher,
/**
* @public
*/
defaultArgs,
/**
* @public
*/
executablePath,
/**
* @public
*/
launch,
} = puppeteer;

View File

@ -33,10 +33,25 @@ const puppeteer = new PuppeteerNode({
});
export const {
/**
* @public
*/
connect,
/**
* @public
*/
createBrowserFetcher,
/**
* @public
*/
defaultArgs,
/**
* @public
*/
executablePath,
/**
* @public
*/
launch,
} = puppeteer;