/// <reference types="chrome" />
type AllowCleanUpFunction = void | (() => void);
/**
 * Creates a port and recreates a new port if the old one disconnects
 *
 * @param createPort - function to create a port
 * @param onConnect - callback when connected
 */
export declare function autoConnect(createPort: () => chrome.runtime.Port, onConnect: (port: chrome.runtime.Port) => AllowCleanUpFunction): Promise<void>;
/**
 * Reconnects a port if it disconnects
 * @param port - port to reconnect
 * @param createPort - function to create a port
 * @param onConnect - callback when connected
 */
export declare function autoReconnect(port: chrome.runtime.Port, createPort: () => chrome.runtime.Port, onReconnect: (port: chrome.runtime.Port) => AllowCleanUpFunction): void;
export {};
//# sourceMappingURL=chrome.d.ts.map