Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.1 KB
Raw Blame
// Generated by dts-bundle-generator v8.1.2

import { AnyTRPCRouter, inferRouterContext } from "@trpc/server";
import { BrowserWindow, IpcMainInvokeEvent } from "electron";

export declare const ELECTRON_TRPC_CHANNEL = "trpc-electron";
export interface CreateContextOptions {
  event: IpcMainInvokeEvent;
}
export type MaybePromise<TType> = Promise<TType> | TType;
declare class IPCHandler<TRouter extends AnyTRPCRouter> {
  constructor({
    createContext,
    router,
    windows,
  }: {
    createContext?: (
      opts: CreateContextOptions,
    ) => MaybePromise<inferRouterContext<TRouter>>;
    router: TRouter;
    windows?: BrowserWindow[];
  });
  attachWindow(win: BrowserWindow): void;
  detachWindow(win: BrowserWindow, webContentsId?: number): void;
}
export declare const createIPCHandler: <TRouter extends AnyTRPCRouter>({
  createContext,
  router,
  windows,
}: {
  createContext?: (
    opts: CreateContextOptions,
  ) => Promise<inferRouterContext<TRouter>>;
  router: TRouter;
  windows?: Electron.BrowserWindow[];
}) => IPCHandler<TRouter>;
export declare const exposeElectronTRPC: () => void;