@artstesh/postboy 2.1.9 → 2.1.10

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.
Files changed (34) hide show
  1. package/lib/i-postboy-depending.service.d.ts +3 -3
  2. package/lib/i-postboy-depending.service.js +2 -2
  3. package/lib/index.d.ts +10 -10
  4. package/lib/index.js +29 -29
  5. package/lib/locker.store.d.ts +8 -8
  6. package/lib/locker.store.js +26 -26
  7. package/lib/mocks/message-history-item-mock.d.ts +9 -9
  8. package/lib/mocks/message-history-item-mock.js +25 -25
  9. package/lib/mocks/message-history-mock.d.ts +8 -8
  10. package/lib/mocks/message-history-mock.js +23 -23
  11. package/lib/mocks/postboy-service-mock.d.ts +21 -21
  12. package/lib/mocks/postboy-service-mock.js +50 -50
  13. package/lib/models/message-queue.model.d.ts +43 -43
  14. package/lib/models/message-queue.model.js +65 -65
  15. package/lib/models/postboy-callback.message.d.ts +8 -8
  16. package/lib/models/postboy-callback.message.js +18 -18
  17. package/lib/models/postboy-execution.handler.d.ts +14 -14
  18. package/lib/models/postboy-execution.handler.js +16 -16
  19. package/lib/models/postboy-executor.d.ts +3 -3
  20. package/lib/models/postboy-executor.js +7 -7
  21. package/lib/models/postboy-generic-message.d.ts +7 -7
  22. package/lib/models/postboy-generic-message.js +18 -18
  23. package/lib/models/postboy-subscription.d.ts +6 -6
  24. package/lib/models/postboy-subscription.js +10 -10
  25. package/lib/models/postboy.locker.d.ts +5 -5
  26. package/lib/models/postboy.locker.js +2 -2
  27. package/lib/postboy-abstract.registrator.d.ts +113 -113
  28. package/lib/postboy-abstract.registrator.d.ts.map +1 -1
  29. package/lib/postboy-abstract.registrator.js +141 -141
  30. package/lib/postboy.service.d.ts +108 -105
  31. package/lib/postboy.service.d.ts.map +1 -1
  32. package/lib/postboy.service.js +161 -161
  33. package/lib/postboy.service.js.map +1 -1
  34. package/package.json +1 -1
