|
1 |
| -import * as $ from "../serialization"; |
| 1 | +import * as $ from ".."; |
2 | 2 | export const _capnpFileId = BigInt("0xb8630836983feed7");
|
| 3 | +/** |
| 4 | + * Schema for member of an enum. |
| 5 | + * */ |
3 | 6 | export class Persistent_SaveParams extends $.Struct {
|
4 | 7 | static readonly _capnp = {
|
5 | 8 | displayName: "SaveParams",
|
@@ -50,9 +53,74 @@ export class Persistent_SaveResults extends $.Struct {
|
50 | 53 | return "Persistent_SaveResults_" + super.toString();
|
51 | 54 | }
|
52 | 55 | }
|
53 |
| -export class Persistent extends $.Struct { |
| 56 | +export class Persistent_SaveResults$Promise { |
| 57 | + pipeline: $.Pipeline<any, any, Persistent_SaveResults>; |
| 58 | + constructor(pipeline: $.Pipeline<any, any, Persistent_SaveResults>) { |
| 59 | + this.pipeline = pipeline; |
| 60 | + } |
| 61 | + async promise(): Promise<Persistent_SaveResults> { |
| 62 | + return await this.pipeline.struct(); |
| 63 | + } |
| 64 | +} |
| 65 | +export class Persistent$Client { |
| 66 | + client: $.Client; |
| 67 | + static readonly interfaceId: bigint = BigInt("0xc8cb212fcd9f5691"); |
| 68 | + constructor(client: $.Client) { |
| 69 | + this.client = client; |
| 70 | + } |
| 71 | + static readonly methods: [ |
| 72 | + $.Method<Persistent_SaveParams, Persistent_SaveResults>, |
| 73 | + ] = [ |
| 74 | + { |
| 75 | + ParamsClass: Persistent_SaveParams, |
| 76 | + ResultsClass: Persistent_SaveResults, |
| 77 | + interfaceId: Persistent$Client.interfaceId, |
| 78 | + methodId: 0, |
| 79 | + interfaceName: "src/capnp/_capnp/persistent.capnp:Persistent", |
| 80 | + methodName: "save", |
| 81 | + }, |
| 82 | + ]; |
| 83 | + save( |
| 84 | + paramsFunc?: (params: Persistent_SaveParams) => void, |
| 85 | + ): Persistent_SaveResults$Promise { |
| 86 | + const answer = this.client.call({ |
| 87 | + method: Persistent$Client.methods[0], |
| 88 | + paramsFunc: paramsFunc, |
| 89 | + }); |
| 90 | + const pipeline = new $.Pipeline(Persistent_SaveResults, answer); |
| 91 | + return new Persistent_SaveResults$Promise(pipeline); |
| 92 | + } |
| 93 | +} |
| 94 | +$.Registry.register(Persistent$Client.interfaceId, Persistent$Client); |
| 95 | +export interface Persistent$Server$Target { |
| 96 | + save( |
| 97 | + params: Persistent_SaveParams, |
| 98 | + results: Persistent_SaveResults, |
| 99 | + ): Promise<void>; |
| 100 | +} |
| 101 | +export class Persistent$Server extends $.Server { |
| 102 | + readonly target: Persistent$Server$Target; |
| 103 | + constructor(target: Persistent$Server$Target) { |
| 104 | + super(target, [ |
| 105 | + { |
| 106 | + ...Persistent$Client.methods[0], |
| 107 | + impl: target.save, |
| 108 | + }, |
| 109 | + ]); |
| 110 | + this.target = target; |
| 111 | + } |
| 112 | + client(): Persistent$Client { |
| 113 | + return new Persistent$Client(this); |
| 114 | + } |
| 115 | +} |
| 116 | +/** |
| 117 | + * A group. |
| 118 | + * */ |
| 119 | +export class Persistent extends $.Interface { |
54 | 120 | static readonly SaveParams = Persistent_SaveParams;
|
55 | 121 | static readonly SaveResults = Persistent_SaveResults;
|
| 122 | + static readonly Client = Persistent$Client; |
| 123 | + static readonly Server = Persistent$Server; |
56 | 124 | static readonly _capnp = {
|
57 | 125 | displayName: "Persistent",
|
58 | 126 | id: "c8cb212fcd9f5691",
|
|
0 commit comments