mirror of
https://github.com/hanzoai/zap-es.git
synced 2026-10-30 18:17:07 +00:00
233 lines
6.7 KiB
JavaScript
233 lines
6.7 KiB
JavaScript
// Generated by capnpc-ts (0.7.0)
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Person =
|
|
exports.Person_Employment =
|
|
exports.Person_Employment_Which =
|
|
exports.Person_PhoneNumber =
|
|
exports.Person_PhoneNumber_Type =
|
|
exports.AddressBook =
|
|
exports._capnpFileId =
|
|
void 0;
|
|
/**
|
|
* This file has been automatically generated by the [capnpc-ts utility](https://github.com/jdiaz5513/capnp-ts).
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
const capnp = require("capnp-ts");
|
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
const capnp_ts_1 = require("capnp-ts");
|
|
exports._capnpFileId = 0xb5_97_bf_48_97_e5_4f_89n;
|
|
class AddressBook extends capnp_ts_1.Struct {
|
|
adoptPeople(value) {
|
|
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(0, this));
|
|
}
|
|
disownPeople() {
|
|
return capnp_ts_1.Struct.disown(this.getPeople());
|
|
}
|
|
getPeople() {
|
|
return capnp_ts_1.Struct.getList(0, AddressBook._People, this);
|
|
}
|
|
hasPeople() {
|
|
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(0, this));
|
|
}
|
|
initPeople(length) {
|
|
return capnp_ts_1.Struct.initList(0, AddressBook._People, length, this);
|
|
}
|
|
setPeople(value) {
|
|
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(0, this));
|
|
}
|
|
toString() {
|
|
return "AddressBook_" + super.toString();
|
|
}
|
|
}
|
|
exports.AddressBook = AddressBook;
|
|
AddressBook._capnp = {
|
|
displayName: "AddressBook",
|
|
id: "f724540a01e98224",
|
|
size: new capnp_ts_1.ObjectSize(0, 1),
|
|
};
|
|
var Person_PhoneNumber_Type;
|
|
(function (Person_PhoneNumber_Type) {
|
|
Person_PhoneNumber_Type[(Person_PhoneNumber_Type["MOBILE"] = 0)] = "MOBILE";
|
|
Person_PhoneNumber_Type[(Person_PhoneNumber_Type["HOME"] = 1)] = "HOME";
|
|
Person_PhoneNumber_Type[(Person_PhoneNumber_Type["WORK"] = 2)] = "WORK";
|
|
})(
|
|
(Person_PhoneNumber_Type =
|
|
exports.Person_PhoneNumber_Type || (exports.Person_PhoneNumber_Type = {})),
|
|
);
|
|
class Person_PhoneNumber extends capnp_ts_1.Struct {
|
|
getNumber() {
|
|
return capnp_ts_1.Struct.getText(0, this);
|
|
}
|
|
setNumber(value) {
|
|
capnp_ts_1.Struct.setText(0, value, this);
|
|
}
|
|
getType() {
|
|
return capnp_ts_1.Struct.getUint16(0, this);
|
|
}
|
|
setType(value) {
|
|
capnp_ts_1.Struct.setUint16(0, value, this);
|
|
}
|
|
toString() {
|
|
return "Person_PhoneNumber_" + super.toString();
|
|
}
|
|
}
|
|
exports.Person_PhoneNumber = Person_PhoneNumber;
|
|
Person_PhoneNumber.Type = Person_PhoneNumber_Type;
|
|
Person_PhoneNumber._capnp = {
|
|
displayName: "PhoneNumber",
|
|
id: "cba8ed6b45001ccc",
|
|
size: new capnp_ts_1.ObjectSize(8, 1),
|
|
};
|
|
var Person_Employment_Which;
|
|
(function (Person_Employment_Which) {
|
|
Person_Employment_Which[(Person_Employment_Which["EMPLOYER"] = 1)] =
|
|
"EMPLOYER";
|
|
Person_Employment_Which[(Person_Employment_Which["SCHOOL"] = 2)] = "SCHOOL";
|
|
Person_Employment_Which[(Person_Employment_Which["UNEMPLOYED"] = 0)] =
|
|
"UNEMPLOYED";
|
|
Person_Employment_Which[(Person_Employment_Which["SELF_EMPLOYED"] = 3)] =
|
|
"SELF_EMPLOYED";
|
|
})(
|
|
(Person_Employment_Which =
|
|
exports.Person_Employment_Which || (exports.Person_Employment_Which = {})),
|
|
);
|
|
class Person_Employment extends capnp_ts_1.Struct {
|
|
getEmployer() {
|
|
capnp_ts_1.Struct.testWhich(
|
|
"employer",
|
|
capnp_ts_1.Struct.getUint16(6, this),
|
|
1,
|
|
this,
|
|
);
|
|
return capnp_ts_1.Struct.getText(3, this);
|
|
}
|
|
isEmployer() {
|
|
return capnp_ts_1.Struct.getUint16(6, this) === 1;
|
|
}
|
|
setEmployer(value) {
|
|
capnp_ts_1.Struct.setUint16(6, 1, this);
|
|
capnp_ts_1.Struct.setText(3, value, this);
|
|
}
|
|
getSchool() {
|
|
capnp_ts_1.Struct.testWhich(
|
|
"school",
|
|
capnp_ts_1.Struct.getUint16(6, this),
|
|
2,
|
|
this,
|
|
);
|
|
return capnp_ts_1.Struct.getText(3, this);
|
|
}
|
|
isSchool() {
|
|
return capnp_ts_1.Struct.getUint16(6, this) === 2;
|
|
}
|
|
setSchool(value) {
|
|
capnp_ts_1.Struct.setUint16(6, 2, this);
|
|
capnp_ts_1.Struct.setText(3, value, this);
|
|
}
|
|
getUnemployed() {
|
|
capnp_ts_1.Struct.testWhich(
|
|
"unemployed",
|
|
capnp_ts_1.Struct.getUint16(6, this),
|
|
0,
|
|
this,
|
|
);
|
|
return capnp_ts_1.Struct.getBit(32, this);
|
|
}
|
|
isUnemployed() {
|
|
return capnp_ts_1.Struct.getUint16(6, this) === 0;
|
|
}
|
|
setUnemployed(value) {
|
|
capnp_ts_1.Struct.setUint16(6, 0, this);
|
|
capnp_ts_1.Struct.setBit(32, value, this);
|
|
}
|
|
getSelfEmployed() {
|
|
capnp_ts_1.Struct.testWhich(
|
|
"selfEmployed",
|
|
capnp_ts_1.Struct.getUint16(6, this),
|
|
3,
|
|
this,
|
|
);
|
|
return capnp_ts_1.Struct.getBit(32, this);
|
|
}
|
|
isSelfEmployed() {
|
|
return capnp_ts_1.Struct.getUint16(6, this) === 3;
|
|
}
|
|
setSelfEmployed(value) {
|
|
capnp_ts_1.Struct.setUint16(6, 3, this);
|
|
capnp_ts_1.Struct.setBit(32, value, this);
|
|
}
|
|
toString() {
|
|
return "Person_Employment_" + super.toString();
|
|
}
|
|
which() {
|
|
return capnp_ts_1.Struct.getUint16(6, this);
|
|
}
|
|
}
|
|
exports.Person_Employment = Person_Employment;
|
|
Person_Employment.EMPLOYER = Person_Employment_Which.EMPLOYER;
|
|
Person_Employment.SCHOOL = Person_Employment_Which.SCHOOL;
|
|
Person_Employment.UNEMPLOYED = Person_Employment_Which.UNEMPLOYED;
|
|
Person_Employment.SELF_EMPLOYED = Person_Employment_Which.SELF_EMPLOYED;
|
|
Person_Employment._capnp = {
|
|
displayName: "employment",
|
|
id: "927f49708287c3b6",
|
|
size: new capnp_ts_1.ObjectSize(8, 4),
|
|
};
|
|
class Person extends capnp_ts_1.Struct {
|
|
getId() {
|
|
return capnp_ts_1.Struct.getUint32(0, this);
|
|
}
|
|
setId(value) {
|
|
capnp_ts_1.Struct.setUint32(0, value, this);
|
|
}
|
|
getName() {
|
|
return capnp_ts_1.Struct.getText(0, this);
|
|
}
|
|
setName(value) {
|
|
capnp_ts_1.Struct.setText(0, value, this);
|
|
}
|
|
getEmail() {
|
|
return capnp_ts_1.Struct.getText(1, this);
|
|
}
|
|
setEmail(value) {
|
|
capnp_ts_1.Struct.setText(1, value, this);
|
|
}
|
|
adoptPhones(value) {
|
|
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(2, this));
|
|
}
|
|
disownPhones() {
|
|
return capnp_ts_1.Struct.disown(this.getPhones());
|
|
}
|
|
getPhones() {
|
|
return capnp_ts_1.Struct.getList(2, Person._Phones, this);
|
|
}
|
|
hasPhones() {
|
|
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(2, this));
|
|
}
|
|
initPhones(length) {
|
|
return capnp_ts_1.Struct.initList(2, Person._Phones, length, this);
|
|
}
|
|
setPhones(value) {
|
|
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(2, this));
|
|
}
|
|
getEmployment() {
|
|
return capnp_ts_1.Struct.getAs(Person_Employment, this);
|
|
}
|
|
initEmployment() {
|
|
return capnp_ts_1.Struct.getAs(Person_Employment, this);
|
|
}
|
|
toString() {
|
|
return "Person_" + super.toString();
|
|
}
|
|
}
|
|
exports.Person = Person;
|
|
Person.PhoneNumber = Person_PhoneNumber;
|
|
Person._capnp = {
|
|
displayName: "Person",
|
|
id: "efbbc4e996f07104",
|
|
size: new capnp_ts_1.ObjectSize(8, 4),
|
|
};
|
|
AddressBook._People = capnp.CompositeList(Person);
|
|
Person._Phones = capnp.CompositeList(Person_PhoneNumber);
|