Skip to content

Commit

Permalink
Merge branch 'types' of https://github.com/hadeeb/eiphop into hadeeb-…
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
shivekkhurana committed Apr 19, 2019
2 parents 8a239dd + c2f52fa commit ed01fc1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Electron from "electron";

declare namespace EipHop {
export interface RequestObject<Payload> {
payload: Payload;
}

export interface ResponseObject<Response, Error> {
send: (response?: Response) => void;
error: (error?: Error) => void;
}

export interface Action<Payload = any, Response = any, Error = any> {
(
request: RequestObject<Payload>,
response: ResponseObject<Response, Error>
): void;
}

export interface Actions {
[x: string]: Action;
}
}

export const setupMainHandler: (
electronModule: typeof Electron,
actions: EipHop.Actions,
enableLogs?: boolean
) => void;

export const setupFrontendListener: (electronModule: typeof Electron) => void;

export const emit: <Response = any>(
action: string,
payload?: any
) => Promise<Response>;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"repository": "[email protected]:krimlabs/eiphop.git",
"author": "Shivek Khurana <[email protected]>",
"main": "lib/index.js",
"types": "index.d.ts",
"license": "MIT",
"scripts": {
"build": "rm -rf lib && babel src -d lib"
Expand Down

0 comments on commit ed01fc1

Please sign in to comment.