From 9f198626f8a02e53b629739cc14b4f15fe2dcd23 Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Tue, 30 Jun 2020 15:56:37 +0100 Subject: [PATCH] chore(docs): mark JSHandle properties as internal (#6126) --- new-docs/puppeteer.jshandle._client.md | 11 ---------- new-docs/puppeteer.jshandle._constructor_.md | 22 -------------------- new-docs/puppeteer.jshandle._context.md | 11 ---------- new-docs/puppeteer.jshandle._disposed.md | 11 ---------- new-docs/puppeteer.jshandle._remoteobject.md | 11 ---------- new-docs/puppeteer.jshandle.md | 19 ++++------------- src/common/JSHandle.ts | 15 +++++++++++++ 7 files changed, 19 insertions(+), 81 deletions(-) delete mode 100644 new-docs/puppeteer.jshandle._client.md delete mode 100644 new-docs/puppeteer.jshandle._constructor_.md delete mode 100644 new-docs/puppeteer.jshandle._context.md delete mode 100644 new-docs/puppeteer.jshandle._disposed.md delete mode 100644 new-docs/puppeteer.jshandle._remoteobject.md diff --git a/new-docs/puppeteer.jshandle._client.md b/new-docs/puppeteer.jshandle._client.md deleted file mode 100644 index c3f8e5e99cd2c..0000000000000 --- a/new-docs/puppeteer.jshandle._client.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [JSHandle](./puppeteer.jshandle.md) > [\_client](./puppeteer.jshandle._client.md) - -## JSHandle.\_client property - -Signature: - -```typescript -_client: CDPSession; -``` diff --git a/new-docs/puppeteer.jshandle._constructor_.md b/new-docs/puppeteer.jshandle._constructor_.md deleted file mode 100644 index 5d8e00d0f1694..0000000000000 --- a/new-docs/puppeteer.jshandle._constructor_.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [JSHandle](./puppeteer.jshandle.md) > [(constructor)](./puppeteer.jshandle._constructor_.md) - -## JSHandle.(constructor) - -Constructs a new instance of the `JSHandle` class - -Signature: - -```typescript -constructor(context: ExecutionContext, client: CDPSession, remoteObject: Protocol.Runtime.RemoteObject); -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| context | [ExecutionContext](./puppeteer.executioncontext.md) | | -| client | [CDPSession](./puppeteer.cdpsession.md) | | -| remoteObject | Protocol.Runtime.RemoteObject | | - diff --git a/new-docs/puppeteer.jshandle._context.md b/new-docs/puppeteer.jshandle._context.md deleted file mode 100644 index 1fa562f89dc60..0000000000000 --- a/new-docs/puppeteer.jshandle._context.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [JSHandle](./puppeteer.jshandle.md) > [\_context](./puppeteer.jshandle._context.md) - -## JSHandle.\_context property - -Signature: - -```typescript -_context: ExecutionContext; -``` diff --git a/new-docs/puppeteer.jshandle._disposed.md b/new-docs/puppeteer.jshandle._disposed.md deleted file mode 100644 index 45c1a5d1c9f18..0000000000000 --- a/new-docs/puppeteer.jshandle._disposed.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [JSHandle](./puppeteer.jshandle.md) > [\_disposed](./puppeteer.jshandle._disposed.md) - -## JSHandle.\_disposed property - -Signature: - -```typescript -_disposed: boolean; -``` diff --git a/new-docs/puppeteer.jshandle._remoteobject.md b/new-docs/puppeteer.jshandle._remoteobject.md deleted file mode 100644 index 1c8613531ab90..0000000000000 --- a/new-docs/puppeteer.jshandle._remoteobject.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [JSHandle](./puppeteer.jshandle.md) > [\_remoteObject](./puppeteer.jshandle._remoteobject.md) - -## JSHandle.\_remoteObject property - -Signature: - -```typescript -_remoteObject: Protocol.Runtime.RemoteObject; -``` diff --git a/new-docs/puppeteer.jshandle.md b/new-docs/puppeteer.jshandle.md index 97ad93dd5e54d..e1e2b7906f3a1 100644 --- a/new-docs/puppeteer.jshandle.md +++ b/new-docs/puppeteer.jshandle.md @@ -12,6 +12,10 @@ Represents an in-page JavaScript object. JSHandles can be created with the [page export declare class JSHandle ``` +## 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. + ## Example @@ -23,21 +27,6 @@ JSHandle prevents the referenced JavaScript object from being garbage-collected JSHandle instances can be used as arguments for [Page.$eval()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(context, client, remoteObject)](./puppeteer.jshandle._constructor_.md) | | Constructs a new instance of the JSHandle class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [\_client](./puppeteer.jshandle._client.md) | | [CDPSession](./puppeteer.cdpsession.md) | | -| [\_context](./puppeteer.jshandle._context.md) | | [ExecutionContext](./puppeteer.executioncontext.md) | | -| [\_disposed](./puppeteer.jshandle._disposed.md) | | boolean | | -| [\_remoteObject](./puppeteer.jshandle._remoteobject.md) | | Protocol.Runtime.RemoteObject | | - ## Methods | Method | Modifiers | Description | diff --git a/src/common/JSHandle.ts b/src/common/JSHandle.ts index 7d37bf0a48053..2202d76ac0db9 100644 --- a/src/common/JSHandle.ts +++ b/src/common/JSHandle.ts @@ -100,11 +100,26 @@ export function createJSHandle( * @public */ export class JSHandle { + /** + * @internal + */ _context: ExecutionContext; + /** + * @internal + */ _client: CDPSession; + /** + * @internal + */ _remoteObject: Protocol.Runtime.RemoteObject; + /** + * @internal + */ _disposed = false; + /** + * @internal + */ constructor( context: ExecutionContext, client: CDPSession,