exupery-core-async 0.1.24 → 0.1.25
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/Safe_Procedure_Context.d.ts +4 -0
- package/dist/Safe_Query_Result.d.ts +4 -4
- package/dist/Unsafe_Procedure_Context.d.ts +24 -0
- package/dist/Unsafe_Query_Result.d.ts +3 -3
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/initialize_safe_procedure_context.d.ts +12 -0
- package/dist/{execute_safe_command.js → initialize_safe_procedure_context.js} +10 -10
- package/dist/{execute_unsafe_command.d.ts → initialize_unsafe_procedure_context.d.ts} +3 -3
- package/dist/{execute_unsafe_command.js → initialize_unsafe_procedure_context.js} +17 -17
- package/dist/run_safe_query.js +6 -6
- package/dist/run_unsafe_query.js +5 -5
- package/package.json +1 -1
- package/dist/Safe_Command_Result.d.ts +0 -4
- package/dist/Unsafe_Command_Result.d.ts +0 -24
- package/dist/execute_safe_command.d.ts +0 -12
- /package/dist/{Safe_Command_Result.js → Safe_Procedure_Context.js} +0 -0
- /package/dist/{Unsafe_Command_Result.js → Unsafe_Procedure_Context.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Safe_Procedure_Context } from "./Safe_Procedure_Context";
|
|
2
|
+
import { Unsafe_Procedure_Context } from "./Unsafe_Procedure_Context";
|
|
3
3
|
/**
|
|
4
4
|
* A value that will asynchronously become available.
|
|
5
5
|
* Similar to the concept of a promise, but with a smaller API.
|
|
@@ -11,8 +11,8 @@ export interface Safe_Query_Result<T> {
|
|
|
11
11
|
* @param handle_value callback that transforms the actual value into a new Async_Value
|
|
12
12
|
*/
|
|
13
13
|
then<NT>(handle_value: ($: T) => Safe_Query_Result<NT>): Safe_Query_Result<NT>;
|
|
14
|
-
process_safe(handle_value: ($i:
|
|
15
|
-
process_unsafe<E>(handle_value: ($i:
|
|
14
|
+
process_safe(handle_value: ($i: Safe_Procedure_Context, $: T) => Safe_Procedure_Context): Safe_Procedure_Context;
|
|
15
|
+
process_unsafe<E>(handle_value: ($i: Unsafe_Procedure_Context<E>, $: T) => Unsafe_Procedure_Context<E>): Unsafe_Procedure_Context<E>;
|
|
16
16
|
/**
|
|
17
17
|
* This method is only to be used by resources
|
|
18
18
|
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as _et from 'exupery-core-types';
|
|
2
|
+
import { Safe_Procedure_Context } from "./Safe_Procedure_Context";
|
|
3
|
+
export interface Unsafe_Procedure_Context<E> {
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* executes a command when an exception has occurred,
|
|
7
|
+
* but stays in the unsafe context
|
|
8
|
+
*
|
|
9
|
+
* this is useful when you want to do some cleanup
|
|
10
|
+
* or logging in case of an exception,
|
|
11
|
+
* but still want to propagate the exception further
|
|
12
|
+
*
|
|
13
|
+
* note that this is different from `catch`,
|
|
14
|
+
* which would switch to the safe context
|
|
15
|
+
*/
|
|
16
|
+
process_exception<NE>(handle: ($i: Safe_Procedure_Context, $: E) => Safe_Procedure_Context, map: ($: E) => NE): Unsafe_Procedure_Context<NE>;
|
|
17
|
+
throw_exception<E>($: E): Unsafe_Procedure_Context<E>;
|
|
18
|
+
catch(handle_exception: ($i: Safe_Procedure_Context, $: E) => Safe_Procedure_Context): Safe_Procedure_Context;
|
|
19
|
+
execute_unsafe(handle: ($i: Unsafe_Procedure_Context<E>) => Unsafe_Procedure_Context<E>): Unsafe_Procedure_Context<E>;
|
|
20
|
+
execute(handle: ($i: Safe_Procedure_Context) => Safe_Procedure_Context): Unsafe_Procedure_Context<E>;
|
|
21
|
+
execute_dictionary_unsafe<E2>($: _et.Dictionary<Unsafe_Procedure_Context<E2>>, aggregate_exceptions: ($: _et.Dictionary<E2>) => E): Unsafe_Procedure_Context<E>;
|
|
22
|
+
execute_multiple_unsafe<E2>($: _et.Array<Unsafe_Procedure_Context<E2>>, aggregate_exceptions: ($: _et.Array<E2>) => E): Unsafe_Procedure_Context<E>;
|
|
23
|
+
__start(on_success: () => void, on_exception: ($: E) => void): void;
|
|
24
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Safe_Procedure_Context } from "./Safe_Procedure_Context";
|
|
2
2
|
import { Safe_Query_Result } from "./Safe_Query_Result";
|
|
3
|
-
import {
|
|
3
|
+
import { Unsafe_Procedure_Context } from "./Unsafe_Procedure_Context";
|
|
4
4
|
export interface Unsafe_Query_Result<T, E> {
|
|
5
5
|
map<NT>(handle_value: ($: T) => NT): Unsafe_Query_Result<NT, E>;
|
|
6
6
|
map_exception<NE>(handle_exception: ($: E) => NE): Unsafe_Query_Result<T, NE>;
|
|
@@ -19,6 +19,6 @@ export interface Unsafe_Query_Result<T, E> {
|
|
|
19
19
|
* @param map_exception the handler that will map the exception of the query into a new exception value of the command's exception type
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
process<NE>(handle_exception: ($i:
|
|
22
|
+
process<NE>(handle_exception: ($i: Safe_Procedure_Context, $: E) => Safe_Procedure_Context, map_exception: ($: E) => NE, handle_value: ($i: Unsafe_Procedure_Context<NE>, $: T) => Unsafe_Procedure_Context<NE>): Unsafe_Procedure_Context<NE>;
|
|
23
23
|
__start(on_value: ($: T) => void, on_exception: ($: E) => void): void;
|
|
24
24
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./Safe_Procedure_Context";
|
|
2
|
+
export * from "./Unsafe_Procedure_Context";
|
|
3
3
|
export * from "./Safe_Query_Result";
|
|
4
4
|
export * from "./Unsafe_Query_Result";
|
|
5
5
|
export * from "./merge_2_safe_query_results";
|
|
6
6
|
export * from "./run_safe_query";
|
|
7
7
|
export * from "./run_unsafe_query";
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
export * from "./initialize_safe_procedure_context";
|
|
9
|
+
export * from "./initialize_unsafe_procedure_context";
|
|
10
|
+
import { Safe_Procedure_Context } from "./Safe_Procedure_Context";
|
|
11
|
+
import { Unsafe_Procedure_Context } from "./Unsafe_Procedure_Context";
|
|
12
12
|
import { Safe_Query_Result } from "./Safe_Query_Result";
|
|
13
13
|
import { Unsafe_Query_Result } from "./Unsafe_Query_Result";
|
|
14
14
|
export declare const query: {
|
|
@@ -22,10 +22,10 @@ export declare const query: {
|
|
|
22
22
|
};
|
|
23
23
|
export declare const command: {
|
|
24
24
|
safe: {
|
|
25
|
-
initialize: () =>
|
|
25
|
+
initialize: () => Safe_Procedure_Context;
|
|
26
26
|
};
|
|
27
27
|
unsafe: {
|
|
28
|
-
initialize: <E>() =>
|
|
29
|
-
'raise exception': <E>($: E) =>
|
|
28
|
+
initialize: <E>() => Unsafe_Procedure_Context<E>;
|
|
29
|
+
'raise exception': <E>($: E) => Unsafe_Procedure_Context<E>;
|
|
30
30
|
};
|
|
31
31
|
};
|
package/dist/index.js
CHANGED
|
@@ -15,17 +15,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.command = exports.query = void 0;
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./Safe_Procedure_Context"), exports);
|
|
19
|
+
__exportStar(require("./Unsafe_Procedure_Context"), exports);
|
|
20
20
|
__exportStar(require("./Safe_Query_Result"), exports);
|
|
21
21
|
__exportStar(require("./Unsafe_Query_Result"), exports);
|
|
22
22
|
__exportStar(require("./merge_2_safe_query_results"), exports);
|
|
23
23
|
__exportStar(require("./run_safe_query"), exports);
|
|
24
24
|
__exportStar(require("./run_unsafe_query"), exports);
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
const
|
|
28
|
-
const
|
|
25
|
+
__exportStar(require("./initialize_safe_procedure_context"), exports);
|
|
26
|
+
__exportStar(require("./initialize_unsafe_procedure_context"), exports);
|
|
27
|
+
const initialize_safe_procedure_context_1 = require("./initialize_safe_procedure_context");
|
|
28
|
+
const initialize_unsafe_procedure_context_1 = require("./initialize_unsafe_procedure_context");
|
|
29
29
|
const run_safe_query_1 = require("./run_safe_query");
|
|
30
30
|
const run_unsafe_query_1 = require("./run_unsafe_query");
|
|
31
31
|
exports.query = {
|
|
@@ -57,12 +57,12 @@ exports.query = {
|
|
|
57
57
|
};
|
|
58
58
|
exports.command = {
|
|
59
59
|
'safe': {
|
|
60
|
-
'initialize':
|
|
60
|
+
'initialize': initialize_safe_procedure_context_1.initialize_safe_procedure_context
|
|
61
61
|
},
|
|
62
62
|
'unsafe': {
|
|
63
|
-
'initialize':
|
|
63
|
+
'initialize': initialize_unsafe_procedure_context_1.initialize_unsafe_procedure_context,
|
|
64
64
|
'raise exception': ($) => {
|
|
65
|
-
return (0,
|
|
65
|
+
return (0, initialize_unsafe_procedure_context_1.__execute_unsafe_action)({
|
|
66
66
|
'execute': (on_success, on_exception) => {
|
|
67
67
|
on_exception($);
|
|
68
68
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Safe_Procedure_Context } from "./Safe_Procedure_Context";
|
|
2
|
+
type Executer = {
|
|
3
|
+
'execute': (on_finished: () => void) => void;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* returns an {@link Async_Value }
|
|
7
|
+
* @param executer the function that produces the eventual value
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function __execute_safe_action(executer: Executer): Safe_Procedure_Context;
|
|
11
|
+
export declare const initialize_safe_procedure_context: () => Safe_Procedure_Context;
|
|
12
|
+
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.initialize_safe_procedure_context = void 0;
|
|
4
|
+
exports.__execute_safe_action = __execute_safe_action;
|
|
5
5
|
class Safe_Command_Result_Class {
|
|
6
6
|
constructor(executer) {
|
|
7
7
|
this.executer = executer;
|
|
8
8
|
}
|
|
9
9
|
execute(handle) {
|
|
10
|
-
return
|
|
10
|
+
return __execute_safe_action({
|
|
11
11
|
'execute': (on_finished) => {
|
|
12
12
|
this.executer.execute(() => {
|
|
13
|
-
handle((0, exports.
|
|
13
|
+
handle((0, exports.initialize_safe_procedure_context)()).__start(on_finished);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
});
|
|
@@ -24,14 +24,14 @@ class Safe_Command_Result_Class {
|
|
|
24
24
|
* @param executer the function that produces the eventual value
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
function
|
|
27
|
+
function __execute_safe_action(executer) {
|
|
28
28
|
return new Safe_Command_Result_Class(executer);
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
-
'execute': (
|
|
33
|
-
|
|
30
|
+
const initialize_safe_procedure_context = () => {
|
|
31
|
+
return new Safe_Command_Result_Class({
|
|
32
|
+
'execute': (on_finished) => {
|
|
33
|
+
on_finished(); //nothing to do, call on_finished immediately
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
exports.
|
|
37
|
+
exports.initialize_safe_procedure_context = initialize_safe_procedure_context;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Unsafe_Procedure_Context } from "./Unsafe_Procedure_Context";
|
|
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
|
|
17
|
-
export declare const
|
|
16
|
+
export declare function __execute_unsafe_action<E>(executer: Executer<E>): Unsafe_Procedure_Context<E>;
|
|
17
|
+
export declare const initialize_unsafe_procedure_context: <E>() => Unsafe_Procedure_Context<E>;
|
|
18
18
|
export {};
|
|
@@ -23,10 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.initialize_unsafe_procedure_context = void 0;
|
|
27
|
+
exports.__execute_unsafe_action = __execute_unsafe_action;
|
|
28
28
|
const _ei = __importStar(require("exupery-core-internals"));
|
|
29
|
-
const
|
|
29
|
+
const initialize_safe_procedure_context_1 = require("./initialize_safe_procedure_context");
|
|
30
30
|
const create_asynchronous_processes_monitor_1 = require("./create_asynchronous_processes_monitor");
|
|
31
31
|
class Unsafe_Command_Result_Class {
|
|
32
32
|
constructor(executer) {
|
|
@@ -36,22 +36,22 @@ class Unsafe_Command_Result_Class {
|
|
|
36
36
|
return new Unsafe_Command_Result_Class({
|
|
37
37
|
'execute': (new_on_success, new_on_exception) => {
|
|
38
38
|
this.executer.execute(new_on_success, ($) => {
|
|
39
|
-
handle((0,
|
|
39
|
+
handle((0, initialize_safe_procedure_context_1.initialize_safe_procedure_context)(), $).__start(() => new_on_exception(map($)));
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
catch(handle_exception) {
|
|
45
|
-
return (0,
|
|
45
|
+
return (0, initialize_safe_procedure_context_1.__execute_safe_action)({
|
|
46
46
|
'execute': (new_on_success) => {
|
|
47
47
|
this.executer.execute(new_on_success, ($) => {
|
|
48
|
-
handle_exception((0,
|
|
48
|
+
handle_exception((0, initialize_safe_procedure_context_1.initialize_safe_procedure_context)(), $).__start(new_on_success);
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
throw_exception($) {
|
|
54
|
-
return
|
|
54
|
+
return __execute_unsafe_action({
|
|
55
55
|
'execute': (on_finished, on_exception) => {
|
|
56
56
|
this.executer.execute(() => {
|
|
57
57
|
on_exception($);
|
|
@@ -63,7 +63,7 @@ class Unsafe_Command_Result_Class {
|
|
|
63
63
|
return new Unsafe_Command_Result_Class({
|
|
64
64
|
'execute': (new_on_success, new_on_exception) => {
|
|
65
65
|
this.executer.execute(() => {
|
|
66
|
-
handle((0, exports.
|
|
66
|
+
handle((0, exports.initialize_unsafe_procedure_context)()).__start(new_on_success, new_on_exception);
|
|
67
67
|
}, new_on_exception);
|
|
68
68
|
}
|
|
69
69
|
});
|
|
@@ -72,14 +72,14 @@ class Unsafe_Command_Result_Class {
|
|
|
72
72
|
return new Unsafe_Command_Result_Class({
|
|
73
73
|
'execute': (new_on_success, new_on_exception) => {
|
|
74
74
|
this.executer.execute(() => {
|
|
75
|
-
handle((0,
|
|
75
|
+
handle((0, initialize_safe_procedure_context_1.initialize_safe_procedure_context)()).__start(new_on_success);
|
|
76
76
|
}, new_on_exception);
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
execute_dictionary_unsafe($, aggregate_exceptions) {
|
|
81
81
|
let exceptions = {};
|
|
82
|
-
return
|
|
82
|
+
return __execute_unsafe_action({
|
|
83
83
|
'execute': (on_success, on_exception) => {
|
|
84
84
|
(0, create_asynchronous_processes_monitor_1.create_asynchronous_processes_monitor)((monitor) => {
|
|
85
85
|
$.map(($, key) => {
|
|
@@ -104,7 +104,7 @@ class Unsafe_Command_Result_Class {
|
|
|
104
104
|
}
|
|
105
105
|
execute_multiple_unsafe($, aggregate_exceptions) {
|
|
106
106
|
let exceptions = [];
|
|
107
|
-
return
|
|
107
|
+
return __execute_unsafe_action({
|
|
108
108
|
'execute': (on_success, on_exception) => {
|
|
109
109
|
(0, create_asynchronous_processes_monitor_1.create_asynchronous_processes_monitor)((monitor) => {
|
|
110
110
|
$.map(($) => {
|
|
@@ -136,14 +136,14 @@ class Unsafe_Command_Result_Class {
|
|
|
136
136
|
* @param executer the function that produces the eventual value
|
|
137
137
|
* @returns
|
|
138
138
|
*/
|
|
139
|
-
function
|
|
139
|
+
function __execute_unsafe_action(executer) {
|
|
140
140
|
return new Unsafe_Command_Result_Class(executer);
|
|
141
141
|
}
|
|
142
|
-
const
|
|
143
|
-
return
|
|
144
|
-
'execute': (on_success) => {
|
|
145
|
-
on_success();
|
|
142
|
+
const initialize_unsafe_procedure_context = () => {
|
|
143
|
+
return new Unsafe_Command_Result_Class({
|
|
144
|
+
'execute': (on_success, on_exception) => {
|
|
145
|
+
on_success(); //nothing to do, call on_finished immediately
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
};
|
|
149
|
-
exports.
|
|
149
|
+
exports.initialize_unsafe_procedure_context = initialize_unsafe_procedure_context;
|
package/dist/run_safe_query.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__run_safe_query = __run_safe_query;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const initialize_safe_procedure_context_1 = require("./initialize_safe_procedure_context");
|
|
5
|
+
const initialize_unsafe_procedure_context_1 = require("./initialize_unsafe_procedure_context");
|
|
6
6
|
class Safe_Query_Result_Class {
|
|
7
7
|
constructor(executer) {
|
|
8
8
|
this.executer = executer;
|
|
@@ -26,19 +26,19 @@ class Safe_Query_Result_Class {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
process_safe(handle_value) {
|
|
29
|
-
return (0,
|
|
29
|
+
return (0, initialize_safe_procedure_context_1.__execute_safe_action)({
|
|
30
30
|
'execute': (on_success) => {
|
|
31
31
|
this.executer.execute((value) => {
|
|
32
|
-
handle_value((0,
|
|
32
|
+
handle_value((0, initialize_safe_procedure_context_1.initialize_safe_procedure_context)(), value).__start(on_success);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
process_unsafe(handle_value) {
|
|
38
|
-
return (0,
|
|
38
|
+
return (0, initialize_unsafe_procedure_context_1.__execute_unsafe_action)({
|
|
39
39
|
'execute': (on_success, on_exception) => {
|
|
40
40
|
this.executer.execute((value) => {
|
|
41
|
-
handle_value((0,
|
|
41
|
+
handle_value((0, initialize_unsafe_procedure_context_1.initialize_unsafe_procedure_context)(), value).__start(on_success, on_exception);
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
});
|
package/dist/run_unsafe_query.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__run_unsafe_query = __run_unsafe_query;
|
|
4
4
|
const run_safe_query_1 = require("./run_safe_query");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const initialize_safe_procedure_context_1 = require("./initialize_safe_procedure_context");
|
|
6
|
+
const initialize_unsafe_procedure_context_1 = require("./initialize_unsafe_procedure_context");
|
|
7
7
|
class Unsafe_Query_Result_Class {
|
|
8
8
|
constructor(executer) {
|
|
9
9
|
this.executer = executer;
|
|
@@ -45,12 +45,12 @@ class Unsafe_Query_Result_Class {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
process(handle_exception, map_exception, handle_value) {
|
|
48
|
-
return (0,
|
|
48
|
+
return (0, initialize_unsafe_procedure_context_1.__execute_unsafe_action)({
|
|
49
49
|
'execute': (on_success, on_exception) => {
|
|
50
50
|
this.executer.execute((value) => {
|
|
51
|
-
handle_value((0,
|
|
51
|
+
handle_value((0, initialize_unsafe_procedure_context_1.initialize_unsafe_procedure_context)(), value).__start(on_success, on_exception);
|
|
52
52
|
}, (exception) => {
|
|
53
|
-
handle_exception((0,
|
|
53
|
+
handle_exception((0, initialize_safe_procedure_context_1.initialize_safe_procedure_context)(), exception).__start(() => on_exception(map_exception(exception)));
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
});
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import { Safe_Command_Result } from "./Safe_Command_Result";
|
|
3
|
-
export interface Unsafe_Command_Result<E> {
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* executes a command when an exception has occurred,
|
|
7
|
-
* but stays in the unsafe context
|
|
8
|
-
*
|
|
9
|
-
* this is useful when you want to do some cleanup
|
|
10
|
-
* or logging in case of an exception,
|
|
11
|
-
* but still want to propagate the exception further
|
|
12
|
-
*
|
|
13
|
-
* note that this is different from `catch`,
|
|
14
|
-
* which would switch to the safe context
|
|
15
|
-
*/
|
|
16
|
-
process_exception<NE>(handle: ($i: Safe_Command_Result, $: E) => Safe_Command_Result, map: ($: E) => NE): Unsafe_Command_Result<NE>;
|
|
17
|
-
throw_exception<E>($: E): Unsafe_Command_Result<E>;
|
|
18
|
-
catch(handle_exception: ($i: Safe_Command_Result, $: E) => Safe_Command_Result): Safe_Command_Result;
|
|
19
|
-
execute_unsafe(handle: ($i: Unsafe_Command_Result<E>) => Unsafe_Command_Result<E>): Unsafe_Command_Result<E>;
|
|
20
|
-
execute(handle: ($i: Safe_Command_Result) => Safe_Command_Result): Unsafe_Command_Result<E>;
|
|
21
|
-
execute_dictionary_unsafe<E2>($: _et.Dictionary<Unsafe_Command_Result<E2>>, aggregate_exceptions: ($: _et.Dictionary<E2>) => E): Unsafe_Command_Result<E>;
|
|
22
|
-
execute_multiple_unsafe<E2>($: _et.Array<Unsafe_Command_Result<E2>>, aggregate_exceptions: ($: _et.Array<E2>) => E): Unsafe_Command_Result<E>;
|
|
23
|
-
__start(on_success: () => void, on_exception: ($: E) => void): void;
|
|
24
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Safe_Command_Result } from "./Safe_Command_Result";
|
|
2
|
-
type Executer = {
|
|
3
|
-
'execute': (on_finished: () => void) => void;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* returns an {@link Async_Value }
|
|
7
|
-
* @param executer the function that produces the eventual value
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare function __execute_safe_command(executer: Executer): Safe_Command_Result;
|
|
11
|
-
export declare const initialize_safe_command: () => Safe_Command_Result;
|
|
12
|
-
export {};
|
|
File without changes
|
|
File without changes
|