sindresorhus/electron-better-ipc

Better Typescript Support

オープン

#45 opened on 2022/07/20

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (53 件のフォーク)user submission
enhancementhelp wanted

Repository metrics

Stars
 (744 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

It'd be lovely if this library came with excellent Typescript support, where one can define which "ipc methods" actually exist. Like being able to say

type MainIpc = {
  "get-emoji"(name: string): string;
};

Then doing a bit to annotate the IPC with said types, like const ipc: SafeMainProcessIpc<MainIpc, RendererIpc> = ipcMain;

After that, one could have excellent autocomplete and Typescript errors if something doesn't add up. image

コントリビューターガイド