UNPKG

@openfin/automation-helpers

Version:

Helper methods for automation testing in the OpenFin ecosystem

52 lines (51 loc) 2.37 kB
import type OpenFin from "@openfin/core"; /** * Methods for create a proxy to the OpenFin methods through async calls. */ export declare class OpenFinProxy { /** * Connections for the identities. */ private static readonly _connections; /** * Build a proxy for the given object. * @param objectName The name of the object. * @param notSupportedMethods Methods which are not supported through the proxy. * @param timeoutMs The timeout for the request. * @param intervalMs The amount of time between checks. * @returns The proxy object. */ static build<T>(objectName: string, notSupportedMethods: string[], timeoutMs?: number, intervalMs?: number): Promise<T | undefined>; /** * Access the fin object using executeAsync wrapped calls, not all methods are available. * @param identity The identity of the view to connect to, or undefined for the current window. * @param timeoutMs The timeout for the request. * @param intervalMs The amount of time between checks. * @returns The proxy fin object. */ static fin(identity?: OpenFin.Identity, timeoutMs?: number, intervalMs?: number): Promise<OpenFin.FinApi<"window" | "view"> | undefined>; /** * Access the fin object with with openfin adaptor, only the external connection APIs are available. * @param identity The identity of the view to connect to, or undefined for the current window. * @param timeoutMs The timeout for the request. * @param intervalMs The amount of time between checks. * @returns The proxy fin object. */ static finConnection(identity?: OpenFin.Identity, timeoutMs?: number, intervalMs?: number): Promise<OpenFin.FinApi<"external connection"> | undefined>; /** * Wait for an object to use as a proxy. * @param objectPath The name of the object to wait for. * @param timeoutMs The amount of time to wait for the object. * @param intervalMs The amount of time between checks. * @returns The object if it exists. */ private static waitForProxy; /** * Proxy the methods. * @param obj The obj to proxy. * @param parentName The parent object name. * @param notSupportedMethods Methods which are not supported through the proxy. * @returns The proxy object. */ private static proxyMethods; }