mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-21 00:02:50 +00:00
29 lines
735 B
TypeScript
29 lines
735 B
TypeScript
// Type definitions for Elm 0.12
|
|
// Project: http://elm-lang.org
|
|
// Definitions by: Dénes Harmath <https://github.com/thSoft>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare var Elm: Elm;
|
|
|
|
interface Elm {
|
|
embed<P>(elmModule: ElmModule<P>, element: Node, initialValues?: Object): ElmComponent<P>;
|
|
fullscreen<P>(elmModule: ElmModule<P>, initialValues?: Object): ElmComponent<P>;
|
|
worker<P>(elmModule: ElmModule<P>, initialValues?: Object): ElmComponent<P>;
|
|
}
|
|
|
|
interface ElmModule<P> {
|
|
}
|
|
|
|
interface ElmComponent<P> {
|
|
ports: P;
|
|
}
|
|
|
|
interface PortToElm<V> {
|
|
send(value: V): void;
|
|
}
|
|
|
|
interface PortFromElm<V> {
|
|
subscribe(handler: (value: V) => void): void;
|
|
unsubscribe(handler: (value: V) => void): void;
|
|
}
|