Fray Electron
    Preparing search index...

    Variable layoutHubConst

    layoutHub: {
        announceActive(project: ActiveProject | null): void;
        announceRenamed(id: string, path: string): void;
        announceRequested(requested: HistoryRequested): void;
        announceRestored(restored: HistoryRestored): void;
        sendLayout(project: string, revision: number, layout: string): void;
        sendStep(
            project: string,
            direction: "undo" | "redo",
            fromRevision: number,
        ): void;
        setSender(next: LayoutSender | null): void;
        setStepSender(next: StepSender | null): void;
        subscribe(listener: ActiveListener): () => void;
        subscribeRenamed(listener: RenameListener): () => void;
        subscribeRequested(listener: RequestedListener): () => void;
        subscribeRestored(listener: RestoredListener): () => void;
    } = ...

    Synchronous renderer-process event hub between message handling and workspace state.

    Type Declaration

    • announceActive: function
      • Stores and broadcasts the active project, including a null close announcement.

        Parameters

        • project: ActiveProject | null

          Latest Engine-authoritative project state.

        Returns void

        Synchronously invokes subscribers; no process waits for listeners.

    • announceRenamed: function
      • Publishes a project rename and updates the cached active path for future replay.

        Parameters

        • id: string

          Stable project identity.

        • path: string

          New project path.

        Returns void

        Updates in-memory active state and synchronously invokes rename listeners.

    • announceRequested: function
      • Publishes an Engine request for revisions the renderer has retained.

        Parameters

        Returns void

        Synchronously invokes listeners; the Engine response is sent separately.

    • announceRestored: function
      • Publishes an Engine history-restoration result.

        Parameters

        • restored: HistoryRestored

          Restoration metadata and serialized document payload.

        Returns void

        Synchronously invokes listeners; no wait or IPC occurs here.

    • sendLayout: function
      • Forwards a serialized layout snapshot when a sender is installed.

        Parameters

        • project: string

          Stable project id.

        • revision: number

          Layout revision represented by the payload.

        • layout: string

          Serialized workspace document.

        Returns void

        Sends through the callback without waiting for Engine persistence.

    • sendStep: function
      • Forwards an undo/redo request if a sender is installed.

        Parameters

        • project: string

          Stable project id.

        • direction: "undo" | "redo"

          Requested history direction.

        • fromRevision: number

          Current revision the request is based on.

        Returns void

        Enqueues/sends through the installed callback; this hub does not wait for the Engine.

    • setSender: function
      • Installs or clears the callback used to send layout snapshots.

        Parameters

        • next: LayoutSender | null

          Sender, or null when messaging is unavailable.

        Returns void

    • setStepSender: function
      • Installs or clears the callback used to send undo/redo requests.

        Parameters

        • next: StepSender | null

          Sender, or null when messaging is unavailable.

        Returns void

    • subscribe: function
      • Subscribes to active-project updates and replays the latest announcement when available.

        Parameters

        • listener: ActiveListener

          Project callback.

        Returns () => void

        Unsubscribe function.

    • subscribeRenamed: function
      • Subscribes to project rename notifications.

        Parameters

        • listener: RenameListener

          Rename callback.

        Returns () => void

        Unsubscribe function.

    • subscribeRequested: function
      • Subscribes to Engine history-revision requests.

        Parameters

        • listener: RequestedListener

          Request callback.

        Returns () => void

        Unsubscribe function.

    • subscribeRestored: function
      • Subscribes to restored-history events.

        Parameters

        • listener: RestoredListener

          Restoration callback.

        Returns () => void

        Unsubscribe function.