author jdiaz5513
  import * as capnp from "capnp-ts" ; import { ObjectSize as __O , Struct as __S } from "capnp-ts" ; export const _id = "b597bf4897e54f89" ; export class AddressBook extends __S { static _capnp = { displayName : "AddressBook" , id : "" , size : new __O ( 0 , 1 ) } ; static People : capnp . ListCtor < Person > ; adoptPeople ( value ) { __S . adopt ( value , __S . getPointer ( 0 , this ) ) ; } disownPeople ( ) { return __S . disown ( this . getPeople ( ) ) ; } getPeople ( ) { return __S . getList ( 0 , AddressBook . People , this ) ; } hasPeople ( ) { return ! __S . isNull ( __S . getPointer ( 0 , this ) ) ; } initPeople ( length ) { return __S . initList ( 0 , AddressBook . People , length , this ) ; } setPeople ( value ) { __S . copyFrom ( value , __S . getPointer ( 0 , this ) ) ; } toString ( ) { return `AddressBook_${ super . toString ( ) }` ; } } declare namespace Person_PhoneNumber_Type { export const _displayName = "Type" ; export const _id = "98bef1051277b9df" ; } enum Person_PhoneNumber_Type { MOBILE = 0 , HOME = 1 , WORK = 2 } class Person_Employment extends __S { static readonly _capnp = { displayName : "Employment" , id : "927f49708287c3b6" , size : new __O ( 8 , 4 ) , } ; static UNEMPLOYED = 0 ; static EMPLOYER = 1 ; static SCHOOL = 2 ; static SELF_EMPLOYED = 3 ; _initGroup = ( ) => { __S . setUint16 ( 4 , 0 , this ) ; } ; getEmployer ( ) { __S . testWhich ( "employment" , this . which ( ) , 1 , this ) ; return __S . getText ( 3 , this ) ; } getSchool ( ) { __S . testWhich ( "employment" , this . which ( ) , 2 , this ) ; return __S . getText ( 3 , this ) ; } isEmployer ( ) { return this . which ( ) === 1 ; } isSchool ( ) { return this . which ( ) === 2 ; } isSelfEmployed ( ) { return this . which ( ) === 3 ; } isUnemployed ( ) { return this . which ( ) === 0 ; } hasEmployer ( ) { __S . testWhich ( "employment" , this . which ( ) , 1 , this ) ; return ! __S . isNull ( __S . getPointer ( 3 , this ) ) ; } hasSchool ( ) { __S . testWhich ( "employment" , this . which ( ) , 2 , this ) ; return ! __S . isNull ( __S . getPointer ( 3 , this ) ) ; } setEmployer ( value ) { __S . setUint16 ( 4 , 1 , this ) ; __S . setText ( 3 , value , this ) ; } setSchool ( value ) { __S . setUint16 ( 4 , 2 , this ) ; __S . setText ( 3 , value , this ) ; } setSelfEmployed ( ) { __S . setUint16 ( 4 , 3 , this ) ; } setUnemployed ( ) { __S . setUint16 ( 4 , 0 , this ) ; } toString ( ) { return `Person_Employment_${ super . toString ( ) }` ; } which ( ) { return __S . getUint16 ( 4 , this ) ; } } class Person_PhoneNumber extends __S { static readonly _capnp = { displayName : "PhoneNumber" , id : "cba8ed6b45001ccc" , size : new __O ( 2 , 1 ) , } ; static readonly Type = Person_PhoneNumber_Type ; getNumber ( ) { return __S . getText ( 0 , this ) ; } getType ( ) { return __S . getUint16 ( 0 , this ) ; } setNumber ( value ) { __S . setText ( 0 , value , this ) ; } setType ( value ) { __S . setUint16 ( 0 , value , this ) ; } toString ( ) { return `Person_PhoneNumber_${ super . toString ( ) }` ; } } export class Person extends __S { static readonly _capnp = { displayName : "Person" , id : "efbbc4e996f07104" , size : new __O ( 8 , 4 ) , } ; static readonly Employment = Person_Employment ; static readonly PhoneNumber = Person_PhoneNumber ; static Phones : capnp . ListCtor < Person_PhoneNumber > ; adoptPhones ( value ) { __S . adopt ( value , __S . getPointer ( 2 , this ) ) ; } disownPhones ( ) { return __S . disown ( this . getPhones ( ) ) ; } getEmail ( ) { return __S . getText ( 1 , this ) ; } getEmployment ( ) { return __S . getAs ( Person_Employment , this ) ; } getId ( ) { return __S . getUint32 ( 0 , this ) ; } getName ( ) { return __S . getText ( 0 , this ) ; } getPhones ( ) { return __S . getList ( 2 , Person . Phones , this ) ; } hasEmail ( ) { return ! __S . isNull ( __S . getPointer ( 1 , this ) ) ; } hasName ( ) { return ! __S . isNull ( __S . getPointer ( 0 , this ) ) ; } hasPhones ( ) { return ! __S . isNull ( __S . getPointer ( 2 , this ) ) ; } initEmployment ( ) { const e = this . getEmployment ( ) ; e . _initGroup ( ) ; return e ; } initPhones ( length ) { return __S . initList ( 2 , Person . Phones , length , this ) ; } setEmail ( value ) { __S . setText ( 1 , value , this ) ; } setId ( value ) { __S . setUint32 ( 0 , value , this ) ; } setName ( value ) { __S . setText ( 0 , value , this ) ; } setPhones ( value ) { __S . copyFrom ( value , __S . getPointer ( 2 , this ) ) ; } toString ( ) { return `Person_${ super . toString ( ) }` ; } } AddressBook . People = capnp . CompositeList ( Person ) ; Person . Phones = capnp . CompositeList ( Person_PhoneNumber ) ;