@@ -10,6 +10,7 @@ import type * as MutableRef from "./MutableRef.js"
10
10
import type * as Option from "./Option.js"
11
11
import type { Pipeable } from "./Pipeable.js"
12
12
import type * as Types from "./Types.js"
13
+ import type * as Unify from "./Unify.js"
13
14
14
15
/**
15
16
* @since 2.0.0
@@ -74,6 +75,26 @@ export interface Queue<in out A> extends Enqueue<A>, Dequeue<A>, Pipeable {
74
75
readonly shutdownFlag : MutableRef . MutableRef < boolean >
75
76
/** @internal */
76
77
readonly strategy : Strategy < A >
78
+
79
+ readonly [ Unify . typeSymbol ] ?: unknown
80
+ readonly [ Unify . unifySymbol ] ?: QueueUnify < this>
81
+ readonly [ Unify . ignoreSymbol ] ?: QueueUnifyIgnore
82
+ }
83
+
84
+ /**
85
+ * @category models
86
+ * @since 3.8.0
87
+ */
88
+ export interface QueueUnify < A extends { [ Unify . typeSymbol ] ?: any } > extends DequeueUnify < A > {
89
+ Queue ?: ( ) => Extract < A [ Unify . typeSymbol ] , Queue < any > >
90
+ }
91
+
92
+ /**
93
+ * @category models
94
+ * @since 3.8.0
95
+ */
96
+ export interface QueueUnifyIgnore extends DequeueUnifyIgnore {
97
+ Dequeue ?: true
77
98
}
78
99
79
100
/**
@@ -113,7 +134,7 @@ export interface Enqueue<in A> extends Queue.EnqueueVariance<A>, BaseQueue, Pipe
113
134
* @since 2.0.0
114
135
* @category models
115
136
*/
116
- export interface Dequeue < out A > extends Queue . DequeueVariance < A > , BaseQueue , Pipeable {
137
+ export interface Dequeue < out A > extends Effect . Effect < A > , Queue . DequeueVariance < A > , BaseQueue , Pipeable {
117
138
/**
118
139
* Takes the oldest value in the queue. If the queue is empty, this will return
119
140
* a computation that resumes when an item has been added to the queue.
@@ -137,6 +158,26 @@ export interface Dequeue<out A> extends Queue.DequeueVariance<A>, BaseQueue, Pip
137
158
* suspends until at least the minimum number of elements have been collected.
138
159
*/
139
160
takeBetween ( min : number , max : number ) : Effect . Effect < Chunk . Chunk < A > >
161
+
162
+ readonly [ Unify . typeSymbol ] ?: unknown
163
+ readonly [ Unify . unifySymbol ] ?: DequeueUnify < this>
164
+ readonly [ Unify . ignoreSymbol ] ?: DequeueUnifyIgnore
165
+ }
166
+
167
+ /**
168
+ * @category models
169
+ * @since 3.8.0
170
+ */
171
+ export interface DequeueUnify < A extends { [ Unify . typeSymbol ] ?: any } > extends Effect . EffectUnify < A > {
172
+ Dequeue ?: ( ) => A [ Unify . typeSymbol ] extends Dequeue < infer A0 > | infer _ ? Dequeue < A0 > : never
173
+ }
174
+
175
+ /**
176
+ * @category models
177
+ * @since 3.8.0
178
+ */
179
+ export interface DequeueUnifyIgnore extends Effect . EffectUnifyIgnore {
180
+ Effect ?: true
140
181
}
141
182
142
183
/**
0 commit comments