Files
zeekay e73f0edb86 rename @hanzo/zap-web → @zap-proto/web; depend on @zap-proto/zap ^0.1.0
Aligns with the zap-proto org canonical naming. No code changes;
import paths flipped, dep entry renamed, alias updated.
2026-06-15 15:28:58 -07:00

69 lines
1.8 KiB
TypeScript

// Code generated by zapgen --target=ts; DO NOT EDIT.
// source: echo.zap
import { Builder, Message, StructView } from "@zap-proto/zap";
const echoArgsOff = {
Msg: 0,
} as const;
const echoArgsSize = 8;
/** Zero-copy view into a ZAP-encoded EchoArgs message. */
export class EchoArgs extends StructView {
/** Parse `b` and return a typed view. Throws on a wire-level check failure (magic, version, size). */
static wrap(b: Uint8Array): EchoArgs {
const root = Message.parse(b).root();
return new EchoArgs(root.data, root.offset);
}
get msg(): string {
return this.text(echoArgsOff.Msg);
}
}
/** Field values for newEchoArgs. */
export interface EchoArgsInput {
msg: string;
}
/** Build a ZAP-encoded EchoArgs message from `in` and return the bytes. */
export function newEchoArgs(in_: EchoArgsInput): Uint8Array {
const b = new Builder(256);
const ob = b.startObject(echoArgsSize);
ob.setText(echoArgsOff.Msg, in_.msg);
ob.finishAsRoot();
return b.finish();
}
const echoResultOff = {
Msg: 0,
} as const;
const echoResultSize = 8;
/** Zero-copy view into a ZAP-encoded EchoResult message. */
export class EchoResult extends StructView {
/** Parse `b` and return a typed view. Throws on a wire-level check failure (magic, version, size). */
static wrap(b: Uint8Array): EchoResult {
const root = Message.parse(b).root();
return new EchoResult(root.data, root.offset);
}
get msg(): string {
return this.text(echoResultOff.Msg);
}
}
/** Field values for newEchoResult. */
export interface EchoResultInput {
msg: string;
}
/** Build a ZAP-encoded EchoResult message from `in` and return the bytes. */
export function newEchoResult(in_: EchoResultInput): Uint8Array {
const b = new Builder(256);
const ob = b.startObject(echoResultSize);
ob.setText(echoResultOff.Msg, in_.msg);
ob.finishAsRoot();
return b.finish();
}