patron-oop 1.43.0 → 1.45.0

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 (89) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/patron.cjs +295 -275
  3. package/dist/patron.cjs.map +1 -1
  4. package/dist/patron.d.ts +181 -155
  5. package/dist/patron.js +283 -268
  6. package/dist/patron.js.map +1 -1
  7. package/dist/patron.min.js +1 -1
  8. package/dist/patron.min.mjs +1 -1
  9. package/dist/patron.min.mjs.map +1 -1
  10. package/dist/patron.mjs +283 -268
  11. package/dist/patron.mjs.map +1 -1
  12. package/package.json +1 -1
  13. package/src/Guest/Guest.test.ts +11 -6
  14. package/src/Guest/Guest.ts +7 -14
  15. package/src/Guest/GuestApplied.test.ts +13 -0
  16. package/src/Guest/GuestApplied.ts +16 -0
  17. package/src/Guest/GuestCast.test.ts +4 -5
  18. package/src/Guest/GuestCast.ts +3 -10
  19. package/src/Guest/GuestDisposable.test.ts +13 -17
  20. package/src/Guest/GuestDisposable.ts +3 -3
  21. package/src/Guest/GuestExecutorApplied.test.ts +27 -0
  22. package/src/Guest/GuestExecutorApplied.ts +23 -0
  23. package/src/Guest/GuestObject.test.ts +6 -6
  24. package/src/Guest/GuestObject.ts +3 -3
  25. package/src/Guest/GuestPool.test.ts +5 -22
  26. package/src/Guest/GuestPool.ts +7 -8
  27. package/src/Guest/GuestSync.test.ts +2 -2
  28. package/src/Patron/Patron.test.ts +4 -5
  29. package/src/Patron/Patron.ts +11 -3
  30. package/src/Patron/PatronOnce.sourceEmpty.test.ts +2 -2
  31. package/src/Patron/PatronOnce.test.ts +2 -2
  32. package/src/Patron/PatronOnce.ts +3 -9
  33. package/src/Patron/PatronPool.test.ts +2 -1
  34. package/src/Patron/PatronPool.ts +22 -27
  35. package/src/Private/PrivateClass.modules.test.ts +11 -8
  36. package/src/Private/PrivateClass.test.ts +7 -6
  37. package/src/Source/Source.test.ts +9 -5
  38. package/src/Source/Source.ts +46 -30
  39. package/src/Source/SourceActive.test.ts +13 -0
  40. package/src/Source/SourceActive.ts +41 -0
  41. package/src/Source/SourceAll._asArray.test.ts +22 -0
  42. package/src/Source/SourceAll._twoValuesAfter.test.ts +19 -0
  43. package/src/Source/SourceAll._twoValuesBefore.test.ts +19 -0
  44. package/src/Source/SourceAll._withPatron.test.ts +25 -0
  45. package/src/{Guest/GuestAwareAll.ts → Source/SourceAll.ts} +11 -11
  46. package/src/Source/SourceApplied.test.ts +14 -0
  47. package/src/Source/SourceApplied.ts +23 -0
  48. package/src/Source/SourceDynamic.ofSource.test.ts +12 -12
  49. package/src/Source/SourceDynamic.test.ts +9 -9
  50. package/src/Source/SourceDynamic.ts +7 -7
  51. package/src/Source/SourceExecutorApplied.test.ts +30 -0
  52. package/src/Source/SourceExecutorApplied.ts +22 -0
  53. package/src/Source/SourceMap.defered.test.ts +46 -0
  54. package/src/Source/SourceMap.fn.test.ts +27 -0
  55. package/src/Source/SourceMap.test.ts +32 -0
  56. package/src/Source/SourceMap.ts +48 -0
  57. package/src/Source/SourceOnce.notcalled.test.ts +13 -0
  58. package/src/Source/SourceOnce.test.ts +10 -0
  59. package/src/Source/SourceOnce.ts +31 -0
  60. package/src/Source/SourceRace.test.ts +46 -0
  61. package/src/Source/SourceRace.ts +30 -0
  62. package/src/Source/SourceSequence.defered.test.ts +53 -0
  63. package/src/Source/SourceSequence.test.ts +30 -0
  64. package/src/{Guest/GuestAwareSequence.ts → Source/SourceSequence.ts} +14 -19
  65. package/src/Source/SourceWithPool.empty.test.ts +14 -0
  66. package/src/Source/SourceWithPool.test.ts +10 -0
  67. package/src/Source/SourceWithPool.ts +58 -0
  68. package/src/index.ts +9 -7
  69. package/test-utils/debounce.ts +11 -0
  70. package/test-utils/id.ts +1 -0
  71. package/test-utils/wait.ts +6 -3
  72. package/src/Guest/GuestAware.test.ts +0 -13
  73. package/src/Guest/GuestAware.ts +0 -59
  74. package/src/Guest/GuestAwareActive.test.ts +0 -12
  75. package/src/Guest/GuestAwareActive.ts +0 -42
  76. package/src/Guest/GuestAwareAll._asArray.test.ts +0 -19
  77. package/src/Guest/GuestAwareAll._twoValuesAfter.test.ts +0 -16
  78. package/src/Guest/GuestAwareAll._twoValuesBefore.test.ts +0 -16
  79. package/src/Guest/GuestAwareAll._withPatron.test.ts +0 -22
  80. package/src/Guest/GuestAwareMap.defered.test.ts +0 -46
  81. package/src/Guest/GuestAwareMap.fn.test.ts +0 -27
  82. package/src/Guest/GuestAwareMap.test.ts +0 -29
  83. package/src/Guest/GuestAwareMap.ts +0 -48
  84. package/src/Guest/GuestAwareRace.test.ts +0 -46
  85. package/src/Guest/GuestAwareRace.ts +0 -33
  86. package/src/Guest/GuestAwareSequence.defered.test.ts +0 -58
  87. package/src/Guest/GuestAwareSequence.test.ts +0 -30
  88. package/src/Source/SourceEmpty.test.ts +0 -20
  89. package/src/Source/SourceEmpty.ts +0 -31
