import { HostAppAPI } from '../../types'; export type ConnectToHostAppResult = { api: HostAppAPI; initialState?: string; }; /** * Connects to the Fusion host and returns the API along with any initial state * provided by the host. * * @example * ```typescript * import { connectToHostApp } from '@cognite/app-sdk'; * * const { api, initialState } = await connectToHostApp(); * api.getProject().then(project => { * console.log(project); * }); * ``` * * @privateRemarks * This function is used to connect to the Fusion host and return the API. * It's meant to be used in the custom app to get the API to interact with the * Fusion host. * * It will generate a unique handshake ID and send a ready signal to the Fusion * host. It will then wait for the bridge port to be exposed by the Fusion host * and return the API. * * @returns a promise that resolves to the API and optional initial state. */ export declare const connectToHostApp: (meta?: { applicationName?: string; }) => Promise; /** * Resets the module level variables to their initial values. It's meant to * be used in tests. * * DO NOT USE IN PRODUCTION CODE! * * @internal */ export declare const test_resetConnectionForTesting: () => void;