pareto-core-interface 0.1.15 → 0.1.17
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/algorithm_signatures/Query.d.ts +1 -1
- package/dist/data/Dictionary.d.ts +3 -4
- package/dist/data/List.d.ts +2 -3
- package/dist/data/Optional_Value.d.ts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +3 -5
- package/dist/{algorithm_signatures → interfaces}/Query_Result.d.ts +2 -2
- package/dist/{algorithm_signatures → interfaces}/Query_Result.js +1 -1
- package/dist/{algorithm_signatures → interfaces}/Queryer.js +1 -1
- package/package.json +1 -1
- package/dist/Deprecated_Key_Value_Pair.d.ts +0 -4
- package/dist/Deprecated_Key_Value_Pair.js +0 -3
- package/dist/Deprecated_Refinement_Result.d.ts +0 -13
- package/dist/Deprecated_Refinement_Result.js +0 -3
- package/dist/interfaces/Non_Void.d.ts +0 -1
- package/dist/interfaces/Non_Void.js +0 -3
- /package/dist/{algorithm_signatures → interfaces}/Queryer.d.ts +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Query_Result } from "
|
|
1
|
+
import { Query_Result } from "../interfaces/Query_Result";
|
|
2
2
|
import { Transformer } from "./Transformer";
|
|
3
3
|
export type Query<Output, Error, Input> = <Target_Error>($: Input, error_transformer: Transformer<Error, Target_Error>) => Query_Result<Output, Target_Error>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Abort } from "../interfaces/Abort";
|
|
2
|
-
import { Non_Void } from "../interfaces/Non_Void";
|
|
3
2
|
import { List } from "./List";
|
|
4
3
|
import { Optional_Value } from "./Optional_Value";
|
|
5
4
|
/**
|
|
@@ -11,11 +10,11 @@ export interface Dictionary<T> {
|
|
|
11
10
|
*
|
|
12
11
|
* @param handle_entry callback to transform an individual entry. keys are not available.
|
|
13
12
|
*/
|
|
14
|
-
map<NT>(handle_entry: (value: T, key: string) =>
|
|
13
|
+
map<NT>(handle_entry: (value: T, key: string) => NT): Dictionary<NT>;
|
|
15
14
|
/**
|
|
16
15
|
* the ordering of the list will be the same as the insertion order in the dictionary
|
|
17
16
|
*/
|
|
18
|
-
to_list<New_Type>(handle_entry: (value: T, key: string) =>
|
|
17
|
+
to_list<New_Type>(handle_entry: (value: T, key: string) => New_Type): List<New_Type>;
|
|
19
18
|
/**
|
|
20
19
|
* This method is only to be used by resources
|
|
21
20
|
* returns an {@link Optional_Value } of type T reflecting wether the entry existed or not
|
|
@@ -25,6 +24,6 @@ export interface Dictionary<T> {
|
|
|
25
24
|
get_possible_entry(key: string): Optional_Value<T>;
|
|
26
25
|
get_entry(key: string, abort: Abort<null>): T;
|
|
27
26
|
get_number_of_entries(): number;
|
|
28
|
-
filter<New_Type>(handle_entry: (value: T, key: string) => Optional_Value<
|
|
27
|
+
filter<New_Type>(handle_entry: (value: T, key: string) => Optional_Value<New_Type>): Dictionary<New_Type>;
|
|
29
28
|
is_empty(): boolean;
|
|
30
29
|
}
|
package/dist/data/List.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Abort } from "../interfaces/Abort";
|
|
2
|
-
import { Non_Void } from "../interfaces/Non_Void";
|
|
3
2
|
import { Optional_Value } from "./Optional_Value";
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* A List for Pareto.
|
|
6
5
|
* unmutable and minimal by design
|
|
7
6
|
*/
|
|
8
7
|
export interface List<T> {
|
|
@@ -10,7 +9,7 @@ export interface List<T> {
|
|
|
10
9
|
*
|
|
11
10
|
* @param handle_element callback to transform an individual entry.
|
|
12
11
|
*/
|
|
13
|
-
map<NT>(handle_element: ($: T) =>
|
|
12
|
+
map<NT>(handle_element: ($: T) => NT): List<NT>;
|
|
14
13
|
filter<New_Type>(handle_element: ($: T) => Optional_Value<New_Type>): List<New_Type>;
|
|
15
14
|
get_number_of_elements(): number;
|
|
16
15
|
is_empty(): boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Non_Void } from "../interfaces/Non_Void";
|
|
2
1
|
/**
|
|
3
2
|
* Why this type and not use for example 'null | T'?
|
|
4
3
|
* the 'null | T' is vulnerable. If you have a parametrized function 'foo<T>() null | T' and T is null | number,
|
|
@@ -10,12 +9,11 @@ export interface Optional_Value<T> {
|
|
|
10
9
|
* @param set what to do when the value was set, returns the new type
|
|
11
10
|
* @param not_set what to do when the value was not set, returns the new type
|
|
12
11
|
*/
|
|
13
|
-
transform<NT>(set: ($: T) =>
|
|
12
|
+
transform<NT>(set: ($: T) => NT, not_set: () => NT): NT;
|
|
14
13
|
/**
|
|
15
14
|
*
|
|
16
15
|
*/
|
|
17
|
-
map<NT>(
|
|
18
|
-
set: ($: T) => Non_Void<NT>): Optional_Value<NT>;
|
|
16
|
+
map<NT>(set: ($: T) => NT): Optional_Value<NT>;
|
|
19
17
|
is_set(): boolean;
|
|
20
18
|
_extract_data(set: ($: T) => void, not_set: () => void): void;
|
|
21
19
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,12 +9,10 @@ export * from "./algorithm_signatures/Command";
|
|
|
9
9
|
export * from "./algorithm_signatures/Deserializer";
|
|
10
10
|
export * from "./algorithm_signatures/Production";
|
|
11
11
|
export * from "./algorithm_signatures/Query_Function";
|
|
12
|
-
export * from "./
|
|
12
|
+
export * from "./interfaces/Query_Result";
|
|
13
13
|
export * from "./algorithm_signatures/Query";
|
|
14
|
-
export * from "./
|
|
14
|
+
export * from "./interfaces/Queryer";
|
|
15
15
|
export * from "./algorithm_signatures/Refiner";
|
|
16
16
|
export * from "./algorithm_signatures/Transformer";
|
|
17
17
|
export * from "./algorithm_signatures/Serializer";
|
|
18
18
|
export * from "./Deprecated_Source_Location";
|
|
19
|
-
export * from "./Deprecated_Refinement_Result";
|
|
20
|
-
export * from "./Deprecated_Key_Value_Pair";
|
package/dist/index.js
CHANGED
|
@@ -25,13 +25,11 @@ __exportStar(require("./algorithm_signatures/Command"), exports);
|
|
|
25
25
|
__exportStar(require("./algorithm_signatures/Deserializer"), exports);
|
|
26
26
|
__exportStar(require("./algorithm_signatures/Production"), exports);
|
|
27
27
|
__exportStar(require("./algorithm_signatures/Query_Function"), exports);
|
|
28
|
-
__exportStar(require("./
|
|
28
|
+
__exportStar(require("./interfaces/Query_Result"), exports);
|
|
29
29
|
__exportStar(require("./algorithm_signatures/Query"), exports);
|
|
30
|
-
__exportStar(require("./
|
|
30
|
+
__exportStar(require("./interfaces/Queryer"), exports);
|
|
31
31
|
__exportStar(require("./algorithm_signatures/Refiner"), exports);
|
|
32
32
|
__exportStar(require("./algorithm_signatures/Transformer"), exports);
|
|
33
33
|
__exportStar(require("./algorithm_signatures/Serializer"), exports);
|
|
34
34
|
__exportStar(require("./Deprecated_Source_Location"), exports);
|
|
35
|
-
|
|
36
|
-
__exportStar(require("./Deprecated_Key_Value_Pair"), exports);
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUNBLDhDQUEyQjtBQUMzQiw2REFBMEM7QUFDMUMsb0RBQWlDO0FBQ2pDLHdEQUFxQztBQUVyQyxxREFBa0M7QUFFbEMsd0RBQXFDO0FBQ3JDLDREQUF5QztBQUV6QyxpRUFBOEM7QUFDOUMsc0VBQW1EO0FBQ25ELG9FQUFpRDtBQUNqRCx3RUFBcUQ7QUFDckQsc0VBQW1EO0FBQ25ELCtEQUE0QztBQUM1QyxpRUFBOEM7QUFDOUMsaUVBQThDO0FBQzlDLHFFQUFrRDtBQUNsRCxvRUFBaUQ7QUFFakQsK0RBQTRDO0FBQzVDLGlFQUE4QztBQUM5Qyw4REFBMkMifQ==
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUNBLDhDQUEyQjtBQUMzQiw2REFBMEM7QUFDMUMsb0RBQWlDO0FBQ2pDLHdEQUFxQztBQUVyQyxxREFBa0M7QUFFbEMsd0RBQXFDO0FBQ3JDLDREQUF5QztBQUV6QyxpRUFBOEM7QUFDOUMsc0VBQW1EO0FBQ25ELG9FQUFpRDtBQUNqRCx3RUFBcUQ7QUFDckQsNERBQXlDO0FBQ3pDLCtEQUE0QztBQUM1Qyx1REFBb0M7QUFDcEMsaUVBQThDO0FBQzlDLHFFQUFrRDtBQUNsRCxvRUFBaUQ7QUFFakQsK0RBQTRDIn0=
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Queryer } from "./Queryer";
|
|
2
|
-
import { Transformer } from "
|
|
3
|
-
import { Abort } from "
|
|
2
|
+
import { Transformer } from "../algorithm_signatures/Transformer";
|
|
3
|
+
import { Abort } from "./Abort";
|
|
4
4
|
export interface Query_Result<Output, Error> {
|
|
5
5
|
query_result: null;
|
|
6
6
|
transform_result<New_Output>(transformer: Transformer<Output, New_Output>): Query_Result<New_Output, Error>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUXVlcnlfUmVzdWx0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ludGVyZmFjZXMvUXVlcnlfUmVzdWx0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUXVlcnllci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbnRlcmZhY2VzL1F1ZXJ5ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGVwcmVjYXRlZF9LZXlfVmFsdWVfUGFpci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9EZXByZWNhdGVkX0tleV9WYWx1ZV9QYWlyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Transformer } from "./algorithm_signatures/Transformer";
|
|
2
|
-
export interface Deprecated_Refinement_Result<Output, Error> {
|
|
3
|
-
transform<Target>(output_transformer: Transformer<Output, Target>, error_transformer: Transformer<Error, Target>): Target;
|
|
4
|
-
transform_result<New_Output>(transformer: Transformer<Output, New_Output>): Deprecated_Refinement_Result<New_Output, Error>;
|
|
5
|
-
deprecated_transform_error<New_Error>(error_transformer: Transformer<Error, New_Error>): Deprecated_Refinement_Result<Output, New_Error>;
|
|
6
|
-
deprecated_refine_old<New_Output, Refiner_Error>(refiner: Deprecated_Refiner_Catcher<New_Output, Refiner_Error, Output>,
|
|
7
|
-
/**
|
|
8
|
-
* if the refiner fails, rework its error into the desired error type
|
|
9
|
-
*/
|
|
10
|
-
error_transformer: Transformer<Refiner_Error, Error>): Deprecated_Refinement_Result<New_Output, Error>;
|
|
11
|
-
__extract_data: (on_success: ($: Output) => void, on_error: ($: Error) => void) => void;
|
|
12
|
-
}
|
|
13
|
-
export type Deprecated_Refiner_Catcher<Result, Error, Input> = ($: Input) => Deprecated_Refinement_Result<Result, Error>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGVwcmVjYXRlZF9SZWZpbmVtZW50X1Jlc3VsdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9EZXByZWNhdGVkX1JlZmluZW1lbnRfUmVzdWx0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Non_Void<T> = T extends void ? never : T;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTm9uX1ZvaWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW50ZXJmYWNlcy9Ob25fVm9pZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
|
File without changes
|