Skip to content

Instantly share code, notes, and snippets.

@pravdomil
Last active January 16, 2020 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pravdomil/dce521aebe721d79be592240ee51e6d9 to your computer and use it in GitHub Desktop.
Save pravdomil/dce521aebe721d79be592240ee51e6d9 to your computer and use it in GitHub Desktop.
...  
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