Skip to content

Commit

Permalink
chore: format docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Jul 5, 2022
1 parent 9e596d0 commit dfe273e
Show file tree
Hide file tree
Showing 724 changed files with 17,463 additions and 15,295 deletions.
3 changes: 0 additions & 3 deletions README.md
@@ -1,6 +1,3 @@
<!-- docusaurus-metadata-start -->
<!-- docusaurus-metadata-end -->

# Puppeteer

<!-- [START badges] -->
Expand Down
332 changes: 166 additions & 166 deletions docs/api/index.md

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions docs/api/puppeteer.accessibility.md
@@ -1,29 +1,29 @@
---
sidebar_label: Accessibility
---
# Accessibility class

The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access).

**Signature:**

```typescript
export declare class Accessibility
```

## Remarks

Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output.

Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree.

Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class.

## Methods

| Method | Modifiers | Description |
| --- | --- | --- |
| [snapshot(options)](./puppeteer.accessibility.snapshot.md) | | Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. |

---
sidebar_label: Accessibility
---

# Accessibility class

The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access).

**Signature:**

```typescript
export declare class Accessibility
```

## Remarks

Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output.

Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree.

Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class.

## Methods

| Method | Modifiers | Description |
| ---------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- |
| [snapshot(options)](./puppeteer.accessibility.snapshot.md) | | Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. |
117 changes: 59 additions & 58 deletions docs/api/puppeteer.accessibility.snapshot.md
@@ -1,58 +1,59 @@
---
sidebar_label: Accessibility.snapshot
---
# Accessibility.snapshot() method

Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.

**Signature:**

```typescript
class Accessibility {snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;}
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | <i>(Optional)</i> |

**Returns:**

Promise&lt;[SerializedAXNode](./puppeteer.serializedaxnode.md) \| null&gt;

An AXNode object representing the snapshot.

## Remarks

\*\*NOTE\*\* The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.

## Example 1

An example of dumping the entire accessibility tree:

```ts
const snapshot = await page.accessibility.snapshot();
console.log(snapshot);
```

## Example 2

An example of logging the focused node's name:

```ts
const snapshot = await page.accessibility.snapshot();
const node = findFocusedNode(snapshot);
console.log(node && node.name);

function findFocusedNode(node) {
if (node.focused)
return node;
for (const child of node.children || []) {
const foundNode = findFocusedNode(child);
return foundNode;
}
return null;
}
```

---
sidebar_label: Accessibility.snapshot
---

# Accessibility.snapshot() method

Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.

**Signature:**

```typescript
class Accessibility {
snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;
}
```

## Parameters

| Parameter | Type | Description |
| --------- | ------------------------------------------------- | ----------------- |
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | <i>(Optional)</i> |

**Returns:**

Promise&lt;[SerializedAXNode](./puppeteer.serializedaxnode.md) \| null&gt;

An AXNode object representing the snapshot.

## Remarks

\*\*NOTE\*\* The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.

## Example 1

An example of dumping the entire accessibility tree:

```ts
const snapshot = await page.accessibility.snapshot();
console.log(snapshot);
```

## Example 2

An example of logging the focused node's name:

```ts
const snapshot = await page.accessibility.snapshot();
const node = findFocusedNode(snapshot);
console.log(node && node.name);

function findFocusedNode(node) {
if (node.focused) return node;
for (const child of node.children || []) {
const foundNode = findFocusedNode(child);
return foundNode;
}
return null;
}
```
22 changes: 11 additions & 11 deletions docs/api/puppeteer.actionresult.md
@@ -1,11 +1,11 @@
---
sidebar_label: ActionResult
---
# ActionResult type


**Signature:**

```typescript
export declare type ActionResult = 'continue' | 'abort' | 'respond';
```
---
sidebar_label: ActionResult
---

# ActionResult type

**Signature:**

```typescript
export declare type ActionResult = 'continue' | 'abort' | 'respond';
```
22 changes: 11 additions & 11 deletions docs/api/puppeteer.awaitable.md
@@ -1,11 +1,11 @@
---
sidebar_label: Awaitable
---
# Awaitable type


**Signature:**

```typescript
export declare type Awaitable<T> = T | PromiseLike<T>;
```
---
sidebar_label: Awaitable
---

# Awaitable type

**Signature:**

```typescript
export declare type Awaitable<T> = T | PromiseLike<T>;
```
27 changes: 15 additions & 12 deletions docs/api/puppeteer.boundingbox.height.md
@@ -1,12 +1,15 @@
---
sidebar_label: BoundingBox.height
---
# BoundingBox.height property

the height of the element in pixels.

**Signature:**

```typescript
interface BoundingBox {height: number;}
```
---
sidebar_label: BoundingBox.height
---

# BoundingBox.height property

the height of the element in pixels.

**Signature:**

```typescript
interface BoundingBox {
height: number;
}
```
40 changes: 20 additions & 20 deletions docs/api/puppeteer.boundingbox.md
@@ -1,20 +1,20 @@
---
sidebar_label: BoundingBox
---
# BoundingBox interface


**Signature:**

```typescript
export interface BoundingBox extends Point
```
**Extends:** [Point](./puppeteer.point.md)
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. |
| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. |
---
sidebar_label: BoundingBox
---

# BoundingBox interface

**Signature:**

```typescript
export interface BoundingBox extends Point
```
**Extends:** [Point](./puppeteer.point.md)
## Properties
| Property | Modifiers | Type | Description |
| ------------------------------------------- | --------- | ------ | ------------------------------------ |
| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. |
| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. |
27 changes: 15 additions & 12 deletions docs/api/puppeteer.boundingbox.width.md
@@ -1,12 +1,15 @@
---
sidebar_label: BoundingBox.width
---
# BoundingBox.width property

the width of the element in pixels.

**Signature:**

```typescript
interface BoundingBox {width: number;}
```
---
sidebar_label: BoundingBox.width
---

# BoundingBox.width property

the width of the element in pixels.

**Signature:**

```typescript
interface BoundingBox {
width: number;
}
```
23 changes: 13 additions & 10 deletions docs/api/puppeteer.boxmodel.border.md
@@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.border
---
# BoxModel.border property

**Signature:**

```typescript
interface BoxModel {border: Point[];}
```
---
sidebar_label: BoxModel.border
---

# BoxModel.border property

**Signature:**

```typescript
interface BoxModel {
border: Point[];
}
```
23 changes: 13 additions & 10 deletions docs/api/puppeteer.boxmodel.content.md
@@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.content
---
# BoxModel.content property

**Signature:**

```typescript
interface BoxModel {content: Point[];}
```
---
sidebar_label: BoxModel.content
---

# BoxModel.content property

**Signature:**

```typescript
interface BoxModel {
content: Point[];
}
```
23 changes: 13 additions & 10 deletions docs/api/puppeteer.boxmodel.height.md
@@ -1,10 +1,13 @@
---
sidebar_label: BoxModel.height
---
# BoxModel.height property

**Signature:**

```typescript
interface BoxModel {height: number;}
```
---
sidebar_label: BoxModel.height
---

# BoxModel.height property

**Signature:**

```typescript
interface BoxModel {
height: number;
}
```

0 comments on commit dfe273e

Please sign in to comment.