Last active
January 16, 2020 15:39
-
-
Save pravdomil/dce521aebe721d79be592240ee51e6d9 to your computer and use it in GitHub Desktop.
...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare const Elm: Elm | |
interface Elm { | |
Main: AppConstructor<unknown, { port1: SubscribePort<unknown>; port2: SendPort<unknown> }> | |
} | |
interface AppConstructor<Flags, Ports> { | |
init(options: { node?: HTMLElement; flags: Flags }): { ports: Ports } | |
} | |
interface SendPort<A> { | |
send(value: A): void | |
} | |
interface SubscribePort<A> { | |
subscribe(callback: (value: A) => void): void | |
unsubscribe(callback: (value: A) => void): void | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment