@koine/api 1.0.21 → 1.0.24
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/package.json +4 -4
- package/typings.d.ts +7 -4
package/package.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"typings": "./index.d.ts",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@koine/utils": "1.0.24",
|
|
8
9
|
"next": "^12.1.6",
|
|
9
10
|
"swr": "^2.0.0-beta.3",
|
|
10
11
|
"tslib": "^2.4.0"
|
|
11
12
|
},
|
|
12
|
-
"
|
|
13
|
-
"version": "1.0.21",
|
|
13
|
+
"version": "1.0.24",
|
|
14
14
|
"module": "./index.js",
|
|
15
15
|
"types": "./index.d.ts"
|
|
16
16
|
}
|
package/typings.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ declare namespace Koine.Api {
|
|
|
51
51
|
endpoint: TEndpoint,
|
|
52
52
|
options?: TOptions
|
|
53
53
|
// ) => Promise<EndpointResponse<TEndpoints, TEndpoint, TMethod>>;
|
|
54
|
-
) => Promise<
|
|
54
|
+
) => Promise<Result<TSuccesfull, TFailed>>;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* The `api` interface generated by `createApi`
|
|
@@ -104,14 +104,14 @@ declare namespace Koine.Api {
|
|
|
104
104
|
TEndpoints extends Endpoints,
|
|
105
105
|
TEndpoint extends EndpointUrl<TEndpoints>,
|
|
106
106
|
TMethod extends RequestMethod
|
|
107
|
-
> =
|
|
107
|
+
> = Result<
|
|
108
108
|
EndpointResponseOk<TEndpoints, TEndpoint, TMethod>,
|
|
109
109
|
EndpointResponseFail<TEndpoints, TEndpoint, TMethod>
|
|
110
110
|
>;
|
|
111
111
|
|
|
112
112
|
//////////////////////////////////////////////////////////////////////////////
|
|
113
113
|
//
|
|
114
|
-
//
|
|
114
|
+
// Definitions
|
|
115
115
|
//
|
|
116
116
|
//////////////////////////////////////////////////////////////////////////////
|
|
117
117
|
|
|
@@ -274,7 +274,10 @@ declare namespace Koine.Api {
|
|
|
274
274
|
data: TResponse;
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
-
type Result<
|
|
277
|
+
type Result<
|
|
278
|
+
TResponseOk extends ResponseOk,
|
|
279
|
+
TResponseFail extends ResponseFail
|
|
280
|
+
> =
|
|
278
281
|
// FIXME: without the type duplication below the following two lines do not
|
|
279
282
|
// work as they do not narrow the type when checking for the boolean values
|
|
280
283
|
// truthiness
|