package/dist/patron.d.ts CHANGED
@@ -1,17 +1,14 @@
1
1
  type GuestIntroduction = "guest" | "patron";
2
- interface GiveOptions {
3
- data?: unknown;
4
- }
5
- type GuestExecutorType<T = any, This = void> = (value: T, options?: GiveOptions) => This;
2
+ type GuestExecutorType<T = any, This = void> = (value: T) => This;
6
3
  interface GuestObjectType<T = any> {
7
- give(value: T, options?: GiveOptions): this;
4
+ give(value: T): this;
8
5
  introduction?(): GuestIntroduction;
9
6
  }
10
7
  type GuestType<T = any> = GuestExecutorType<T> | GuestObjectType<T>;
11
8
  /**
12
9
  * @url https://kosukhin.github.io/patron.site/#/utils/give
13
10
  */
14
- declare function give<T>(data: T, guest: GuestType<T>, options?: GiveOptions): void;
11
+ declare function give<T>(data: T, guest: GuestType<T>): void;
15
12
  /**
16
13
  * @url https://kosukhin.github.io/patron.site/#/utils/is-guest
17
14
  */
@@ -22,72 +19,40 @@ declare function isGuest(mbGuest: any): mbGuest is GuestType;
22
19
  declare class Guest<T> implements GuestObjectType<T> {
23
20
  private receiver;
24
21
  constructor(receiver: GuestExecutorType<T>);
25
- give(value: T, options?: GiveOptions): this;
26
- }
27
-
28
- type GuestAwareExecutorType<T> = (guest: GuestType<T>) => unknown;
29
- interface GuestAwareObjectType<T> {
30
- value: GuestAwareExecutorType<T>;
31
- }
32
- type GuestAwareType<T = any> = GuestAwareExecutorType<T> | GuestAwareObjectType<T>;
33
- /**
34
- * @url https://kosukhin.github.io/patron.site/#/utils/give
35
- */
36
- declare function value<T>(guestAware: GuestAwareType<T>, guest: GuestType<T>): unknown;
37
- /**
38
- * @url https://kosukhin.github.io/patron.site/#/utils/is-guest-aware
39
- */
40
- declare function isGuestAware(mbGuestAware: any): mbGuestAware is GuestAwareType;
41
- /**
42
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-aware
43
- */
44
- declare class GuestAware<T = any> implements GuestAwareObjectType<T> {
45
- private guestAware;
46
- constructor(guestAware: GuestAwareType<T>);
47
- value(guest: GuestType<T>): GuestType<T>;
22
+ give(value: T): this;
48
23
  }
