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.
- package/CHANGELOG.md +17 -0
- package/dist/patron.cjs +295 -275
- package/dist/patron.cjs.map +1 -1
- package/dist/patron.d.ts +181 -155
- package/dist/patron.js +283 -268
- package/dist/patron.js.map +1 -1
- package/dist/patron.min.js +1 -1
- package/dist/patron.min.mjs +1 -1
- package/dist/patron.min.mjs.map +1 -1
- package/dist/patron.mjs +283 -268
- package/dist/patron.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Guest/Guest.test.ts +11 -6
- package/src/Guest/Guest.ts +7 -14
- package/src/Guest/GuestApplied.test.ts +13 -0
- package/src/Guest/GuestApplied.ts +16 -0
- package/src/Guest/GuestCast.test.ts +4 -5
- package/src/Guest/GuestCast.ts +3 -10
- package/src/Guest/GuestDisposable.test.ts +13 -17
- package/src/Guest/GuestDisposable.ts +3 -3
- package/src/Guest/GuestExecutorApplied.test.ts +27 -0
- package/src/Guest/GuestExecutorApplied.ts +23 -0
- package/src/Guest/GuestObject.test.ts +6 -6
- package/src/Guest/GuestObject.ts +3 -3
- package/src/Guest/GuestPool.test.ts +5 -22
- package/src/Guest/GuestPool.ts +7 -8
- package/src/Guest/GuestSync.test.ts +2 -2
- package/src/Patron/Patron.test.ts +4 -5
- package/src/Patron/Patron.ts +11 -3
- package/src/Patron/PatronOnce.sourceEmpty.test.ts +2 -2
- package/src/Patron/PatronOnce.test.ts +2 -2
- package/src/Patron/PatronOnce.ts +3 -9
- package/src/Patron/PatronPool.test.ts +2 -1
- package/src/Patron/PatronPool.ts +22 -27
- package/src/Private/PrivateClass.modules.test.ts +11 -8
- package/src/Private/PrivateClass.test.ts +7 -6
- package/src/Source/Source.test.ts +9 -5
- package/src/Source/Source.ts +46 -30
- package/src/Source/SourceActive.test.ts +13 -0
- package/src/Source/SourceActive.ts +41 -0
- package/src/Source/SourceAll._asArray.test.ts +22 -0
- package/src/Source/SourceAll._twoValuesAfter.test.ts +19 -0
- package/src/Source/SourceAll._twoValuesBefore.test.ts +19 -0
- package/src/Source/SourceAll._withPatron.test.ts +25 -0
- package/src/{Guest/GuestAwareAll.ts → Source/SourceAll.ts} +11 -11
- package/src/Source/SourceApplied.test.ts +14 -0
- package/src/Source/SourceApplied.ts +23 -0
- package/src/Source/SourceDynamic.ofSource.test.ts +12 -12
- package/src/Source/SourceDynamic.test.ts +9 -9
- package/src/Source/SourceDynamic.ts +7 -7
- package/src/Source/SourceExecutorApplied.test.ts +30 -0
- package/src/Source/SourceExecutorApplied.ts +22 -0
- package/src/Source/SourceMap.defered.test.ts +46 -0
- package/src/Source/SourceMap.fn.test.ts +27 -0
- package/src/Source/SourceMap.test.ts +32 -0
- package/src/Source/SourceMap.ts +48 -0
- package/src/Source/SourceOnce.notcalled.test.ts +13 -0
- package/src/Source/SourceOnce.test.ts +10 -0
- package/src/Source/SourceOnce.ts +31 -0
- package/src/Source/SourceRace.test.ts +46 -0
- package/src/Source/SourceRace.ts +30 -0
- package/src/Source/SourceSequence.defered.test.ts +53 -0
- package/src/Source/SourceSequence.test.ts +30 -0
- package/src/{Guest/GuestAwareSequence.ts → Source/SourceSequence.ts} +14 -19
- package/src/Source/SourceWithPool.empty.test.ts +14 -0
- package/src/Source/SourceWithPool.test.ts +10 -0
- package/src/Source/SourceWithPool.ts +58 -0
- package/src/index.ts +9 -7
- package/test-utils/debounce.ts +11 -0
- package/test-utils/id.ts +1 -0
- package/test-utils/wait.ts +6 -3
- package/src/Guest/GuestAware.test.ts +0 -13
- package/src/Guest/GuestAware.ts +0 -59
- package/src/Guest/GuestAwareActive.test.ts +0 -12
- package/src/Guest/GuestAwareActive.ts +0 -42
- package/src/Guest/GuestAwareAll._asArray.test.ts +0 -19
- package/src/Guest/GuestAwareAll._twoValuesAfter.test.ts +0 -16
- package/src/Guest/GuestAwareAll._twoValuesBefore.test.ts +0 -16
- package/src/Guest/GuestAwareAll._withPatron.test.ts +0 -22
- package/src/Guest/GuestAwareMap.defered.test.ts +0 -46
- package/src/Guest/GuestAwareMap.fn.test.ts +0 -27
- package/src/Guest/GuestAwareMap.test.ts +0 -29
- package/src/Guest/GuestAwareMap.ts +0 -48
- package/src/Guest/GuestAwareRace.test.ts +0 -46
- package/src/Guest/GuestAwareRace.ts +0 -33
- package/src/Guest/GuestAwareSequence.defered.test.ts +0 -58
- package/src/Guest/GuestAwareSequence.test.ts +0 -30
- package/src/Source/SourceEmpty.test.ts +0 -20
- package/src/Source/SourceEmpty.ts +0 -31
package/dist/patron.d.ts
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
type GuestIntroduction = "guest" | "patron";
|
2
|
-
|
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
|
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
|
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
|
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
|
-
|
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-
|
30
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/guest-disposable
|
64
31
|
*/
|
65
|
-
declare class
|
66
|
-
private
|
67
|
-
private
|
68
|
-
constructor(
|
69
|
-
value
|
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-
|
41
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/guest-cast
|
74
42
|
*/
|
75
|
-
declare class
|
76
|
-
private
|
77
|
-
private
|
78
|
-
constructor(
|
79
|
-
|
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/#/
|
53
|
+
* @url https://kosukhin.github.io/patron.site/#/utils/patron-pools
|
84
54
|
*/
|
85
|
-
declare
|
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
|
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/#/
|
87
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/guest-pool
|
126
88
|
*/
|
127
|
-
|
128
|
-
|
129
|
-
private
|
130
|
-
|
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
|
-
|
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/#/
|
105
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/guest-sync
|
139
106
|
*/
|
140
|
-
|
141
|
-
|
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
|
-
|
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-
|
126
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/guest-applied
|
147
127
|
*/
|
148
|
-
declare class
|
149
|
-
private
|
150
|
-
private
|
151
|
-
constructor(
|
152
|
-
|
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
|
-
|
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/#/
|
146
|
+
* @url https://kosukhin.github.io/patron.site/#/utils/is-patron
|
162
147
|
*/
|
163
|
-
declare
|
164
|
-
|
165
|
-
|
166
|
-
|
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/#/
|
168
|
+
* @url https://kosukhin.github.io/patron.site/#/utils/value
|
173
169
|
*/
|
174
|
-
declare
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
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
|
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/
|
193
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/source-all
|
189
194
|
*/
|
190
|
-
declare class
|
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/#/
|
208
|
+
* @url https://kosukhin.github.io/patron.site/#/utils/private
|
204
209
|
*/
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
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
|
-
|
218
|
-
|
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/
|
230
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/source-map
|
222
231
|
*/
|
223
|
-
declare class
|
224
|
-
private
|
225
|
-
|
226
|
-
|
227
|
-
value():
|
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/
|
240
|
+
* @url https://kosukhin.github.io/patron.site/#/guest/source-race
|
232
241
|
*/
|
233
|
-
declare class
|
234
|
-
private
|
235
|
-
constructor(
|
236
|
-
|
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/#/
|
252
|
+
* @url https://kosukhin.github.io/patron.site/#/source-with-pool
|
243
253
|
*/
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
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/#/
|
268
|
+
* @url https://kosukhin.github.io/patron.site/#/utils/action-type
|
258
269
|
*/
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
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
|
289
|
+
declare class SourceDynamic<T = unknown> implements SourceWithPoolType<T> {
|
272
290
|
private baseGuest;
|
273
|
-
private
|
274
|
-
constructor(baseGuest: GuestType<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-
|
299
|
+
* @url https://kosukhin.github.io/patron.site/#/source/source-applied
|
282
300
|
*/
|
283
|
-
declare class
|
301
|
+
declare class SourceApplied<T, R> implements SourceObjectType<R> {
|
284
302
|
private baseSource;
|
285
|
-
|
286
|
-
|
287
|
-
|
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,
|
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 };
|