@@ -1,142 +1,142 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostboyAbstractRegistrator = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const postboy_generic_message_1 = require("./models/postboy-generic-message");
6
- class PostboyAbstractRegistrator {
7
- constructor(postboy) {
8
- this.postboy = postboy;
9
- this.ids = [];
10
- this.services = [];
11
- /**
12
- * @deprecated The method should be replaced with recordReplay<T>
13
- */
14
- this.registerReplay = (id, bufferSize = 1) => this.register(id, new rxjs_1.ReplaySubject(bufferSize));
15
- /**
16
- * @deprecated The method should be replaced with recordBehavior<T>
17
- */
18
- this.registerBehavior = (id, initial) => this.register(id, new rxjs_1.BehaviorSubject(initial));
19
- /**
20
- * @deprecated The method should be replaced with recordSubject<T>
21
- */
22
- this.registerSubject = (id) => this.register(id, new rxjs_1.Subject());
23
- /**
24
- * A utility function that facilitates the recording and replaying of messages
25
- * using a ReplaySubject. This function is designed to handle messages of a
26
- * specific type and allows specifying a buffer size to determine how many
27
- * of the most recent messages should be replayed.
28
- *
29
- * @template T Extends the PostboyGenericMessage type, representing the type of message
30
- * to be recorded and replayed.
31
- * @param {MessageType<T>} type The constructor of the message type to be recorded and replayed.
32
- * @param {number} [bufferSize=1] The number of recent messages to retain in the ReplaySubject's buffer.
33
- * Defaults to 1 if not specified.
34
- * @returns The result of invoking the `record` method with the given message type and configured ReplaySubject.
35
- */
36
- this.recordReplay = (type, bufferSize = 1) => this.record(type, new rxjs_1.ReplaySubject(bufferSize));
37
- /**
38
- * Represents a method that records a specific behavior associated with a message type.
39
- * It creates a `BehaviorSubject` initialized with the provided initial message
40
- * and associates it with the given message type using the `record` method.
41
- *
42
- * @template T - A type parameter extending `PostboyGenericMessage` that defines the message structure.
43
- * @param {MessageType<T>} type - The constructor function of the message type to be recorded.
44
- * @param {T} initial - The initial value of the message that will be set in the `BehaviorSubject`.
45
- * @returns {void} - This function does not return a value; instead, it modifies the internal state.
46
- */
47
- this.recordBehavior = (type, initial) => this.record(type, new rxjs_1.BehaviorSubject(initial));
48
- /**
49
- * A function that creates and returns a new generic message recorder for a specific message type.
50
- *
51
- * @template T - A type parameter extending from `PostboyGenericMessage`.
52
- * @param {MessageType<T>} type - The constructor for the message type being recorded.
53
- * @returns {Subject<T>} A new instance of `Subject<T>` bound to the specified message type.
54
- */
55
- this.recordSubject = (type) => this.record(type, new rxjs_1.Subject());
56
- }
57
- /**
58
- * Registers a list of services to be used by the application.
59
- *
60
- * @param {IPostboyDependingService[]} services - An array of services to register.
61
- * @return {void} This method does not return a value.
62
- */
63
- registerServices(services) {
64
- this.services = services;
65
- }
66
- up() {
67
- this._up();
68
- this.services.forEach((s) => s.up());
69
- }
70
- /**
71
- * @deprecated The method should be replaced with recordExecutor<T>
72
- */
73
- registerExecutor(id, exec) {
74
- this.postboy.registerExecutor(id, exec);
75
- }
76
- /**
77
- * @deprecated The method should be replaced with record<T>
78
- */
79
- register(id, sub) {
80
- this.ids.push(id);
81
- this.postboy.register(id, sub);
82
- }
83
- /**
84
- * @deprecated The method should be replaced with recordWithPipe<T>
85
- */
86
- registerWithPipe(id, sub, pipe) {
87
- this.ids.push(id);
88
- this.postboy.registerWithPipe(id, sub, pipe);
89
- }
90
- down() {
91
- this.services = [];
92
- this.ids.forEach((id) => this.postboy.unregister(id));
93
- }
94
- // future
95
- /**
96
- * Records a type and its corresponding Subject<T> into the Postboy system and updates the internal identifiers.
97
- *
98
- * @param {MessageType<T>} type - A constructor for the generic message type T.
99
- * @param {Subject<T>} sub - The subject associated with the generic message type.
100
- * @return {this} Returns the current instance for method chaining.
101
- */
102
- record(type, sub) {
103
- this.ids.push((0, postboy_generic_message_1.checkId)(type));
104
- this.postboy.record(type, sub);
105
- return this;
106
- }
107
- /**
108
- * Records a message type with a specific subject and applies a transformation pipe to the subject.
109
- *
110
- * @param {MessageType<T>} type - The constructor of the message type to record, which extends PostboyGenericMessage.
111
- * @param {Subject<T>} sub - The Subject instance to associate with the message type.
112
- * @param {(s: Subject<T>) => Observable<T>} pipe - A function that takes the subject as input and returns an Observable with transformations applied.
113
- * @return {this} The current instance of the class for chaining.
114
- */
115
- recordWithPipe(type, sub, pipe) {
116
- this.ids.push((0, postboy_generic_message_1.checkId)(type));
117
- this.postboy.recordWithPipe(type, sub, pipe);
118
- return this;
119
- }
120
- /**
121
- * Records an executor associated with a specific type and execution logic.
122
- *
123
- * @param type The class constructor of the executor type to be recorded, which extends PostboyExecutor.
124
- * @param exec A callback function that executes the logic using an instance of the specified executor type.
125
- * @return void
126
- */
127
- recordExecutor(type, exec) {
128
- this.postboy.recordExecutor(type, exec);
129
- }
130
- /**
131
- * Records a handler for a specific executor type.
132
- *
133
- * @param executor The constructor of the executor type, which extends `PostboyExecutor`.
134
- * @param handler The execution handler associated with the given executor type.
135
- * @return void
136
- */
137
- recordHandler(executor, handler) {
138
- this.postboy.recordHandler(executor, handler);
139
- }
140
- }
141
- exports.PostboyAbstractRegistrator = PostboyAbstractRegistrator;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboyAbstractRegistrator = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const postboy_generic_message_1 = require("./models/postboy-generic-message");
6
+ class PostboyAbstractRegistrator {
7
+ constructor(postboy) {
8
+ this.postboy = postboy;
9
+ this.ids = [];
10
+ this.services = [];
11
+ /**
12
+ * @deprecated The method should be replaced with recordReplay<T>
13
+ */
14
+ this.registerReplay = (id, bufferSize = 1) => this.register(id, new rxjs_1.ReplaySubject(bufferSize));
15
+ /**
16
+ * @deprecated The method should be replaced with recordBehavior<T>
17
+ */
18
+ this.registerBehavior = (id, initial) => this.register(id, new rxjs_1.BehaviorSubject(initial));
19
+ /**
20
+ * @deprecated The method should be replaced with recordSubject<T>
21
+ */
22
+ this.registerSubject = (id) => this.register(id, new rxjs_1.Subject());
23
+ /**
24
+ * A utility function that facilitates the recording and replaying of messages
25
+ * using a ReplaySubject. This function is designed to handle messages of a
26
+ * specific type and allows specifying a buffer size to determine how many
27
+ * of the most recent messages should be replayed.
28
+ *
29
+ * @template T Extends the PostboyGenericMessage type, representing the type of message
30
+ * to be recorded and replayed.
31
+ * @param {MessageType<T>} type The constructor of the message type to be recorded and replayed.
32
+ * @param {number} [bufferSize=1] The number of recent messages to retain in the ReplaySubject's buffer.
33
+ * Defaults to 1 if not specified.
34
+ * @returns The result of invoking the `record` method with the given message type and configured ReplaySubject.
35
+ */
36
+ this.recordReplay = (type, bufferSize = 1) => this.record(type, new rxjs_1.ReplaySubject(bufferSize));
37
+ /**
38
+ * Represents a method that records a specific behavior associated with a message type.
39
+ * It creates a `BehaviorSubject` initialized with the provided initial message
40
+ * and associates it with the given message type using the `record` method.
41
+ *
42
+ * @template T - A type parameter extending `PostboyGenericMessage` that defines the message structure.
43
+ * @param {MessageType<T>} type - The constructor function of the message type to be recorded.
44
+ * @param {T} initial - The initial value of the message that will be set in the `BehaviorSubject`.
45
+ * @returns {void} - This function does not return a value; instead, it modifies the internal state.
46
+ */
47
+ this.recordBehavior = (type, initial) => this.record(type, new rxjs_1.BehaviorSubject(initial));
48
+ /**
49
+ * A function that creates and returns a new generic message recorder for a specific message type.
50
+ *
51
+ * @template T - A type parameter extending from `PostboyGenericMessage`.
52
+ * @param {MessageType<T>} type - The constructor for the message type being recorded.
53
+ * @returns {Subject<T>} A new instance of `Subject<T>` bound to the specified message type.
54
+ */
55
+ this.recordSubject = (type) => this.record(type, new rxjs_1.Subject());
56
+ }
57
+ /**
58
+ * Registers a list of services to be used by the application.
59
+ *
60
+ * @param {IPostboyDependingService[]} services - An array of services to register.
61
+ * @return {void} This method does not return a value.
62
+ */
63
+ registerServices(services) {
64
+ this.services = services;
65
+ }
66
+ up() {
67
+ this._up();
68
+ this.services.forEach((s) => s.up());
69
+ }
70
+ /**
71
+ * @deprecated The method should be replaced with recordExecutor<T>
72
+ */
73
+ registerExecutor(id, exec) {
74
+ this.postboy.registerExecutor(id, exec);
75
+ }
76
+ /**
77
+ * @deprecated The method should be replaced with record<T>
78
+ */
79
+ register(id, sub) {
80
+ this.ids.push(id);
81
+ this.postboy.register(id, sub);
82
+ }
83
+ /**
84
+ * @deprecated The method should be replaced with recordWithPipe<T>
85
+ */
86
+ registerWithPipe(id, sub, pipe) {
87
+ this.ids.push(id);
88
+ this.postboy.registerWithPipe(id, sub, pipe);
89
+ }
90
+ down() {
91
+ this.services = [];
92
+ this.ids.forEach((id) => this.postboy.unregister(id));
93
+ }
94
+ // future
95
+ /**
96
+ * Records a type and its corresponding Subject<T> into the Postboy system and updates the internal identifiers.
97
+ *
98
+ * @param {MessageType<T>} type - A constructor for the generic message type T.
99
+ * @param {Subject<T>} sub - The subject associated with the generic message type.
100
+ * @return {this} Returns the current instance for method chaining.
101
+ */
102
+ record(type, sub) {
103
+ this.ids.push((0, postboy_generic_message_1.checkId)(type));
104
+ this.postboy.record(type, sub);
105
+ return this;
106
+ }
107
+ /**
108
+ * Records a message type with a specific subject and applies a transformation pipe to the subject.
109
+ *
110
+ * @param {MessageType<T>} type - The constructor of the message type to record, which extends PostboyGenericMessage.
111
+ * @param {Subject<T>} sub - The Subject instance to associate with the message type.
112
+ * @param {(s: Subject<T>) => Observable<T>} pipe - A function that takes the subject as input and returns an Observable with transformations applied.
113
+ * @return {this} The current instance of the class for chaining.
114
+ */
115
+ recordWithPipe(type, sub, pipe) {
116
+ this.ids.push((0, postboy_generic_message_1.checkId)(type));
117
+ this.postboy.recordWithPipe(type, sub, pipe);
118
+ return this;
119
+ }
120
+ /**
121
+ * Records an executor associated with a specific type and execution logic.
122
+ *
123
+ * @param type The class constructor of the executor type to be recorded, which extends PostboyExecutor.
124
+ * @param exec A callback function that executes the logic using an instance of the specified executor type.
125
+ * @return void
126
+ */
127
+ recordExecutor(type, exec) {
128
+ this.postboy.recordExecutor(type, exec);
129
+ }
130
+ /**
131
+ * Records a handler for a specific executor type.
132
+ *
133
+ * @param executor The constructor of the executor type, which extends `PostboyExecutor`.
134
+ * @param handler The execution handler associated with the given executor type.
135
+ * @return void
136
+ */
137
+ recordHandler(executor, handler) {
138
+ this.postboy.recordHandler(executor, handler);
139
+ }
140
+ }
141
+ exports.PostboyAbstractRegistrator = PostboyAbstractRegistrator;
142
142
  //# sourceMappingURL=postboy-abstract.registrator.js.map
