Skip to content

Commit

Permalink
docs(new): migrate Touchscreen docs to TSDoc (#6087)
Browse files Browse the repository at this point in the history
Co-authored-by: martinsplitt <martin@geekonaut.de>
  • Loading branch information
2 people authored and mathiasbynens committed Jun 25, 2020
1 parent 73b9795 commit 2ad42dc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion new-docs/puppeteer.md
Expand Up @@ -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)<!-- -->. |

Expand Down
21 changes: 0 additions & 21 deletions new-docs/puppeteer.touchscreen._constructor_.md

This file was deleted.

10 changes: 5 additions & 5 deletions new-docs/puppeteer.touchscreen.md
Expand Up @@ -4,17 +4,17 @@

## Touchscreen class

The Touchscreen class exposes touchscreen events.

<b>Signature:</b>

```typescript
export declare class Touchscreen
```

## Constructors
## Remarks

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(client, keyboard)](./puppeteer.touchscreen._constructor_.md) | | Constructs a new instance of the <code>Touchscreen</code> 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

Expand All @@ -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 <code>touchstart</code> and <code>touchend</code> event. |

6 changes: 4 additions & 2 deletions new-docs/puppeteer.touchscreen.tap.md
Expand Up @@ -4,6 +4,8 @@

## Touchscreen.tap() method

Dispatches a `touchstart` and `touchend` event.

<b>Signature:</b>

```typescript
Expand All @@ -14,8 +16,8 @@ tap(x: number, y: number): Promise<void>;

| Parameter | Type | Description |
| --- | --- | --- |
| x | number | |
| y | number | |
| x | number | Horizontal position of the tap. |
| y | number | Vertical position of the tap. |

<b>Returns:</b>

Expand Down
11 changes: 9 additions & 2 deletions src/common/Input.ts
Expand Up @@ -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<void> {
// Touches appear to be lost during the first frame after navigation.
Expand Down

0 comments on commit 2ad42dc

Please sign in to comment.