49
24
 
50
- /**
51
- * @url https://kosukhin.github.io/patron.site/#/utils/private
52
- */
53
- interface PrivateType<T> {
54
- get<R extends unknown[], CT = null>(...args: R): CT extends null ? T : CT;
55
- }
56
- declare class Private<T> implements PrivateType<T> {
57
- private buildingFn;
58
- constructor(buildingFn: (...args: any[]) => T);
59
- get<R extends unknown[], CT = null>(...args: R): CT extends null ? T : CT;
25
+ interface GuestDisposableType<T = any> extends GuestObjectType<T> {
26
+ disposed(value: T | null): boolean;
60
27
  }
61
-
28
+ type MaybeDisposableType<T = any> = Partial<GuestDisposableType<T>>;
62
29
  /**
63
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-aware-sequence
30
+ * @url https://kosukhin.github.io/patron.site/#/guest/guest-disposable
64
31
  */
65
- declare class GuestAwareSequence<T, TG> implements GuestAwareObjectType<TG[]> {
66
- private baseSource;
67
- private targetSource;
68
- constructor(baseSource: GuestAwareType<T[]>, targetSource: PrivateType<GuestAwareType<TG>>);
69
- value(guest: GuestType<TG[]>): this;
32
+ declare class GuestDisposable<T> implements GuestDisposableType<T> {
33
+ private guest;
34
+ private disposeCheck;
35
+ constructor(guest: GuestType, disposeCheck: (value: T | null) => boolean);
36
+ disposed(value: T | null): boolean;
37
+ give(value: T): this;
70
38
  }
71
39
 
72
40
  /**
73
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-aware-map
41
+ * @url https://kosukhin.github.io/patron.site/#/guest/guest-cast
74
42
  */
75
- declare class GuestAwareMap<T, TG> implements GuestAwareObjectType<TG[]> {
76
- private baseSource;
77
- private targetSource;
78
- constructor(baseSource: GuestAwareType<T[]>, targetSource: PrivateType<GuestAwareType<TG>>);
79
- value(guest: GuestType<TG[]>): this;
43
+ declare class GuestCast<T> implements GuestDisposableType<T> {
44
+ private sourceGuest;
45
+ private targetGuest;
46
+ constructor(sourceGuest: GuestType<any>, targetGuest: GuestType<T>);
47
+ introduction(): "guest" | "patron";
48
+ give(value: T): this;
49
+ disposed(value: T | null): boolean;
80
50
  }
81
51
 
82
52
  /**
83
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-aware-race
53
+ * @url https://kosukhin.github.io/patron.site/#/utils/patron-pools
84
54
  */
85
- declare class GuestAwareRace<T> implements GuestAwareObjectType<T> {
86
- private guestAwares;
87
- constructor(guestAwares: GuestAwareType<T>[]);
88
- value(guest: GuestType<T>): this;
89
- }
90
-
55
+ declare const patronPools: (patron: GuestObjectType) => PoolType<any>[];
91
56
  /**
92
57
  * @url https://kosukhin.github.io/patron.site/#/utils/remove-patron-from-pools
93
58
  */
@@ -108,7 +73,7 @@ interface PoolType<T = any> extends GuestObjectType<T> {
108
73
  declare class PatronPool<T> implements PoolType<T> {
109
74
  private initiator;
110
75
  private patrons;
111
- give: (value: T, options?: GiveOptions) => this;
76
+ give: (value: T) => this;
112
77
  constructor(initiator: unknown);
113
78
  size(): number;
114
79
  add(shouldBePatron: GuestType<T>): this;
@@ -118,76 +83,116 @@ declare class PatronPool<T> implements PoolType<T> {
118
83
  private guestDisposed;
119
84
  }
120
85
 
121
- interface PoolAware<T = any> {
122
- pool(): PatronPool<T>;
123
- }
124
86
  /**
125
- * @url https://kosukhin.github.io/patron.site/#/source
87
+ * @url https://kosukhin.github.io/patron.site/#/guest/guest-pool
126
88
  */
127
- type SourceType<T = any> = GuestAwareObjectType<T> & GuestObjectType<T> & PoolAware<T>;
128
- declare class Source<T> implements SourceType<T> {
129
- private sourceDocument;
130
- private thePool;
131
- constructor(sourceDocument: T);
132
- pool(): PatronPool<unknown>;
89
+ declare class GuestPool<T> implements GuestObjectType<T>, PoolType<T> {
90
+ private guests;
91
+ private patronPool;
92
+ constructor(initiator: unknown);
133
93
  give(value: T): this;
134
- value(guest: GuestType<T>): this;
94
+ add(guest: GuestType<T>): this;
95
+ remove(patron: GuestObjectType<T>): this;
96
+ distribute(receiving: T, possiblePatron: GuestObjectType<T>): this;
97
+ size(): number;
98
+ private deliverToGuests;
135
99
  }
136
100
 
101
+ interface GuestValueType<T = any> extends GuestObjectType<T> {
102
+ value(): T;
103
+ }
137
104
  /**
138
- * @url https://kosukhin.github.io/patron.site/#/utils/action-type
105
+ * @url https://kosukhin.github.io/patron.site/#/guest/guest-sync
139
106
  */
140
- interface ActionType<P = any> {
141
- do(config: P): this;
107
+ declare class GuestSync<T> implements GuestValueType<T> {
108
+ private theValue;
109
+ constructor(theValue: T);
110
+ give(value: T): this;
111
+ value(): T;
142
112
  }
143
- interface GuestAwareAcitveType<R = unknown, T = unknown> extends GuestAwareObjectType<T>, ActionType<R> {
113
+
114
+ /**
115
+ * @url https://kosukhin.github.io/patron.site/#/guest/guest-object
116
+ */
117
+ declare class GuestObject<T> implements GuestDisposableType<T> {
118
+ private baseGuest;
119
+ constructor(baseGuest: GuestType<T>);
120
+ give(value: T): this;
121
+ introduction(): "guest" | "patron";
122
+ disposed(value: T | null): boolean;
144
123
  }
124
+
145
125
  /**
146
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-aware-active
126
+ * @url https://kosukhin.github.io/patron.site/#/guest/guest-applied
147
127
  */
148
- declare class GuestAwareActive<R, T> implements GuestAwareAcitveType<R, T> {
149
- private configExecutor;
150
- private source;
151
- constructor(configExecutor: (config: R, source: SourceType<T>) => void);
152
- do(config: R): this;
153
- value(guest: GuestType<T>): this;
128
+ declare class GuestApplied<T, R> implements GuestObjectType<T> {
129
+ private baseGuest;
130
+ private applier;
131
+ constructor(baseGuest: GuestType<R>, applier: (value: T) => R);
132
+ give(value: T): this;
154
133
  }
155
134
 
156
- interface GuestDisposableType<T = any> extends GuestObjectType<T> {
135
+ /**
136
+ * @url https://kosukhin.github.io/patron.site/#/patron
137
+ */
138
+ declare class Patron<T> implements GuestDisposableType<T> {
139
+ private willBePatron;
140
+ constructor(willBePatron: GuestType<T>);
141
+ introduction(): "patron";
142
+ give(value: T): this;
157
143
  disposed(value: T | null): boolean;
158
144
  }
159
- type MaybeDisposableType<T = any> = Partial<GuestDisposableType<T>>;
160
145
  /**
161
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-disposable
146
+ * @url https://kosukhin.github.io/patron.site/#/utils/is-patron
162
147
  */
163
- declare class GuestDisposable<T> implements GuestDisposableType<T> {
164
- private guest;
165
- private disposeCheck;
166
- constructor(guest: GuestType, disposeCheck: (value: T | null) => boolean);
148
+ declare const isPatron: (guest: GuestType) => guest is Patron<unknown>;
149
+
150
+ /**
151
+ * @url https://kosukhin.github.io/patron.site/#/patron/patron-once
152
+ */
153
+ declare class PatronOnce<T> implements GuestDisposableType<T> {
154
+ private baseGuest;
155
+ private received;
156
+ constructor(baseGuest: GuestType<T>);
157
+ introduction(): "patron";
158
+ give(value: T): this;
167
159
  disposed(value: T | null): boolean;
168
- give(value: T, options?: GiveOptions): this;
169
160
  }
170
161
 
162
+ type SourceExecutorType<T> = (guest: GuestType<T>) => unknown;
163
+ interface SourceObjectType<T> {
164
+ value: SourceExecutorType<T>;
165
+ }
166
+ type SourceType<T = any> = SourceExecutorType<T> | SourceObjectType<T>;
171
167
  /**
172
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-cast
168
+ * @url https://kosukhin.github.io/patron.site/#/utils/value
173
169
  */
174
- declare class GuestCast<T> implements GuestDisposableType<T> {
175
- private sourceGuest;
176
- private targetGuest;
177
- constructor(sourceGuest: GuestType<any>, targetGuest: GuestType<T>);
178
- introduction(): "guest" | "patron";
179
- give(value: T, options?: GiveOptions): this;
180
- disposed(value: T | null): boolean;
170
+ declare function value<T>(source: SourceType<T>, guest: GuestType<T>): unknown;
171
+ /**
172
+ * @url https://kosukhin.github.io/patron.site/#/utils/is-source
173
+ */
174
+ declare function isSource(mbSource: any): mbSource is SourceType;
175
+ /**
176
+ * @url https://kosukhin.github.io/patron.site/#/guest/source
177
+ */
178
+ declare class Source<T = any> implements SourceObjectType<T> {
179
+ private source;
180
+ constructor(source: SourceType<T>);
181
+ value(guest: GuestType<T>): GuestType<T>;
181
182
  }
183
+ /**
184
+ * @url https://kosukhin.github.io/patron.site/#/utils/source-of
185
+ */
186
+ declare const sourceOf: <T>(value: T) => Source<T>;
182
187
 
183
- interface GuestAwareAllType<T = any> extends GuestAwareObjectType<T> {
188
+ interface SourceAllType<T = any> extends SourceObjectType<T> {
184
189
  valueArray(guest: GuestObjectType<T>): this;
185
190
  guestKey<R>(key: string): GuestObjectType<R>;
186
191
  }
187
192
  /**
188
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-aware-all
193
+ * @url https://kosukhin.github.io/patron.site/#/guest/source-all
189
194
  */
190
- declare class GuestAwareAll<T> implements GuestAwareAllType<T> {
195
+ declare class SourceAll<T> implements SourceAllType<T> {
191
196
  private theAll;
192
197
  private keysKnown;
193
198
  private keysFilled;
@@ -200,91 +205,112 @@ declare class GuestAwareAll<T> implements GuestAwareAllType<T> {
200
205
  }
201
206
 
202
207
  /**
203
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-pool
208
+ * @url https://kosukhin.github.io/patron.site/#/utils/private
204
209
  */
205
- declare class GuestPool<T> implements GuestObjectType<T>, PoolType<T> {
206
- private guests;
207
- private patronPool;
208
- constructor(initiator: unknown);
209
- give(value: T, options?: GiveOptions): this;
210
- add(guest: GuestType<T>): this;
211
- remove(patron: GuestObjectType<T>): this;
212
- distribute(receiving: T, possiblePatron: GuestObjectType<T>): this;
213
- size(): number;
214
- private deliverToGuests;
210
+ interface PrivateType<T> {
211
+ get<R extends unknown[], CT = null>(...args: R): CT extends null ? T : CT;
212
+ }
213
+ declare class Private<T> implements PrivateType<T> {
214
+ private buildingFn;
215
+ constructor(buildingFn: (...args: any[]) => T);
216
+ get<R extends unknown[], CT = null>(...args: R): CT extends null ? T : CT;
215
217
  }
216
218
 
217
- interface GuestValueType<T = any> extends GuestObjectType<T> {
218
- value(): T;
219
+ /**
220
+ * @url https://kosukhin.github.io/patron.site/#/guest/source-sequence
221
+ */
222
+ declare class SourceSequence<T, TG> implements SourceObjectType<TG[]> {
223
+ private baseSource;
224
+ private targetSource;
225
+ constructor(baseSource: SourceType<T[]>, targetSource: PrivateType<SourceType<TG>>);
226
+ value(guest: GuestType<TG[]>): this;
219
227
  }
228
+
220
229
  /**
221
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-sync
230
+ * @url https://kosukhin.github.io/patron.site/#/guest/source-map
222
231
  */
223
- declare class GuestSync<T> implements GuestValueType<T> {
224
- private theValue;
225
- constructor(theValue: T);
226
- give(value: T): this;
227
- value(): T;
232
+ declare class SourceMap<T, TG> implements SourceObjectType<TG[]> {
233
+ private baseSource;
234
+ private targetSource;
235
+ constructor(baseSource: SourceType<T[]>, targetSource: PrivateType<SourceType<TG>>);
236
+ value(guest: GuestType<TG[]>): this;
228
237
  }
229
238
 
230
239
  /**
231
- * @url https://kosukhin.github.io/patron.site/#/guest/guest-object
240
+ * @url https://kosukhin.github.io/patron.site/#/guest/source-race
232
241
  */
233
- declare class GuestObject<T> implements GuestDisposableType<T> {
234
- private baseGuest;
235
- constructor(baseGuest: GuestType<T>);
236
- give(value: T, options?: GiveOptions): this;
237
- introduction(): "guest" | "patron";
238
- disposed(value: T | null): boolean;
242
+ declare class SourceRace<T> implements SourceObjectType<T> {
243
+ private sources;
244
+ constructor(sources: SourceType<T>[]);
245
+ value(guest: GuestType<T>): this;
239
246
  }
240
247
 
248
+ interface PoolAwareType<T = any> {
249
+ pool(): PatronPool<T>;
250
+ }
241
251
  /**
242
- * @url https://kosukhin.github.io/patron.site/#/patron
252
+ * @url https://kosukhin.github.io/patron.site/#/source-with-pool
243
253
  */
244
- declare class Patron<T> implements GuestDisposableType<T> {
245
- private willBePatron;
246
- constructor(willBePatron: GuestType<T>);
247
- introduction(): "patron";
248
- give(value: T, options?: GiveOptions): this;
249
- disposed(value: T | null): boolean;
254
+ type SourceWithPoolType<T = any> = SourceObjectType<T> & GuestObjectType<T> & PoolAwareType<T>;
255
+ declare class SourceWithPool<T> implements SourceWithPoolType<T> {
256
+ private sourceDocument?;
257
+ private thePool;
258
+ private theEmptyPool;
259
+ private isEmpty;
260
+ constructor(sourceDocument?: T | undefined);
261
+ pool(): PatronPool<unknown>;
262
+ give(value: T): this;
263
+ value(guest: GuestType<T>): this;
264
+ filled(): boolean;
250
265
  }
251
266
 
252
- type PoolAwareOptions = {
253
- pool?: PoolType;
254
- castedGuest?: GuestObjectType;
255
- };
256
267
  /**
257
- * @url https://kosukhin.github.io/patron.site/#/patron/patron-once
268
+ * @url https://kosukhin.github.io/patron.site/#/utils/action-type
258
269
  */
259
- declare class PatronOnce<T> implements GuestDisposableType<T> {
260
- private baseGuest;
261
- private received;
262
- constructor(baseGuest: GuestType<T>);
263
- introduction(): "patron";
264
- give(value: T, options?: GiveOptions): this;
265
- disposed(value: T | null): boolean;
270
+ interface ActionType<P = any> {
271
+ do(config: P): this;
272
+ }
273
+ interface SourceAcitveType<R = unknown, T = unknown> extends SourceObjectType<T>, ActionType<R> {
274
+ }
275
+ /**
276
+ * @url https://kosukhin.github.io/patron.site/#/guest/source-active
277
+ */
278
+ declare class SourceActive<R, T> implements SourceAcitveType<R, T> {
279
+ private configExecutor;
280
+ private source;
281
+ constructor(configExecutor: (config: R, source: SourceWithPoolType<T>) => void);
282
+ do(config: R): this;
283
+ value(guest: GuestType<T>): this;
266
284
  }
267
285
 
268
286
  /**
269
287
  * @url https://kosukhin.github.io/patron.site/#/source-dynamic
270
288
  */
271
- declare class SourceDynamic<T = unknown> implements SourceType<T> {
289
+ declare class SourceDynamic<T = unknown> implements SourceWithPoolType<T> {
272
290
  private baseGuest;
273
- private baseGuestAware;
274
- constructor(baseGuest: GuestType<T>, baseGuestAware: GuestAwareType<T>);
291
+ private baseSource;
292
+ constructor(baseGuest: GuestType<T>, baseSource: SourceType<T>);
275
293
  value(guest: GuestType<T>): this;
276
294
  give(value: T): this;
277
295
  pool(): PatronPool<T>;
278
296
  }
279
297
 
280
298
  /**
281
- * @url https://kosukhin.github.io/patron.site/#/source/source-empty
299
+ * @url https://kosukhin.github.io/patron.site/#/source/source-applied
282
300
  */
283
- declare class SourceEmpty<T> implements SourceType<T> {
301
+ declare class SourceApplied<T, R> implements SourceObjectType<R> {
284
302
  private baseSource;
285
- value(guest: GuestType<T>): this;
286
- give(value: T): this;
287
- pool(): PatronPool<T>;
303
+ private applier;
304
+ constructor(baseSource: SourceType<T>, applier: (v: T) => R);
305
+ value(g: GuestType<R>): this;
306
+ }
307
+
308
+ /**
309
+ * @url https://kosukhin.github.io/patron.site/#/source/source-executor-applied
310
+ */
311
+ declare class SourceExecutorApplied<T> implements SourceObjectType<T> {
312
+ value: SourceExecutorType<T>;
313
+ constructor(source: SourceType<T>, applier: (executor: SourceExecutorType<T>) => SourceExecutorType<T>);
288
314
  }
289
315
 
290
316
  interface Prototyped<T> {
@@ -297,4 +323,4 @@ declare class PrivateClass<T> implements PrivateType<T> {
297
323
  get<R extends unknown[], CT = null>(...args: R): CT extends null ? T : CT;
298
324
  }
299
325
 
300
- export { type ActionType, type GiveOptions, Guest, GuestAware, type GuestAwareAcitveType, GuestAwareActive, GuestAwareAll, type GuestAwareAllType, type GuestAwareExecutorType, GuestAwareMap, type GuestAwareObjectType, GuestAwareRace, GuestAwareSequence, type GuestAwareType, GuestCast, GuestDisposable, type GuestDisposableType, type GuestExecutorType, GuestObject, type GuestObjectType, GuestPool, GuestSync, type GuestType, type GuestValueType, type MaybeDisposableType, Patron, PatronOnce, PatronPool, type PoolAware, type PoolAwareOptions, type PoolType, Private, PrivateClass, type PrivateType, Source, SourceDynamic, SourceEmpty, type SourceType, give, isGuest, isGuestAware, isPatronInPools, removePatronFromPools, value };
326
+ export { type ActionType, Guest, GuestApplied, GuestCast, GuestDisposable, type GuestDisposableType, type GuestExecutorType, GuestObject, type GuestObjectType, GuestPool, GuestSync, type GuestType, type GuestValueType, type MaybeDisposableType, Patron, PatronOnce, PatronPool, type PoolAwareType, type PoolType, Private, PrivateClass, type PrivateType, Source, type SourceAcitveType, SourceActive, SourceAll, type SourceAllType, SourceApplied, SourceDynamic, SourceExecutorApplied, type SourceExecutorType, SourceMap, type SourceObjectType, SourceRace, SourceSequence, type SourceType, SourceWithPool, type SourceWithPoolType, give, isGuest, isPatron, isPatronInPools, isSource, patronPools, removePatronFromPools, sourceOf, value };