nirum
nirum copied to clipboard
TypeScript target
- [ ] unboxed type
- [ ] builtin types
- [ ] runtime
- [ ] Map
- [ ] Set
- [ ] List
- [ ] runtime
- [ ] type alias
- [ ] enum type
- [ ] record type
- [ ] union type
- [ ] service client
- [ ] type definition
- [ ] flow
- [ ] typescript
Type definitions can be separately generated through custom libdef (for Flow) or .d.ts (for Typescript).
wip
class Offset { // float64
constructor(value) {
this.value = value;
}
toJSON() {
return this.value.toJSON ? this.value.toJSON() : this.value;
}
static fromJSON(jsonObject) {
return new Offset(jsonObject);
}
eq(other) {
return other instanceof Offset &&
this.value === other.value;
}
}
class Payload {
constructor({left}) {
this.left = left;
}
toJSON() {
return {
_type: 'payload',
left: this.left.toJSON()
};
}
static fromJSON() {
//
}
}
// tood
class Map {
constructor() {
this.
}
get(key) {
//
}
set(key, value) {
//
}
has() {
//
}
}