exupery-core-async 0.3.0 → 0.3.2

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,4 +1,4 @@
1
- import { Guaranteed_Procedure } from "../../types/Guaranteed_Procedure";
1
+ import { Guaranteed_Procedure_Promise } from "../../types/Guaranteed_Procedure";
2
2
  type Executer = {
3
3
  'execute': (on_finished: () => void) => void;
4
4
  };
@@ -7,6 +7,6 @@ type Executer = {
7
7
  * @param executer the function that produces the eventual value
8
8
  * @returns
9
9
  */
10
- export declare function __create_guaranted_procedure(executer: Executer): Guaranteed_Procedure;
11
- export declare const initialize_no_op_guaranteed_procedure: () => Guaranteed_Procedure;
10
+ export declare function __create_guaranted_procedure(executer: Executer): Guaranteed_Procedure_Promise;
11
+ export declare const initialize_no_op_guaranteed_procedure: () => Guaranteed_Procedure_Promise;
12
12
  export {};
@@ -6,13 +6,14 @@ class Guaranteed_Procedure_Class {
6
6
  constructor(executer) {
7
7
  this.executer = executer;
8
8
  }
9
- x_execute(get_action, get_parameters) {
9
+ x_execute(get_action, get_parameters, get_resources) {
10
10
  return __create_guaranted_procedure({
11
11
  'execute': (on_finished) => {
12
12
  this.executer.execute(() => {
13
13
  const action = get_action();
14
14
  const params = get_parameters();
15
- action(params).__start(on_finished);
15
+ const resources = get_resources();
16
+ action(params, resources).__start(on_finished);
16
17
  });
17
18
  }
18
19
  });
@@ -1,4 +1,4 @@
1
- import { Unguaranteed_Procedure } from "../../types/Unguaranteed_Procedure";
1
+ import { Unguaranteed_Procedure_Promise } from "../../types/Unguaranteed_Procedure";
2
2
  /**
3
3
  * this function contains the body in which the async value or exception is executed
4
4
  * after the execution, either the on_value or on_exception callback will be called
@@ -13,6 +13,6 @@ type Executer<E> = {
13
13
  * @param executer the function that produces the eventual value
14
14
  * @returns
15
15
  */
16
- export declare function __create_unguaranteed_procedure<E>(executer: Executer<E>): Unguaranteed_Procedure<E>;
17
- export declare const initialize_no_op_unguaranteed_procedure: <E>() => Unguaranteed_Procedure<E>;
16
+ export declare function __create_unguaranteed_procedure<E>(executer: Executer<E>): Unguaranteed_Procedure_Promise<E>;
17
+ export declare const initialize_no_op_unguaranteed_procedure: <E>() => Unguaranteed_Procedure_Promise<E>;
18
18
  export {};
@@ -1,4 +1,4 @@
1
- import { _Guaranteed_Query } from "../../types/Guaranteed_Query";
1
+ import { Guaranteed_Query_Promise } from "../../types/Guaranteed_Query";
2
2
  type Executer<T> = {
3
3
  'execute': (on_value: ($: T) => void) => void;
4
4
  };
@@ -7,5 +7,5 @@ type Executer<T> = {
7
7
  * @param executer the function that produces the eventual value
8
8
  * @returns
9
9
  */
10
- export declare function __create_guaranteed_query<T>(executer: Executer<T>): _Guaranteed_Query<T>;
10
+ export declare function __create_guaranteed_query<T>(executer: Executer<T>): Guaranteed_Query_Promise<T>;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import { _Unguaranteed_Query } from "../../types/Unguaranteed_Query";
1
+ import { Unguaranteed_Query_Promise } from "../../types/Unguaranteed_Query";
2
2
  /**
3
3
  * this function contains the body in which the async value or exception is executed
4
4
  * after the execution, either the on_value or on_exception callback will be called
@@ -13,5 +13,5 @@ type Executer<T, E> = {
13
13
  * @param executer the function that produces the eventual value
14
14
  * @returns
15
15
  */
16
- export declare function __create_unguaranteed_query<T, E>(executer: Executer<T, E>): _Unguaranteed_Query<T, E>;
16
+ export declare function __create_unguaranteed_query<T, E>(executer: Executer<T, E>): Unguaranteed_Query_Promise<T, E>;
17
17
  export {};
@@ -1,6 +1,6 @@
1
- import { _Guaranteed_Query } from "../../types/Guaranteed_Query";
1
+ import { Guaranteed_Query_Promise } from "../../types/Guaranteed_Query";
2
2
  export type Sync_Tuple_2<T1, T2> = {
3
3
  readonly 'first': T1;
4
4
  readonly 'second': T2;
5
5
  };
6
- export declare function merge_2_unguaranteed_queries<T1, T2>(first: _Guaranteed_Query<T1>, second: _Guaranteed_Query<T2>): _Guaranteed_Query<Sync_Tuple_2<T1, T2>>;
6
+ export declare function merge_2_unguaranteed_queries<T1, T2>(first: Guaranteed_Query_Promise<T1>, second: Guaranteed_Query_Promise<T2>): Guaranteed_Query_Promise<Sync_Tuple_2<T1, T2>>;
package/dist/index.d.ts CHANGED
@@ -8,25 +8,25 @@ export * from "./algorithms/query/create_unguaranteed_query";
8
8
  export * from "./algorithms/procedure/initialize_guaranteed_procedure";
9
9
  export * from "./algorithms/procedure/initialize_unguaranteed_procedure";
10
10
  export * from "./shorthands";
11
- import { Guaranteed_Procedure } from "./types/Guaranteed_Procedure";
12
- import { Unguaranteed_Procedure } from "./types/Unguaranteed_Procedure";
13
- import { _Guaranteed_Query } from "./types/Guaranteed_Query";
14
- import { _Unguaranteed_Query } from "./types/Unguaranteed_Query";
11
+ import { Guaranteed_Procedure_Promise } from "./types/Guaranteed_Procedure";
12
+ import { Unguaranteed_Procedure_Promise } from "./types/Unguaranteed_Procedure";
13
+ import { Guaranteed_Query_Promise } from "./types/Guaranteed_Query";
14
+ import { Unguaranteed_Query_Promise } from "./types/Unguaranteed_Query";
15
15
  export declare const query: {
16
16
  guaranteed: {
17
- 'create result': <T>($: T) => _Guaranteed_Query<T>;
17
+ 'create result': <T>($: T) => Guaranteed_Query_Promise<T>;
18
18
  };
19
19
  unguaranteed: {
20
- 'create result': <T, E>($: T) => _Unguaranteed_Query<T, E>;
21
- 'raise exception': <T, E>($: E) => _Unguaranteed_Query<T, E>;
20
+ 'create result': <T, E>($: T) => Unguaranteed_Query_Promise<T, E>;
21
+ 'raise exception': <T, E>($: E) => Unguaranteed_Query_Promise<T, E>;
22
22
  };
23
23
  };
24
24
  export declare const command: {
25
25
  guaranteed: {
26
- initialize: () => Guaranteed_Procedure;
26
+ initialize: () => Guaranteed_Procedure_Promise;
27
27
  };
28
28
  unguaranteed: {
29
- initialize: <E>() => Unguaranteed_Procedure<E>;
30
- 'raise exception': <E>($: E) => Unguaranteed_Procedure<E>;
29
+ initialize: <E>() => Unguaranteed_Procedure_Promise<E>;
30
+ 'raise exception': <E>($: E) => Unguaranteed_Procedure_Promise<E>;
31
31
  };
32
32
  };
@@ -1,9 +1,9 @@
1
1
  import * as _ei from 'exupery-core-internals';
2
2
  import * as _et from 'exupery-core-types';
3
- import { Unguaranteed } from "./types/Unguaranteed_Query";
4
- import { Guaranteed } from "./types/Guaranteed_Query";
5
- import { Guaranteed_Procedure, Guaranteed_Procedure_Initializer } from "./types/Guaranteed_Procedure";
6
- import { Unguaranteed_Procedure_Initializer, Unguaranteed_Procedure } from "./types/Unguaranteed_Procedure";
3
+ import { Basic_Unguaranteed_Query_Promise } from "./types/Unguaranteed_Query";
4
+ import { Basic_Guaranteed_Query_Promise } from "./types/Guaranteed_Query";
5
+ import { Guaranteed_Procedure_Promise, Guaranteed_Procedure_Initializer } from "./types/Guaranteed_Procedure";
6
+ import { Unguaranteed_Procedure_Initializer, Unguaranteed_Procedure_Promise } from "./types/Unguaranteed_Procedure";
7
7
  import { Unguaranteed_Query_Initializer } from "./types/Unguaranteed_Query";
8
8
  import { Guaranteed_Query_Initializer } from "./types/Guaranteed_Query";
9
9
  import { Error_Handler } from "./types/Error_Handler";
@@ -12,7 +12,7 @@ import { Error_Handler } from "./types/Error_Handler";
12
12
  * @param action gpi
13
13
  * @param error_transform gt
14
14
  */
15
- export declare const eh: <Parameters, Error>(action: Guaranteed_Procedure_Initializer<Parameters>, error_transform: _ei.Transformation_Without_Parameters<Error, Parameters>) => Error_Handler<Error>;
15
+ export declare const eh: <Parameters, Error, Resources>(action: Guaranteed_Procedure_Initializer<Parameters, Resources>, error_transform: _ei.Transformation_Without_Parameters<Error, Parameters>, resources: Resources) => Error_Handler<Error>;
16
16
  export declare namespace gp {
17
17
  /**
18
18
  *
@@ -20,7 +20,7 @@ export declare namespace gp {
20
20
  * @param query g.q
21
21
  * @returns
22
22
  */
23
- const action: <Parameters>(action: Guaranteed_Procedure_Initializer<Parameters>, query: Guaranteed.Query_<Parameters>) => Guaranteed_Procedure;
23
+ const action: <Parameters, Resources>(action: Guaranteed_Procedure_Initializer<Parameters, Resources>, query: Basic_Guaranteed_Query_Promise<Parameters>, $r: Resources) => Guaranteed_Procedure_Promise;
24
24
  }
25
25
  export declare namespace gq {
26
26
  /**
@@ -28,7 +28,7 @@ export declare namespace gq {
28
28
  * @param query_result qr
29
29
  * @returns
30
30
  */
31
- const fixed: <Query_Result>(query_result: Query_Result) => Guaranteed.Query_<Query_Result>;
31
+ const fixed: <Query_Result>(query_result: Query_Result) => Basic_Guaranteed_Query_Promise<Query_Result>;
32
32
  /**
33
33
  *
34
34
  * @param the_query gqi
@@ -36,7 +36,7 @@ export declare namespace gq {
36
36
  * @param result_transformation gt
37
37
  * @returns
38
38
  */
39
- const g: <Result_After_Transformation, Parameters, Query_Result>(the_query: Guaranteed_Query_Initializer<Parameters, Query_Result>, parameters: Guaranteed.Query_<Parameters>, result_transformation: _ei.Transformation_Without_Parameters<Query_Result, Result_After_Transformation>) => Guaranteed.Query_<Result_After_Transformation>;
39
+ const g: <Result_After_Transformation, Parameters, Query_Result, Resources>(the_query: Guaranteed_Query_Initializer<Parameters, Query_Result, Resources>, parameters: Basic_Guaranteed_Query_Promise<Parameters>, result_transformation: _ei.Transformation_Without_Parameters<Query_Result, Result_After_Transformation>, resources: Resources) => Basic_Guaranteed_Query_Promise<Result_After_Transformation>;
40
40
  }
41
41
  export declare namespace gt {
42
42
  /**
@@ -52,39 +52,39 @@ export declare namespace up {
52
52
  * @param action upi
53
53
  * @param query u.q
54
54
  */
55
- const action: <Error, Parameters>(action: Unguaranteed_Procedure_Initializer<Parameters, Error>, query: Unguaranteed.Query<Parameters, Error>) => Unguaranteed_Procedure<Error>;
55
+ const action: <Error, Parameters, Resources>(action: Unguaranteed_Procedure_Initializer<Parameters, Error, Resources>, query: Basic_Unguaranteed_Query_Promise<Parameters, Error>, resources: Resources) => Unguaranteed_Procedure_Promise<Error>;
56
56
  /**
57
57
  *
58
58
  * @param steps up[]
59
59
  * @returns
60
60
  */
61
- const sequence: <Error>(steps: Unguaranteed_Procedure<Error>[]) => Unguaranteed_Procedure<Error>;
61
+ const sequence: <Error>(steps: Unguaranteed_Procedure_Promise<Error>[]) => Unguaranteed_Procedure_Promise<Error>;
62
62
  /**
63
63
  *
64
64
  * @param the_array up[]
65
65
  * @param aggregate_exceptions gt
66
66
  * @returns
67
67
  */
68
- const array: <Error, Element_Error>(the_array: _et.Array<Unguaranteed_Procedure<Element_Error>>, aggregate_exceptions: _ei.Transformation_Without_Parameters<_et.Array<Element_Error>, Error>) => Unguaranteed_Procedure<Error>;
68
+ const array: <Error, Element_Error>(the_array: _et.Array<Unguaranteed_Procedure_Promise<Element_Error>>, aggregate_exceptions: _ei.Transformation_Without_Parameters<_et.Array<Element_Error>, Error>) => Unguaranteed_Procedure_Promise<Error>;
69
69
  /**
70
70
  *
71
71
  * @param the_dictionary dict<up>
72
72
  * @param aggregate_exceptions gt
73
73
  * @returns
74
74
  */
75
- const dictionary: <Error, Element_Error>(the_dictionary: _et.Dictionary<Unguaranteed_Procedure<Element_Error>>, aggregate_exceptions: _ei.Transformation_Without_Parameters<_et.Dictionary<Element_Error>, Error>) => Unguaranteed_Procedure<Error>;
75
+ const dictionary: <Error, Element_Error>(the_dictionary: _et.Dictionary<Unguaranteed_Procedure_Promise<Element_Error>>, aggregate_exceptions: _ei.Transformation_Without_Parameters<_et.Dictionary<Element_Error>, Error>) => Unguaranteed_Procedure_Promise<Error>;
76
76
  }
77
77
  export declare namespace upi {
78
78
  /**
79
79
  *
80
80
  * @param action gpi
81
81
  */
82
- const g: <Parameters, Error>(action: Guaranteed_Procedure_Initializer<Parameters>) => Unguaranteed_Procedure_Initializer<Parameters, Error>;
82
+ const g: <Parameters, Error, Resources>(action: Guaranteed_Procedure_Initializer<Parameters, Resources>, $r: Resources) => Unguaranteed_Procedure_Initializer<Parameters, Error, Resources>;
83
83
  /**
84
84
  *
85
85
  * @param action upi
86
86
  */
87
- const u: <Parameters, Error, Action_Error>(action: Unguaranteed_Procedure_Initializer<Parameters, Action_Error>, error_transform: _ei.Transformation_Without_Parameters<Action_Error, Error>, error_handler?: Error_Handler<Action_Error>) => Unguaranteed_Procedure_Initializer<Parameters, Error>;
87
+ const u: <Parameters, Error, Action_Error, Resources>(action: Unguaranteed_Procedure_Initializer<Parameters, Action_Error, Resources>, error_transform: _ei.Transformation_Without_Parameters<Action_Error, Error>, error_handler?: Error_Handler<Action_Error>) => Unguaranteed_Procedure_Initializer<Parameters, Error, Resources>;
88
88
  }
89
89
  export declare namespace uq {
90
90
  /**
@@ -92,7 +92,7 @@ export declare namespace uq {
92
92
  * @param query_result qr
93
93
  * @returns
94
94
  */
95
- const fixed: <Query_Result, Error>(query_result: Query_Result) => Unguaranteed.Query<Query_Result, Error>;
95
+ const fixed: <Query_Result, Error>(query_result: Query_Result) => Basic_Unguaranteed_Query_Promise<Query_Result, Error>;
96
96
  /**
97
97
  * unguaranteed query
98
98
  * @param the_query uqi
@@ -102,14 +102,14 @@ export declare namespace uq {
102
102
  * @param error_handler eh
103
103
  * @returns
104
104
  */
105
- const u: <Result_After_Transformation, Error, Parameters, Query_Result, Query_Error>(the_query: Unguaranteed_Query_Initializer<Parameters, Query_Result, Query_Error>, parameters: Unguaranteed.Query<Parameters, Error>, result_refinement: _ei.Refinement_Without_Parameters<Query_Result, Result_After_Transformation, Error>, error_transform: _ei.Transformation_Without_Parameters<Query_Error, Error>, error_handler?: Error_Handler<Query_Error>) => Unguaranteed.Query<Result_After_Transformation, Error>;
105
+ const u: <Result_After_Transformation, Error, Parameters, Query_Result, Query_Error, Resources>(the_query: Unguaranteed_Query_Initializer<Parameters, Query_Result, Query_Error, Resources>, parameters: Basic_Unguaranteed_Query_Promise<Parameters, Error>, resources: Resources, result_refinement: _ei.Refinement_Without_Parameters<Query_Result, Result_After_Transformation, Error>, error_transform: _ei.Transformation_Without_Parameters<Query_Error, Error>, error_handler?: Error_Handler<Query_Error>) => Basic_Unguaranteed_Query_Promise<Result_After_Transformation, Error>;
106
106
  /**
107
107
  * guaranteed query
108
108
  * @param the_query gqi
109
109
  * @param parameters u.q
110
110
  * @param result_refinement ut
111
111
  */
112
- const g: <Result_After_Transformation, Error, Parameters, Query_Result>(the_query: Guaranteed_Query_Initializer<Parameters, Query_Result>, parameters: Unguaranteed.Query<Parameters, Error>, result_refinement: _ei.Refinement_Without_Parameters<Query_Result, Result_After_Transformation, Error>) => Unguaranteed.Query<Result_After_Transformation, Error>;
112
+ const g: <Result_After_Transformation, Error, Parameters, Query_Result, Resources>(the_query: Guaranteed_Query_Initializer<Parameters, Query_Result, Resources>, parameters: Basic_Unguaranteed_Query_Promise<Parameters, Error>, result_refinement: _ei.Refinement_Without_Parameters<Query_Result, Result_After_Transformation, Error>, resources: Resources) => Basic_Unguaranteed_Query_Promise<Result_After_Transformation, Error>;
113
113
  }
114
114
  export declare namespace ut {
115
115
  /**
@@ -32,9 +32,9 @@ const create_asynchronous_processes_monitor_1 = require("./create_asynchronous_p
32
32
  * @param action gpi
33
33
  * @param error_transform gt
34
34
  */
35
- const eh = (action, error_transform) => {
35
+ const eh = (action, error_transform, resources) => {
36
36
  return ($) => {
37
- action(error_transform($)).__start(() => { });
37
+ action(error_transform($), resources).__start(() => { });
38
38
  };
39
39
  };
40
40
  exports.eh = eh;
@@ -46,13 +46,13 @@ var gp;
46
46
  * @param query g.q
47
47
  * @returns
48
48
  */
49
- gp.action = (action, query) => {
49
+ gp.action = (action, query, $r) => {
50
50
  return {
51
51
  __start: (on_finished) => {
52
52
  //run the query
53
53
  query.__start((query_result) => {
54
54
  //run the action
55
- action(query_result).__start(on_finished);
55
+ action(query_result, $r).__start(on_finished);
56
56
  });
57
57
  }
58
58
  };
@@ -79,11 +79,11 @@ var gq;
79
79
  * @param result_transformation gt
80
80
  * @returns
81
81
  */
82
- gq.g = (the_query, parameters, result_transformation) => {
82
+ gq.g = (the_query, parameters, result_transformation, resources) => {
83
83
  return {
84
84
  __start: (on_finished) => {
85
85
  parameters.__start((qr_in) => {
86
- the_query(qr_in).__start((result) => {
86
+ the_query(qr_in, resources).__start((result) => {
87
87
  on_finished(result_transformation(result));
88
88
  });
89
89
  });
@@ -109,13 +109,13 @@ var up;
109
109
  * @param action upi
110
110
  * @param query u.q
111
111
  */
112
- up.action = (action, query) => {
112
+ up.action = (action, query, resources) => {
113
113
  return {
114
114
  __start: (on_success, on_error) => {
115
115
  //run the query
116
116
  query.__start((query_result) => {
117
117
  //run the action
118
- action(query_result).__start(on_success, (error) => {
118
+ action(query_result, resources).__start(on_success, (error) => {
119
119
  //transform the error
120
120
  on_error(error);
121
121
  });
@@ -212,10 +212,10 @@ var upi;
212
212
  *
213
213
  * @param action gpi
214
214
  */
215
- upi.g = (action) => ($) => {
215
+ upi.g = (action, $r) => ($) => {
216
216
  return (0, initialize_unguaranteed_procedure_1.__create_unguaranteed_procedure)({
217
217
  'execute': (on_succes, on_error) => {
218
- action($).__start(on_succes);
218
+ action($, $r).__start(on_succes);
219
219
  }
220
220
  });
221
221
  };
@@ -223,10 +223,10 @@ var upi;
223
223
  *
224
224
  * @param action upi
225
225
  */
226
- upi.u = (action, error_transform, error_handler) => ($) => {
226
+ upi.u = (action, error_transform, error_handler) => ($, $r) => {
227
227
  return (0, initialize_unguaranteed_procedure_1.__create_unguaranteed_procedure)({
228
228
  'execute': (on_succes, on_error) => {
229
- action($).__start(on_succes, (error) => {
229
+ action($, $r).__start(on_succes, (error) => {
230
230
  if (error_handler !== undefined) {
231
231
  error_handler(error);
232
232
  }
@@ -259,11 +259,11 @@ var uq;
259
259
  * @param error_handler eh
260
260
  * @returns
261
261
  */
262
- uq.u = (the_query, parameters, result_refinement, error_transform, error_handler) => {
262
+ uq.u = (the_query, parameters, resources, result_refinement, error_transform, error_handler) => {
263
263
  return {
264
264
  __start: (on_success, on_error) => {
265
265
  parameters.__start((qr_in) => {
266
- the_query(qr_in).__start((result) => {
266
+ the_query(qr_in, resources).__start((result) => {
267
267
  result_refinement(result).process((x) => on_success(x), on_error);
268
268
  }, (error) => {
269
269
  if (error_handler !== undefined) {
@@ -281,11 +281,11 @@ var uq;
281
281
  * @param parameters u.q
282
282
  * @param result_refinement ut
283
283
  */
284
- uq.g = (the_query, parameters, result_refinement) => {
284
+ uq.g = (the_query, parameters, result_refinement, resources) => {
285
285
  return {
286
286
  __start: (on_success, on_error) => {
287
287
  parameters.__start((x) => {
288
- the_query(x).__start(($) => {
288
+ the_query(x, resources).__start(($) => {
289
289
  result_refinement($).process((x) => on_success(x), on_error);
290
290
  });
291
291
  }, on_error);
@@ -1,4 +1,4 @@
1
- export type Guaranteed_Procedure_Initializer<Parameters> = ($: Parameters) => Guaranteed_Procedure;
2
- export interface Guaranteed_Procedure {
1
+ export type Guaranteed_Procedure_Initializer<Parameters, Resources> = ($: Parameters, $r: Resources) => Guaranteed_Procedure_Promise;
2
+ export interface Guaranteed_Procedure_Promise {
3
3
  __start: (on_finished: () => void) => void;
4
4
  }
@@ -1,22 +1,20 @@
1
+ export type Guaranteed_Query_Initializer<Parameters, Result, Resources> = ($: Parameters, $r: Resources) => Guaranteed_Query_Promise<Result>;
1
2
  /**
2
3
  * A value that will asynchronously become available.
3
4
  * Similar to the concept of a promise, but with a smaller API.
4
5
  */
5
- export interface _Guaranteed_Query<T> {
6
- map<NT>(handle_value: ($: T) => NT): _Guaranteed_Query<NT>;
6
+ export type Guaranteed_Query_Promise<Result> = {
7
+ map<NT>(handle_value: ($: Result) => NT): Guaranteed_Query_Promise<NT>;
7
8
  /**
8
9
  * maps the current async value into a new async value
9
10
  * @param handle_value callback that transforms the actual value into a new Async_Value
10
11
  */
11
- then<NT>(handle_value: ($: T) => _Guaranteed_Query<NT>): _Guaranteed_Query<NT>;
12
+ then<NT>(handle_value: ($: Result) => Guaranteed_Query_Promise<NT>): Guaranteed_Query_Promise<NT>;
12
13
  /**
13
14
  * This method is only to be used by resources
14
15
  */
15
- __start(on_value: ($: T) => void): void;
16
- }
17
- export type Guaranteed_Query_Initializer<Parameters, Result> = ($: Parameters) => _Guaranteed_Query<Result>;
18
- export declare namespace Guaranteed {
19
- type Query_<Result> = {
20
- __start: (on_finished: (result: Result) => void) => void;
21
- };
22
- }
16
+ __start(on_finished: ($: Result) => void): void;
17
+ };
18
+ export type Basic_Guaranteed_Query_Promise<Result> = {
19
+ __start: (on_finished: (result: Result) => void) => void;
20
+ };
@@ -1,4 +1,4 @@
1
- export type Unguaranteed_Procedure_Initializer<Parameters, Error> = ($: Parameters) => Unguaranteed_Procedure<Error>;
2
- export interface Unguaranteed_Procedure<Error> {
1
+ export type Unguaranteed_Procedure_Initializer<Parameters, Error, Resources> = ($: Parameters, $r: Resources) => Unguaranteed_Procedure_Promise<Error>;
2
+ export interface Unguaranteed_Procedure_Promise<Error> {
3
3
  __start: (on_success: () => void, on_error: (error: Error) => void) => void;
4
4
  }
@@ -1,15 +1,13 @@
1
- import { _Guaranteed_Query } from "./Guaranteed_Query";
2
- export interface _Unguaranteed_Query<T, E> {
3
- map_<NT>(handle_value: ($: T) => NT): _Unguaranteed_Query<NT, E>;
4
- map_exception_<NE>(handle_exception: ($: E) => NE): _Unguaranteed_Query<T, NE>;
5
- then<NT>(handle_value: ($: T) => _Guaranteed_Query<NT>): _Unguaranteed_Query<NT, E>;
6
- then_unguaranteed<NT>(handle_value: ($: T) => _Unguaranteed_Query<NT, E>): _Unguaranteed_Query<NT, E>;
7
- catch_(handle_exception: ($: E) => _Guaranteed_Query<T>): _Guaranteed_Query<T>;
8
- __start(on_value: ($: T) => void, on_exception: ($: E) => void): void;
9
- }
10
- export type Unguaranteed_Query_Initializer<Parameters, Result, Error> = ($: Parameters) => _Unguaranteed_Query<Result, Error>;
11
- export declare namespace Unguaranteed {
12
- type Query<Result, Error> = {
13
- __start: (on_success: (result: Result) => void, on_error: (error: Error) => void) => void;
14
- };
15
- }
1
+ import { Guaranteed_Query_Promise } from "./Guaranteed_Query";
2
+ export type Unguaranteed_Query_Initializer<Parameters, Result, Error, Resources> = ($: Parameters, $r: Resources) => Unguaranteed_Query_Promise<Result, Error>;
3
+ export type Unguaranteed_Query_Promise<Result, Error> = {
4
+ map_<NT>(handle_value: ($: Result) => NT): Unguaranteed_Query_Promise<NT, Error>;
5
+ map_exception_<NE>(handle_exception: ($: Error) => NE): Unguaranteed_Query_Promise<Result, NE>;
6
+ then<NT>(handle_value: ($: Result) => Guaranteed_Query_Promise<NT>): Unguaranteed_Query_Promise<NT, Error>;
7
+ then_unguaranteed<NT>(handle_value: ($: Result) => Unguaranteed_Query_Promise<NT, Error>): Unguaranteed_Query_Promise<NT, Error>;
8
+ catch_(handle_exception: ($: Error) => Guaranteed_Query_Promise<Result>): Guaranteed_Query_Promise<Result>;
9
+ __start(on_success: ($: Result) => void, on_error: ($: Error) => void): void;
10
+ };
11
+ export type Basic_Unguaranteed_Query_Promise<Result, Error> = {
12
+ __start: (on_success: (result: Result) => void, on_error: (error: Error) => void) => void;
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exupery-core-async",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Corno",
6
6
  "description": "async types for Exupery",