import { Session } from "../lib/session"; import { EvaluateResultException, EvaluateResultSuccess } from "./evaluateResult"; import { ReferenceValue, RemoteValue } from "./protocolValue"; import { RealmInfo } from "./realmInfo"; type AnyFunction = (...args: any[]) => any; type ReferenceValueJSON = ReturnType; declare class ScriptManager { constructor(driver: Session); _driver: Session; init(browsingContextId: string): Promise; disownRealmScript(realmId: string, handles: string[]): Promise; disownBrowsingContextScript( browsingContextId: string, handles: string[], sandbox?: boolean | null, ): Promise; callFunctionInRealm( realmId: string, functionDeclaration: FUNC, awaitPromise: boolean, argumentValueList?: ReferenceValue[] | null, thisParameter?: any, resultOwnership?: any, ): Promise>>> | EvaluateResultException>; callFunctionInBrowsingContext( browsingContextId: string, functionDeclaration: FUNC, awaitPromise: boolean, argumentValueList?: ReferenceValue[] | null, thisParameter?: any, resultOwnership?: any, sandbox?: boolean | null, ): Promise>>> | EvaluateResultException>; evaluateFunctionInRealm( realmId: string, expression: string, awaitPromise: boolean, resultOwnership?: any, ): Promise>>> | EvaluateResultException>; evaluateFunctionInBrowsingContext( browsingContextId: string, expression: string, awaitPromise: boolean, resultOwnership?: any, sandbox?: boolean | null, ): Promise>>> | EvaluateResultException>; addPreloadScript( functionDeclaration: (...args: any) => any, argumentValueList?: ReferenceValue[] | null, sandbox?: boolean | null, ): Promise; removePreloadScript(script: string): Promise; getCallFunctionParams( targetType: string, id: string, sandbox: boolean | null, functionDeclaration: FUNC, awaitPromise: boolean, argumentValueList?: ReferenceValue[] | null, thisParameter?: any, resultOwnership?: any, ): { target: { context?: string; realm?: string; sandbox?: boolean }; functionDeclaration: FUNC; awaitPromise: boolean; arguments: ReferenceValueJSON[]; this: any; resultOwnership: any; }; getEvaluateParams( targetType: string, id: string, sandbox: boolean | null, expression: string, awaitPromise: boolean, resultOwnership?: any, ): { target: { context?: string; realm?: string; sandbox?: boolean; }; expression: string; awaitPromise: boolean; resultOwnership?: any; }; createEvaluateResult( response: { result: EvaluateResultSuccess | EvaluateResultException }, ): EvaluateResultSuccess | EvaluateResultException; realmInfoMapper(realms: any[]): RealmInfo[]; getAllRealms(): Promise; getRealmsByType(type: string): RealmInfo[]; getRealmsInBrowsingContext(browsingContext: any): Promise; getRealmsInBrowsingContextByType(browsingContext: any, type: string): Promise; } declare function getScriptManagerInstance(browsingContextId: string, driver: Session): ScriptManager; export = getScriptManagerInstance;