From 2ad42dc398fe806306f47b976111142a6a906da8 Mon Sep 17 00:00:00 2001 From: Martin Splitt Date: Wed, 24 Jun 2020 10:34:37 +0200 Subject: [PATCH] docs(new): migrate Touchscreen docs to TSDoc (#6087) Co-authored-by: martinsplitt --- new-docs/puppeteer.md | 2 +- .../puppeteer.touchscreen._constructor_.md | 21 ------------------- new-docs/puppeteer.touchscreen.md | 10 ++++----- new-docs/puppeteer.touchscreen.tap.md | 6 ++++-- src/common/Input.ts | 11 ++++++++-- 5 files changed, 19 insertions(+), 31 deletions(-) delete mode 100644 new-docs/puppeteer.touchscreen._constructor_.md diff --git a/new-docs/puppeteer.md b/new-docs/puppeteer.md index e0219567f813b..cf0b32628d80e 100644 --- a/new-docs/puppeteer.md +++ b/new-docs/puppeteer.md @@ -33,7 +33,7 @@ | [SecurityDetails](./puppeteer.securitydetails.md) | The SecurityDetails class represents the security details of a response that was received over a secure connection. | | [Target](./puppeteer.target.md) | | | [TimeoutError](./puppeteer.timeouterror.md) | TimeoutError is emitted whenever certain operations are terminated due to timeout. | -| [Touchscreen](./puppeteer.touchscreen.md) | | +| [Touchscreen](./puppeteer.touchscreen.md) | The Touchscreen class exposes touchscreen events. | | [Tracing](./puppeteer.tracing.md) | | | [WebWorker](./puppeteer.webworker.md) | The WebWorker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). | diff --git a/new-docs/puppeteer.touchscreen._constructor_.md b/new-docs/puppeteer.touchscreen._constructor_.md deleted file mode 100644 index 61062bcfdf4c0..0000000000000 --- a/new-docs/puppeteer.touchscreen._constructor_.md +++ /dev/null @@ -1,21 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Touchscreen](./puppeteer.touchscreen.md) > [(constructor)](./puppeteer.touchscreen._constructor_.md) - -## Touchscreen.(constructor) - -Constructs a new instance of the `Touchscreen` class - -Signature: - -```typescript -constructor(client: CDPSession, keyboard: Keyboard); -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| client | [CDPSession](./puppeteer.cdpsession.md) | | -| keyboard | [Keyboard](./puppeteer.keyboard.md) | | - diff --git a/new-docs/puppeteer.touchscreen.md b/new-docs/puppeteer.touchscreen.md index bae9a85e3991d..e1f7d85208304 100644 --- a/new-docs/puppeteer.touchscreen.md +++ b/new-docs/puppeteer.touchscreen.md @@ -4,17 +4,17 @@ ## Touchscreen class +The Touchscreen class exposes touchscreen events. + Signature: ```typescript export declare class Touchscreen ``` -## Constructors +## Remarks -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(client, keyboard)](./puppeteer.touchscreen._constructor_.md) | | Constructs a new instance of the Touchscreen class | +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Touchscreen` class. ## Properties @@ -27,5 +27,5 @@ export declare class Touchscreen | Method | Modifiers | Description | | --- | --- | --- | -| [tap(x, y)](./puppeteer.touchscreen.tap.md) | | | +| [tap(x, y)](./puppeteer.touchscreen.tap.md) | | Dispatches a touchstart and touchend event. | diff --git a/new-docs/puppeteer.touchscreen.tap.md b/new-docs/puppeteer.touchscreen.tap.md index 78308f1d889b8..ae04b304bffe8 100644 --- a/new-docs/puppeteer.touchscreen.tap.md +++ b/new-docs/puppeteer.touchscreen.tap.md @@ -4,6 +4,8 @@ ## Touchscreen.tap() method +Dispatches a `touchstart` and `touchend` event. + Signature: ```typescript @@ -14,8 +16,8 @@ tap(x: number, y: number): Promise; | Parameter | Type | Description | | --- | --- | --- | -| x | number | | -| y | number | | +| x | number | Horizontal position of the tap. | +| y | number | Vertical position of the tap. | Returns: diff --git a/src/common/Input.ts b/src/common/Input.ts index e423808922722..d9c89757ccac6 100644 --- a/src/common/Input.ts +++ b/src/common/Input.ts @@ -238,18 +238,25 @@ export class Mouse { } } +/** + * The Touchscreen class exposes touchscreen events. + */ export class Touchscreen { _client: CDPSession; _keyboard: Keyboard; + /** + * @internal + */ constructor(client: CDPSession, keyboard: Keyboard) { this._client = client; this._keyboard = keyboard; } /** - * @param {number} x - * @param {number} y + * Dispatches a `touchstart` and `touchend` event. + * @param x - Horizontal position of the tap. + * @param y - Vertical position of the tap. */ async tap(x: number, y: number): Promise { // Touches appear to be lost during the first frame after navigation.