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

1.0.1 • Public • Published

Installation

npm install --save @types/react-elm-components

Summary

This package contains type definitions for react-elm-components (https://github.com/evancz/react-elm).

Details

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

import React = require("react");

interface Props {
    src: Elm.Elm18Node | Elm.Elm19Node;
    flags?: Record<string, any>;
    ports?: (ports: Elm.Ports) => void;
}

declare class Elm extends React.Component<Props> {}

declare namespace Elm {
    interface Elm18Node {
        embed: (node: HTMLElement, flags?: any) => any;
    }
    interface Elm19Node {
        init: ({ node, flags }: { node: HTMLElement; flags: any }) => any;
    }

    interface SenderPort<Data> {
        send: (data: Data) => void;
    }
    interface ReceiverPort<Value> {
        subscribe: (callback: (value: Value) => void) => void;
    }
    interface Ports {
        [x: string]: SenderPort<any> | ReceiverPort<any>;
    }
}

export = Elm;

Additional Details

  • Last updated: Tue, 16 Apr 2024 15:28:48 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Johannes Kvamme.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-elm-components

Weekly Downloads

12

Version

1.0.1

License

MIT

Unpacked Size

4.16 kB

Total Files

5

Last publish

Collaborators

  • types