Fray Electron
    Preparing search index...

    Variable logHubConst

    logHub: {
        add(line: LogLine): void;
        addPage(requestId: number, page: LogLine[], isExhausted: boolean): void;
        removeProject(project: string): void;
        requestOlder(): void;
        reset(): void;
        resolveProject(openingTag: string, project: string): void;
        setSender(next: PageSender | null): void;
        snapshot(): { exhausted: boolean; lines: readonly LogLine[] };
        subscribe(listener: Listener): () => void;
    } = ...

    Shared renderer log cache, subscription, project-label, and history-request interface.

    Type Declaration

    • add: function
      • Adds one live Engine line and notifies subscribers.

        Parameters

        • line: LogLine

          Newly received log entry.

        Returns void

        Updates cache and synchronously notifies renderer listeners.

    • addPage: function
      • Accepts a matching global or project history-page response and merges its entries.

        Parameters

        • requestId: number

          Id of the outstanding page request.

        • page: LogLine[]

          Entries returned by the Engine.

        • isExhausted: boolean

          Whether no still-older entries exist.

        Returns void

        Advances the appropriate cursor, requests additional project pages if needed, and notifies listeners; stale responses are ignored.

    • removeProject: function
      • Drops a closed project's lines, including its session dividers, from the cache; they stay on disk.

        Parameters

        • project: string

          Stable project id.

        Returns void

        Removes cached lines, ignores later lines for the project until it opens again, cancels its history backfill, and notifies listeners.

    • requestOlder: function
      • Requests the next global history page and retries expired project backfills.

        Returns void

        Sends asynchronous Engine requests without waiting for responses.

    • reset: function
      • Clears cached state, sender, and subscribers; primarily used to isolate tests.

        Returns void

        Resets all module-level log-hub state.

    • resolveProject: function
      • Associates opening lines with their project and loads its history into the existing timeline.

        Parameters

        • openingTag: string

          Temporary tag supplied during project opening.

        • project: string

          Stable project id returned by the Engine.

        Returns void

        Relabels lines, resets global exhaustion and requests project history asynchronously.

    • setSender: function
      • Installs or clears the Engine page-request sender; an installed sender immediately requests older lines.

        Parameters

        • next: PageSender | null

          Sender function, or null when IPC is unavailable.

        Returns void

        May send one asynchronous request; never waits for a reply.

    • snapshot: function
      • Returns the current immutable-by-convention cache snapshot.

        Returns { exhausted: boolean; lines: readonly LogLine[] }

        Cached lines and whether older history is exhausted.

    • subscribe: function
      • Registers a synchronous change listener.

        Parameters

        • listener: Listener

          Callback invoked after cache updates.

        Returns () => void

        Unsubscribe function.