@types/elm
TypeScript icon, indicating that this package has built-in type declarations

0.19.4 • Public • Published

Installation

npm install --save @types/elm

Summary

This package contains type definitions for elm (http://elm-lang.org).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/elm.

type ElmInstance<
    P,
    F,
    Entrypoints extends string[] =
        // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
        ["Main"],
> = NestedEntrypoints<Entrypoints, P, F>;

type NestedEntrypoints<Entrypoints extends string[], P, F> = Entrypoints extends [
    infer First extends string,
    ...infer Rest extends string[],
] ? { [K in First]: NestedEntrypoints<Rest, P, F> }
    : ElmMain<P, F>;

interface ElmMain<P, F> {
    init(options?: { node?: Node | undefined; flags: F } | undefined): ElmApp<P>;
}

interface ElmApp<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;
}

Additional Details

  • Last updated: Tue, 06 May 2025 18:02:39 GMT
  • Dependencies: none

Credits

These definitions were written by Dénes Harmath, and Renan Vaz .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/elm

Weekly Downloads

1,334

Version

0.19.4

License

MIT

Unpacked Size

4.23 kB

Total Files

5

Last publish

Collaborators

  • types