Skip to content

Commit

Permalink
fix: remove explicit resource management from types
Browse files Browse the repository at this point in the history
Since explicit resource management requires TypeScript 5.0.0, this PR removes all public references to preserve compatibility with older TypeScript versions. Once we stop support for <5.0.0, we can move forward with these symbols.
  • Loading branch information
jrandolf committed Sep 15, 2023
1 parent c949656 commit 74165ef
Show file tree
Hide file tree
Showing 16 changed files with 2,062 additions and 9,501 deletions.
17 changes: 0 additions & 17 deletions docs/api/puppeteer.browser._symbol.asyncdispose_.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/api/puppeteer.browser._symbol.dispose_.md

This file was deleted.

6 changes: 1 addition & 5 deletions docs/api/puppeteer.browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ A Browser is created when Puppeteer connects to a browser instance, either throu
#### Signature:

```typescript
export declare class Browser extends EventEmitter<BrowserEvents> implements AsyncDisposable, Disposable
export declare class Browser extends EventEmitter<BrowserEvents>
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[BrowserEvents](./puppeteer.browserevents.md)&gt;
**Implements:** AsyncDisposable, Disposable
## Remarks
The Browser class extends from Puppeteer's [EventEmitter](./puppeteer.eventemitter.md) class and will emit various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.
Expand Down Expand Up @@ -62,8 +60,6 @@ import puppeteer from 'puppeteer';
| Method | Modifiers | Description |
| ---------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [\[Symbol.asyncDispose\]()](./puppeteer.browser._symbol.asyncdispose_.md) | | |
| [\[Symbol.dispose\]()](./puppeteer.browser._symbol.dispose_.md) | | |
| [browserContexts()](./puppeteer.browser.browsercontexts.md) | | Returns an array of all open browser contexts. In a newly created browser, this will return a single instance of [BrowserContext](./puppeteer.browsercontext.md). |
| [close()](./puppeteer.browser.close.md) | | Closes the browser and all of its pages (if any were opened). The [Browser](./puppeteer.browser.md) object itself is considered to be disposed and cannot be used anymore. |
| [createIncognitoBrowserContext(options)](./puppeteer.browser.createincognitobrowsercontext.md) | | Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. |
Expand Down
17 changes: 0 additions & 17 deletions docs/api/puppeteer.jshandle._symbol.asyncdispose_.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/api/puppeteer.jshandle._symbol.dispose_.md

This file was deleted.

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

```typescript
export declare abstract class JSHandle<T = unknown> implements Disposable, AsyncDisposable, Moveable
export declare abstract class JSHandle<T = unknown>
```

**Implements:** Disposable, AsyncDisposable, [Moveable](./puppeteer.moveable.md)
## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `JSHandle` class.
Expand All @@ -39,8 +37,6 @@ const windowHandle = await page.evaluateHandle(() => window);

| Method | Modifiers | Description |
| ---------------------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [\[Symbol.asyncDispose\]()](./puppeteer.jshandle._symbol.asyncdispose_.md) | | |
| [\[Symbol.dispose\]()](./puppeteer.jshandle._symbol.dispose_.md) | | |
| [asElement()](./puppeteer.jshandle.aselement.md) | | Either <code>null</code> or the handle itself if the handle is an instance of [ElementHandle](./puppeteer.elementhandle.md). |
| [dispose()](./puppeteer.jshandle.dispose.md) | | Releases the object referenced by the handle for garbage collection. |
| [evaluate(pageFunction, args)](./puppeteer.jshandle.evaluate.md) | | Evaluates the given function with the current handle as its first argument. |
Expand Down
17 changes: 0 additions & 17 deletions docs/api/puppeteer.page._symbol.asyncdispose_.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/api/puppeteer.page._symbol.dispose_.md

This file was deleted.

6 changes: 1 addition & 5 deletions docs/api/puppeteer.page.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ One Browser instance might have multiple Page instances.
#### Signature:

```typescript
export declare abstract class Page extends EventEmitter<PageEvents> implements AsyncDisposable, Disposable
export declare abstract class Page extends EventEmitter<PageEvents>
```
**Extends:** [EventEmitter](./puppeteer.eventemitter.md)&lt;[PageEvents](./puppeteer.pageevents.md)&gt;
**Implements:** AsyncDisposable, Disposable
## Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Page` class.
Expand Down Expand Up @@ -78,8 +76,6 @@ page.off('request', logRequest);
| Method | Modifiers | Description |
| ---------------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [\[Symbol.asyncDispose\]()](./puppeteer.page._symbol.asyncdispose_.md) | | |
| [\[Symbol.dispose\]()](./puppeteer.page._symbol.dispose_.md) | | |
| [$(selector)](./puppeteer.page._.md) | | Runs <code>document.querySelector</code> within the page. If no element matches the selector, the return value resolves to <code>null</code>. |
| [$$(selector)](./puppeteer.page.__.md) | | The method runs <code>document.querySelectorAll</code> within the page. If no elements match the selector, the return value resolves to <code>[]</code>. |
| [$$eval(selector, pageFunction, args)](./puppeteer.page.__eval.md) | | This method runs <code>Array.from(document.querySelectorAll(selector))</code> within the page and passes the result as the first argument to the <code>pageFunction</code>. |
Expand Down

0 comments on commit 74165ef

Please sign in to comment.