Fray Electron
    Preparing search index...

    Function createMessageHandler

    • Builds renderer-side protocol actions and dispatches incoming Engine/main messages.

      Parameters

      • send: (frame: Uint8Array) => void

        Transfers encoded frames to the IPC router.

      • setStatus: (status: string) => void

        Reports user-visible protocol/transport errors.

      • OptionalshowPrompt: (options: PromptOptions) => void

        Optional UI callback for incoming prompt requests.

      • windowId: number = 0

        Renderer instance ID.

      • syncProjectState: boolean = true

        Whether this window requests project state.

      Returns {
          bindProjectActions: (
              bridge: FrayBridge,
              platform: string,
              notify: (options: NotificationOptions) => void,
          ) => () => void;
          cancelPending: (reason: string) => void;
          closeProject: (packageProject: boolean, targetProject?: string) => void;
          createProject: (path: string, choice: number) => string;
          onMessage: (incoming: IncomingMessage<Uint8Array<ArrayBufferLike>>) => void;
          onPeerReady: (kind: number, id: number) => void;
          onReady: () => void;
          requestPrompt: (options: Omit<PromptOptions, "onResponse">) => string;
          sendApplicationPreference: (change: ApplicationPreferenceChange) => void;
          sendApplicationStyle: (operation: ButtonStyleOperation) => void;
          sendHistoryStep: (
              project: string,
              direction: "undo" | "redo",
              fromRevision: number,
          ) => void;
          sendLayout: (project: string, revision: number, layout: string) => void;
          sendLog: (level: string, text: string) => void;
          sendLogPage: (request: LogPageRequest) => void;
          sendNotification: (report: NotificationReport) => void;
          sendProjectPreference: (
              id: string,
              change?: ProjectPreferenceChange,
          ) => void;
          takePromptResult: (requestId: string) => PromptResult | undefined;
      }

      Message actions and event handlers used by renderer components.