Skip to content

Commit

Permalink
fix: make CDPSessionEvent.SessionAttached public (#10941)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Sep 19, 2023
1 parent 88e0997 commit cfed7b9
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 6 deletions.
6 changes: 6 additions & 0 deletions docs/api/index.md
Expand Up @@ -134,6 +134,12 @@ sidebar_label: API
| [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | |
| [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | |

## Namespaces

| Namespace | Description |
| ------------------------------------------------- | --------------------------------------- |
| [CDPSessionEvent](./puppeteer.cdpsessionevent.md) | Events that the CDPSession class emits. |

## Variables

| Variable | Description |
Expand Down
20 changes: 20 additions & 0 deletions docs/api/puppeteer.cdpsessionevent.md
@@ -0,0 +1,20 @@
---
sidebar_label: CDPSessionEvent
---

# CDPSessionEvent namespace

Events that the CDPSession class emits.

#### Signature:

```typescript
export declare namespace CDPSessionEvent
```
## Variables
| Variable | Description |
| ----------------------------------------------------------------- | ----------- |
| [SessionAttached](./puppeteer.cdpsessionevent.sessionattached.md) | |
| [SessionDetached](./puppeteer.cdpsessionevent.sessiondetached.md) | |
11 changes: 11 additions & 0 deletions docs/api/puppeteer.cdpsessionevent.sessionattached.md
@@ -0,0 +1,11 @@
---
sidebar_label: CDPSessionEvent.SessionAttached
---

# CDPSessionEvent.SessionAttached variable

#### Signature:

```typescript
SessionAttached: 'sessionattached';
```
11 changes: 11 additions & 0 deletions docs/api/puppeteer.cdpsessionevent.sessiondetached.md
@@ -0,0 +1,11 @@
---
sidebar_label: CDPSessionEvent.SessionDetached
---

# CDPSessionEvent.SessionDetached variable

#### Signature:

```typescript
SessionDetached: 'sessiondetached';
```
7 changes: 7 additions & 0 deletions docs/api/puppeteer.cdpsessionevents.md
Expand Up @@ -11,3 +11,10 @@ export interface CDPSessionEvents extends CDPEvents, Record<EventType, unknown>
```
**Extends:** [CDPEvents](./puppeteer.cdpevents.md), Record&lt;EventType, unknown&gt;
## Properties
| Property | Modifiers | Type | Description | Default |
| --------------- | --------- | --------------------------------------- | ----------- | ------- |
| sessionattached | | [CDPSession](./puppeteer.cdpsession.md) | | |
| sessiondetached | | [CDPSession](./puppeteer.cdpsession.md) | | |
14 changes: 8 additions & 6 deletions packages/puppeteer-core/src/api/CDPSession.ts
Expand Up @@ -11,21 +11,25 @@ export type CDPEvents = {
};

/**
* Internal events that the CDPSession class emits.
* Events that the CDPSession class emits.
*
* @internal
* @public
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace CDPSessionEvent {
/** @internal */
export const Disconnected = Symbol('CDPSession.Disconnected');
/** @internal */
export const Swapped = Symbol('CDPSession.Swapped');
/**
* Emitted when the session is ready to be configured during the auto-attach
* process. Right after the event is handled, the session will be resumed.
*
* @internal
*/
export const Ready = Symbol('CDPSession.Ready');
export const SessionAttached = Symbol('CDPSession.SessionAttached');
export const SessionDetached = Symbol('CDPSession.SessionDetached');
export const SessionAttached = 'sessionattached' as const;
export const SessionDetached = 'sessiondetached' as const;
}

/**
Expand All @@ -40,9 +44,7 @@ export interface CDPSessionEvents
[CDPSessionEvent.Swapped]: CDPSession;
/** @internal */
[CDPSessionEvent.Ready]: CDPSession;
/** @internal */
[CDPSessionEvent.SessionAttached]: CDPSession;
/** @internal */
[CDPSessionEvent.SessionDetached]: CDPSession;
}

Expand Down

0 comments on commit cfed7b9

Please sign in to comment.