<A, XR>(
context: Context.Context<XR>,
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
<A, E, XR, R extends XR>(
self: Stream<A, E, R>,
context: Context.Context<XR>,
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
): ReadableStream<A>Converts the stream to a ReadableStream using the provided services.
When to use
Use when bridging to Web Streams and you already have the Context required
to run the stream outside an Effect.
Details
See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
Example (Converting to a ReadableStream with services)
import { Context, Stream } from "effect"
const stream = Stream.make(1, 2, 3, 4, 5)
const readableStream = Stream.toReadableStreamWith(stream, Context.empty())export const const toReadableStreamWith: (<A, XR>(
context: Context.Context<XR>,
options?: {
readonly strategy?:
| QueuingStrategy<A>
| undefined
}
) => <E, R extends XR>(
self: Stream<A, E, R>
) => ReadableStream<A>) &
(<A, E, XR, R extends XR>(
self: Stream<A, E, R>,
context: Context.Context<XR>,
options?: {
readonly strategy?:
| QueuingStrategy<A>
| undefined
}
) => ReadableStream<A>)
Converts the stream to a ReadableStream using the provided services.
When to use
Use when bridging to Web Streams and you already have the Context required
to run the stream outside an Effect.
Details
See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
Example (Converting to a ReadableStream with services)
import { Context, Stream } from "effect"
const stream = Stream.make(1, 2, 3, 4, 5)
const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
toReadableStreamWith = import dualdual<
<function (type parameter) A in <A, XR>(context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
A, function (type parameter) XR in <A, XR>(context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
XR>(
context: Context.Context<XR>(parameter) context: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
context: import ContextContext.type Context.Context = /*unresolved*/ anyContext<function (type parameter) XR in <A, XR>(context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
XR>,
options: | {
readonly strategy?:
| QueuingStrategy<A>
| undefined
}
| undefined
options?: { readonly strategy?: QueuingStrategy<A> | undefinedstrategy?: interface QueuingStrategy<T = any>QueuingStrategy<function (type parameter) A in <A, XR>(context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
A> | undefined }
) => <function (type parameter) E in <E, R extends XR>(self: Stream<A, E, R>): ReadableStream<A>E, function (type parameter) R in <E, R extends XR>(self: Stream<A, E, R>): ReadableStream<A>R extends function (type parameter) XR in <A, XR>(context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
XR>(self: Stream<A, E, R>(parameter) self: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) A in <A, XR>(context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
A, function (type parameter) E in <E, R extends XR>(self: Stream<A, E, R>): ReadableStream<A>E, function (type parameter) R in <E, R extends XR>(self: Stream<A, E, R>): ReadableStream<A>R>) => interface ReadableStream<R = any>The ReadableStream interface of the Streams API represents a readable stream of byte data.
ReadableStream<function (type parameter) A in <A, XR>(context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>
A>,
<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A, function (type parameter) E in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
E, function (type parameter) XR in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
XR, function (type parameter) R in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
R extends function (type parameter) XR in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
XR>(
self: Stream<A, E, R>(parameter) self: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A, function (type parameter) E in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
E, function (type parameter) R in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
R>,
context: Context.Context<XR>(parameter) context: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
context: import ContextContext.type Context.Context = /*unresolved*/ anyContext<function (type parameter) XR in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
XR>,
options: | {
readonly strategy?:
| QueuingStrategy<A>
| undefined
}
| undefined
options?: { readonly strategy?: QueuingStrategy<A> | undefinedstrategy?: interface QueuingStrategy<T = any>QueuingStrategy<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A> | undefined }
) => interface ReadableStream<R = any>The ReadableStream interface of the Streams API represents a readable stream of byte data.
ReadableStream<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A>
>(
(args: anyargs) => const isStream: (
u: unknown
) => u is Stream<unknown, unknown, unknown>
Checks whether a value is a Stream.
Example (Checking whether a value is a Stream)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
const stream = Stream.make(1, 2, 3)
const notStream = { data: [1, 2, 3] }
yield* Console.log(Stream.isStream(stream))
// true
yield* Console.log(Stream.isStream(notStream))
// false
})
Effect.runPromise(program)
isStream(args: anyargs[0]),
<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A, function (type parameter) E in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
E, function (type parameter) XR in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
XR, function (type parameter) R in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
R extends function (type parameter) XR in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
XR>(
self: Stream<A, E, R>(parameter) self: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A, function (type parameter) E in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
E, function (type parameter) R in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
R>,
context: Context.Context<XR>(parameter) context: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
context: import ContextContext.type Context.Context = /*unresolved*/ anyContext<function (type parameter) XR in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
XR>,
options: | {
readonly strategy?:
| QueuingStrategy<A>
| undefined
}
| undefined
options?: { readonly strategy?: QueuingStrategy<A> | undefinedstrategy?: interface QueuingStrategy<T = any>QueuingStrategy<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A> | undefined }
): interface ReadableStream<R = any>The ReadableStream interface of the Streams API represents a readable stream of byte data.
ReadableStream<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A> => {
let let currentResolve:
| (() => void)
| undefined
currentResolve: (() => void) | undefined = var undefinedundefined
let let fiber:
| Fiber.Fiber<void, E>
| undefined
fiber: import FiberFiber.type Fiber.Fiber = /*unresolved*/ anyFiber<void, function (type parameter) E in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
E> | undefined = var undefinedundefined
const const latch: Latch.Latchconst latch: {
open: Effect.Effect<boolean>;
openUnsafe: (this: Latch) => boolean;
release: Effect.Effect<boolean>;
await: Effect.Effect<void>;
close: Effect.Effect<boolean>;
closeUnsafe: (this: Latch) => boolean;
whenOpen: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
isOpen: (this: Latch) => boolean;
}
latch = import LatchLatch.makeUnsafe(false)
return new var ReadableStream: new <A>(underlyingSource: UnderlyingDefaultSource<A>, strategy?: QueuingStrategy<A> | undefined) => ReadableStream<A> (+2 overloads)ReadableStream<function (type parameter) A in <A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>, options?: {
readonly strategy?: QueuingStrategy<A> | undefined;
}): ReadableStream<A>
A>({
UnderlyingDefaultSource<A>.start?: ((controller: ReadableStreamDefaultController<A>) => any) | undefinedstart(controller: ReadableStreamDefaultController<A>controller) {
let fiber:
| Fiber.Fiber<void, E>
| undefined
fiber = import EffectEffect.runFork(import EffectEffect.provideContext(
const runForEachArray: {
<A, X, E2, R2>(
f: (
a: Arr.NonEmptyReadonlyArray<A>
) => Effect.Effect<X, E2, R2>
): <E, R>(
self: Stream<A, E, R>
) => Effect.Effect<void, E2 | E, R2 | R>
<A, E, R, X, E2, R2>(
self: Stream<A, E, R>,
f: (
a: Arr.NonEmptyReadonlyArray<A>
) => Effect.Effect<X, E2, R2>
): Effect.Effect<void, E | E2, R | R2>
}
runForEachArray(self: Stream<A, E, R>(parameter) self: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self, (chunk: Arr.NonEmptyReadonlyArray<A>(parameter) chunk: {
0: A;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<A>>): Array<A>; (...items: Array<A | ConcatArray<A>>): Array<A> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<A>;
indexOf: (searchElement: A, fromIndex?: number) => number;
lastIndexOf: (searchElement: A, fromIndex?: number) => number;
every: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: A, index: number, array: ReadonlyArray<A>) => void, thisArg?: any) => void;
map: (callbackfn: (value: A, index: number, array: ReadonlyArray<A>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): Array<S>; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): Array<A> };
reduce: { (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A): A; (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A, initialValue: A): A; (callbac…;
reduceRight: { (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A): A; (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A, initialValue: A): A; (callbac…;
find: { (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => unknown, thisArg?: any): A | undefined };
findIndex: (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, A]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<A>;
includes: (searchElement: A, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: A, index: number, array: Array<A>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => A | undefined;
findLast: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): A | undefined };
findLastIndex: (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any) => number;
toReversed: () => Array<A>;
toSorted: (compareFn?: ((a: A, b: A) => number) | undefined) => Array<A>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<A>): Array<A>; (start: number, deleteCount?: number): Array<A> };
with: (index: number, value: A) => Array<A>;
}
chunk) =>
const latch: Latch.Latchconst latch: {
open: Effect.Effect<boolean>;
openUnsafe: (this: Latch) => boolean;
release: Effect.Effect<boolean>;
await: Effect.Effect<void>;
close: Effect.Effect<boolean>;
closeUnsafe: (this: Latch) => boolean;
whenOpen: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
isOpen: (this: Latch) => boolean;
}
latch.whenOpen(import EffectEffect.sync(() => {
const latch: Latch.Latchconst latch: {
open: Effect.Effect<boolean>;
openUnsafe: (this: Latch) => boolean;
release: Effect.Effect<boolean>;
await: Effect.Effect<void>;
close: Effect.Effect<boolean>;
closeUnsafe: (this: Latch) => boolean;
whenOpen: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
isOpen: (this: Latch) => boolean;
}
latch.closeUnsafe()
for (let let i: numberi = 0; let i: numberi < chunk: Arr.NonEmptyReadonlyArray<A>(parameter) chunk: {
0: A;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<A>>): Array<A>; (...items: Array<A | ConcatArray<A>>): Array<A> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<A>;
indexOf: (searchElement: A, fromIndex?: number) => number;
lastIndexOf: (searchElement: A, fromIndex?: number) => number;
every: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: A, index: number, array: ReadonlyArray<A>) => void, thisArg?: any) => void;
map: (callbackfn: (value: A, index: number, array: ReadonlyArray<A>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): Array<S>; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): Array<A> };
reduce: { (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A): A; (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A, initialValue: A): A; (callbac…;
reduceRight: { (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A): A; (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A, initialValue: A): A; (callbac…;
find: { (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => unknown, thisArg?: any): A | undefined };
findIndex: (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, A]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<A>;
includes: (searchElement: A, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: A, index: number, array: Array<A>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => A | undefined;
findLast: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): A | undefined };
findLastIndex: (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any) => number;
toReversed: () => Array<A>;
toSorted: (compareFn?: ((a: A, b: A) => number) | undefined) => Array<A>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<A>): Array<A>; (start: number, deleteCount?: number): Array<A> };
with: (index: number, value: A) => Array<A>;
}
chunk.length; let i: numberi++) {
controller: ReadableStreamDefaultController<A>controller.ReadableStreamDefaultController<A>.enqueue(chunk?: A | undefined): voidThe enqueue() method of the js-nolint enqueue(chunk) - chunk - : The chunk to enqueue.
enqueue(chunk: Arr.NonEmptyReadonlyArray<A>(parameter) chunk: {
0: A;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<A>>): Array<A>; (...items: Array<A | ConcatArray<A>>): Array<A> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<A>;
indexOf: (searchElement: A, fromIndex?: number) => number;
lastIndexOf: (searchElement: A, fromIndex?: number) => number;
every: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: A, index: number, array: ReadonlyArray<A>) => void, thisArg?: any) => void;
map: (callbackfn: (value: A, index: number, array: ReadonlyArray<A>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): Array<S>; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): Array<A> };
reduce: { (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A): A; (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A, initialValue: A): A; (callbac…;
reduceRight: { (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A): A; (callbackfn: (previousValue: A, currentValue: A, currentIndex: number, array: ReadonlyArray<A>) => A, initialValue: A): A; (callbac…;
find: { (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => unknown, thisArg?: any): A | undefined };
findIndex: (predicate: (value: A, index: number, obj: ReadonlyArray<A>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, A]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<A>;
includes: (searchElement: A, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: A, index: number, array: Array<A>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => A | undefined;
findLast: { (predicate: (value: A, index: number, array: ReadonlyArray<A>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any): A | undefined };
findLastIndex: (predicate: (value: A, index: number, array: ReadonlyArray<A>) => unknown, thisArg?: any) => number;
toReversed: () => Array<A>;
toSorted: (compareFn?: ((a: A, b: A) => number) | undefined) => Array<A>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<A>): Array<A>; (start: number, deleteCount?: number): Array<A> };
with: (index: number, value: A) => Array<A>;
}
chunk[let i: numberi])
}
let currentResolve:
| (() => void)
| undefined
currentResolve!()
let currentResolve:
| (() => void)
| undefined
currentResolve = var undefinedundefined
}))),
context: Context.Context<XR>(parameter) context: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
context
))
let fiber:
| Fiber.Fiber<void, E>
| undefined
let fiber: {
id: number;
currentOpCount: number;
getRef: <A>(ref: Context.Reference<A>) => A;
context: Context.Context<never>;
setContext: (context: Context.Context<never>) => void;
currentScheduler: Scheduler;
currentDispatcher: SchedulerDispatcher;
currentSpan: AnySpan | undefined;
currentLogLevel: LogLevel;
minimumLogLevel: LogLevel;
currentStackFrame: StackFrame | undefined;
maxOpsBeforeYield: number;
currentPreventYield: boolean;
addObserver: (cb: (exit: Exit<A, E>) => void) => () => void;
interruptUnsafe: (fiberId?: number | undefined, annotations?: Context.Context<never> | undefined) => void;
pollUnsafe: () => Exit<A, E> | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
fiber.addObserver((exit: Exit.Exit<void, E>exit) => {
if (exit: Exit.Exit<void, E>exit._tag === "Failure") {
controller: ReadableStreamDefaultController<A>controller.ReadableStreamDefaultController<A>.error(e?: any): voidThe error() method of the with the associated stream to error.
error(import CauseCause.squash(exit: Exit.Failure<void, E>(parameter) exit: {
_tag: "Failure";
cause: Cause.Cause<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
exit.cause))
} else {
controller: ReadableStreamDefaultController<A>controller.ReadableStreamDefaultController<A>.close(): voidThe close() method of the ReadableStreamDefaultController interface closes the associated stream.
close()
}
})
},
UnderlyingDefaultSource<A>.pull?: ((controller: ReadableStreamDefaultController<A>) => void | PromiseLike<void>) | undefinedpull() {
return new var Promise: PromiseConstructor
new <void>(executor: (resolve: (value: void | PromiseLike<void>) => void, reject: (reason?: any) => void) => void) => Promise<void>
Creates a new Promise.
Promise<void>((resolve: (
value: void | PromiseLike<void>
) => void
resolve) => {
let currentResolve:
| (() => void)
| undefined
currentResolve = resolve: (
value: void | PromiseLike<void>
) => void
resolve
const latch: Latch.Latchconst latch: {
open: Effect.Effect<boolean>;
openUnsafe: (this: Latch) => boolean;
release: Effect.Effect<boolean>;
await: Effect.Effect<void>;
close: Effect.Effect<boolean>;
closeUnsafe: (this: Latch) => boolean;
whenOpen: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
isOpen: (this: Latch) => boolean;
}
latch.openUnsafe()
})
},
UnderlyingDefaultSource<A>.cancel?: UnderlyingSourceCancelCallback | undefinedcancel() {
if (!let fiber:
| Fiber.Fiber<void, E>
| undefined
fiber) return
return import EffectEffect.runPromise(import EffectEffect.asVoid(import FiberFiber.interrupt(let fiber:
| Fiber.Fiber<void, E>
| undefined
let fiber: {
id: number;
currentOpCount: number;
getRef: <A>(ref: Context.Reference<A>) => A;
context: Context.Context<never>;
setContext: (context: Context.Context<never>) => void;
currentScheduler: Scheduler;
currentDispatcher: SchedulerDispatcher;
currentSpan: AnySpan | undefined;
currentLogLevel: LogLevel;
minimumLogLevel: LogLevel;
currentStackFrame: StackFrame | undefined;
maxOpsBeforeYield: number;
currentPreventYield: boolean;
addObserver: (cb: (exit: Exit<A, E>) => void) => () => void;
interruptUnsafe: (fiberId?: number | undefined, annotations?: Context.Context<never> | undefined) => void;
pollUnsafe: () => Exit<A, E> | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
fiber)))
}
}, options: | {
readonly strategy?:
| QueuingStrategy<A>
| undefined
}
| undefined
options?.strategy?: QueuingStrategy<A> | undefinedstrategy)
}
)