@seam-rpc/core 5.2.0 → 5.4.0

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +6 -7
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,13 +1,12 @@
1
- export type Result<Data, Error extends ApiError<any, any> | undefined = undefined> = Error extends undefined ? {
1
+ export type Ok<T> = {
2
2
  ok: true;
3
- data: Data;
4
- } : {
5
- ok: true;
6
- data: Data;
7
- } | {
3
+ data: T;
4
+ };
5
+ export type Err<E extends ApiError<any, any> = ApiError<any, any>> = {
8
6
  ok: false;
9
- error: Error;
7
+ error: E;
10
8
  };
9
+ export type Result<T, E extends ApiError<any, any> = never> = Ok<T> | Err<E>;
11
10
  export type ResError = {
12
11
  isApiError: false;
13
12
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seam-rpc/core",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",