@hazae41/jsonrpc 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/mods/rpc/ok.cjs.map +1 -1
- package/dist/cjs/mods/rpc/request.cjs.map +1 -1
- package/dist/cjs/mods/rpc/rpc.cjs.map +1 -1
- package/dist/esm/mods/rpc/ok.mjs.map +1 -1
- package/dist/esm/mods/rpc/request.mjs.map +1 -1
- package/dist/esm/mods/rpc/rpc.mjs.map +1 -1
- package/dist/types/mods/rpc/ok.d.ts +4 -9
- package/dist/types/mods/rpc/request.d.ts +11 -16
- package/dist/types/mods/rpc/response.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ok.cjs","sources":["../../../../src/mods/rpc/ok.ts"],"sourcesContent":["import { Ok } from \"@hazae41/result\"\nimport { RpcId } from \"./request.js\"\n\nexport type RpcOkInit<T = unknown> =\n undefined extends T
|
|
1
|
+
{"version":3,"file":"ok.cjs","sources":["../../../../src/mods/rpc/ok.ts"],"sourcesContent":["import { Ok } from \"@hazae41/result\"\nimport { RpcId } from \"./request.js\"\n\nexport type RpcOkInit<T = unknown> =\n | (undefined extends T ? RpcResultlessOkInit : never)\n | RpcResultfulOkInit<T>\n\nexport interface RpcResultfulOkInit<T = unknown> {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n readonly result: T\n}\n\nexport interface RpcResultlessOkInit {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n}\n\nexport namespace RpcOkInit {\n\n export function from<T>(response: RpcOk<T>): RpcOkInit<T> {\n return response.toJSON()\n }\n\n}\n\nexport class RpcOk<T = unknown> extends Ok<T> {\n readonly jsonrpc = \"2.0\"\n\n constructor(\n readonly id: RpcId,\n readonly result: T\n ) {\n super(result)\n }\n\n static from<T>(init: RpcOkInit<T>): RpcOk<T>\n\n static from<T>(init: RpcResultfulOkInit<T>) {\n return new RpcOk(init.id, init.result)\n }\n\n static rewrap<T extends Ok.Infer<T>>(id: RpcId, result: T) {\n return new RpcOk(id, result.inner)\n }\n\n toJSON(): RpcOkInit<T> {\n const { jsonrpc, id, result } = this\n return { jsonrpc, id, result } as const\n }\n\n}\n"],"names":["RpcOkInit","Ok"],"mappings":";;;;AAkBiBA,2BAMhB;AAND,CAAA,UAAiB,SAAS,EAAA;IAExB,SAAgB,IAAI,CAAI,QAAkB,EAAA;AACxC,QAAA,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAA;KACzB;AAFe,IAAA,SAAA,CAAA,IAAI,OAEnB,CAAA;AAEH,CAAC,EANgBA,iBAAS,KAATA,iBAAS,GAMzB,EAAA,CAAA,CAAA,CAAA;AAEK,MAAO,KAAmB,SAAQC,SAAK,CAAA;AAIhC,IAAA,EAAA,CAAA;AACA,IAAA,MAAA,CAAA;IAJF,OAAO,GAAG,KAAK,CAAA;IAExB,WACW,CAAA,EAAS,EACT,MAAS,EAAA;QAElB,KAAK,CAAC,MAAM,CAAC,CAAA;QAHJ,IAAE,CAAA,EAAA,GAAF,EAAE,CAAO;QACT,IAAM,CAAA,MAAA,GAAN,MAAM,CAAG;KAGnB;IAID,OAAO,IAAI,CAAI,IAA2B,EAAA;QACxC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;KACvC;AAED,IAAA,OAAO,MAAM,CAAwB,EAAS,EAAE,MAAS,EAAA;QACvD,OAAO,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;KACnC;IAED,MAAM,GAAA;QACJ,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;AACpC,QAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAW,CAAA;KACxC;AAEF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.cjs","sources":["../../../../src/mods/rpc/request.ts"],"sourcesContent":["export type RpcId = number | string | null\n\nexport type RpcRequestPreinit<T = unknown> =\n undefined extends T
|
|
1
|
+
{"version":3,"file":"request.cjs","sources":["../../../../src/mods/rpc/request.ts"],"sourcesContent":["export type RpcId = number | string | null\n\nexport type RpcRequestPreinit<T = unknown> =\n | (undefined extends T ? RpcParamlessRequestPreinit : never)\n | RpcParamfulRequestPreinit<T>\n\nexport interface RpcParamfulRequestPreinit<T = unknown> {\n readonly id?: RpcId\n readonly method: string,\n readonly params: T\n}\n\nexport interface RpcParamlessRequestPreinit {\n readonly id?: RpcId\n readonly method: string\n}\n\nexport type RpcRequestInit<T = unknown> =\n | (undefined extends T ? RpcParamlessRequestInit : never)\n | RpcParamfulRequestInit<T>\n\nexport interface RpcParamfulRequestInit<T = unknown> {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n readonly method: string\n readonly params: T\n}\n\nexport interface RpcParamlessRequestInit {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n readonly method: string\n}\n\nexport class RpcRequest<T = unknown> {\n readonly jsonrpc = \"2.0\" as const\n\n constructor(\n readonly id: RpcId,\n readonly method: string,\n readonly params: T\n ) { }\n\n static from<T>(init: RpcRequestInit<T>): RpcRequest<T>\n\n static from<T>(init: RpcParamfulRequestInit<T>) {\n const { id, method, params } = init\n return new RpcRequest(id, method, params)\n }\n\n toJSON(): RpcRequestInit<T> {\n const { jsonrpc, id, method, params } = this\n return { jsonrpc, id, method, params } as const\n }\n\n}"],"names":[],"mappings":";;MAkCa,UAAU,CAAA;AAIV,IAAA,EAAA,CAAA;AACA,IAAA,MAAA,CAAA;AACA,IAAA,MAAA,CAAA;IALF,OAAO,GAAG,KAAc,CAAA;AAEjC,IAAA,WAAA,CACW,EAAS,EACT,MAAc,EACd,MAAS,EAAA;QAFT,IAAE,CAAA,EAAA,GAAF,EAAE,CAAO;QACT,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAM,CAAA,MAAA,GAAN,MAAM,CAAG;KACf;IAIL,OAAO,IAAI,CAAI,IAA+B,EAAA;QAC5C,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QACnC,OAAO,IAAI,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAC1C;IAED,MAAM,GAAA;QACJ,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QAC5C,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAW,CAAA;KAChD;AAEF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.cjs","sources":["../../../../src/mods/rpc/rpc.ts"],"sourcesContent":["import { RpcRequest, RpcRequestPreinit } from \"./request.js\"\n\nexport class RpcCounter {\n\n id = 0\n\n prepare<T>(init: RpcRequestPreinit<T>): RpcRequest<T> {\n const { id = this.id++, method, params } = init\n return new RpcRequest(id, method, params)\n }\n\n}\n"],"names":["RpcRequest"],"mappings":";;;;MAEa,UAAU,CAAA;IAErB,EAAE,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"rpc.cjs","sources":["../../../../src/mods/rpc/rpc.ts"],"sourcesContent":["import { RpcParamfulRequestPreinit, RpcRequest, RpcRequestPreinit } from \"./request.js\"\n\nexport class RpcCounter {\n\n id = 0\n\n prepare<T>(init: RpcRequestPreinit<T>): RpcRequest<T>\n\n prepare<T>(init: RpcParamfulRequestPreinit<T>): RpcRequest<T> {\n const { id = this.id++, method, params } = init\n return new RpcRequest(id, method, params)\n }\n\n}\n"],"names":["RpcRequest"],"mappings":";;;;MAEa,UAAU,CAAA;IAErB,EAAE,GAAG,CAAC,CAAA;AAIN,IAAA,OAAO,CAAI,IAAkC,EAAA;AAC3C,QAAA,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QAC/C,OAAO,IAAIA,kBAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAC1C;AAEF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ok.mjs","sources":["../../../../src/mods/rpc/ok.ts"],"sourcesContent":["import { Ok } from \"@hazae41/result\"\nimport { RpcId } from \"./request.js\"\n\nexport type RpcOkInit<T = unknown> =\n undefined extends T
|
|
1
|
+
{"version":3,"file":"ok.mjs","sources":["../../../../src/mods/rpc/ok.ts"],"sourcesContent":["import { Ok } from \"@hazae41/result\"\nimport { RpcId } from \"./request.js\"\n\nexport type RpcOkInit<T = unknown> =\n | (undefined extends T ? RpcResultlessOkInit : never)\n | RpcResultfulOkInit<T>\n\nexport interface RpcResultfulOkInit<T = unknown> {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n readonly result: T\n}\n\nexport interface RpcResultlessOkInit {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n}\n\nexport namespace RpcOkInit {\n\n export function from<T>(response: RpcOk<T>): RpcOkInit<T> {\n return response.toJSON()\n }\n\n}\n\nexport class RpcOk<T = unknown> extends Ok<T> {\n readonly jsonrpc = \"2.0\"\n\n constructor(\n readonly id: RpcId,\n readonly result: T\n ) {\n super(result)\n }\n\n static from<T>(init: RpcOkInit<T>): RpcOk<T>\n\n static from<T>(init: RpcResultfulOkInit<T>) {\n return new RpcOk(init.id, init.result)\n }\n\n static rewrap<T extends Ok.Infer<T>>(id: RpcId, result: T) {\n return new RpcOk(id, result.inner)\n }\n\n toJSON(): RpcOkInit<T> {\n const { jsonrpc, id, result } = this\n return { jsonrpc, id, result } as const\n }\n\n}\n"],"names":[],"mappings":";;AAkBM,IAAW,UAMhB;AAND,CAAA,UAAiB,SAAS,EAAA;IAExB,SAAgB,IAAI,CAAI,QAAkB,EAAA;AACxC,QAAA,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAA;KACzB;AAFe,IAAA,SAAA,CAAA,IAAI,OAEnB,CAAA;AAEH,CAAC,EANgB,SAAS,KAAT,SAAS,GAMzB,EAAA,CAAA,CAAA,CAAA;AAEK,MAAO,KAAmB,SAAQ,EAAK,CAAA;AAIhC,IAAA,EAAA,CAAA;AACA,IAAA,MAAA,CAAA;IAJF,OAAO,GAAG,KAAK,CAAA;IAExB,WACW,CAAA,EAAS,EACT,MAAS,EAAA;QAElB,KAAK,CAAC,MAAM,CAAC,CAAA;QAHJ,IAAE,CAAA,EAAA,GAAF,EAAE,CAAO;QACT,IAAM,CAAA,MAAA,GAAN,MAAM,CAAG;KAGnB;IAID,OAAO,IAAI,CAAI,IAA2B,EAAA;QACxC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;KACvC;AAED,IAAA,OAAO,MAAM,CAAwB,EAAS,EAAE,MAAS,EAAA;QACvD,OAAO,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;KACnC;IAED,MAAM,GAAA;QACJ,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;AACpC,QAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAW,CAAA;KACxC;AAEF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.mjs","sources":["../../../../src/mods/rpc/request.ts"],"sourcesContent":["export type RpcId = number | string | null\n\nexport type RpcRequestPreinit<T = unknown> =\n undefined extends T
|
|
1
|
+
{"version":3,"file":"request.mjs","sources":["../../../../src/mods/rpc/request.ts"],"sourcesContent":["export type RpcId = number | string | null\n\nexport type RpcRequestPreinit<T = unknown> =\n | (undefined extends T ? RpcParamlessRequestPreinit : never)\n | RpcParamfulRequestPreinit<T>\n\nexport interface RpcParamfulRequestPreinit<T = unknown> {\n readonly id?: RpcId\n readonly method: string,\n readonly params: T\n}\n\nexport interface RpcParamlessRequestPreinit {\n readonly id?: RpcId\n readonly method: string\n}\n\nexport type RpcRequestInit<T = unknown> =\n | (undefined extends T ? RpcParamlessRequestInit : never)\n | RpcParamfulRequestInit<T>\n\nexport interface RpcParamfulRequestInit<T = unknown> {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n readonly method: string\n readonly params: T\n}\n\nexport interface RpcParamlessRequestInit {\n readonly jsonrpc: \"2.0\"\n readonly id: RpcId\n readonly method: string\n}\n\nexport class RpcRequest<T = unknown> {\n readonly jsonrpc = \"2.0\" as const\n\n constructor(\n readonly id: RpcId,\n readonly method: string,\n readonly params: T\n ) { }\n\n static from<T>(init: RpcRequestInit<T>): RpcRequest<T>\n\n static from<T>(init: RpcParamfulRequestInit<T>) {\n const { id, method, params } = init\n return new RpcRequest(id, method, params)\n }\n\n toJSON(): RpcRequestInit<T> {\n const { jsonrpc, id, method, params } = this\n return { jsonrpc, id, method, params } as const\n }\n\n}"],"names":[],"mappings":"MAkCa,UAAU,CAAA;AAIV,IAAA,EAAA,CAAA;AACA,IAAA,MAAA,CAAA;AACA,IAAA,MAAA,CAAA;IALF,OAAO,GAAG,KAAc,CAAA;AAEjC,IAAA,WAAA,CACW,EAAS,EACT,MAAc,EACd,MAAS,EAAA;QAFT,IAAE,CAAA,EAAA,GAAF,EAAE,CAAO;QACT,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAM,CAAA,MAAA,GAAN,MAAM,CAAG;KACf;IAIL,OAAO,IAAI,CAAI,IAA+B,EAAA;QAC5C,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QACnC,OAAO,IAAI,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAC1C;IAED,MAAM,GAAA;QACJ,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QAC5C,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAW,CAAA;KAChD;AAEF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.mjs","sources":["../../../../src/mods/rpc/rpc.ts"],"sourcesContent":["import { RpcRequest, RpcRequestPreinit } from \"./request.js\"\n\nexport class RpcCounter {\n\n id = 0\n\n prepare<T>(init: RpcRequestPreinit<T>): RpcRequest<T> {\n const { id = this.id++, method, params } = init\n return new RpcRequest(id, method, params)\n }\n\n}\n"],"names":[],"mappings":";;MAEa,UAAU,CAAA;IAErB,EAAE,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"rpc.mjs","sources":["../../../../src/mods/rpc/rpc.ts"],"sourcesContent":["import { RpcParamfulRequestPreinit, RpcRequest, RpcRequestPreinit } from \"./request.js\"\n\nexport class RpcCounter {\n\n id = 0\n\n prepare<T>(init: RpcRequestPreinit<T>): RpcRequest<T>\n\n prepare<T>(init: RpcParamfulRequestPreinit<T>): RpcRequest<T> {\n const { id = this.id++, method, params } = init\n return new RpcRequest(id, method, params)\n }\n\n}\n"],"names":[],"mappings":";;MAEa,UAAU,CAAA;IAErB,EAAE,GAAG,CAAC,CAAA;AAIN,IAAA,OAAO,CAAI,IAAkC,EAAA;AAC3C,QAAA,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QAC/C,OAAO,IAAI,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAC1C;AAEF;;;;"}
|
|
@@ -6,12 +6,11 @@ interface RpcResultfulOkInit<T = unknown> {
|
|
|
6
6
|
readonly id: RpcId;
|
|
7
7
|
readonly result: T;
|
|
8
8
|
}
|
|
9
|
-
interface RpcResultlessOkInit
|
|
9
|
+
interface RpcResultlessOkInit {
|
|
10
10
|
readonly jsonrpc: "2.0";
|
|
11
11
|
readonly id: RpcId;
|
|
12
|
-
readonly result?: T;
|
|
13
12
|
}
|
|
14
|
-
type RpcOkInit<T = unknown> = undefined extends T ? RpcResultlessOkInit
|
|
13
|
+
type RpcOkInit<T = unknown> = (undefined extends T ? RpcResultlessOkInit : never) | RpcResultfulOkInit<T>;
|
|
15
14
|
declare namespace RpcOkInit {
|
|
16
15
|
function from<T>(response: RpcOk<T>): RpcOkInit<T>;
|
|
17
16
|
}
|
|
@@ -20,13 +19,9 @@ declare class RpcOk<T = unknown> extends Ok<T> {
|
|
|
20
19
|
readonly result: T;
|
|
21
20
|
readonly jsonrpc = "2.0";
|
|
22
21
|
constructor(id: RpcId, result: T);
|
|
23
|
-
static from<T>(init: RpcOkInit<T>): RpcOk<T
|
|
22
|
+
static from<T>(init: RpcOkInit<T>): RpcOk<T>;
|
|
24
23
|
static rewrap<T extends Ok.Infer<T>>(id: RpcId, result: T): RpcOk<Ok.Inner<T>>;
|
|
25
|
-
toJSON():
|
|
26
|
-
readonly jsonrpc: "2.0";
|
|
27
|
-
readonly id: RpcId;
|
|
28
|
-
readonly result: T;
|
|
29
|
-
};
|
|
24
|
+
toJSON(): RpcOkInit<T>;
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
export { RpcOk, RpcOkInit, type RpcResultfulOkInit, type RpcResultlessOkInit };
|
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
type RpcId = number | string | null;
|
|
2
|
-
type RpcRequestPreinit<T = unknown> = undefined extends T ? RpcParamlessRequestPreinit
|
|
2
|
+
type RpcRequestPreinit<T = unknown> = (undefined extends T ? RpcParamlessRequestPreinit : never) | RpcParamfulRequestPreinit<T>;
|
|
3
3
|
interface RpcParamfulRequestPreinit<T = unknown> {
|
|
4
4
|
readonly id?: RpcId;
|
|
5
5
|
readonly method: string;
|
|
6
6
|
readonly params: T;
|
|
7
7
|
}
|
|
8
|
-
interface RpcParamlessRequestPreinit
|
|
8
|
+
interface RpcParamlessRequestPreinit {
|
|
9
9
|
readonly id?: RpcId;
|
|
10
10
|
readonly method: string;
|
|
11
|
-
readonly params?: T;
|
|
12
11
|
}
|
|
13
|
-
type RpcRequestInit<T = unknown> = undefined extends T ? RpcParamlessRequestInit
|
|
12
|
+
type RpcRequestInit<T = unknown> = (undefined extends T ? RpcParamlessRequestInit : never) | RpcParamfulRequestInit<T>;
|
|
14
13
|
interface RpcParamfulRequestInit<T = unknown> {
|
|
14
|
+
readonly jsonrpc: "2.0";
|
|
15
15
|
readonly id: RpcId;
|
|
16
16
|
readonly method: string;
|
|
17
|
-
readonly params:
|
|
17
|
+
readonly params: T;
|
|
18
18
|
}
|
|
19
|
-
interface RpcParamlessRequestInit
|
|
19
|
+
interface RpcParamlessRequestInit {
|
|
20
|
+
readonly jsonrpc: "2.0";
|
|
20
21
|
readonly id: RpcId;
|
|
21
22
|
readonly method: string;
|
|
22
|
-
readonly params?: T;
|
|
23
23
|
}
|
|
24
24
|
declare class RpcRequest<T = unknown> {
|
|
25
25
|
readonly id: RpcId;
|
|
26
26
|
readonly method: string;
|
|
27
|
-
readonly params
|
|
27
|
+
readonly params: T;
|
|
28
28
|
readonly jsonrpc: "2.0";
|
|
29
|
-
constructor(id: RpcId, method: string, params
|
|
30
|
-
static from<T>(init: RpcRequestInit<T>): RpcRequest<T
|
|
31
|
-
toJSON():
|
|
32
|
-
readonly jsonrpc: "2.0";
|
|
33
|
-
readonly id: RpcId;
|
|
34
|
-
readonly method: string;
|
|
35
|
-
readonly params: T | undefined;
|
|
36
|
-
};
|
|
29
|
+
constructor(id: RpcId, method: string, params: T);
|
|
30
|
+
static from<T>(init: RpcRequestInit<T>): RpcRequest<T>;
|
|
31
|
+
toJSON(): RpcRequestInit<T>;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
export { type RpcId, type RpcParamfulRequestInit, type RpcParamfulRequestPreinit, type RpcParamlessRequestInit, type RpcParamlessRequestPreinit, RpcRequest, type RpcRequestInit, type RpcRequestPreinit };
|
|
@@ -6,7 +6,7 @@ import { RpcId } from './request.js';
|
|
|
6
6
|
type RpcResponseInit<T = unknown> = RpcOkInit<T> | RpcErrInit;
|
|
7
7
|
type RpcResponse<T = unknown> = RpcOk<T> | RpcErr;
|
|
8
8
|
declare namespace RpcResponse {
|
|
9
|
-
function from<T>(init: RpcResponseInit<T>): RpcErr | RpcOk<T
|
|
9
|
+
function from<T>(init: RpcResponseInit<T>): RpcErr | RpcOk<T>;
|
|
10
10
|
function rewrap<T extends Ok.Infer<T>>(id: RpcId, result: T): RpcOk<Ok.Inner<T>>;
|
|
11
11
|
function rewrap<T extends Err.Infer<T>>(id: RpcId, result: T): RpcErr;
|
|
12
12
|
function rewrap<T extends Result.Infer<T>>(id: RpcId, result: T): RpcResponse<Ok.Inner<T>>;
|
package/package.json
CHANGED