import { type LooseTarget, type KnownTarget, type TopLevelFrame, type MessengerMeta, type FrameTarget } from "./types.js"; /** * @file This file exists because `runtime.sendMessage` acts as a broadcast to * all open extension pages, so the receiver needs a way to figure out if the * message was intended for them. * * If the requested target only includes a `page` (URL), then it can be determined * immediately. If the target also specifies a tab, like `{tabId: 1, page: '/sidebar.html'}`, * then the receiving target needs to fetch the tab information via `__getTabData`. * * `__getTabData` is called automatically when `webext-messenger` is imported in * a context that requires this logic (most extension:// pages). * * If a broadcast message with `tabId` target is received before `__getTabData` is "received", * the message will be ignored and it can be retried. If `__getTabData` somehow fails, * the target will forever ignore any messages that require the `tabId`. In that case, * an error would be thrown once and will be visible in the console, uncaught. * * Content scripts do not use this logic at all at the moment because they're * always targeted via `tabId/frameId` combo and `tabs.sendMessage`. */ export declare const thisTarget: KnownTarget; declare let tabDataStatus: "needed" | "pending" | "received" | "not-needed" | "error"; export declare function getTabDataStatus(): typeof tabDataStatus; export declare function __getTabData(this: MessengerMeta): LooseTarget; export declare function getThisFrame(): Promise; export declare function getTopLevelFrame(): Promise; export declare function initPrivateApi(): void; export {};