Skip to content

jslba/haxe-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
/* 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

About

An implementation of some Haxe Type.

Resources

License

Stars

Watchers

Forks

Packages

No packages published