exupery-core-types 0.3.49 → 0.3.50
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/Query_Result.d.ts +12 -10
- package/package.json +1 -1
package/dist/Query_Result.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import { Refinement_Result } from "./Refinement_Result";
|
|
1
2
|
import { Transformer } from "./Transformer";
|
|
2
|
-
type
|
|
3
|
+
type Queryer<Output, Error, Input> = ($: Input) => Query_Result<Output, Error>;
|
|
4
|
+
type Refiner<Output, Error, Input> = ($: Input) => Refinement_Result<Output, Error>;
|
|
3
5
|
export interface Query_Result<Output, Error> {
|
|
4
6
|
query_result: null;
|
|
5
7
|
transform_result<New_Output>(transformer: Transformer<New_Output, Output>): Query_Result<New_Output, Error>;
|
|
6
8
|
transform_error_temp<New_Error>(error_transformer: Transformer<New_Error, Error>): Query_Result<Output, New_Error>;
|
|
7
|
-
query_without_error_transformation<New_Output>(query:
|
|
8
|
-
query<New_Output,
|
|
9
|
+
query_without_error_transformation<New_Output>(query: Queryer<New_Output, Error, Output>): Query_Result<New_Output, Error>;
|
|
10
|
+
query<New_Output, Query_Error>(query: Queryer<New_Output, Query_Error, Output>,
|
|
9
11
|
/**
|
|
10
|
-
* if the
|
|
12
|
+
* if the query fails, rework its error into the desired error type
|
|
11
13
|
*/
|
|
12
|
-
error_transformer: Transformer<Error,
|
|
13
|
-
refine_without_error_transformation<New_Output>(refiner:
|
|
14
|
-
refine<New_Output,
|
|
14
|
+
error_transformer: Transformer<Error, Query_Error>): Query_Result<New_Output, Error>;
|
|
15
|
+
refine_without_error_transformation<New_Output>(refiner: Refiner<New_Output, Error, Output>): Query_Result<New_Output, Error>;
|
|
16
|
+
refine<New_Output, Refiner_Error>(refiner: Refiner<New_Output, Refiner_Error, Output>,
|
|
15
17
|
/**
|
|
16
|
-
* if the
|
|
18
|
+
* if the refiner fails, rework its error into the desired error type
|
|
17
19
|
*/
|
|
18
|
-
error_transformer: Transformer<Error,
|
|
19
|
-
rework_error_temp<New_Error, Rework_Error>(error_reworker:
|
|
20
|
+
error_transformer: Transformer<Error, Refiner_Error>): Query_Result<New_Output, Error>;
|
|
21
|
+
rework_error_temp<New_Error, Rework_Error>(error_reworker: Queryer<New_Error, Rework_Error, Error>,
|
|
20
22
|
/**
|
|
21
23
|
* if the reworker fails, we need to transform *that* error into the New_Error
|
|
22
24
|
*/
|