@@ -1,106 +1,109 @@
1
- import { Observable, Subject } from 'rxjs';
2
- import { PostboyGenericMessage } from './models/postboy-generic-message';
3
- import { PostboyLocker } from './models/postboy.locker';
4
- import { PostboyExecutor } from './models/postboy-executor';
5
- import { PostboyCallbackMessage } from './models/postboy-callback.message';
6
- import { MessageType } from './postboy-abstract.registrator';
7
- import { PostboyExecutionHandler } from './models/postboy-execution.handler';
8
- export declare class PostboyService {
9
- private applications;
10
- private locker;
11
- private executors;
12
- /**
13
- * Adds a locker to the current list of lockers.
14
- *
15
- * @param {PostboyLocker} locker - The locker object to be added.
16
- * @return {void} This method does not return a value.
17
- */
18
- addLocker(locker: PostboyLocker): void;
19
- /**
20
- * @deprecated The method should be replaced with recordExecutor<T>
21
- */
22
- registerExecutor<E extends PostboyExecutor<T>, T>(id: string, exec: (e: E) => T): void;
23
- /**
24
- * @deprecated The method should be replaced with exec<T>
25
- */
26
- execute<E extends PostboyExecutor<T>, T>(executor: E): T;
27
- /**
28
- * @deprecated The method should be replaced with record<T>
29
- */
30
- register<T>(id: string, sub: Subject<T>): void;
31
- /**
32
- * @deprecated The method should be replaced with recordWithPipe<T>
33
- */
34
- registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
35
- unregister(id: string): void;
36
- /**
37
- * @deprecated The method should be replaced with sub<T>
38
- */
39
- subscribe<T>(id: string): Observable<T>;
40
- /**
41
- * Fires a registered event and passes the message to its subscribers.
42
- *
43
- * @param {PostboyGenericMessage} message - The message object containing the event data.
44
- * @return {void} This method does not return a value.
45
- * @throws {Error} Throws an error if no registered event is found for the provided message ID.
46
- */
47
- fire(message: PostboyGenericMessage): void;
48
- /**
49
- * Triggers a callback function associated with a given message.
50
- *
51
- * @param {PostboyCallbackMessage<T>} message - The message object used to trigger the callback.
52
- * It contains details about the event and result subscription.
53
- * @param {(e: T) => void} [action] - Optional callback function to execute when the result of the message is emitted.
54
- * @return {void} This method does not return any value.
55
- */
56
- fireCallback<T>(message: PostboyCallbackMessage<T>, action?: (e: T) => void): Observable<T>;
57
- /**
58
- * Subscribes to a specific message type and returns an observable of that type.
59
- *
60
- * @param type The constructor function of the type that extends PostboyGenericMessage.
61
- * @return An Observable of the specified generic message type.
62
- */
63
- sub<T extends PostboyGenericMessage>(type: MessageType<T>): Observable<T>;
64
- /**
65
- * Registers a given message type and its associated subject subscription with the system.
66
- *
67
- * @param type The constructor function of the message type that extends the PostboyGenericMessage.
68
- * @param sub The Subject instance for the provided message type, used for managing subscriptions.
69
- * @return {void} No return value.
70
- */
71
- record<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>): void;
72
- /**
73
- * Registers a generic message type with a Subject and a transformation pipe.
74
- *
75
- * @param {MessageType<T>} type - The constructor of the message type being registered.
76
- * @param {Subject<T>} sub - The Subject instance used to handle incoming messages of the specified type.
77
- * @param {(s: Subject<T>) => Observable<T>} pipe - A function that applies a transformation or processing logic to the Subject and returns an Observable.
78
- * @return {void} No return value.
79
- */
80
- recordWithPipe<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
81
- /**
82
- * Records an executor instance and its corresponding execution function.
83
- *
84
- * @param {new (...args: any[]) => E} type - The constructor type of the executor.
85
- * @param {(e: E) => T} exec - The function to execute with the provided executor instance.
86
- * @return {void} No return value.
87
- */
88
- recordExecutor<E extends PostboyExecutor<T>, T>(type: new (...args: any[]) => E, exec: (e: E) => T): void;
89
- /**
90
- * Executes the provided executor function and returns its result.
91
- *
92
- * @param {PostboyExecutor<T>} executor The executor to be executed, which includes its identifier and logic.
93
- * @return {T} The resulting output from the executed executor function.
94
- * @throws {Error} If the specified executor is not registered.
95
- */
96
- exec<T>(executor: PostboyExecutor<T>): T;
97
- /**
98
- * Manages the recording of an executor and its corresponding handler into internal storage.
99
- *
100
- * @param {new (...args: any[]) => E} executor - The constructor for a class extending PostboyExecutor, used to register the executor type.
101
- * @param {PostboyExecutionHandler<R, E>} handler - The handler responsible for processing the specific executor.
102
- * @return {void} No return value.
103
- */
104
- recordHandler<E extends PostboyExecutor<R>, R>(executor: new (...args: any[]) => E, handler: PostboyExecutionHandler<R, E>): void;
105
- }
1
+ import { Observable, Subject } from 'rxjs';
2
+ import { PostboyGenericMessage } from './models/postboy-generic-message';
3
+ import { LockerStore } from './locker.store';
4
+ import { PostboyLocker } from './models/postboy.locker';
5
+ import { PostboySubscription } from './models/postboy-subscription';
6
+ import { PostboyExecutor } from './models/postboy-executor';
7
+ import { PostboyCallbackMessage } from './models/postboy-callback.message';
8
+ import { Dictionary } from '@artstesh/collections';
9
+ import { MessageType } from './postboy-abstract.registrator';
10
+ import { PostboyExecutionHandler } from './models/postboy-execution.handler';
11
+ export declare class PostboyService {
12
+ protected applications: Dictionary<PostboySubscription<any>>;
13
+ protected locker: LockerStore;
14
+ protected executors: Dictionary<(e: PostboyExecutor<any>) => any>;
15
+ /**
16
+ * Adds a locker to the current list of lockers.
17
+ *
18
+ * @param {PostboyLocker} locker - The locker object to be added.
19
+ * @return {void} This method does not return a value.
20
+ */
21
+ addLocker(locker: PostboyLocker): void;
22
+ /**
23
+ * @deprecated The method should be replaced with recordExecutor<T>
24
+ */
25
+ registerExecutor<E extends PostboyExecutor<T>, T>(id: string, exec: (e: E) => T): void;
26
+ /**
27
+ * @deprecated The method should be replaced with exec<T>
28
+ */
29
+ execute<E extends PostboyExecutor<T>, T>(executor: E): T;
30
+ /**
31
+ * @deprecated The method should be replaced with record<T>
32
+ */
33
+ register<T>(id: string, sub: Subject<T>): void;
34
+ /**
35
+ * @deprecated The method should be replaced with recordWithPipe<T>
36
+ */
37
+ registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
38
+ unregister(id: string): void;
39
+ /**
40
+ * @deprecated The method should be replaced with sub<T>
41
+ */
42
+ subscribe<T>(id: string): Observable<T>;
43
+ /**
44
+ * Fires a registered event and passes the message to its subscribers.
45
+ *
46
+ * @param {PostboyGenericMessage} message - The message object containing the event data.
47
+ * @return {void} This method does not return a value.
48
+ * @throws {Error} Throws an error if no registered event is found for the provided message ID.
49
+ */
50
+ fire(message: PostboyGenericMessage): void;
51
+ /**
52
+ * Triggers a callback function associated with a given message.
53
+ *
54
+ * @param {PostboyCallbackMessage<T>} message - The message object used to trigger the callback.
55
+ * It contains details about the event and result subscription.
56
+ * @param {(e: T) => void} [action] - Optional callback function to execute when the result of the message is emitted.
57
+ * @return {void} This method does not return any value.
58
+ */
59
+ fireCallback<T>(message: PostboyCallbackMessage<T>, action?: (e: T) => void): Observable<T>;
60
+ /**
61
+ * Subscribes to a specific message type and returns an observable of that type.
62
+ *
63
+ * @param type The constructor function of the type that extends PostboyGenericMessage.
64
+ * @return An Observable of the specified generic message type.
65
+ */
66
+ sub<T extends PostboyGenericMessage>(type: MessageType<T>): Observable<T>;
67
+ /**
68
+ * Registers a given message type and its associated subject subscription with the system.
69
+ *
70
+ * @param type The constructor function of the message type that extends the PostboyGenericMessage.
71
+ * @param sub The Subject instance for the provided message type, used for managing subscriptions.
72
+ * @return {void} No return value.
73
+ */
74
+ record<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>): void;
75
+ /**
76
+ * Registers a generic message type with a Subject and a transformation pipe.
77
+ *
78
+ * @param {MessageType<T>} type - The constructor of the message type being registered.
79
+ * @param {Subject<T>} sub - The Subject instance used to handle incoming messages of the specified type.
80
+ * @param {(s: Subject<T>) => Observable<T>} pipe - A function that applies a transformation or processing logic to the Subject and returns an Observable.
81
+ * @return {void} No return value.
82
+ */
83
+ recordWithPipe<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
84
+ /**
85
+ * Records an executor instance and its corresponding execution function.
86
+ *
87
+ * @param {new (...args: any[]) => E} type - The constructor type of the executor.
88
+ * @param {(e: E) => T} exec - The function to execute with the provided executor instance.
89
+ * @return {void} No return value.
90
+ */
91
+ recordExecutor<E extends PostboyExecutor<T>, T>(type: new (...args: any[]) => E, exec: (e: E) => T): void;
92
+ /**
93
+ * Executes the provided executor function and returns its result.
94
+ *
95
+ * @param {PostboyExecutor<T>} executor The executor to be executed, which includes its identifier and logic.
96
+ * @return {T} The resulting output from the executed executor function.
97
+ * @throws {Error} If the specified executor is not registered.
98
+ */
99
+ exec<T>(executor: PostboyExecutor<T>): T;
100
+ /**
101
+ * Manages the recording of an executor and its corresponding handler into internal storage.
102
+ *
103
+ * @param {new (...args: any[]) => E} executor - The constructor for a class extending PostboyExecutor, used to register the executor type.
104
+ * @param {PostboyExecutionHandler<R, E>} handler - The handler responsible for processing the specific executor.
105
+ * @return {void} No return value.
106
+ */
107
+ recordHandler<E extends PostboyExecutor<R>, R>(executor: new (...args: any[]) => E, handler: PostboyExecutionHandler<R, E>): void;
108
+ }
106
109
  //# sourceMappingURL=postboy.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postboy.service.d.ts","sourceRoot":"","sources":["../src/postboy.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAW,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,qBAAa,cAAc;IACzB,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,SAAS,CAAsD;IAEvE;;;;;OA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