IFClite TypeScript API
    Preparing search index...

    Test helpers for hosts and panels: a scriptable viewer and transcript matching.

    interface FakeViewer {
        connected: boolean;
        log: unknown[];
        origin: string;
        window: WindowLike;
        close(): void;
        emit<T extends keyof EventPayloads>(
            type: T,
            payload: EventPayloads[T],
        ): void;
        offer(): {
            data: ViewerOffer;
            origin: string;
            ports: PortLike[];
            source: unknown;
        };
    }
    Index
    connected: boolean
    log: unknown[]

    Everything that reached the fake, in order: hellos, requests, byes, and { dropped } posts.

    origin: string
    window: WindowLike

    Pass as viewer to connectViewer. Posts to any other origin are dropped and counted in log.

    • Say bye and close the connection.

      Returns void

    • Make a panel offer: returns the window message to dispatch to the panel's window (it carries the port).

      Returns { data: ViewerOffer; origin: string; ports: PortLike[]; source: unknown }