Skip to content

Instantly share code, notes, and snippets.

@jtlapp
Last active April 2, 2022 17:40
Show Gist options
  • Save jtlapp/3b44de677f56f5dec299cdeefc9207db to your computer and use it in GitHub Desktop.
Save jtlapp/3b44de677f56f5dec299cdeefc9207db to your computer and use it in GitHub Desktop.
Type definition of ElectronMainApi
export type PublicProperty<P> = P extends `_${string}`
? never
: (P extends `#${string}` ? never : P);
export type ElectronMainApi<T> = {
[K in PublicProperty<keyof T>]: (...args: any[]) => Promise<any>;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment