Files

258 lines
8.0 KiB
TypeScript

// This file has been automatically generated by zap-es.
import * as $ from "zap-es";
export const _zapFileId = 0xbba26a2caa3411e8n;
export class HashFactory_NewSha1$Params extends $.Struct {
static readonly _zap = {
displayName: "newSha1$Params",
id: "82994ca98e892c55",
size: new $.ObjectSize(0, 0),
};
toString(): string { return "HashFactory_NewSha1$Params_" + super.toString(); }
}
export class HashFactory_NewSha1$Results extends $.Struct {
static readonly _zap = {
displayName: "newSha1$Results",
id: "9ad1223357407533",
size: new $.ObjectSize(0, 1),
};
get hash(): Hash$Client {
return new Hash$Client($.utils.getInterfaceClientOrNullAt(0, this));
}
set hash(value: Hash$Client) {
$.utils.setInterfacePointer(this.segment.message.addCap(value.client), $.utils.getPointer(0, this));
}
toString(): string { return "HashFactory_NewSha1$Results_" + super.toString(); }
}
export class HashFactory_NewSha1$Results$Promise {
pipeline: $.Pipeline<any, any, HashFactory_NewSha1$Results>;
constructor(pipeline: $.Pipeline<any, any, HashFactory_NewSha1$Results>) {
this.pipeline = pipeline;
}
getHash(): Hash$Client {
return new Hash$Client(this.pipeline.getPipeline(Hash, 0).client());
}
async promise(): Promise<HashFactory_NewSha1$Results> {
return await this.pipeline.struct();
}
}
export class HashFactory$Client {
client: $.Client;
static readonly interfaceId: bigint = 0xcb1e6205ea21d707n;
constructor(client: $.Client) {
this.client = client;
}
static readonly methods: [
$.Method<HashFactory_NewSha1$Params, HashFactory_NewSha1$Results>
] = [
{
ParamsClass: HashFactory_NewSha1$Params,
ResultsClass: HashFactory_NewSha1$Results,
interfaceId: HashFactory$Client.interfaceId,
methodId: 0,
interfaceName: "test/fixtures/hash-factory.zap:HashFactory",
methodName: "newSha1"
}
];
newSha1(paramsFunc?: (params: HashFactory_NewSha1$Params) => void): HashFactory_NewSha1$Results$Promise {
const answer = this.client.call({
method: HashFactory$Client.methods[0],
paramsFunc: paramsFunc
});
const pipeline = new $.Pipeline(HashFactory_NewSha1$Results, answer);
return new HashFactory_NewSha1$Results$Promise(pipeline);
}
}
$.Registry.register(HashFactory$Client.interfaceId, HashFactory$Client);
export interface HashFactory$Server$Target {
newSha1(params: HashFactory_NewSha1$Params, results: HashFactory_NewSha1$Results): Promise<void>;
}
export class HashFactory$Server extends $.Server {
readonly target: HashFactory$Server$Target;
constructor(target: HashFactory$Server$Target) {
super(target, [
{
...HashFactory$Client.methods[0],
impl: target.newSha1
}
]);
this.target = target;
}
client(): HashFactory$Client {
return new HashFactory$Client(this);
}
}
export class HashFactory extends $.Interface {
static readonly Client = HashFactory$Client;
static readonly Server = HashFactory$Server;
static readonly _zap = {
displayName: "HashFactory",
id: "cb1e6205ea21d707",
size: new $.ObjectSize(0, 0),
};
toString(): string { return "HashFactory_" + super.toString(); }
}
export class Hash_Write$Params extends $.Struct {
static readonly _zap = {
displayName: "write$Params",
id: "f65501e064be5175",
size: new $.ObjectSize(0, 1),
};
_adoptData(value: $.Orphan<$.Data>): void {
$.utils.adopt(value, $.utils.getPointer(0, this));
}
_disownData(): $.Orphan<$.Data> {
return $.utils.disown(this.data);
}
get data(): $.Data {
return $.utils.getData(0, this);
}
_hasData(): boolean {
return !$.utils.isNull($.utils.getPointer(0, this));
}
_initData(length: number): $.Data {
return $.utils.initData(0, length, this);
}
set data(value: $.Data) {
$.utils.copyFrom(value, $.utils.getPointer(0, this));
}
toString(): string { return "Hash_Write$Params_" + super.toString(); }
}
export class Hash_Write$Results extends $.Struct {
static readonly _zap = {
displayName: "write$Results",
id: "dffb54fe160f874c",
size: new $.ObjectSize(0, 0),
};
toString(): string { return "Hash_Write$Results_" + super.toString(); }
}
export class Hash_Write$Results$Promise {
pipeline: $.Pipeline<any, any, Hash_Write$Results>;
constructor(pipeline: $.Pipeline<any, any, Hash_Write$Results>) {
this.pipeline = pipeline;
}
async promise(): Promise<Hash_Write$Results> {
return await this.pipeline.struct();
}
}
export class Hash_Sum$Params extends $.Struct {
static readonly _zap = {
displayName: "sum$Params",
id: "b494960a8116663b",
size: new $.ObjectSize(0, 0),
};
toString(): string { return "Hash_Sum$Params_" + super.toString(); }
}
export class Hash_Sum$Results extends $.Struct {
static readonly _zap = {
displayName: "sum$Results",
id: "e9098d3e3e6517b0",
size: new $.ObjectSize(0, 1),
};
_adoptHash(value: $.Orphan<$.Data>): void {
$.utils.adopt(value, $.utils.getPointer(0, this));
}
_disownHash(): $.Orphan<$.Data> {
return $.utils.disown(this.hash);
}
get hash(): $.Data {
return $.utils.getData(0, this);
}
_hasHash(): boolean {
return !$.utils.isNull($.utils.getPointer(0, this));
}
_initHash(length: number): $.Data {
return $.utils.initData(0, length, this);
}
set hash(value: $.Data) {
$.utils.copyFrom(value, $.utils.getPointer(0, this));
}
toString(): string { return "Hash_Sum$Results_" + super.toString(); }
}
export class Hash_Sum$Results$Promise {
pipeline: $.Pipeline<any, any, Hash_Sum$Results>;
constructor(pipeline: $.Pipeline<any, any, Hash_Sum$Results>) {
this.pipeline = pipeline;
}
async promise(): Promise<Hash_Sum$Results> {
return await this.pipeline.struct();
}
}
export class Hash$Client {
client: $.Client;
static readonly interfaceId: bigint = 0xe9620cda4245af9an;
constructor(client: $.Client) {
this.client = client;
}
static readonly methods: [
$.Method<Hash_Write$Params, Hash_Write$Results>,
$.Method<Hash_Sum$Params, Hash_Sum$Results>
] = [
{
ParamsClass: Hash_Write$Params,
ResultsClass: Hash_Write$Results,
interfaceId: Hash$Client.interfaceId,
methodId: 0,
interfaceName: "test/fixtures/hash-factory.zap:Hash",
methodName: "write"
},
{
ParamsClass: Hash_Sum$Params,
ResultsClass: Hash_Sum$Results,
interfaceId: Hash$Client.interfaceId,
methodId: 1,
interfaceName: "test/fixtures/hash-factory.zap:Hash",
methodName: "sum"
}
];
write(paramsFunc?: (params: Hash_Write$Params) => void): Hash_Write$Results$Promise {
const answer = this.client.call({
method: Hash$Client.methods[0],
paramsFunc: paramsFunc
});
const pipeline = new $.Pipeline(Hash_Write$Results, answer);
return new Hash_Write$Results$Promise(pipeline);
}
sum(paramsFunc?: (params: Hash_Sum$Params) => void): Hash_Sum$Results$Promise {
const answer = this.client.call({
method: Hash$Client.methods[1],
paramsFunc: paramsFunc
});
const pipeline = new $.Pipeline(Hash_Sum$Results, answer);
return new Hash_Sum$Results$Promise(pipeline);
}
}
$.Registry.register(Hash$Client.interfaceId, Hash$Client);
export interface Hash$Server$Target {
write(params: Hash_Write$Params, results: Hash_Write$Results): Promise<void>;
sum(params: Hash_Sum$Params, results: Hash_Sum$Results): Promise<void>;
}
export class Hash$Server extends $.Server {
readonly target: Hash$Server$Target;
constructor(target: Hash$Server$Target) {
super(target, [
{
...Hash$Client.methods[0],
impl: target.write
},
{
...Hash$Client.methods[1],
impl: target.sum
}
]);
this.target = target;
}
client(): Hash$Client {
return new Hash$Client(this);
}
}
export class Hash extends $.Interface {
static readonly Client = Hash$Client;
static readonly Server = Hash$Server;
static readonly _zap = {
displayName: "Hash",
id: "e9620cda4245af9a",
size: new $.ObjectSize(0, 0),
};
toString(): string { return "Hash_" + super.toString(); }
}