exupery-core-types 0.3.60 → 0.3.63

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.
@@ -1,5 +1,5 @@
1
1
  import { Transformer } from "./Transformer";
2
- export type Command_Procedure<Error, Parameters, Command_Resources, Query_Resources> = ($c: Command_Resources, $q: Query_Resources) => Command<Error, Parameters>;
2
+ export type Command_Procedure<Command, Command_Resources, Query_Resources> = ($c: Command_Resources, $q: Query_Resources) => Command;
3
3
  export type Command<Error, Parameters> = {
4
4
  'execute': <Target_Error>(parameters: Parameters, error_transformer: Transformer<Error, Target_Error>) => Command_Promise<Target_Error>;
5
5
  };
@@ -1,2 +1 @@
1
- import { Query } from "./Query";
2
- export type Query_Function<Result, Error, Parameters, Query_Resources> = ($q: Query_Resources) => Query<Result, Error, Parameters>;
1
+ export type Query_Function<Query, Query_Resources> = ($q: Query_Resources) => Query;
@@ -15,16 +15,17 @@ export interface Dictionary<T> {
15
15
  */
16
16
  map<NT>(handle_value: ($: T, key: string) => NT): Dictionary<NT>;
17
17
  /**
18
- * This method is only to be used by resources
19
- * iterates over all entries in a sorted manner
18
+ * the ordering of the list will be the same as the insertion order in the dictionary
20
19
  */
21
- deprecated_to_array(compare: (a: Key_Value_Pair<T>, b: Key_Value_Pair<T>) => number): List<Key_Value_Pair<T>>;
20
+ to_list<New_Type>(handle_value: (value: T, key: string) => New_Type): List<New_Type>;
22
21
  /**
23
22
  * This method is only to be used by resources
24
23
  * returns an {@link Optional_Value } of type T reflecting wether the entry existed or not
25
24
  *
26
25
  * @param key
27
26
  */
28
- __get_entry(key: string): Optional_Value<T>;
29
- __get_number_of_entries(): number;
27
+ get_entry(key: string): Optional_Value<T>;
28
+ get_number_of_entries(): number;
29
+ filter<New_Type>(handle_value: (value: T, key: string) => Optional_Value<New_Type>): Dictionary<T>;
30
+ is_empty(): boolean;
30
31
  }
@@ -1,6 +1,6 @@
1
1
  import { Optional_Value } from "./Optional_Value";
2
2
  /**
3
- * A Exupery array.
3
+ * An Exupery List.
4
4
  * unmutable and minimal by design
5
5
  */
6
6
  export interface List<T> {
@@ -9,6 +9,11 @@ export interface List<T> {
9
9
  * @param handle_value callback to transform an individual entry.
10
10
  */
11
11
  map<NT>(handle_value: ($: T) => NT): List<NT>;
12
+ filter<New_Type>(handle_value: ($: T) => Optional_Value<New_Type>): List<New_Type>;
13
+ get_number_of_elements(): number;
14
+ is_empty(): boolean;
15
+ __get_element_at(index: number): Optional_Value<T>;
16
+ __get_raw_copy(): readonly T[];
12
17
  /**
13
18
  * This method is only to be used by resources
14
19
  * iterates over all entries
@@ -16,16 +21,4 @@ export interface List<T> {
16
21
  * @param $handle_value callback to process the entry
17
22
  */
18
23
  __for_each(handle_value: ($: T) => void): void;
19
- /**
20
- * This method is only to be used by resources
21
- *
22
- */
23
- __get_number_of_elements(): number;
24
- /**
25
- * This method is only to be used by resources
26
- *
27
- * @param index
28
- */
29
- __get_element_at(index: number): Optional_Value<T>;
30
- __get_raw_copy(): readonly T[];
31
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exupery-core-types",
3
- "version": "0.3.60",
3
+ "version": "0.3.63",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Corno",
6
6
  "description": "core types for Exupery",