brass-runtime 1.11.1 → 1.12.1
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/README.md +48 -5
- package/dist/agent/cli/main.cjs +16 -0
- package/dist/agent/cli/main.d.mts +1 -0
- package/dist/agent/cli/main.d.ts +1 -0
- package/dist/agent/cli/main.js +16 -0
- package/dist/agent/index.cjs +1 -0
- package/dist/agent/index.d.mts +688 -0
- package/dist/agent/index.d.ts +688 -0
- package/dist/agent/index.js +1 -0
- package/dist/chunk-63MXGA7P.js +1 -0
- package/dist/chunk-63ODH5W4.cjs +25 -0
- package/dist/chunk-7PHP7KQB.cjs +1 -0
- package/dist/chunk-MAR4TNUH.js +1 -0
- package/dist/chunk-P4IND5C3.js +25 -0
- package/dist/chunk-T3QEEHK6.cjs +1 -0
- package/dist/effect-NSaHksNl.d.mts +367 -0
- package/dist/effect-NSaHksNl.d.ts +367 -0
- package/dist/http/index.cjs +1 -0
- package/dist/http/index.d.mts +2 -1
- package/dist/http/index.d.ts +2 -1
- package/dist/http/index.js +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.mts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +1 -1
- package/dist/stream-DNTGNv-G.d.ts +66 -0
- package/dist/stream-FwtnWmgX.d.mts +66 -0
- package/package.json +30 -3
- package/dist/chunk-Q2H2CAII.js +0 -1
- package/dist/chunk-ZXK3XM2Q.mjs +0 -1
- package/dist/http/index.mjs +0 -1
- package/dist/index.mjs +0 -1
- package/dist/stream-hTHRKq88.d.mts +0 -355
- package/dist/stream-hTHRKq88.d.ts +0 -355
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
type Canceler = () => void;
|
|
2
|
-
type CancelToken = {
|
|
3
|
-
/** true si ya fue cancelado */
|
|
4
|
-
readonly isCancelled: () => boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Registra un callback que se ejecuta cuando se cancela.
|
|
7
|
-
* Si ya estaba cancelado, lo ejecuta inmediatamente.
|
|
8
|
-
* Devuelve un "unsubscribe" para desregistrar.
|
|
9
|
-
*/
|
|
10
|
-
readonly onCancel: (f: Canceler) => Canceler;
|
|
11
|
-
};
|
|
12
|
-
/** Implementación simple de CancelToken */
|
|
13
|
-
declare function makeCancelToken(): CancelToken & {
|
|
14
|
-
cancel: Canceler;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Helper: conecta un AbortController a un CancelToken.
|
|
18
|
-
* Devuelve una función para desenganchar (unsubscribe).
|
|
19
|
-
*/
|
|
20
|
-
declare function linkAbortController(token: CancelToken, ac: AbortController): Canceler;
|
|
21
|
-
|
|
22
|
-
type Task = () => void;
|
|
23
|
-
declare class Scheduler {
|
|
24
|
-
private queue;
|
|
25
|
-
private flushing;
|
|
26
|
-
private scheduled;
|
|
27
|
-
schedule(task: Task, tag?: string): void;
|
|
28
|
-
private requestFlush;
|
|
29
|
-
private flush;
|
|
30
|
-
}
|
|
31
|
-
declare const globalScheduler: Scheduler;
|
|
32
|
-
|
|
33
|
-
type RuntimeEvent = {
|
|
34
|
-
type: "fiber.start";
|
|
35
|
-
fiberId: number;
|
|
36
|
-
parentFiberId?: number;
|
|
37
|
-
scopeId?: number;
|
|
38
|
-
name?: string;
|
|
39
|
-
} | {
|
|
40
|
-
type: "fiber.end";
|
|
41
|
-
fiberId: number;
|
|
42
|
-
status: "success" | "failure" | "interrupted";
|
|
43
|
-
error?: unknown;
|
|
44
|
-
} | {
|
|
45
|
-
type: "fiber.suspend";
|
|
46
|
-
fiberId: number;
|
|
47
|
-
reason?: string;
|
|
48
|
-
} | {
|
|
49
|
-
type: "fiber.resume";
|
|
50
|
-
fiberId: number;
|
|
51
|
-
} | {
|
|
52
|
-
type: "scope.open";
|
|
53
|
-
scopeId: number;
|
|
54
|
-
parentScopeId?: number;
|
|
55
|
-
} | {
|
|
56
|
-
type: "scope.close";
|
|
57
|
-
scopeId: number;
|
|
58
|
-
status: "success" | "failure" | "interrupted";
|
|
59
|
-
error?: unknown;
|
|
60
|
-
} | {
|
|
61
|
-
type: "log";
|
|
62
|
-
level: "debug" | "info" | "warn" | "error";
|
|
63
|
-
message: string;
|
|
64
|
-
fields?: Record<string, unknown>;
|
|
65
|
-
};
|
|
66
|
-
interface RuntimeHooks {
|
|
67
|
-
emit(ev: RuntimeEvent, ctx: RuntimeEmitContext): void;
|
|
68
|
-
}
|
|
69
|
-
type RuntimeEmitContext = {
|
|
70
|
-
fiberId?: number;
|
|
71
|
-
scopeId?: number;
|
|
72
|
-
traceId?: string;
|
|
73
|
-
spanId?: string;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type NodeCallback<A> = (err: Error | null, result: A) => void;
|
|
77
|
-
/**
|
|
78
|
-
* --- Runtime como objeto único (ZIO-style) ---
|
|
79
|
-
* Un valor que representa "cómo" se ejecutan los efectos: scheduler + environment + hooks.
|
|
80
|
-
*/
|
|
81
|
-
declare class Runtime<R> {
|
|
82
|
-
readonly env: R;
|
|
83
|
-
readonly scheduler: Scheduler;
|
|
84
|
-
readonly hooks: RuntimeHooks;
|
|
85
|
-
readonly forkPolicy: {
|
|
86
|
-
initChild(fiber: RuntimeFiber<any, any, any> & any, parent?: (RuntimeFiber<any, any, any> & any) | null): void;
|
|
87
|
-
};
|
|
88
|
-
constructor(args: {
|
|
89
|
-
env: R;
|
|
90
|
-
scheduler?: Scheduler;
|
|
91
|
-
hooks?: RuntimeHooks;
|
|
92
|
-
});
|
|
93
|
-
fork<E, A>(effect: Async<R, E, A>): Fiber<E, A>;
|
|
94
|
-
unsafeRunAsync<E, A>(effect: Async<R, E, A>, cb: (exit: Exit<E | Interrupted, A>) => void): void;
|
|
95
|
-
toPromise<E, A>(effect: Async<R, E, A>): Promise<A>;
|
|
96
|
-
log(level: "debug" | "info" | "warn" | "error", message: string, fields?: Record<string, unknown>): void;
|
|
97
|
-
withHooks(hooks: RuntimeHooks): Runtime<R>;
|
|
98
|
-
emit(ev: RuntimeEvent): void;
|
|
99
|
-
static make<R>(env: R, scheduler?: Scheduler): Runtime<R>;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* ---------------------------------------------------------------------------
|
|
103
|
-
* Helpers existentes (los dejo igual) + wrappers que usan Runtime por debajo
|
|
104
|
-
* ---------------------------------------------------------------------------
|
|
105
|
-
*/
|
|
106
|
-
declare function from<A>(f: (cb: NodeCallback<A>) => void): Async<{}, Error, A>;
|
|
107
|
-
declare function from<A>(thunk: () => Promise<A>): Async<{}, Error, A>;
|
|
108
|
-
type BrassError = {
|
|
109
|
-
_tag: "Abort";
|
|
110
|
-
} | {
|
|
111
|
-
_tag: "PromiseRejected";
|
|
112
|
-
reason: unknown;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* --- Wrappers legacy (mantienen tu API actual) ---
|
|
116
|
-
* Internamente crean un Runtime ad-hoc con env + scheduler.
|
|
117
|
-
*/
|
|
118
|
-
declare function fork<R, E, A>(effect: Async<R, E, A>, env: R, scheduler?: Scheduler): Fiber<E, A>;
|
|
119
|
-
declare function unsafeRunAsync<R, E, A>(effect: Async<R, E, A>, env: R, cb: (exit: Exit<E | Interrupted, A>) => void): void;
|
|
120
|
-
declare function toPromise<R, E, A>(eff: Async<R, E, A>, env: R): Promise<A>;
|
|
121
|
-
declare function fromPromise<R, E, A>(thunk: (env: R) => Promise<A>, onError: (e: unknown) => E): Async<R, E, A>;
|
|
122
|
-
declare function fromCallback<A>(f: (cb: NodeCallback<A>) => void): Async<{}, Error, A>;
|
|
123
|
-
declare function tryPromiseAbortable<A>(thunk: (signal: AbortSignal) => Promise<A>): Async<unknown, BrassError, A>;
|
|
124
|
-
declare function tryPromiseAbortable<R, A>(thunk: (env: R, signal: AbortSignal) => Promise<A>): Async<R, BrassError, A>;
|
|
125
|
-
declare function fromPromiseAbortable<E, A>(thunk: (signal: AbortSignal) => Promise<A>, onError: (e: unknown) => E): Async<unknown, E, A>;
|
|
126
|
-
declare function fromPromiseAbortable<R, E, A>(thunk: (env: R, signal: AbortSignal) => Promise<A>, onError: (e: unknown) => E): Async<R, E, A>;
|
|
127
|
-
declare function getCurrentRuntime<R>(): Runtime<R>;
|
|
128
|
-
|
|
129
|
-
type JSONValue = null | boolean | number | string | JSONValue[] | {
|
|
130
|
-
[k: string]: JSONValue;
|
|
131
|
-
};
|
|
132
|
-
type ContextNode = {
|
|
133
|
-
parent: ContextNode | null;
|
|
134
|
-
patch: Record<string, JSONValue>;
|
|
135
|
-
};
|
|
136
|
-
type TraceContext = {
|
|
137
|
-
traceId: string;
|
|
138
|
-
spanId: string;
|
|
139
|
-
parentSpanId?: string;
|
|
140
|
-
sampled?: boolean;
|
|
141
|
-
};
|
|
142
|
-
type FiberContext = {
|
|
143
|
-
log: ContextNode;
|
|
144
|
-
trace: TraceContext | null;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
type FiberId = number;
|
|
148
|
-
type Interrupted = {
|
|
149
|
-
readonly _tag: "Interrupted";
|
|
150
|
-
};
|
|
151
|
-
type FiberStatus = "Running" | "Done" | "Interrupted";
|
|
152
|
-
type StepDecision = "Continue" | "Suspend" | "Done";
|
|
153
|
-
type Fiber<E, A> = {
|
|
154
|
-
readonly id: FiberId;
|
|
155
|
-
readonly status: () => FiberStatus;
|
|
156
|
-
readonly join: (cb: (exit: Exit<E | Interrupted, A>) => void) => void;
|
|
157
|
-
readonly interrupt: () => void;
|
|
158
|
-
readonly addFinalizer: (f: (exit: Exit<E | Interrupted, A>) => void) => void;
|
|
159
|
-
};
|
|
160
|
-
declare class RuntimeFiber<R, E, A> implements Fiber<E, A> {
|
|
161
|
-
readonly id: FiberId;
|
|
162
|
-
readonly runtime: Runtime<R>;
|
|
163
|
-
private closing;
|
|
164
|
-
private finishing;
|
|
165
|
-
private runState;
|
|
166
|
-
private interrupted;
|
|
167
|
-
private result;
|
|
168
|
-
private readonly joiners;
|
|
169
|
-
private current;
|
|
170
|
-
private readonly stack;
|
|
171
|
-
private readonly fiberFinalizers;
|
|
172
|
-
private finalizersDrained;
|
|
173
|
-
fiberContext: FiberContext;
|
|
174
|
-
name?: string;
|
|
175
|
-
scopeId?: number;
|
|
176
|
-
constructor(runtime: Runtime<R>, effect: Async<R, E, A>);
|
|
177
|
-
private get env();
|
|
178
|
-
private get scheduler();
|
|
179
|
-
addFinalizer(f: (exit: Exit<E | Interrupted, A>) => void): void;
|
|
180
|
-
status(): FiberStatus;
|
|
181
|
-
join(cb: (exit: Exit<E | Interrupted, A>) => void): void;
|
|
182
|
-
interrupt(): void;
|
|
183
|
-
schedule(tag?: string): void;
|
|
184
|
-
private runFinalizersOnce;
|
|
185
|
-
private notify;
|
|
186
|
-
private onSuccess;
|
|
187
|
-
private onFailure;
|
|
188
|
-
step(): StepDecision;
|
|
189
|
-
}
|
|
190
|
-
declare function getCurrentFiber(): RuntimeFiber<any, any, any> | null;
|
|
191
|
-
declare function withCurrentFiber<T>(fiber: RuntimeFiber<any, any, any>, f: () => T): T;
|
|
192
|
-
|
|
193
|
-
type ScopeId = number;
|
|
194
|
-
type CloseOptions = {
|
|
195
|
-
awaitChildren?: boolean;
|
|
196
|
-
};
|
|
197
|
-
declare class Scope<R> {
|
|
198
|
-
private readonly runtime;
|
|
199
|
-
readonly id: ScopeId;
|
|
200
|
-
private closed;
|
|
201
|
-
private readonly children;
|
|
202
|
-
private readonly subScopes;
|
|
203
|
-
private readonly finalizers;
|
|
204
|
-
constructor(runtime: Runtime<R>);
|
|
205
|
-
/** Acceso al env del runtime (conserva tu modelo actual) */
|
|
206
|
-
private get env();
|
|
207
|
-
/** registra un finalizer (LIFO) */
|
|
208
|
-
addFinalizer(f: (exit: Exit<any, any>) => Async<R, any, any>): void;
|
|
209
|
-
/** crea un sub scope (mismo runtime) */
|
|
210
|
-
subScope(): Scope<R>;
|
|
211
|
-
/** fork en este scope */
|
|
212
|
-
fork<E, A>(eff: Async<R, E, A>): Fiber<E | Interrupted, A>;
|
|
213
|
-
/** close fire-and-forget (no bloquea) */
|
|
214
|
-
close(exit?: Exit<any, any>): void;
|
|
215
|
-
closeAsync(exit?: Exit<any, any>, options?: CloseOptions): Async<R, never, void>;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Ejecuta una función dentro de un scope estructurado (sync).
|
|
219
|
-
* NOTA: En sync no tenés env real; por eso recibimos Runtime explícito.
|
|
220
|
-
*/
|
|
221
|
-
declare function withScope<R, A>(runtime: Runtime<R>, body: (scope: Scope<R>) => A): A;
|
|
222
|
-
/**
|
|
223
|
-
* Versión async: crea scope, corre el efecto, cierra el scope con el Exit.
|
|
224
|
-
*/
|
|
225
|
-
declare function withScopeAsync<R, E, A>(runtime: Runtime<R>, use: (scope: Scope<R>) => Async<R, E, A>): Async<R, E | Interrupted, A>;
|
|
226
|
-
|
|
227
|
-
type Async<R, E, A> = {
|
|
228
|
-
_tag: "Succeed";
|
|
229
|
-
value: A;
|
|
230
|
-
} | {
|
|
231
|
-
_tag: "Fail";
|
|
232
|
-
error: E;
|
|
233
|
-
} | {
|
|
234
|
-
_tag: "Sync";
|
|
235
|
-
thunk: (env: R) => A;
|
|
236
|
-
} | {
|
|
237
|
-
_tag: "Async";
|
|
238
|
-
register: (env: R, cb: (exit: Exit<E, A>) => void) => void | Canceler;
|
|
239
|
-
} | {
|
|
240
|
-
_tag: "FlatMap";
|
|
241
|
-
first: Async<R, E, any>;
|
|
242
|
-
andThen: (a: any) => Async<R, E, A>;
|
|
243
|
-
} | {
|
|
244
|
-
_tag: "Fold";
|
|
245
|
-
first: Async<R, E, any>;
|
|
246
|
-
onFailure: (e: any) => Async<R, E, A>;
|
|
247
|
-
onSuccess: (a: any) => Async<R, E, A>;
|
|
248
|
-
};
|
|
249
|
-
declare function asyncFold<R, E, A, B>(fa: Async<R, E, A>, onFailure: (e: E) => Async<R, E, B>, onSuccess: (a: A) => Async<R, E, B>): Async<R, E, B>;
|
|
250
|
-
declare function asyncCatchAll<R, E, A, R2, E2, B>(fa: Async<R, E, A>, handler: (e: E) => Async<R2, E2, B>): Async<R & R2, E2, A | B>;
|
|
251
|
-
declare function asyncMapError<R, E, E2, A>(fa: Async<R, E, A>, f: (e: E) => E2): Async<R, E2, A>;
|
|
252
|
-
declare const unit: <R>() => Async<R, never, void>;
|
|
253
|
-
declare const asyncSucceed: <A>(value: A) => Async<unknown, never, A>;
|
|
254
|
-
declare const asyncFail: <E>(error: E) => Async<unknown, E, never>;
|
|
255
|
-
declare const asyncSync: <R, A>(thunk: (env: R) => A) => Async<R, unknown, A>;
|
|
256
|
-
declare const asyncTotal: <A>(thunk: () => A) => Async<unknown, unknown, A>;
|
|
257
|
-
declare const async: <R, E, A>(register: (env: R, cb: (exit: Exit<E, A>) => void) => void | Canceler) => Async<R, E, A>;
|
|
258
|
-
declare function asyncMap<R, E, A, B>(fa: Async<R, E, A>, f: (a: A) => B): Async<R, E, B>;
|
|
259
|
-
declare function asyncFlatMap<R, E, A, B>(fa: Async<R, E, A>, f: (a: A) => Async<R, E, B>): Async<R, E, B>;
|
|
260
|
-
declare function acquireRelease<R, E, A>(acquire: Async<R, E, A>, release: (res: A, exit: Exit<E, any>) => Async<R, any, any>, scope: Scope<R>): Async<R, E, A>;
|
|
261
|
-
declare function asyncInterruptible<R, E, A>(register: (env: R, cb: (exit: Exit<E, A>) => void) => void | Canceler): Async<R, E, A>;
|
|
262
|
-
type AsyncWithPromise<R, E, A> = Async<R, E, A> & {
|
|
263
|
-
toPromise: (env: R) => Promise<A>;
|
|
264
|
-
unsafeRunPromise: () => Promise<A>;
|
|
265
|
-
};
|
|
266
|
-
declare const withAsyncPromise: <R, E, A>(run: (eff: Async<R, E, A>, env: R) => Promise<A>) => (eff: Async<R, E, A>) => AsyncWithPromise<R, E, A>;
|
|
267
|
-
declare const mapAsync: <R, E, A, B>(fa: Async<R, E, A>, f: (a: A) => B) => Async<R, E, B>;
|
|
268
|
-
declare const mapTryAsync: <R, E, A, B>(fa: Async<R, E, A>, f: (a: A) => B) => Async<R, E, B>;
|
|
269
|
-
|
|
270
|
-
type None = {
|
|
271
|
-
readonly _tag: "None";
|
|
272
|
-
};
|
|
273
|
-
type Some<A> = {
|
|
274
|
-
readonly _tag: "Some";
|
|
275
|
-
readonly value: A;
|
|
276
|
-
};
|
|
277
|
-
type Option<A> = None | Some<A>;
|
|
278
|
-
declare const none: Option<never>;
|
|
279
|
-
declare const some: <A>(value: A) => Option<A>;
|
|
280
|
-
|
|
281
|
-
type Exit<E, A> = {
|
|
282
|
-
readonly _tag: "Success";
|
|
283
|
-
readonly value: A;
|
|
284
|
-
} | {
|
|
285
|
-
readonly _tag: "Failure";
|
|
286
|
-
readonly error: E;
|
|
287
|
-
};
|
|
288
|
-
type ZIO<R, E, A> = Async<R, E, A>;
|
|
289
|
-
declare const succeed: <A>(value: A) => ZIO<unknown, never, A>;
|
|
290
|
-
declare const fail: <E>(error: E) => ZIO<unknown, E, never>;
|
|
291
|
-
declare const sync: <R, A>(thunk: (env: R) => A) => ZIO<R, unknown, A>;
|
|
292
|
-
declare const map: <R, E, A, B>(fa: ZIO<R, E, A>, f: (a: A) => B) => Async<R, E, B>;
|
|
293
|
-
declare const flatMap: <R, E, A, R2, E2, B>(fa: ZIO<R, E, A>, f: (a: A) => ZIO<R2, E2, B>) => ZIO<R & R2, E | E2, B>;
|
|
294
|
-
declare const mapError: <R, E, E2, A>(fa: ZIO<R, E, A>, f: (e: E) => E2) => any;
|
|
295
|
-
declare const catchAll: <R, E, A, R2, E2, B>(fa: ZIO<R, E, A>, handler: (e: E) => ZIO<R2, E2, B>) => ZIO<R & R2, E2, A | B>;
|
|
296
|
-
declare function orElseOptional<R, E, A, R2, A2>(fa: ZIO<R, Option<E>, A>, that: () => ZIO<R2, Option<E>, A2>): ZIO<R & R2, Option<E>, A | A2>;
|
|
297
|
-
declare const end: <E>() => ZIO<unknown, Option<E>, never>;
|
|
298
|
-
|
|
299
|
-
type Empty<R, E, A> = {
|
|
300
|
-
readonly _tag: "Empty";
|
|
301
|
-
};
|
|
302
|
-
type Emit<R, E, A> = {
|
|
303
|
-
readonly _tag: "Emit";
|
|
304
|
-
readonly value: ZIO<R, E, A>;
|
|
305
|
-
};
|
|
306
|
-
type Concat<R, E, A> = {
|
|
307
|
-
readonly _tag: "Concat";
|
|
308
|
-
readonly left: ZStream<R, E, A>;
|
|
309
|
-
readonly right: ZStream<R, E, A>;
|
|
310
|
-
};
|
|
311
|
-
type Flatten<R, E, A> = {
|
|
312
|
-
readonly _tag: "Flatten";
|
|
313
|
-
readonly stream: ZStream<R, E, ZStream<R, E, A>>;
|
|
314
|
-
};
|
|
315
|
-
type FromPull<R, E, A> = {
|
|
316
|
-
readonly _tag: "FromPull";
|
|
317
|
-
readonly pull: ZIO<R, Option<E>, [A, ZStream<R, E, A>]>;
|
|
318
|
-
};
|
|
319
|
-
type Merge<R, E, A> = {
|
|
320
|
-
readonly _tag: "Merge";
|
|
321
|
-
readonly left: ZStream<R, E, A>;
|
|
322
|
-
readonly right: ZStream<R, E, A>;
|
|
323
|
-
readonly flip: boolean;
|
|
324
|
-
};
|
|
325
|
-
type Scoped<R, E, A> = {
|
|
326
|
-
readonly _tag: "Scoped";
|
|
327
|
-
readonly acquire: ZIO<R, E, ZStream<R, E, A>>;
|
|
328
|
-
readonly release: (exit: Exit<any, any>) => Async<R, any, void>;
|
|
329
|
-
};
|
|
330
|
-
type ZStream<R, E, A> = Empty<R, E, A> | Emit<R, E, A> | Concat<R, E, A> | FromPull<R, E, A> | Flatten<R, E, A> | Merge<R, E, A> | Scoped<R, E, A>;
|
|
331
|
-
type Normalize<E> = (u: unknown) => E;
|
|
332
|
-
declare const widenOpt: <E1, E2>(opt: Option<E1>) => Option<E1 | E2>;
|
|
333
|
-
declare const fromPull: <R, E, A>(pull: ZIO<R, Option<E>, [A, ZStream<R, E, A>]>) => ZStream<R, E, A>;
|
|
334
|
-
declare const unwrapScoped: <R, E, A>(acquire: ZIO<R, E, ZStream<R, E, A>>, release: (exit: Exit<any, any>) => Async<R, any, void>) => ZStream<R, E, A>;
|
|
335
|
-
declare const managedStream: <R, E, A>(acquire: Async<R, E, {
|
|
336
|
-
stream: ZStream<R, E, A>;
|
|
337
|
-
release: (exit: Exit<any, any>) => Async<R, any, void>;
|
|
338
|
-
}>) => ZStream<R, E, A>;
|
|
339
|
-
declare const mergeStream: <R, E, A>(left: ZStream<R, E, A>, right: ZStream<R, E, A>, flip?: boolean) => ZStream<R, E, A>;
|
|
340
|
-
declare const emptyStream: <R, E, A>() => ZStream<R, E, A>;
|
|
341
|
-
declare const emitStream: <R, E, A>(value: ZIO<R, E, A>) => ZStream<R, E, A>;
|
|
342
|
-
declare const concatStream: <R, E, A>(left: ZStream<R, E, A>, right: ZStream<R, E, A>) => ZStream<R, E, A>;
|
|
343
|
-
declare const flattenStream: <R, E, A>(stream: ZStream<R, E, ZStream<R, E, A>>) => ZStream<R, E, A>;
|
|
344
|
-
declare function merge<R, E, A>(left: ZStream<R, E, A>, right: ZStream<R, E, A>): ZStream<R, E, A>;
|
|
345
|
-
declare function uncons<R, E, A>(self: ZStream<R, E, A>): ZIO<R, Option<E>, [A, ZStream<R, E, A>]>;
|
|
346
|
-
declare function assertNever(x: never, msg?: string): never;
|
|
347
|
-
declare function mapStream<R, E, A, B>(self: ZStream<R, E, A>, f: (a: A) => B): ZStream<R, E, B>;
|
|
348
|
-
declare function rangeStream(start: number, end: number): ZStream<unknown, never, number>;
|
|
349
|
-
declare function zip<R, E1, A, E2, B>(left: ZStream<R, E1, A>, right: ZStream<R, E2, B>): ZStream<R, E1 | E2, [A, B]>;
|
|
350
|
-
declare function foreachStream<R, E, A, R2, E2>(stream: ZStream<R, E, A>, f: (a: A) => Async<R2, E2, void>): Async<R & R2, E | E2, void>;
|
|
351
|
-
declare function fromArray<A>(values: readonly A[]): ZStream<unknown, never, A>;
|
|
352
|
-
declare function collectStream<R, E, A>(stream: ZStream<R, E, A>): ZIO<R, E, A[]>;
|
|
353
|
-
declare function streamFromReadableStream<E>(body: ReadableStream<Uint8Array> | null | undefined, normalizeError: Normalize<E>): ZStream<unknown, E, Uint8Array>;
|
|
354
|
-
|
|
355
|
-
export { type FiberId as $, type Async as A, mapTryAsync as B, type Some as C, none as D, type Exit as E, type Fiber as F, some as G, type Canceler as H, type Interrupted as I, type CancelToken as J, makeCancelToken as K, linkAbortController as L, from as M, type None as N, type Option as O, type BrassError as P, fork as Q, Runtime as R, Scope as S, unsafeRunAsync as T, toPromise as U, fromPromise as V, fromCallback as W, tryPromiseAbortable as X, fromPromiseAbortable as Y, type ZStream as Z, getCurrentRuntime as _, type ZIO as a, type FiberStatus as a0, RuntimeFiber as a1, getCurrentFiber as a2, withCurrentFiber as a3, type ScopeId as a4, withScope as a5, withScopeAsync as a6, type Task as a7, Scheduler as a8, globalScheduler as a9, streamFromReadableStream as aA, type Empty as aa, type Emit as ab, type Concat as ac, type Flatten as ad, type FromPull as ae, type Merge as af, type Scoped as ag, type Normalize as ah, widenOpt as ai, fromPull as aj, unwrapScoped as ak, managedStream as al, mergeStream as am, emptyStream as an, emitStream as ao, concatStream as ap, flattenStream as aq, merge as ar, uncons as as, assertNever as at, mapStream as au, rangeStream as av, zip as aw, foreachStream as ax, fromArray as ay, collectStream as az, sync as b, flatMap as c, mapError as d, catchAll as e, fail as f, end as g, asyncFold as h, asyncCatchAll as i, asyncMapError as j, asyncSucceed as k, asyncFail as l, map as m, asyncSync as n, orElseOptional as o, asyncTotal as p, async as q, asyncMap as r, succeed as s, asyncFlatMap as t, unit as u, acquireRelease as v, asyncInterruptible as w, type AsyncWithPromise as x, withAsyncPromise as y, mapAsync as z };
|