type some of ExecutionContextDelegate
This commit is contained in:
parent
dcf92e4d2f
commit
18ddc1bd3f
|
|
@ -149,7 +149,7 @@ export class ExecutionContextDelegate implements js.ExecutionContextDelegate {
|
||||||
await releaseObject(this._client, toRemoteObject(handle));
|
await releaseObject(this._client, toRemoteObject(handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleJSONValue(handle: js.JSHandle): Promise<any> {
|
async handleJSONValue<T>(handle: js.JSHandle<T>): Promise<T> {
|
||||||
const remoteObject = toRemoteObject(handle);
|
const remoteObject = toRemoteObject(handle);
|
||||||
if (remoteObject.objectId) {
|
if (remoteObject.objectId) {
|
||||||
const response = await this._client.send('Runtime.callFunctionOn', {
|
const response = await this._client.send('Runtime.callFunctionOn', {
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ export class ExecutionContextDelegate implements js.ExecutionContextDelegate {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleJSONValue(handle: js.JSHandle): Promise<any> {
|
async handleJSONValue<T>(handle: js.JSHandle<T>): Promise<T> {
|
||||||
const payload = handle._remoteObject;
|
const payload = handle._remoteObject;
|
||||||
if (!payload.objectId)
|
if (!payload.objectId)
|
||||||
return deserializeValue(payload);
|
return deserializeValue(payload);
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export interface ExecutionContextDelegate {
|
||||||
getProperties(handle: JSHandle): Promise<Map<string, JSHandle>>;
|
getProperties(handle: JSHandle): Promise<Map<string, JSHandle>>;
|
||||||
releaseHandle(handle: JSHandle): Promise<void>;
|
releaseHandle(handle: JSHandle): Promise<void>;
|
||||||
handleToString(handle: JSHandle, includeType: boolean): string;
|
handleToString(handle: JSHandle, includeType: boolean): string;
|
||||||
handleJSONValue(handle: JSHandle): Promise<any>;
|
handleJSONValue<T>(handle: JSHandle<T>): Promise<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ExecutionContext {
|
export class ExecutionContext {
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ export class ExecutionContextDelegate implements js.ExecutionContextDelegate {
|
||||||
await releaseObject(this._session, toRemoteObject(handle));
|
await releaseObject(this._session, toRemoteObject(handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleJSONValue(handle: js.JSHandle): Promise<any> {
|
async handleJSONValue<T>(handle: js.JSHandle<T>): Promise<T> {
|
||||||
const remoteObject = toRemoteObject(handle);
|
const remoteObject = toRemoteObject(handle);
|
||||||
if (remoteObject.objectId) {
|
if (remoteObject.objectId) {
|
||||||
const response = await this._session.send('Runtime.callFunctionOn', {
|
const response = await this._session.send('Runtime.callFunctionOn', {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue