mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
28 lines
731 B
TypeScript
28 lines
731 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/borisyankov/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;
|
||
} |