Skip to content

Commit

Permalink
chore: use abstract for implemented methods (#10774)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Aug 23, 2023
1 parent 27636af commit 5f8d2a4
Show file tree
Hide file tree
Showing 33 changed files with 106 additions and 182 deletions.
2 changes: 1 addition & 1 deletion docs/api/puppeteer.elementhandle.autofill.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If the element is a form input, you can use [ElementHandle.autofill()](./puppete

```typescript
class ElementHandle {
autofill(data: AutofillData): Promise<void>;
abstract autofill(data: AutofillData): Promise<void>;
}
```

Expand Down
5 changes: 4 additions & 1 deletion docs/api/puppeteer.elementhandle.click.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ This method scrolls element into view if needed, and then uses [Page.mouse](./pu

```typescript
class ElementHandle {
click(this: ElementHandle<Element>, options?: ClickOptions): Promise<void>;
abstract click(
this: ElementHandle<Element>,
options?: ClickOptions
): Promise<void>;
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/api/puppeteer.elementhandle.contentframe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ sidebar_label: ElementHandle.contentFrame

# ElementHandle.contentFrame() method

Resolves the frame associated with the element.
Resolves the frame associated with the element, if any. Always exists for HTMLIFrameElements.

#### Signature:

```typescript
class ElementHandle {
contentFrame(this: ElementHandle<HTMLIFrameElement>): Promise<Frame>;
abstract contentFrame(this: ElementHandle<HTMLIFrameElement>): Promise<Frame>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.elementhandle.contentframe_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: ElementHandle.contentFrame_1

```typescript
class ElementHandle {
contentFrame(): Promise<Frame | null>;
abstract contentFrame(): Promise<Frame | null>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.elementhandle.hover.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This method scrolls element into view if needed, and then uses [Page](./puppetee

```typescript
class ElementHandle {
hover(this: ElementHandle<Element>): Promise<void>;
abstract hover(this: ElementHandle<Element>): Promise<void>;
}
```

Expand Down
10 changes: 5 additions & 5 deletions docs/api/puppeteer.elementhandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ElementHandle represents an in-page DOM element.
#### Signature:

```typescript
export declare class ElementHandle<ElementType extends Node = Element> extends JSHandle<ElementType>
export declare abstract class ElementHandle<ElementType extends Node = Element> extends JSHandle<ElementType>
```
**Extends:** [JSHandle](./puppeteer.jshandle.md)&lt;ElementType&gt;
Expand Down Expand Up @@ -41,9 +41,9 @@ The constructor for this class is marked as internal. Third-party code should no
## Properties
| Property | Modifiers | Type | Description |
| -------- | --------------------- | ----------------------------- | ----------- |
| frame | <code>readonly</code> | [Frame](./puppeteer.frame.md) | |
| Property | Modifiers | Type | Description |
| -------- | --------------------- | ----------------------------- | ------------------------------------------ |
| frame | <code>readonly</code> | [Frame](./puppeteer.frame.md) | Frame corresponding to the current handle. |
## Methods
Expand All @@ -60,7 +60,7 @@ The constructor for this class is marked as internal. Third-party code should no
| [boxModel()](./puppeteer.elementhandle.boxmodel.md) | | This method returns boxes of the element, or <code>null</code> if the element is not visible. |
| [click(this, options)](./puppeteer.elementhandle.click.md) | | This method scrolls element into view if needed, and then uses [Page.mouse](./puppeteer.page.md) to click in the center of the element. If the element is detached from DOM, the method throws an error. |
| [clickablePoint(offset)](./puppeteer.elementhandle.clickablepoint.md) | | Returns the middle point within an element unless a specific offset is provided. |
| [contentFrame(this)](./puppeteer.elementhandle.contentframe.md) | | Resolves the frame associated with the element. |
| [contentFrame(this)](./puppeteer.elementhandle.contentframe.md) | | Resolves the frame associated with the element, if any. Always exists for HTMLIFrameElements. |
| [contentFrame()](./puppeteer.elementhandle.contentframe_1.md) | | |
| [drag(this, target)](./puppeteer.elementhandle.drag.md) | | This method creates and captures a dragevent from the element. |
| [dragAndDrop(this, target, options)](./puppeteer.elementhandle.draganddrop.md) | | This method triggers a dragenter, dragover, and drop on the element. |
Expand Down
5 changes: 4 additions & 1 deletion docs/api/puppeteer.elementhandle.press.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Focuses the element, and then uses [Keyboard.down()](./puppeteer.keyboard.down.m

```typescript
class ElementHandle {
press(key: KeyInput, options?: Readonly<KeyPressOptions>): Promise<void>;
abstract press(
key: KeyInput,
options?: Readonly<KeyPressOptions>
): Promise<void>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.elementhandle.tap.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This method scrolls element into view if needed, and then uses [Touchscreen.tap(

```typescript
class ElementHandle {
tap(this: ElementHandle<Element>): Promise<void>;
abstract tap(this: ElementHandle<Element>): Promise<void>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.elementhandle.touchend.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: ElementHandle.touchEnd

```typescript
class ElementHandle {
touchEnd(this: ElementHandle<Element>): Promise<void>;
abstract touchEnd(this: ElementHandle<Element>): Promise<void>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.elementhandle.touchmove.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: ElementHandle.touchMove

```typescript
class ElementHandle {
touchMove(this: ElementHandle<Element>): Promise<void>;
abstract touchMove(this: ElementHandle<Element>): Promise<void>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.elementhandle.touchstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: ElementHandle.touchStart

```typescript
class ElementHandle {
touchStart(this: ElementHandle<Element>): Promise<void>;
abstract touchStart(this: ElementHandle<Element>): Promise<void>;
}
```

Expand Down
5 changes: 4 additions & 1 deletion docs/api/puppeteer.elementhandle.type.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ To press a special key, like `Control` or `ArrowDown`, use [ElementHandle.press(

```typescript
class ElementHandle {
type(text: string, options?: Readonly<KeyboardTypeOptions>): Promise<void>;
abstract type(
text: string,
options?: Readonly<KeyboardTypeOptions>
): Promise<void>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.aselement.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Either `null` or the handle itself if the handle is an instance of [ElementHandl

```typescript
class JSHandle {
asElement(): ElementHandle<Node> | null;
abstract asElement(): ElementHandle<Node> | null;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.dispose.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Releases the object referenced by the handle for garbage collection.

```typescript
class JSHandle {
dispose(): Promise<void>;
abstract dispose(): Promise<void>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.evaluate.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Evaluates the given function with the current handle as its first argument.

```typescript
class JSHandle {
evaluate<
abstract evaluate<
Params extends unknown[],
Func extends EvaluateFuncWith<T, Params> = EvaluateFuncWith<T, Params>,
>(
Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.evaluatehandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Evaluates the given function with the current handle as its first argument.

```typescript
class JSHandle {
evaluateHandle<
abstract evaluateHandle<
Params extends unknown[],
Func extends EvaluateFuncWith<T, Params> = EvaluateFuncWith<T, Params>,
>(
Expand Down
4 changes: 2 additions & 2 deletions docs/api/puppeteer.jshandle.getproperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Gets a map of handles representing the properties of the current handle.

```typescript
class JSHandle {
getProperties(): Promise<Map<string, JSHandle>>;
abstract getProperties(): Promise<Map<string, JSHandle<unknown>>>;
}
```

**Returns:**

Promise&lt;Map&lt;string, [JSHandle](./puppeteer.jshandle.md)&gt;&gt;
Promise&lt;Map&lt;string, [JSHandle](./puppeteer.jshandle.md)&lt;unknown&gt;&gt;&gt;

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.getproperty.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Fetches a single property from the referenced object.

```typescript
class JSHandle {
getProperty<K extends keyof T>(
abstract getProperty<K extends keyof T>(
propertyName: HandleOr<K>
): Promise<HandleFor<T[K]>>;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.getproperty_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: JSHandle.getProperty_1

```typescript
class JSHandle {
getProperty(propertyName: string): Promise<JSHandle<unknown>>;
abstract getProperty(propertyName: string): Promise<JSHandle<unknown>>;
}
```

Expand Down
25 changes: 0 additions & 25 deletions docs/api/puppeteer.jshandle.getproperty_2.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.jsonvalue.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A vanilla object representing the serializable portions of the referenced object

```typescript
class JSHandle {
jsonValue(): Promise<T>;
abstract jsonValue(): Promise<T>;
}
```

Expand Down
3 changes: 1 addition & 2 deletions docs/api/puppeteer.jshandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Handles can be used as arguments for any evaluation function such as [Page.$eval
#### Signature:

```typescript
export declare class JSHandle<T = unknown>
export declare abstract class JSHandle<T = unknown>
```

## Remarks
Expand Down Expand Up @@ -43,7 +43,6 @@ const windowHandle = await page.evaluateHandle(() => window);
| [getProperties()](./puppeteer.jshandle.getproperties.md) | | Gets a map of handles representing the properties of the current handle. |
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty.md) | | Fetches a single property from the referenced object. |
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty_1.md) | | |
| [getProperty(propertyName)](./puppeteer.jshandle.getproperty_2.md) | | |
| [jsonValue()](./puppeteer.jshandle.jsonvalue.md) | | A vanilla object representing the serializable portions of the referenced object. |
| [remoteObject()](./puppeteer.jshandle.remoteobject.md) | | Provides access to the [Protocol.Runtime.RemoteObject](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject) backing this handle. |
| [toString()](./puppeteer.jshandle.tostring.md) | | Returns a string representation of the JSHandle. |
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.remoteobject.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Provides access to the [Protocol.Runtime.RemoteObject](https://chromedevtools.gi

```typescript
class JSHandle {
remoteObject(): Protocol.Runtime.RemoteObject;
abstract remoteObject(): Protocol.Runtime.RemoteObject;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.jshandle.tostring.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Returns a string representation of the JSHandle.

```typescript
class JSHandle {
toString(): string;
abstract toString(): string;
}
```

Expand Down
Loading

0 comments on commit 5f8d2a4

Please sign in to comment.