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));
|
||||
}
|
||||
|
||||
async handleJSONValue(handle: js.JSHandle): Promise<any> {
|
||||
async handleJSONValue<T>(handle: js.JSHandle<T>): Promise<T> {
|
||||
const remoteObject = toRemoteObject(handle);
|
||||
if (remoteObject.objectId) {
|
||||
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;
|
||||
if (!payload.objectId)
|
||||
return deserializeValue(payload);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export interface ExecutionContextDelegate {
|
|||
getProperties(handle: JSHandle): Promise<Map<string, JSHandle>>;
|
||||
releaseHandle(handle: JSHandle): Promise<void>;
|
||||
handleToString(handle: JSHandle, includeType: boolean): string;
|
||||
handleJSONValue(handle: JSHandle): Promise<any>;
|
||||
handleJSONValue<T>(handle: JSHandle<T>): Promise<T>;
|
||||
}
|
||||
|
||||
export class ExecutionContext {
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ export class ExecutionContextDelegate implements js.ExecutionContextDelegate {
|
|||
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);
|
||||
if (remoteObject.objectId) {
|
||||
const response = await this._session.send('Runtime.callFunctionOn', {
|
||||
|
|
|
|||
Loading…
Reference in a new issue