haxe-type

0.0.8 • Public • Published

Types implement of some Types

npm tests GitHub

An implementation of some types from haxe. This may be necessary for exchanges between JavaScript and Haxe without type loss.
Warning, all or part of the types presented here can be a partial implementation of the implemented type because I only implemented the bare minimum I needed.

Note
If you are looking for how to use it, you can look at some examples in the unit tests.

Types.List extends Array implement of haxe.ds.List

/* no custom constructor, variables or methods. */

Types.Bytes extends Uint8Array implement of haxe.io.Bytes

/* no custom constructor or variables. */

Methods

// returns the Bytes representation of the given String
static ofString(s: String): Bytes
// returns the `length`-bytes long string  stored at the given position `start`.
public getString(start: Int, length: Int): String
// returns a `String` representation of the bytes
public toString(): String

Types.IntMap extends Object implement of haxe.ds.IntMap

/* no custom variables or methods. */

Constructor

new Types.IntMap(obj: Object)

Types.StringMap extends Object implement of haxe.ds.StringMap

/* no custom variables or methods. */

Constructor

new Types.StringMap(obj: Object);

Types.Enum extends Array implement of Enum (Experimental)

/* no custom constructor or variables. */

Methods

// adds the enumeration to the default  resolver : `global.__enum__` in node and
// `window.__enum__` in the browser.
static resolve(): void
// return the enum name
public toString(): String

Types.Class implement of Class (Experimental)

/* no custom constructor or variables. */

Methods

// adds the  class to  the default  resolver :  `global.__class__`  in node  and
// `window.__class__` in the browser.
static resolve(): void

Readme

Keywords

Package Sidebar

Install

npm i haxe-type

Weekly Downloads

0

Version

0.0.8

License

MIT

Unpacked Size

13.4 kB

Total Files

18

Last publish

Collaborators

  • angelisium